/* ==========================================================================
   The Goblin's Corner — page layouts
   Loads after tokens.css (which holds colors, type, buttons, cards, chips…).
   Only uses the semantic tokens, so light/dark themes just work.
   ========================================================================== */

body { background: var(--color-bg); }
.site-main { min-height: 50vh; }
.kicker {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-link);
}
.lede { font-size: var(--step-1); line-height: var(--leading-snug); color: var(--color-text-muted); max-width: 60ch; }
.page-header { margin-bottom: var(--space-l); }
.page-header h1 { margin: 0 0 var(--space-xs); }
.page-header__page { color: var(--color-text-muted); font-size: 0.6em; }
.section-title { margin: var(--space-2xl) 0 var(--space-m); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-s); margin-bottom: var(--space-m); }
.section-head h2 { margin: 0; }
.empty { padding: var(--space-xl); text-align: center; border: var(--border); border-style: dashed; border-radius: var(--radius-lg); color: var(--color-text-muted); }

/* --- Header ---------------------------------------------------------------- */
.header-tools { display: flex; gap: var(--space-2xs); align-items: center; }
.header-tools svg { width: 22px; height: 22px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[aria-pressed="true"] .icon-sun { display: block; }
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }
.nav-toggle .icon-close { display: none; }
.site-header[data-open] .nav-toggle .icon-close { display: block; }
.site-header[data-open] .nav-toggle .icon-menu { display: none; }
.site-search--menu { display: none; }
@media (max-width: 52rem) {
  .site-header__inner { gap: var(--space-xs); }
  .header-tools { margin-inline-start: auto; }
  .nav-toggle { margin-inline-start: 0; }
  .site-search--menu { display: flex; margin-bottom: var(--space-xs); }
  .site-nav { max-height: calc(100dvh - 76px); overflow-y: auto; box-shadow: var(--shadow-md); }
  body.menu-open { overflow: hidden; }
}

/* --- Breadcrumbs ----------------------------------------------------------- */
.breadcrumbs { display: flex; gap: var(--space-2xs); align-items: center; margin: var(--space-l) 0 var(--space-m); font-size: var(--step--1); color: var(--color-text-muted); }
.breadcrumbs a { min-height: var(--tap); display: inline-flex; align-items: center; }

/* --- Homepage ---------------------------------------------------------------- */
.hero { border-bottom: var(--border); background:
  radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--color-text) 10%, transparent) 1px, transparent 1.5px) 0 0 / 22px 22px,
  var(--color-bg); }
.hero__inner { display: grid; gap: var(--space-xl); padding-block: var(--space-2xl); align-items: center; }
@media (min-width: 64rem) { .hero__inner { grid-template-columns: 5fr 7fr; } }
.hero__title { font-size: var(--step-5); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 var(--space-s); }
.hero__title span { display: inline; background: linear-gradient(transparent 62%, var(--color-accent) 62%); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-m) 0; }
.hero__apps { display: flex; gap: var(--space-2xs); list-style: none; margin: 0; padding: 0; }
.hero__apps a { display: grid; place-items: center; width: var(--tap); height: var(--tap); border: var(--border); border-radius: 50%; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }
.hero__apps a:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); color: var(--color-text); }
.hero__apps svg { width: 22px; height: 22px; }
.hero__label { display: flex; align-items: center; gap: var(--space-2xs); font-family: var(--font-display); font-weight: 700; margin: 0 0 var(--space-xs); }
.card__chips { display: flex; flex-wrap: wrap; gap: var(--space-3xs); margin: 0; }
.card__actions { margin: var(--space-xs) 0 0; position: relative; z-index: 2; }
@media (min-width: 52rem) { .hero__latest .card--feature { flex-direction: column; } .hero__latest .card--feature .card__media { border-right: 0; border-bottom: var(--border); } .hero__latest .card--feature .card__body { padding: var(--space-m) var(--space-l) var(--space-l); } .hero__latest .card--feature .card__title { font-size: var(--step-2); } }

