/* ==========================================================================
   Holiday detail page (Revamp 5). Layout from docs/design/revamp/mockups/
   holiday-detail.html, on the tokens and components in theme.css.
   Kind colours come from the .k-* class on .d-page (--c-solid / --c-soft …).
   ========================================================================== */

.d-page { --mat-shadow: 6px; }

/* ---------- breadcrumbs + day navigation ---------- */
.d-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin: var(--s-2) 0 var(--s-5); }
.crumbs { min-width: 0; font-size: var(--fs-sm); color: var(--ink-muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0; padding: 0; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "›"; padding: 0 8px; color: var(--ink-muted); }
.crumbs a { color: var(--ink-muted); padding: 6px 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] span { color: var(--ink); font-weight: 650; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-nav { display: inline-flex; gap: var(--s-2); flex: none; }
.day-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 2px solid var(--line-strong);
  background: var(--bg-raised); color: var(--ink); text-decoration: none; font: 700 var(--fs-xs)/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.day-nav a:hover { border-color: var(--ink); }
.day-nav a span[aria-hidden] { font-size: 1.1rem; line-height: 1; }

/* ---------- title block ---------- */
.d-head { display: flex; gap: var(--s-6); align-items: flex-end; margin-bottom: var(--s-6); }
.d-head .date-badge.lg { rotate: -5deg; }
.d-title { min-width: 0; }
.d-title h1 { margin: var(--s-3) 0 var(--s-2); overflow-wrap: anywhere; }
.d-when { color: var(--ink-muted); margin: 0; font-size: var(--fs-md); line-height: 1.5; }
.d-when strong { color: var(--ink); }
.d-when .d-rule { margin-right: .25em; }
.away { display: inline-block; font: 700 var(--fs-xs)/1 var(--font-mono); letter-spacing: .04em; background: var(--sun); color: var(--on-sun); padding: 5px 9px; border-radius: var(--r-pill); white-space: nowrap; vertical-align: .15em; }

/* ---------- hero art in a kind-coloured mat ---------- */
.d-hero { margin: 0; padding: 12px; border-radius: var(--r-xl); background: var(--c-soft); border: 2px solid var(--c-solid); box-shadow: var(--mat-shadow) var(--mat-shadow) 0 var(--c-solid); }
.d-hero .art { border-radius: var(--r-lg); }
.d-hero .art-fallback .sticker { width: min(46%, 240px); font-size: clamp(48px, 9vw, 96px); }
.d-hero .art-fallback .sticker small { font-size: 12px; }

/* ---------- two-column body ---------- */
.d-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-7); margin-top: var(--s-7); }
.d-main > * + * { margin-top: var(--s-7); }
.d-h2 { font-size: var(--fs-xl); margin-bottom: var(--s-4); }
.prose { max-width: 66ch; font-size: 1.125rem; line-height: 1.7; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.dropcap > p:first-child::first-letter { float: left; font: 800 4.2em/.8 var(--font-display); font-variation-settings: "SOFT" 100, "WONK" 1; color: var(--brand-ink); padding: .06em .1em 0 0; }
.d-pending { margin: 0; padding: var(--s-5); border: 2px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--ink-muted); }

/* timeline: dashed rail + mono year pills */
.d-timeline { list-style: none; margin: 0; padding: 0 0 0 var(--s-2); position: relative; }
.d-timeline::before { content: ""; position: absolute; left: 39px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: repeating-linear-gradient(var(--line-strong) 0 8px, transparent 8px 14px); }
.d-timeline li { position: relative; display: grid; grid-template-columns: 88px 1fr; gap: var(--s-4); padding: var(--s-3) 0; }
.d-timeline .yr { justify-self: start; position: relative; z-index: 1; font: 700 var(--fs-sm)/1 var(--font-mono); background: var(--bg-raised); color: var(--ink);
  border: 2px solid var(--edge); border-radius: var(--r-pill); padding: 6px 8px; height: fit-content; min-width: 62px; max-width: 88px; text-align: center; overflow-wrap: anywhere; }
