/* Home · Collections · Shows, the app's three tabs, plus the Shows and Collections pages.
   Shared by index.html, the browse pages and episode pages; layered on the web listener stylesheet. */

.header-main:has(.primary-nav) { grid-template-columns: auto auto minmax(260px, 640px) 1fr; gap: 44px; }

.primary-nav { display: flex; align-items: center; gap: 26px; }
.primary-nav a {
  padding: 6px 1px 5px;
  border-bottom: 3px solid transparent;
  color: var(--ink, #111);
  font: 500 1.25rem/1 "Alegreya Sans", system-ui, sans-serif; /* same face and weight as the "Latest Episodes" heading */
  text-decoration: none;
}
.primary-nav a:hover { border-bottom-color: rgba(17, 17, 17, 0.25); }
.primary-nav a[aria-current="page"] { border-bottom-color: var(--ink, #111); }

/* Show pills as links on the Shows and Collections pages */
a.filter-chip { text-decoration: none; }

@media (min-width: 701px) {
  .primary-nav { align-self: end; margin-bottom: 22px; }
}

@media (max-width: 700px) {
  .header-main:has(.primary-nav) { grid-template-columns: 1fr auto; gap: 12px; }
  .primary-nav { grid-column: 1 / -1; grid-row: 3; gap: 22px; padding: 2px 2px 0; }
  .primary-nav a { font-size: 1.08rem; }
}

/* Browse pages */
.browse-shell { min-height: 100svh; padding-top: 52px; padding-bottom: 120px; box-sizing: border-box; } /* short pages keep the footer below the fold */
.shelf-title { margin: 0 0 30px; font: 500 clamp(1.7rem, 3vw, 2.35rem)/1.1 "Alegreya Sans", system-ui, sans-serif; } /* same as the homepage "Latest Episodes" heading */
.browse-empty { font-size: 1.15rem; }
.browse-pager { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 40px; }
.browse-page-count { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.9rem; }
.episode-title a { color: inherit; text-decoration: none; }

/* Shows: vertical posters on News / Education shelves, like the app */
.show-shelf + .show-shelf { margin-top: 44px; }
.poster-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.show-poster { display: block; aspect-ratio: 9 / 16; overflow: hidden; border: 2px solid var(--ink, #111); border-radius: 6px; box-shadow: 6px 6px 0 var(--ink, #111); transition: transform 120ms ease, box-shadow 120ms ease; } /* same corners as the episode cards */
.show-poster img { width: 100%; height: 100%; display: block; object-fit: cover; }
.show-poster:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink, #111); }

/* Show page: the channel header */
.show-header { display: flex; align-items: center; gap: 32px; margin: 0 0 40px; }
.show-header-art { width: 170px; height: 170px; flex: none; object-fit: cover; border: 2px solid var(--ink, #111); border-radius: 6px; }
.show-header h1 { margin: 0 0 12px; font: 700 clamp(2.2rem, 4vw, 3.2rem)/1 "Roboto Condensed", sans-serif; }
.show-header-facts { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 10px; color: rgba(17, 17, 17, 0.62); font: 500 1.2rem "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.06em; }
.show-header-description { margin: 0; max-width: 680px; font: 1.2rem/1.45 ui-serif, Georgia, serif; }
.collection-header-tile { height: 140px; flex: none; display: flex; align-items: center; }
.collection-header-tile .collection-art { width: auto; height: 140px; }
.collection-header-tile .collection-art img, .collection-header-tile .collection-art svg { width: auto; height: 100%; aspect-ratio: auto; } /* hug each drawing so the gap to the title is the same for every collection */
.collection-header-tile .collection-art svg { aspect-ratio: 1; }
.collection-header-tile img { transform: none !important; } /* grid-tile size tweaks (scale, lift) do not apply in the header */
.collection-page-header { align-items: center; }
.collection-page-header .collection-header-tile { margin-top: -28px; } /* art sits higher than the title block */
.collection-header-tile:has(img[src*="rushmore"]), .collection-header-tile:has(img[src*="rushmore"]) .collection-art { height: 180px; }

/* Collections: Daily Mix bar and colored topic tiles, like the app */
.collection-mix { display: flex; align-items: center; gap: 26px; margin-bottom: 20px; padding: 26px 30px; border: 2px solid var(--ink, #111); border-radius: 14px; background: #bcd8f0; color: var(--ink, #111); text-decoration: none; box-shadow: 6px 6px 0 var(--ink, #111); }
.collection-mix svg { width: 76px; flex: none; }
.collection-mix-name { display: block; font: 700 1.6rem/1.1 "Alegreya Sans", system-ui, sans-serif; }
.collection-mix-copy { display: block; margin-top: 4px; font-size: 1.1rem; color: rgba(17, 17, 17, 0.72); }
.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px 48px; } /* same grid as the homepage episode cards */
.collection-tile { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; text-align: center; border: 2px solid var(--ink, #111); border-radius: 6px; background: var(--tile); color: var(--ink, #111); text-decoration: none; box-shadow: 6px 6px 0 var(--ink, #111); transition: transform 120ms ease, box-shadow 120ms ease; }
.collection-tile .collection-art { width: 150px; height: 124px; flex: none; }
.collection-tile .collection-name { font-size: 1.9rem; }
.collection-mix:hover, .collection-tile:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink, #111); }
.collection-art { width: 96px; height: 80px; display: flex; align-items: center; justify-content: center; }
.collection-art svg, .collection-art img { width: 100%; height: 100%; object-fit: contain; }
.collection-name { font: 700 1.3rem/1.15 "Alegreya Sans", system-ui, sans-serif; }

@media (max-width: 700px) {
  .browse-shell { padding-top: 34px; } /* matches the homepage on phones */
  .poster-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .show-poster { border-radius: 6px; box-shadow: 4px 4px 0 var(--ink, #111); }
  .show-header { gap: 18px; margin: 0 0 34px; }
  .show-header-art { width: 112px; height: 112px; border-radius: 6px; }
  .collection-header-tile, .collection-header-tile .collection-art { height: 76px; }
  .show-header-facts { font-size: 0.85rem; gap: 6px; }
  .show-header-description { font-size: 1.02rem; }
  .collection-mix { gap: 16px; padding: 18px; }
  .collection-mix svg { width: 56px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .collection-tile { gap: 12px; padding: 14px; box-shadow: 4px 4px 0 var(--ink, #111); }
  .collection-tile .collection-art { width: 84px; height: 70px; }
  .collection-tile .collection-name { font-size: 1.15rem; }
  .collection-name { font-size: 1.05rem; }
}

/* Episode page: cream card like the episode cards, transcript, app pitch */
.episode-detail { margin: 0; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); border: var(--line, 2px solid #111); border-radius: 6px; background: #F5EFE3; box-shadow: var(--shadow, 7px 7px 0 #111); overflow: hidden; }
.episode-detail-art { border-right: var(--line, 2px solid #111); background: #111; }
.episode-detail-art img, .episode-detail-art .episode-art-fallback { width: 100%; height: 100%; min-height: 100%; aspect-ratio: 3 / 2; display: block; object-fit: cover; }
.episode-detail-copy { display: flex; flex-direction: column; justify-content: center; padding: 36px 40px; }
.episode-detail-show { align-self: flex-start; color: inherit; text-decoration: none; }
.episode-detail-show:hover .episode-show { text-decoration: underline; text-underline-offset: 3px; }
.episode-detail-title { margin: 4px 0 14px; font: 600 clamp(2rem, 3.2vw, 2.9rem)/1.04 var(--episode-title-font, "Roboto Condensed", sans-serif); }
.episode-detail-summary { margin: 0 0 16px; font-size: 1.22rem; line-height: 1.45; }
.episode-detail-meta { margin: 0 0 26px; color: rgba(17, 17, 17, 0.62); font: 500 0.92rem "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.04em; }
.episode-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.episode-detail-play { min-width: 150px; height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 22px 0 16px; border: var(--line, 2px solid #111); border-radius: 5px; background: #fff; color: var(--ink, #111); font: 700 1.15rem "Alegreya Sans", system-ui, sans-serif; cursor: pointer; transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease; }
@media (hover: hover) and (pointer: fine) {
  .episode-detail-play:hover { background: var(--yellow, #ffea4f); transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink, #111); }
}
.episode-detail-play:active { background: var(--yellow, #ffea4f); transform: none; box-shadow: none; }
.episode-detail-play:focus-visible { outline: 3px solid var(--ink, #111); outline-offset: 3px; }
.episode-detail-play .card-play-icon { width: 26px; height: 26px; }
.episode-detail-play.is-playing .card-play-icon--play,
.episode-detail-play.is-loading .card-play-icon--play { display: none; }
.episode-detail-play.is-playing .card-play-bars { display: flex; }
.episode-detail-play.is-loading::before { content: ""; width: 20px; height: 20px; box-sizing: border-box; border: 2.5px solid var(--ink, #111); border-right-color: transparent; border-radius: 50%; animation: card-play-spin 0.75s linear infinite; }
.episode-detail-unavailable { margin: 0; font-size: 1.05rem; }

.episode-reading { max-width: 740px; margin: 64px auto 0; }
.episode-reading h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 22px; font: 400 2rem/1.15 "Bree Serif", Georgia, serif; }
.episode-reading .reading-note { font: 400 1.3rem "Alegreya Sans", sans-serif; color: #666; }
.episode-reading p { margin: 0 0 1.15em; font-size: 1.32rem; line-height: 1.65; overflow-wrap: anywhere; }

.episode-app-pitch { max-width: 740px; margin: 64px auto 0; padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border: var(--line, 2px solid #111); border-radius: 6px; background: #fff4d6; }
.episode-app-pitch p { margin: 0 0 8px; font: 400 1.3rem "Bree Serif", Georgia, serif; }
.episode-app-pitch h2 { margin: 0; font: 700 clamp(1.6rem, 2.5vw, 2.1rem)/1.12 "Roboto Condensed", sans-serif; text-transform: uppercase; text-wrap: balance; }
.episode-app-qr { width: 118px; display: grid; gap: 8px; color: inherit; font: 400 1rem "IBM Plex Mono", ui-monospace, monospace; text-align: center; text-decoration: none; }
.episode-app-qr img { width: 118px; aspect-ratio: 1; display: block; border: var(--line, 2px solid #111); background: #fff; object-fit: contain; }
.episode-app-button { display: none; text-decoration: none; font-weight: 700; }

@media (max-width: 900px) {
  .episode-detail { grid-template-columns: 1fr; }
  .episode-detail-art { border-right: 0; border-bottom: var(--line, 2px solid #111); }
  .episode-detail-copy { padding: 24px 22px 26px; }
}

@media (max-width: 700px) {
  .episode-detail { margin-top: 12px; box-shadow: 4px 4px 0 var(--ink, #111); }
  .episode-detail-title { font-size: 1.9rem; }
  .episode-detail-summary { font-size: 1.08rem; }
  .episode-detail-meta { font-size: 0.8rem; margin-bottom: 20px; }
  .episode-detail-play { min-width: 0; flex: 1; }
  .episode-reading { margin-top: 44px; }
  .episode-reading h2 { font-size: 1.6rem; }
  .episode-reading .reading-note { font-size: 1.1rem; }
  .episode-reading p { font-size: 1.12rem; }
  .episode-app-pitch { margin-top: 44px; padding: 22px; flex-direction: column; align-items: flex-start; }
  .episode-app-qr { display: none; }
  .episode-app-button { display: inline-flex; }
}

/* Optional reading sits beneath the narration, closed until the listener asks. */
.episode-sources { max-width: 740px; margin: 28px auto 0; border-top: 1px solid #d6d0c5; border-bottom: 1px solid #d6d0c5; }
.episode-sources summary { padding: 18px 0; cursor: pointer; font: 600 1.2rem/1.4 "Alegreya Sans", sans-serif; }
.episode-sources summary:focus-visible { outline: 2px solid #111; outline-offset: 4px; }
.episode-sources-body { padding: 0 0 8px; }
.episode-sources h3 { margin: 10px 0 14px; font: 700 1rem/1.4 "Alegreya Sans", sans-serif; color: #666; }
.episode-sources ul { list-style: none; padding: 0; margin: 0 0 24px; }
.episode-sources li { margin: 0 0 18px; overflow-wrap: anywhere; font: 400 1.15rem/1.45 "Alegreya Sans", sans-serif; }
.episode-sources a, .episode-sources .source-title { color: #111; font-weight: 700; }
.episode-sources a { text-underline-offset: 3px; }
.episode-sources .source-publisher { display: block; color: #666; font-size: 1rem; }
.episode-sources p { margin: 4px 0 0; }

/* Homepage Daily Mix view, shown like a collection page */
.lineup-heading[hidden], .mix-header[hidden], #mix-episodes-label[hidden] { display: none; }
.mix-header { margin-top: 20px; }
.mix-header .mix-title { margin: 0 0 12px; font: 700 clamp(2.2rem, 4vw, 3.2rem)/1 "Roboto Condensed", sans-serif; }
.mix-header .collection-art svg { aspect-ratio: 100 / 70; }
.mix-header .collection-header-tile, .mix-header .collection-header-tile .collection-art { height: 96px; }
@media (max-width: 700px) { .mix-header .collection-header-tile, .mix-header .collection-header-tile .collection-art { height: 56px; } }
