/* R-3.0 S3: deck library pages (card list, card, spread list, spread, pair). Every selector is scoped under .deck-lib (no h1/.intro/.steps leaks, W23 rule 5). Tokens only; day and dark come from the site tokens. */
.deck-lib { width: min(1080px, calc(100% - 32px)); margin: 24px auto 56px; color: var(--text); }
.deck-lib * { box-sizing: border-box; }
.deck-lib__crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 10px; list-style: none; margin: 0 0 18px; padding: 0; font-size: .9rem; color: var(--muted); }
.deck-lib__crumbs li + li::before { content: "/"; margin-inline-end: 10px; opacity: .6; }
.deck-lib__crumbs a { color: inherit; }
.deck-lib__head { margin: 0 0 20px; }
.deck-lib__head--card { display: flex; gap: 20px; align-items: flex-start; }
.deck-lib h1 { font-family: var(--brand-font-display, inherit); font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 6px; overflow-wrap: anywhere; }
.deck-lib h2 { font-size: 1.15rem; margin: 0 0 8px; }
.deck-lib h3 { font-size: 1rem; margin: 0 0 4px; }
.deck-lib p { line-height: 1.6; margin: 0 0 12px; overflow-wrap: anywhere; }
.deck-lib__sub { color: var(--muted); }
.deck-lib__grid { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.deck-lib__tile { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 14px; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--brand-radius-card, 12px); }
.deck-lib__tile:hover, .deck-lib__tile:focus-visible { border-color: var(--border-strong); }
.deck-lib__tile:focus-visible, .deck-lib a:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.deck-lib__tile h2 { margin: 0; }
.deck-lib__tile p { margin: 0; color: var(--muted); font-size: .92rem; }
.deck-lib__art { display: flex; align-items: center; justify-content: center; flex: none; width: 96px; aspect-ratio: 2 / 3; border: 1px dashed var(--border-strong); border-radius: var(--tarot-card-radius, 10px); background: var(--surface-soft, var(--surface)); color: var(--muted); }
.deck-lib__tile .deck-lib__art { width: 100%; max-width: 120px; }
.deck-lib__art-no { font-size: 1.4rem; letter-spacing: .05em; }
.deck-lib__block, .deck-lib__faq, .deck-lib__keywords, .deck-lib__related, .deck-lib__positions { margin: 0 0 20px; }
.deck-lib__keywords ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.deck-lib__keywords li { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .9rem; }
.deck-lib__faq dt { font-weight: 600; margin-top: 12px; }
.deck-lib__faq dd { margin: 4px 0 0; line-height: 1.6; }
.deck-lib__positions ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.deck-lib__positions li { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--brand-radius-card, 12px); background: var(--surface); }
.deck-lib__related ul, .deck-lib__pair-cards, .deck-lib__langs { display: flex; flex-wrap: wrap; gap: 8px 14px; list-style: none; margin: 0 0 12px; padding: 0; }
.deck-lib__more, .deck-lib__note { color: var(--muted); }
.deck-lib a { color: var(--accent-strong, var(--accent)); }
@media (max-width: 480px) { .deck-lib__head--card { flex-direction: column; } .deck-lib__art { width: 72px; } }
@media (prefers-reduced-motion: reduce) { .deck-lib * { transition: none !important; animation: none !important; } }

