/* Static pages: card pages, library, hubs, spreads text, guide. The home page has home.css. The paper side of the site:
   quiet type on mauve paper, structure from rules and spacing rather than boxes. */

/* ---------- Shared page furniture ---------- */
.page { padding-top: 40px; }
.page-head { margin-bottom: 40px; }
.page-head .lede { max-width: 58ch; }
.page > section, .page > nav:not(.breadcrumb), .page > .prose { margin-top: 56px; }
.ad-content { margin: 48px 0; }
.noscript { color: var(--ink-soft); max-width: 60ch; }
.table .noscript { color: var(--on-table-soft); }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.prose h2 { margin-top: 1.6em; }
.prose > section:first-child > h2:first-child, .prose > h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--brass-ink); }

/* The oxblood stages at the top of the home page and every spread page. */
.table.hero, .table.stage { padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 7vw, 88px); }
.hero-head { margin-bottom: clamp(24px, 4vw, 40px); }
.hero-head h1 { font-size: var(--step-4); margin-bottom: 0.15em; }
.stage h1 { margin-bottom: 0.2em; }
.stage .lede { margin-bottom: clamp(24px, 4vw, 40px); }
.table .breadcrumb { color: var(--on-table-soft); }

/* The "in short" digest under the opening of card, spread and guide pages: a quiet tinted panel. */
.summary { margin: 24px 0 0; padding: 18px 22px 16px; background: var(--paper-2); border-radius: 4px; max-width: 62ch; }
.summary h2 { margin: 0 0 6px; font-family: var(--body); font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.summary p { margin: 0; }
.summary .updated { margin-top: 10px; font-size: var(--step--1); color: var(--ink-soft); }
.spread-article > .summary { margin: 0 0 56px; }

/* ---------- Card thumbnails ---------- */
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 18px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.thumbs.compact { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 22px 14px; }
.thumbs a { display: block; text-decoration: none; }
.thumbs .tcard { box-shadow: 0 6px 16px -10px rgba(27, 42, 74, 0.55); transition: transform 0.2s ease; }
.thumbs a:hover .tcard { transform: translateY(-3px); }
.thumb-name { display: block; margin-top: 10px; overflow-wrap: break-word; hyphens: auto; font-family: var(--display); font-size: 1.08rem; line-height: 1.2; }
.thumbs.compact .thumb-name { font-size: 0.98rem; }
.thumbs a:hover .thumb-name { text-decoration: underline; text-decoration-color: var(--rule); }

@media (max-width: 560px) {
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 22px 14px; }
  .thumbs.compact { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 18px 10px; }
  .thumbs.compact .thumb-name { font-size: 0.86rem; }
}

.thumbs.with-summary { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 28px 40px; }
.thumbs.with-summary li { display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 18px; align-items: start; }
.thumbs.with-summary a { display: contents; }
.thumbs.with-summary .tcard { grid-row: span 2; }
.thumbs.with-summary .thumb-name { margin-top: 2px; font-size: var(--step-1); }
.thumbs.with-summary p { margin: 4px 0 0; font-size: var(--step--1); color: var(--ink-soft); }

/* ---------- Spread diagrams: engraved outlines of where each card goes ---------- */
.diagram { display: block; overflow: visible; }
.diagram .d-card { fill: var(--paper); stroke: var(--ink); stroke-width: 0.07; }
.diagram .d-across { fill: var(--paper-2); }
.diagram .d-under { font-size: 0.62px; }
.diagram text { fill: var(--ink); font-family: var(--display); font-size: 1.05px; text-anchor: middle; dominant-baseline: central; }
.diagram-small { width: auto; height: 84px; max-width: 84px; }
.diagram-small text { display: none; }
.diagram-large { width: 100%; max-width: 240px; height: auto; max-height: 300px; }

.spread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 40px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.spread-list li { border-top: 1px solid var(--rule); }
.spread-list a { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 20px; align-items: start; padding: 22px 0 26px; text-decoration: none; }
.spread-list .diagram-small { justify-self: center; }
.spread-text h2, .spread-text h3 { font-size: var(--step-1); margin: 0; display: inline; }
.spread-count { margin-left: 10px; font-size: var(--step--1); color: var(--brass-ink); white-space: nowrap; }
.spread-lede { display: block; margin-top: 6px; font-size: var(--step--1); color: var(--ink-soft); }
.spread-list a:hover h2, .spread-list a:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

/* ---------- Spread pages: the text under the table ---------- */
.spread-article > section + section, .spread-article > .ad + section { margin-top: 56px; }
.positions-body { display: grid; gap: 32px 48px; align-items: start; }
@media (min-width: 760px) { .positions-body { grid-template-columns: 220px minmax(0, 1fr); } .positions-body .diagram { position: sticky; top: 24px; } }
.position-list { margin: 0; padding: 0; list-style: none; counter-reset: pos; max-width: var(--measure); }
.position-list li { counter-increment: pos; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); column-gap: 12px; padding: 16px 0; border-top: 1px solid var(--rule); }
.position-list li::before { content: counter(pos); grid-row: span 2; font-family: var(--display); font-size: var(--step-2); line-height: 1; color: var(--brass-ink); }
.position-list h3 { margin: 0 0 4px; }
.position-list p { margin: 0; }
.questions li { font-family: var(--display); font-style: italic; font-size: var(--step-1); line-height: 1.35; }
.more-spreads h2 { margin-bottom: 8px; }