.topic-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-s); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.topic-tile a { display: flex; flex-direction: column; gap: var(--space-3xs); height: 100%; padding: var(--space-s) var(--space-m); background: var(--color-surface); color: var(--color-text); text-decoration: none; border: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.topic-tile a:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-md); color: var(--color-text); }
.topic-tile__name { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); line-height: var(--leading-snug); }
.topic-tile__desc { color: var(--color-text-muted); font-size: var(--step--1); }
.topic-tile__count { margin-top: auto; font-size: var(--step--1); font-weight: 700; color: var(--color-link); }
.topic-grid--compact .topic-tile__name { font-size: var(--step-0); }
.topic-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: 0 0 var(--space-l); }
.series-list { display: flex; flex-wrap: wrap; gap: var(--space-xs); list-style: none; margin: 0; padding: 0; }

.split { display: grid; gap: var(--space-xl); }
@media (min-width: 64rem) { .split { grid-template-columns: 2fr 1fr; } }
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.news-list { list-style: none; margin: 0; padding: 0; border: var(--border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-md); }
.news-list li { padding: var(--space-s) var(--space-m); display: grid; gap: var(--space-3xs); }
.news-list li + li { border-top: 1px solid var(--color-border-subtle); }
.news-list a { font-family: var(--font-display); font-weight: 700; color: var(--color-text); }
.news-list time { font-size: var(--step--1); color: var(--color-text-muted); }

.community__card { padding: var(--space-xl); border: var(--border); border-radius: var(--radius-lg); background: var(--color-surface-2); box-shadow: var(--shadow-lg); }
.community__card h2 { margin-top: 0; }
.community__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-m) 0 0; }

/* --- Single post ------------------------------------------------------------- */
.post { max-width: calc(var(--measure) + var(--gutter) * 2 + 8rem); }
.post-header { max-width: none; }
.post-header .card__chips { margin-bottom: var(--space-xs); }
.post-header__title { margin: 0 0 var(--space-xs); }
.post .embed, .post .post-cover { margin-block: var(--space-l); }
.post-cover img { width: 100%; border: var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.yt-lite { position: relative; display: grid; place-items: center; width: 100%; height: 100%; background: #000 center / cover no-repeat; }
.yt-lite::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgb(0 0 0 / .35)); }
.yt-lite__btn { position: relative; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--color-primary); color: var(--color-on-primary); border: 3px solid var(--ink-900); box-shadow: 5px 5px 0 0 var(--ink-900); transition: transform var(--dur) var(--ease); }
.yt-lite__btn svg { width: 40px; height: 40px; margin-left: 4px; }
.yt-lite:hover .yt-lite__btn, .yt-lite:focus-visible .yt-lite__btn { transform: scale(1.08); }
.embed--audio { display: grid; gap: var(--space-2xs); }
.embed__label { margin: 0; font-family: var(--font-display); font-weight: 800; }
.embed__label span { font-weight: 600; color: var(--color-text-muted); }
.post-listen { margin: 0 0 var(--space-l); }
.post .prose { margin-bottom: var(--space-l); }
.guest-box, .post-footer { max-width: var(--measure); }
.guest-box { padding: var(--space-m); border: var(--border); border-radius: var(--radius-md); background: var(--color-surface-2); margin-bottom: var(--space-l); }
.guest-box h2 { font-size: var(--step-1); margin: 0 0 var(--space-2xs); }
.post-footer { display: grid; gap: var(--space-s); padding-top: var(--space-m); border-top: var(--border); }
.post-topics, .post-tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; margin: 0; }
.post-topics > span, .post-tags > span { font-family: var(--font-display); font-weight: 700; }
.post-tags { font-size: var(--step--1); color: var(--color-text-muted); gap: 0.3em; }

.series-nav { max-width: calc(var(--measure) + var(--gutter) * 2 + 8rem); margin-top: var(--space-l); }
.series-nav > * { max-width: var(--measure); }
.series-nav h2 { font-size: var(--step-1); }
.series-nav ol { padding: var(--space-m) var(--space-m) var(--space-m) calc(var(--space-m) + 1.2em); margin: 0; border: var(--border); border-radius: var(--radius-md); background: var(--color-surface); }
.series-nav li + li { margin-top: var(--space-2xs); }