/* #703: what the Tarot / Gypsy36 template (card-library.css, gypsy-library.css) does not have: card images in the tile frame, the pair hub and the pair page. Scoped by class. */
.d02full-shell .card-library-card-visual { overflow: hidden; }
.d02full-card[hidden], .deck-pair-group[hidden] { display: none; }
.deck-pair-index { display: grid; gap: 28px; margin-top: 12px; }
.deck-pair-group__head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.deck-pair-group__head h2 { margin: 0; font-size: clamp(1.1rem, 2.4vw, 1.5rem); overflow-wrap: anywhere; }
.deck-pair-group__art { flex: none; width: 56px; aspect-ratio: 3 / 5; border-radius: 10px; overflow: hidden; }
.deck-pair-group__art img, .deck-pair-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.deck-pair-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.deck-pair-card { display: flex; align-items: center; gap: 12px; height: 100%; padding: 10px 12px; color: inherit; text-decoration: none; }
.deck-pair-card:hover, .deck-pair-card:focus-visible { border-color: var(--d02-accent, var(--accent)); }
.deck-pair-card__art { flex: none; display: flex; }
.deck-pair-mini { display: block; width: 34px; aspect-ratio: 3 / 5; border-radius: 6px; overflow: hidden; background: var(--d02-panel, color-mix(in srgb, currentColor 8%, transparent)); border: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.deck-pair-mini + .deck-pair-mini { margin-inline-start: -8px; }
.deck-pair-card__name { font-size: .92rem; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.deck-pair-layout .deck-pair-art { display: flex; gap: 12px; align-items: flex-start; }
.deck-pair-layout .deck-pair-art .d03-art { flex: 1 1 0; min-width: 0; }
.deck-pair-chips, .deck-pair-cards { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.deck-pair-chips a, .deck-pair-cards a { display: inline-block; padding: 6px 12px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 999px; color: inherit; text-decoration: none; font-size: .9rem; }
.deck-pair-chips a:hover, .deck-pair-chips a:focus-visible, .deck-pair-cards a:hover { border-color: var(--d02-accent, var(--accent)); }
@media (max-width: 520px) { .deck-pair-list { grid-template-columns: 1fr; } .deck-pair-layout .deck-pair-art:not(.deck-stage) { flex-direction: column; } }
/* RC3.1 (E2, #609): the Tarot pair stage (.deck-stage.deck-pair-art, deck-pairs.css) is a fan of two overlapping cards that stays in ONE row at every width; only the older pair of art frames (deck-page.ts) stacks below 520px. */

/* #703 plates everywhere: the 3:5 frame of a card image. The localized title plate (card-title-overlay.js) is anchored to this frame, so it sits on the card, not on a letterboxed tile
   (the same frame the Gypsy36 library builds in gypsy-library.js). The overlay itself is styled through CSSOM by the shared module. */
.deck-art { position: relative; display: block; height: 100%; max-width: 100%; aspect-ratio: 3 / 5; margin-inline: auto; }
.deck-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* card-art-retry.js: an image being asked again, or one that every attempt failed, stays in the DOM but shows nothing (no broken-image icon, no alt text box). */
main img[data-art-state="retry"], main img[data-art-state="missing"] { visibility: hidden; }
.deck-pair-mini .deck-art, .deck-pair-group__art .deck-art { width: 100%; }

/* MC1-P: the pronunciation line (card page, pair page, library tile). The sign is the same "ʃ" path as on the plate, in the text colour; the line is a native disclosure (keyboard, focus ring). */
.deck-pron { margin: 4px 0 12px; }
.deck-pron__sum { display: inline-flex; align-items: center; gap: .4em; cursor: pointer; font-size: .95rem; color: var(--muted, inherit); list-style: none; padding: 2px 4px; border-radius: 6px; }
.deck-pron__sum::-webkit-details-marker { display: none; }
.deck-pron__sum:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.deck-pron__sign { flex: none; width: .4em; height: 1.05em; overflow: visible; color: var(--accent-strong, var(--accent)); }
.deck-pron__more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; padding-inline-start: 4px; }
.deck-pron__line { margin: 0; overflow-wrap: anywhere; }
.deck-pron__ipa { font-family: "Noto Sans", "Segoe UI", "Lucida Sans Unicode", sans-serif; }
.deck-pron__listen[hidden] { display: none; }
.deck-pron-line { display: flex; align-items: center; gap: .35em; font-size: .85rem; color: var(--muted, inherit); margin: -2px 0 6px; }
.deck-pron-line > span { overflow-wrap: anywhere; }
.deck-stage-col { min-width: 0; }
.deck-stage__pron { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 6px; }
.deck-stage__pron .deck-pron { margin: 0; }
@media (prefers-reduced-motion: reduce) { .deck-pron * { transition: none !important; } }

/* A diagram card laid across another one (data-across: the crossing card of a Celtic Cross, same centre, higher layer) lets the click through its middle to the card under it and stays
   clickable on its two ends that stick out of the card under it (local top and bottom strips; the card is turned 90 degrees, so they are its left and right tips). Its label cannot take a click either. */
#spreadGuideDetail .spread-guide-diagram-card[data-across="true"] { pointer-events: none; }
#spreadGuideDetail .spread-guide-diagram-card[data-across="true"]::before,
#spreadGuideDetail .spread-guide-diagram-card[data-across="true"]::after { content: ""; position: absolute; inset-inline: -3px; height: calc(16% + 3px); pointer-events: auto; cursor: pointer; } /* -3px: the card's 3px border belongs to the hit area */
#spreadGuideDetail .spread-guide-diagram-card[data-across="true"]::before { top: -3px; }
#spreadGuideDetail .spread-guide-diagram-card[data-across="true"]::after { bottom: -3px; }

/* #703 pair hub (owner 13.11): a strip of the cards that jumps to a group, then one folded <details> per card holding the shared "Combinations" rail. */
.deck-pair-strip { margin: 4px 0 18px; }
.deck-pair-strip ul { list-style: none; margin: 0; padding: 4px 2px 10px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; overscroll-behavior-x: contain; }
.deck-pair-strip li { flex: none; scroll-snap-align: start; }
.deck-pair-strip a { display: grid; justify-items: center; gap: 6px; width: 72px; color: inherit; text-decoration: none; border-radius: 10px; padding: 4px; }
.deck-pair-strip__art { display: block; width: 52px; aspect-ratio: 3 / 5; border-radius: 8px; overflow: hidden; background: var(--d02-panel, color-mix(in srgb, currentColor 8%, transparent)); }
.deck-pair-strip__art img, .deck-pair-strip__art .deck-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.deck-pair-strip__name { font-size: .68rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.deck-pair-strip a:hover, .deck-pair-strip a:focus-visible { background: color-mix(in srgb, var(--d02-accent, var(--accent)) 14%, transparent); }
.deck-pair-strip a:focus-visible, .deck-pair-group__summary:focus-visible { outline: 2px solid var(--d02-accent, var(--accent)); outline-offset: 2px; }
.deck-pair-index { gap: 10px; }
.deck-pair-group { border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 14px; background: var(--d02-panel, transparent); scroll-margin-top: 84px; }
.deck-pair-group__summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; min-height: 56px; }
.deck-pair-group__summary::-webkit-details-marker { display: none; }
.deck-pair-group__summary .deck-pair-group__art { width: 32px; border-radius: 6px; }
.deck-pair-group__title { flex: 1 1 auto; min-width: 0; font-size: clamp(1rem, 2.2vw, 1.25rem); font-weight: 650; overflow-wrap: anywhere; }
.deck-pair-group__count { flex: none; font-size: .82rem; opacity: .72; }
.deck-pair-group__chevron { flex: none; width: 10px; height: 10px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); margin-inline-start: 4px; }
.deck-pair-group[open] > .deck-pair-group__summary .deck-pair-group__chevron { transform: rotate(-135deg); }
.deck-pair-group__body { padding: 0 14px 14px; }
.deck-pair-group__body > .deck-rail { margin: 0; }
.deck-pair-group__card { margin: 10px 0 0; }
@media (max-width: 520px) { .deck-pair-group__count { display: none; } .deck-pair-group__summary { padding-inline: 10px; } .deck-pair-group__body { padding-inline: 8px; } }
@media (prefers-reduced-motion: no-preference) { .deck-pair-group__chevron { transition: transform .15s ease; } .deck-pair-strip ul { scroll-behavior: smooth; } }