/* ---------- Card page ---------- */
.card-head { max-width: 60ch; }
.card-head .lede { max-width: 54ch; }
.card-intro { display: grid; gap: 28px 48px; margin: 32px 0 36px; align-items: start; }
@media (min-width: 720px) { .card-intro { grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); } }
.card-figure { margin: 0; width: min(100%, 300px); justify-self: center; }
@media (min-width: 720px) { .card-figure { justify-self: start; width: 100%; } }
.card-figure .tcard { box-shadow: 0 18px 40px -22px rgba(27, 42, 74, 0.75); }

.facts { margin: 0; display: grid; align-content: start; }
.facts div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.facts div:first-child { border-top: 1px solid var(--rule); }
.facts dt { font-size: var(--step--1); color: var(--ink-soft); padding-top: 2px; }
.facts dd { margin: 0; }
.sign-link { display: inline-block; margin-left: 6px; font-size: var(--step--1); color: var(--brass-ink); }
@media (max-width: 420px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }

.jump { margin: 0 0 36px; font-size: var(--step--1); }
.jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.jump a { color: var(--ink-soft); }

.card-section { scroll-margin-top: 16px; }
.card-section h2 { margin-top: 1.5em; }
.advice { margin-top: 48px; padding: 28px 32px 30px; background: var(--paper-2); border-radius: 4px; }
.advice h2 { margin-top: 0; font-size: var(--step-1); color: var(--ink-soft); }
.advice .advice-text { margin: 0; font-family: var(--display); font-style: italic; font-size: var(--step-2); line-height: 1.25; }
.faq h3 { margin-top: 1.4em; font-size: 1.2rem; }

.draw-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin: 56px 0 40px; padding: 26px clamp(20px, 4vw, 36px); border-radius: 14px; }
.draw-cta p { margin: 0; font-family: var(--display); font-size: var(--step-1); }

.card-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.card-pager a { display: flex; align-items: center; gap: 14px; text-decoration: none; font-family: var(--display); font-size: 1.15rem; line-height: 1.2; }
.card-pager .tcard { width: 52px; flex: none; box-shadow: none; }
.card-pager small { display: block; font-family: var(--body); font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 2px; }
.card-pager .pager-next { flex-direction: row-reverse; text-align: right; grid-column: 2; }
.card-pager a:hover > span:last-child { text-decoration: underline; text-decoration-color: var(--rule); }
.siblings { margin-top: 48px; }
.siblings h2 { font-size: var(--step-1); margin-bottom: 20px; }

/* ---------- Library and hubs ---------- */
.lib-tools { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.lib-search { display: grid; gap: 6px; flex: 1 1 280px; max-width: 420px; }
.lib-search[hidden] { display: none; }
.lib-search label { font-size: var(--step--1); color: var(--ink-soft); }
.lib-search input { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--ink-soft); border-radius: 999px; padding: 10px 18px; min-height: 44px; width: 100%; }
.lib-search input::placeholder { color: var(--ink-soft); opacity: 0.8; }
.lib-index { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--step--1); }
.lib-empty { margin-top: 32px; color: var(--ink-soft); }
.lib-group { margin-top: 48px; scroll-margin-top: 16px; }
.lib-group[hidden] { display: none; }
.lib-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: 22px; }
.lib-group-head h2 { margin: 0; }
.lib-group-head h2 a { text-decoration: none; }
.lib-group-head h2 a:hover { text-decoration: underline; text-decoration-color: var(--rule); }
.lib-group-head p { margin: 0; color: var(--ink-soft); }
.thumbs li[hidden] { display: none; }

.page > .hub-intro { margin-top: -12px; }
.hub-others ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 40px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.hub-others li { padding: 14px 0; border-top: 1px solid var(--rule); }
.hub-others a { font-family: var(--display); font-size: var(--step-1); display: block; }
.hub-others span { font-size: var(--step--1); color: var(--ink-soft); }

/* ---------- Guide and info pages ---------- */
.toc { margin: 0 0 40px; padding: 20px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc h2 { font-size: var(--step--1); font-family: var(--body); font-weight: 600; margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.4em; columns: 2 16rem; column-gap: 40px; }
.toc li { margin-bottom: 6px; break-inside: avoid; }
.toc li::marker { color: var(--brass-ink); }
.guide section { scroll-margin-top: 16px; }
.info-page .prose section + section { margin-top: 8px; }

.not-found { padding-top: clamp(48px, 8vw, 96px); }
.not-found section + section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--rule); }
.not-found h2 { font-size: var(--step-2); }

.site-footer .sister { margin: 0; }