.d-timeline .ev { margin: 0; padding-top: 2px; }

/* ---------- side panels ---------- */
.d-side { display: grid; gap: var(--s-4); align-content: start; position: sticky; top: var(--s-4); }
.panel { background: var(--bg-raised); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); min-width: 0; }
.panel .eyebrow { margin: 0 0 var(--s-3); }
.panel-note { margin: var(--s-3) 0 0; font-size: var(--fs-sm); color: var(--ink-muted); }
.panel-sub { margin: var(--s-3) 0 var(--s-2); font-size: inherit; }
.panel-sub:first-of-type { margin-top: 0; }
.upcoming { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.upcoming li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.upcoming .yr { font: 700 var(--fs-sm)/1 var(--font-mono); background: var(--bg-sunken); padding: 5px 7px; border-radius: 6px; }
.upcoming a { color: var(--ink); font-weight: 600; }

.country-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.country-list li, .country-any { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--bg-sunken); border-radius: var(--r-md); font-weight: 600; font-size: var(--fs-sm); margin: 0; }
.country-any { align-items: flex-start; font-weight: 400; }
.country-any strong { display: block; font: 700 var(--fs-xs)/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.flag { display: inline-grid; place-items: center; width: 22px; height: 16px; flex: none; font-size: 18px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.flag.globe { color: var(--ink-muted); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tag { font: 600 var(--fs-sm)/1 var(--font-mono); padding: 7px 10px; border-radius: var(--r-pill); background: var(--bg-sunken); color: var(--ink); }

.mini-list { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.mini-list a { color: var(--ink); font-weight: 600; }
.mini-date { font: 700 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }

/* share */
.share-card { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--line); background: var(--bg-sunken); text-decoration: none; }
.share-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.share-card-cta { display: block; padding: 8px 10px; font: 700 var(--fs-xs)/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--bg-raised); border-top: 1.5px solid var(--line); }
.share-card:hover .share-card-cta { text-decoration: underline; }
.share-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.share-actions:not(:has(button:not([hidden]))) { display: none; }
.share-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s-3) 0 0; padding: 0; }
.share-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 2px solid var(--line-strong);
  background: var(--bg-raised); color: var(--ink); text-decoration: none; font: 650 var(--fs-sm)/1 var(--font-body); }
.share-link:hover { border-color: var(--ink); }

/* ---------- more on this date (compact rows) ---------- */
.d-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.d-row { position: relative; display: flex; gap: var(--s-3); align-items: center; padding: 10px; border-radius: var(--r-md); background: var(--bg-raised); border: 1.5px solid var(--line); min-width: 0; }
.d-row:hover { border-color: var(--c-solid); }
.d-row:focus-within { border-color: var(--focus); }
.d-row .art { width: 56px; flex: none; border-radius: 10px; }
.d-row-main { min-width: 0; flex: 1; }
.d-row-title { font: 700 1.05rem/1.25 var(--font-display); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.d-row-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }
.d-row-title:hover { text-decoration: underline; }
.d-row-title:focus-visible { outline: none; }
.d-row-title:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.d-row .chips { margin-top: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .d-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .d-side { position: static; }
}
@media (max-width: 640px) {
  .d-page { --mat-shadow: 4px; }
  .d-head { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
  .d-head .date-badge.lg { width: 84px; }
  .d-head .date-badge.lg .db-d { font-size: 42px; }
  .d-head .date-badge.lg.rule .db-d { font-size: 26px; }
  .d-hero { padding: 6px; }
  .prose { font-size: 1.0625rem; }
  .d-topbar { flex-direction: column; align-items: stretch; }
  .day-nav { justify-content: space-between; }
  .crumbs [aria-current="page"] span { max-width: 22ch; }
  .d-timeline::before { left: 35px; }
  .d-timeline li { grid-template-columns: 80px 1fr; gap: var(--s-3); }
}
