/* Behind the Brim (blog). Scoped to .mj; fonts come from the theme (Cerebri Sans). */
.magill-journal-container > .row { margin: 0; }
.magill-journal .site-content { padding-top: 0; }
.mj { --mj-ink: #222; --mj-text: #666; --mj-line: #222; --mj-soft: #e8e4de; --mj-accent: #c9b08c; --mj-paper: #f6f4f1; color: var(--mj-text); }
.mj a { color: inherit; text-decoration: none; }
.mj-wrap { max-width: 1440px; margin: 0 auto; padding: 0 40px; overflow: hidden; overflow: clip; }
.mj-pill { display: inline-block; border: 1px solid var(--mj-ink); border-radius: 20px; padding: 2px 12px; font-size: 11px; line-height: 1.7; letter-spacing: 1px; text-transform: uppercase; color: var(--mj-ink) !important; white-space: nowrap; background: #fff; transition: background .2s, color .2s; }
.mj-pill.on, .mj-pill:hover { background: var(--mj-ink); color: #fff !important; }

/* blog home */
.mj-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 40px; padding: 72px 0 28px; border-bottom: 1px solid var(--mj-line); }
.mj-head h1 { margin: 0; font-size: 48px; line-height: 1; letter-spacing: -1px; color: var(--mj-ink); font-weight: 700; }
.mj-head p { margin: 0; max-width: 440px; padding-left: 32px; border-left: 1px solid #e5e5e5; color: #555; font-size: 16px; line-height: 1.5; }
.mj-topics { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mj-rail { display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 40px; padding: 36px 40px 8px; margin: 0 -40px; scrollbar-width: none; cursor: grab; }
.mj-rail::-webkit-scrollbar { display: none; }
.mj-rail.drag { cursor: grabbing; scroll-snap-type: none; }
.mj-rail.drag a { pointer-events: none; }
.mj-card { flex: 0 0 clamp(250px, 21vw, 320px); scroll-snap-align: start; user-select: none; }
.mj-ph { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--mj-soft); }
.mj-ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; -webkit-user-drag: none; }
.mj-card:hover .mj-ph img { transform: scale(1.04); }
.mj-card.s2 .mj-ph { border-radius: 999px 999px 0 0; }
.mj-card.s3 .mj-ph { border-radius: 0 0 140px 0; }
.mj-card.s4 .mj-ph { border-radius: 0 140px 0 0; }
.mj-meta { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--mj-ink); }
.mj-card h2 { margin: 0; font-size: 21px; line-height: 1.25; font-weight: 500; color: var(--mj-ink); text-transform: uppercase; letter-spacing: .2px; }
.mj-ex { margin: 10px 0 0; font-size: 14px; line-height: 1.55; }
.mj-rail-foot { display: flex; align-items: center; gap: 24px; padding: 28px 0 0; border-top: 1px solid var(--mj-line); margin-top: 40px; }
.mj-prog { flex: 1; height: 2px; background: #e5e5e5; position: relative; }
.mj-prog i { position: absolute; left: 0; top: 0; height: 2px; background: var(--mj-ink); width: 20%; }
.mj-arr { width: 44px; height: 44px; border: 1px solid var(--mj-ink); border-radius: 50%; background: #fff; color: var(--mj-ink); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.mj-arr:hover { background: var(--mj-ink); color: #fff; }
.mj-hint { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--mj-ink); }
.mj-rail-foot.static .mj-hint, .mj-rail-foot.static .mj-arr, .mj-rail-foot.static .mj-prog { visibility: hidden; }
.mj .pagination, .mj .nav-links { margin-top: 32px; text-align: center; }
.mj-empty { padding: 48px 0; }
.mj-band { background: var(--mj-paper); margin-top: 80px; padding: 72px 0; }
.mj-band-in { max-width: 1440px; margin: 0 auto; padding: 0 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.mj-band h3 { margin: 0 0 12px; font-size: 28px; color: var(--mj-ink); line-height: 1.2; }
.mj-band p { margin: 0 0 18px; color: #555; }
.mj-btn { display: inline-block; background: var(--mj-ink); color: #fff !important; padding: 14px 28px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }
.mj-topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #ddd; border: 1px solid #ddd; }
.mj-topic-grid a { background: #fff; padding: 22px; color: var(--mj-ink); }
.mj-topic-grid a:hover { background: #fbfaf8; }
.mj-topic-grid b { display: block; font-weight: 500; font-size: 17px; }
.mj-topic-grid span { font-size: 13px; color: var(--mj-text); }

/* guide page */
.mj-hero { max-width: 1440px; margin: 0 auto; padding: 48px 40px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: end; }
.mj-crumb { font-size: 13px; color: #999; margin-bottom: 28px; }
.mj-hero h1 { margin: 0 0 20px; font-size: 54px; line-height: 1.05; letter-spacing: -1px; color: var(--mj-ink); font-weight: 700; text-transform: uppercase; }
.mj-hero .mj-meta { margin: 0 0 16px; }
.mj-lede { font-size: 19px; line-height: 1.6; color: #444; margin: 0 0 8px; max-width: 520px; }
.mj-read { font-size: 13px; color: #999; }
.mj-hero-ph { height: min(68vh, 580px); border-radius: 999px 999px 0 0; overflow: hidden; background: var(--mj-soft); }
.mj-hero-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mj-rule { max-width: 1360px; margin: 48px auto 0; border: 0; border-top: 1px solid var(--mj-line); }
.mj-body { max-width: 1360px; margin: 0 auto; padding: 48px 40px 0; display: grid; grid-template-columns: 220px minmax(0, 680px) 1fr; gap: 56px; }
.mj-body.no-toc { grid-template-columns: minmax(0, 680px) 1fr; justify-content: center; }
.mj-body.no-shop { grid-template-columns: 220px minmax(0, 680px); }
.mj-body.no-toc.no-shop { grid-template-columns: minmax(0, 680px); justify-content: center; }
.mj-toc { position: sticky; top: 100px; align-self: start; font-size: 14px; }
.mj-toc b, .mj-shop b { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--mj-ink); margin-bottom: 10px; font-weight: 500; }
.mj-toc a { display: block; padding: 6px 0; border-bottom: 1px solid #eee; color: #666; }
.mj-toc a:hover { color: var(--mj-ink); }
.mj-article { font-size: 17px; line-height: 1.75; color: #555; }
.mj-article h2 { font-size: 28px; line-height: 1.2; color: var(--mj-ink); margin: 40px 0 12px; scroll-margin-top: 100px; }
.mj-article > h2:first-child { margin-top: 0; }
.mj-article h3 { font-size: 20px; color: var(--mj-ink); margin: 28px 0 8px; }
.mj-article p { margin: 0 0 18px; }
.mj-article a { color: var(--mj-ink); text-decoration: underline; text-underline-offset: 3px; }
.mj-article ol { counter-reset: s; list-style: none; padding: 0; margin: 0 0 18px; }
.mj-article ol li { counter-increment: s; position: relative; padding: 0 0 14px 48px; }
.mj-article ol li:before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border: 1px solid var(--mj-ink); border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--mj-ink); line-height: 1; }
.mj-article blockquote, .mj-article .wp-block-quote { background: var(--mj-paper); padding: 22px 28px; margin: 28px 0; border-left: 2px solid var(--mj-accent); font-style: normal; font-size: 17px; }
.mj-article blockquote p:last-child { margin: 0; }
.mj-article blockquote, .mj-article blockquote p { font-weight: 400; font-family: inherit; color: #444; }
.mj-article blockquote strong { font-weight: 600; color: var(--mj-ink); }
.mj-article blockquote:before, .mj-article blockquote:after { content: none !important; display: none !important; }
.mj-article table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #e5e1da; border-radius: 4px; font-size: 15px; line-height: 1.5; margin: 12px 0 28px; }
.mj-article thead, .mj-article tbody, .mj-article tr { border: 0; }
.mj-table { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0 28px; }
.mj-table table { margin: 0; min-width: 100%; }
.mj-article th, .mj-article td { text-align: left; vertical-align: top; padding: 14px 18px; border: 0; border-bottom: 1px solid #ece8e2; }
.mj-article tbody tr:last-child > * { border-bottom: 0; }
.mj-article thead th { background: var(--mj-paper); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--mj-ink); font-weight: 500; padding-top: 12px; padding-bottom: 12px; }
.mj-article tbody tr > :first-child { color: var(--mj-ink); font-weight: 500; white-space: nowrap; }
.mj-article img { max-width: 100%; height: auto; }
.mj-shop { position: sticky; top: 100px; align-self: start; border: 1px solid #e5e5e5; padding: 20px; }
.mj-shop a { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #f0f0f0; font-size: 14px; color: var(--mj-ink); line-height: 1.35; }
.mj-shop img { width: 64px; height: 58px; object-fit: contain; background: #fafafa; }
.mj-shop small { display: block; color: #999; margin-top: 2px; }
.mj-more { max-width: 1360px; margin: 80px auto 0; padding: 28px 40px 0; border-top: 1px solid var(--mj-line); }
.mj-more h3 { margin: 0 0 24px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--mj-ink); font-weight: 500; }
.mj-more-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.mj-more-ph { aspect-ratio: 3 / 2; overflow: hidden; background: var(--mj-soft); }
.mj-more-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mj-more h4 { margin: 14px 0 0; font-size: 18px; color: var(--mj-ink); font-weight: 500; text-transform: uppercase; line-height: 1.3; }
.mj-single { padding-bottom: 80px; }

@media (max-width: 1100px) {
  .mj-body, .mj-body.no-shop { grid-template-columns: minmax(0, 1fr) 260px; }
  .mj-body.no-shop { grid-template-columns: minmax(0, 1fr); }
  .mj-toc { display: none; }
}
@media (max-width: 900px) {
  .mj-wrap { padding: 0 20px; }
  .mj-head { grid-template-columns: 1fr; gap: 14px; padding: 32px 0 20px; }
  .mj-head h1 { font-size: 38px; }
  .mj-head p { padding-left: 0; border-left: 0; }
  .mj-topics { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
  .mj-rail { padding: 24px 20px 4px; margin: 0 -20px; gap: 18px; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; }
  .mj-card { flex-basis: 76vw; }
  .mj-card h2 { font-size: 19px; }
  .mj-rail-foot .mj-arr, .mj-rail-foot .mj-hint { display: none; }
  .mj-band { margin-top: 48px; padding: 48px 0; }
  .mj-band-in { grid-template-columns: 1fr; gap: 28px; padding: 0 20px; }
  .mj-hero { grid-template-columns: 1fr; gap: 28px; padding: 24px 20px 0; }
  .mj-hero h1 { font-size: 34px; }
  .mj-hero-ph { height: auto; aspect-ratio: 4 / 5; }
  .mj-body, .mj-body.no-shop, .mj-body.no-toc { grid-template-columns: 1fr; padding: 32px 20px 0; gap: 32px; }
  .mj-shop { position: static; }
  .mj-article table { font-size: 14px; }
  .mj-article th, .mj-article td { padding: 12px 14px; }
  .mj-article tbody tr > :first-child { white-space: normal; }
  .mj-rule { margin: 32px 20px 0; }
  .mj-more { padding: 24px 20px 0; }
  .mj-more-row { grid-template-columns: 1fr; gap: 24px; }
}

/* Beige band is the last block on blog/topic pages: no white strip before the footer. */
#content:has(.mj > .mj-band:last-child) { padding-bottom: 0; }
/* Guide pages: keep only the guide's own 80px bottom space (theme adds 60px more). */
#content:has(.mj-single) { padding-bottom: 0; }

/* Desktop: the row stays in place and moves sideways while the page scrolls down (journal.js adds .on). */
.mj-pin.on .mj-pin-in { position: sticky; }
.mj-pin.on .mj-rail { scroll-snap-type: none; }
@media (max-width: 900px) { .mj.mj-single { padding-bottom: 48px; } }