.prev-next { display: grid; gap: var(--space-s); margin-top: var(--space-xl); max-width: calc(var(--measure) + var(--gutter) * 2 + 8rem); }
@media (min-width: 40rem) { .prev-next { grid-template-columns: 1fr 1fr; } }
.prev-next__link { display: grid; gap: var(--space-3xs); padding: var(--space-s) var(--space-m); border: var(--border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-family: var(--font-display); font-weight: 700; text-decoration: none; box-shadow: var(--shadow-sm); }
.prev-next__link small { color: var(--color-text-muted); font-weight: 600; }
.prev-next__link:hover { color: var(--color-text); transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.prev-next__link--next { text-align: right; }
.related { padding-top: var(--space-xl); }

/* --- Pager ------------------------------------------------------------------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-s); margin-top: var(--space-xl); }
.pager__count { color: var(--color-text-muted); font-weight: 700; }

/* --- About ------------------------------------------------------------------- */
.about__banner { border-bottom: var(--border); background: #000; }
.about__banner img { width: 100%; max-height: 360px; object-fit: cover; object-position: 45% center; }
.hosts { display: grid; gap: var(--space-l); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.host__photo { aspect-ratio: 1; border-bottom: var(--border); overflow: hidden; background: var(--color-surface-2); }
.host__photo img { width: 100%; height: 100%; object-fit: cover; }
.host h3 { margin: 0; }
.host:hover { transform: none; box-shadow: var(--shadow-md); }
.press-note { margin-top: var(--space-2xl); padding: var(--space-l); border: var(--border); border-radius: var(--radius-lg); background: var(--color-surface-2); }
.press-note h2 { margin-top: 0; font-size: var(--step-2); }

/* --- Search ------------------------------------------------------------------ */
.search-form { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-m); }
.search-form .input { flex: 1 1 16rem; }
.input--lg { min-height: 52px; font-size: var(--step-1); border-radius: var(--radius-pill); padding-inline: 1.2rem; }
.search-filters { display: flex; flex-wrap: wrap; gap: var(--space-s) var(--space-l); align-items: center; border: 0; padding: 0; margin: 0 0 var(--space-m); }
.filter-group { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.filter-chip { position: relative; }
.filter-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.filter-chip span { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 1rem; font-family: var(--font-display); font-weight: 700; border: var(--border); border-radius: var(--radius-pill); background: var(--color-surface); }
.filter-chip input:checked + span { background: var(--color-text); color: var(--color-bg); }
.filter-chip input:focus-visible + span { outline: var(--focus-outline); outline-offset: 3px; }
.filter-select { display: flex; align-items: center; gap: var(--space-2xs); font-family: var(--font-display); font-weight: 700; }
.filter-select .select { min-height: var(--tap); }
.search-status { font-weight: 700; min-height: 1.6em; }
.search-results mark { background: var(--color-accent); color: var(--ink-900); padding: 0 0.1em; border-radius: 3px; }
.search-empty { margin-top: var(--space-l); }

.notfound { text-align: center; }
.notfound .lede { margin-inline: auto; }
.notfound .search-form { max-width: 36rem; margin: var(--space-l) auto; }

/* --- Footer extras ------------------------------------------------------------- */
.footer-about p { color: var(--color-text-muted); }
.footer-about .logo-badge { margin-bottom: var(--space-s); }
.footer-support { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-m); }
.social-links { margin-top: var(--space-s); }
.listen-more { margin-top: var(--space-m); }
.listen-more summary { cursor: pointer; min-height: var(--tap); display: inline-flex; align-items: center; font-family: var(--font-display); font-weight: 700; color: var(--color-link); }
.listen-more ul { columns: 2; gap: var(--space-m); list-style: none; padding: 0; margin: var(--space-2xs) 0 0; }
.listen-more li { padding-block: 0.3rem; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-s); }
.site-footer__legal nav { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-m); }
.site-footer__legal nav a { min-height: var(--tap); display: inline-flex; align-items: center; }
.site-footer__legal p { margin: 0; align-self: center; }
.site-footer section > h2 { margin-top: 0; }

/* --- Fallback covers: match the category color; smaller text for words --- */
.cover-fallback.cat-article { --cat: var(--cat-article); }
.cover-fallback.cat-news { --cat: var(--cat-news); }
.cover-fallback__num--word { font-size: max(1.6rem, 11cqi); }
.cover-fallback__kicker { max-width: 80%; }
.post-tags a { margin-inline: 0.15em; }

[hidden] { display: none !important; }
/* tokens.css: `.prose p {margin:0}` outranks `.prose > * + *`, so restore paragraph rhythm */
.prose > * + p, .prose > * + ul, .prose > * + ol, .prose > * + figure, .prose > * + blockquote { margin-top: 1.1em; }
/* Neutral (topic/series) chips: readable in both themes */
.topic-row .chip, .post-topics .chip, .series-list .chip, .chip--topic {
  --chip-bg: var(--color-surface); color: var(--color-text); border-color: var(--color-border);
}
.topic-row .chip:hover, .post-topics .chip:hover, .series-list .chip:hover { color: var(--color-text); }

/* Highlighted hero words always use dark ink on the yellow (readable in both themes) */
.hero__title span { color: var(--ink-900); }
/* Bigger tap area for tag links */
.post-tags a { display: inline-flex; align-items: center; min-height: var(--tap); }
.hero__title span { background: var(--color-accent); padding: 0 0.12em; border-radius: 6px; }

/* Section topic filter row (Episodes › Monsters & Creatures …) */
.topic-row .chip.is-active { --chip-bg: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.chip__count { font-weight: 600; opacity: 0.7; margin-inline-start: 0.2em; }
.breadcrumbs span[aria-current] { color: var(--color-text); font-weight: 700; }
.lede .count { color: var(--color-text-muted); font-size: var(--step-0); }

/* Phones: topic chips scroll sideways in one row instead of stacking */
@media (max-width: 40rem) {
  .topic-row { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 8px var(--gutter);
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .topic-row::-webkit-scrollbar { display: none; }
  .topic-row .chip { flex: none; scroll-snap-align: start; }
}

/* Contact form: sent confirmation */
.form-done { padding: var(--space-m); border: var(--border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: 5px 5px 0 0 var(--color-primary); }
.form-done:focus { outline: none; }
.form-done:focus-visible { outline: var(--focus-outline); outline-offset: 3px; }
.form-done__icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 0 var(--space-xs); border-radius: 50%; background: var(--color-primary); color: var(--ink-900); font-size: 1.6rem; font-weight: 800; border: var(--border-width) solid var(--ink-900); }
.form-done h3 { margin: 0 0 var(--space-2xs); font-size: var(--step-1); }
.form-done p { color: var(--color-text-muted); }
.form-done__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-s) 0 0; }

/* About: one row per person (photo + full bio) */
.hosts { display: grid; gap: var(--space-l); grid-template-columns: 1fr; max-width: 60rem; }
.host { display: grid; gap: var(--space-m); padding: var(--space-m); background: var(--color-surface); border: var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
@media (min-width: 40rem) { .host { grid-template-columns: 11rem 1fr; align-items: start; padding: var(--space-l); } }
.host__photo { aspect-ratio: 1; border: var(--border); border-bottom: var(--border); border-radius: var(--radius-md); overflow: hidden; max-width: 11rem; }
.host__body h3 { margin: 0; font-size: var(--step-2); }
.host__role { margin: 0 0 var(--space-xs); font-family: var(--font-display); font-weight: 700; font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--color-link); }
.host__body p:not(.host__role) { color: var(--color-text); max-width: 65ch; }
.about .page-header h1 { max-width: 20ch; }

/* "Video coming soon" note (episode has audio but no video yet) */
.video-note { display: flex; gap: var(--space-s); align-items: flex-start; margin-block: var(--space-l) 0; padding: var(--space-m); border: var(--border); border-radius: var(--radius-lg); background: var(--color-surface-2); box-shadow: 5px 5px 0 0 var(--color-accent); }
.video-note svg { flex: none; width: 32px; height: 32px; color: #ff4e45; }
.video-note p { margin: 0; font-weight: 600; }
