/* ==========================================================================
   GIRL BEER — pages
   Sections that live on the inner pages. Values come from css/brand.css.
   ========================================================================== */

/* ========================================================= PAGE HEADER === */
.pagehead {
  background: var(--bg-start);
  padding-block: clamp(42px, 5.5vw, 84px);
}
.pagehead { border-bottom: var(--rule-hair) solid var(--color-line); }
.pagehead__title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--fs-display-l);
  line-height: .9;
}
.pagehead__line {
  margin: 1.1em 0 0;
  max-width: 48ch;
}

/* ---------------------------------------------------------- filter row --- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: clamp(22px, 2.6vw, 34px);
}
/* the chosen pill, cream on wine at 8.81:1 — the same filled state as
   every other button on the site */
.filters .btn[aria-pressed="true"] {
  background: var(--wine);
  border-color: var(--wine);
  color: var(--color-on-dark);
}

/* ============================================= SINGLE EPISODE — header === */
.epsingle {
  background: var(--bg-start);
  padding-block: clamp(42px, 5.5vw, 80px);
}
.epsingle__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(26px, 4vw, 64px);
  align-items: center;
}
.epsingle__art {
  position: relative;
  max-width: 420px;
}
.epsingle__art :is(.ph, picture) { aspect-ratio: 1; }
.epsingle__art img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: var(--rule-hair) solid var(--color-line);
}
.epsingle__num {
  margin: 0;
  color: var(--color-accent);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: .8;
}
.epsingle__title {
  margin: .42em 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.1rem, 1rem + .5vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 26ch;
}
.epsingle__meta { margin: 1.1em 0 1.8em; opacity: .72; }

/* =========================================================== PLAYER ====== */
.player {
  background: var(--bg-start);
  padding-bottom: clamp(34px, 4vw, 56px);
}
.player__box {
  display: grid;
  place-items: center;
  min-height: clamp(104px, 11vw, 148px);
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--paper-lit);
}
/* Once the feed hands over the audio file this holds a real player. The
   browser's own control is the one every phone and screen reader already
   knows how to drive, so it is not rebuilt here. */
.player__box--live {
  place-items: stretch;
  min-height: 0;
  padding: clamp(16px, 2vw, 24px);
}
.player__audio { width: 100%; display: block; }

/* ======================================================== SHOW NOTES ===== */
.notes {
  background: var(--bg-start);
  border-top: var(--rule-hair) solid var(--color-line);
  padding-block: var(--section-pad);
}
.notes__grid {
  display: grid;
  grid-template-columns: minmax(0, 58ch) minmax(0, 28ch);
  justify-content: start;          /* narrow column with a margin note beside it */
  gap: clamp(28px, 4vw, 72px);
  align-items: start;
}
.notes__body { max-width: 56ch; }
.notes__head {
  margin: 2.2em 0 .9em;
  padding-top: 1em;
  border-top: var(--rule) solid var(--color-line);
  color: var(--color-text);
}
.notes__head:first-child { margin-top: 0; }
.notes__body p + p { margin-top: 1.3em; }
.notes__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.notes__list li { margin-bottom: .55em; }
.notes__list a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.notes__list a:hover { color: var(--wine); }   /* pink is 3.46:1 at this size */

.notes__aside {
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--paper);
  padding: clamp(18px, 2vw, 26px);
}
.notes__asidetext { margin: 1em 0 0; }

@media (max-width: 860px) {
  .epsingle__grid { grid-template-columns: 1fr; }
  .epsingle__art { max-width: 340px; }
  .notes__grid { grid-template-columns: 1fr; }
}

/* the full archive gets roomier cards — 3 across, and it still scales to 60 */
.episodes--all .episodes__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

/* ========================================================= ABOUT HERO ==== */

/* ========================================================== THE SHOW ===== */

/* Emphasis inside running copy, so it is body size: pink would be 3.46:1
   against the cream. Wine is 8.81:1 and still reads as a colour. */

/* ============================================================== BIOS ===== */
/* Portrait one side, name and paragraph together on the other, sides
   alternating. This is the landscape bio: it suits a paragraph of running
   text, where a portrait-above-text card suits a grid of short ones.

   The name was on a full-width row of its own above the pair. That stranded
   it beside half a band of empty space and made it read as a section heading
   rather than as the top of a bio. A name belongs to its paragraph. */
.bio { padding-block: var(--section-pad); }
.bio--b { background: var(--bg-start); border-top: var(--rule-hair) solid var(--color-line); }
.bio--a { background: var(--wine); color: var(--color-on-dark); }

.bio__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "art text";
  column-gap: clamp(28px, 4.5vw, 72px);
  align-items: center;
}
.bio__art  { grid-area: art; }
.bio__text { grid-area: text; }

/* The mirror. Only the portrait side swaps -- the type inside the block stays
   left-aligned both times, because right-aligning a monospace paragraph gives
   it a ragged left edge and monospace shows that badly. */
.bio--b .bio__inner {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "text art";
}

.bio__name {
  margin: 0 0 .32em;
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  line-height: .9;
  color: var(--color-on-dark);        /* cream on the wine band */
}
/* Wine, not pink. Pink on cream is 3.46:1 and only clears the bar because a
   name this size counts as large text; wine is 8.81:1 at any size, and it
   answers the cream name on the band above. BRAND.md records the exception --
   this is the one place wine is type rather than a ground. */
.bio--b .bio__name { color: var(--wine); }

.bio__art { margin: 0; width: clamp(164px, 23vw, 272px); }
.bio__art picture {
  aspect-ratio: 1;
  border-radius: var(--radius-round);
  border: var(--rule) solid var(--color-line);
}
/* ink on wine is 1.49:1 -- the rule would simply vanish */
.bio--a .bio__art picture { border-color: var(--color-on-dark); }

/* 54ch, measured rather than picked: it is the widest the paragraph can run
   and still sit inside the comfortable 45-75 character measure, and at 46ch
   Claire's bio wrapped to five lines and left a third of her column empty. */
/* The hairline between the name and the paragraph, the same one the hero
   sets around its line: --rule-hair in --color-line. Short, because it is
   marking a break inside a block rather than separating two sections.

   Cream on the wine band -- ink on wine is 1.49:1 and the rule would simply
   not be there. Ink on the cream band below. */
.bio__rule {
  width: clamp(44px, 6vw, 72px);
  height: 0;
  margin: 0 0 clamp(14px, 1.7vw, 22px);
  border: 0;
  border-top: var(--rule-hair) solid var(--color-on-dark);
}
.bio--b .bio__rule { border-top-color: var(--color-line); }

.bio__text p { margin: 0; max-width: 54ch; }

/* Where a bio carries links of its own. Set as a label rather than as running
   text, so they read as a pair of destinations under the paragraph instead of
   as a sentence that trails off it. */
.bio__text .bio__links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5em;
  row-gap: .4em;
  margin-top: clamp(14px, 1.7vw, 22px);
  opacity: .85;
  /* The 54ch cap on the paragraph above is a reading measure, and this is a
     row of links rather than running text. It is a <p>, so the cap reached it
     anyway and broke the row onto a second line with half the column still
     empty beside it. Links wrap when they run out of column, not before. */
  max-width: none;
}
.bio__links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
/* Pink is 3.79:1 on the wine ground and 3.46:1 on the cream one -- under the
   bar at this size, which is small. The accent goes to the rule underneath,
   where contrast does not apply, and the type stays as it is. */
.bio__links a:hover,
.bio__links a:focus-visible { border-bottom-color: var(--pink); }

/* Stacked, there is one centred axis and everything sits on it. The name, the
   circle and the paragraph are three different widths, and three different
   widths left-aligned read as ragged rather than as a column.

   The mirror does not survive the stack. Side by side it reverses a two
   column layout, which is the whole point of it; stacked there are no sides
   to reverse, so pushing Claire's circle right only made her block lean the
   other way for no reason. The reversed ground still pairs them. */
@media (max-width: 760px) {
  .bio__inner,
  .bio--b .bio__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "art" "text";
    row-gap: clamp(18px, 3vw, 30px);
    justify-items: center;
  }
  .bio__art { width: clamp(164px, 56vw, 260px); }
  .bio__name { text-align: center; }
  /* Centred, including the running text. A centred monospace paragraph gives
     up a straight left edge, which is a real cost -- but stacked, the column
     reads as one centred axis and a left-aligned block of type in the middle
     of it broke that line. Asked for directly, and the axis is worth it. */
  .bio__text { text-align: center; }
  .bio__rule { margin-inline: auto; }
  .bio__text .bio__links { justify-content: center; }
  /* The paragraph is capped at 54ch. Between about 620 and 760 that cap is
     narrower than the column, so centring the type inside the box leaves the
     box itself sitting left. The box has to be centred too. */
  .bio__text p { margin-inline: auto; }
}

/* ============================================================== 404 ===== */
.notfound {
  background: var(--bg-hero);
  padding-block: clamp(60px, 9vw, 140px);
  text-align: center;
}
.notfound__num {
  margin: 0;
  font-weight: var(--display-weight);
  color: var(--color-accent);
  font-size: clamp(7rem, 30vw, 22rem);
  line-height: .8;
}
.notfound__line { margin: 1.4em auto 2em; max-width: 40ch; }

@media (max-width: 860px) {
}

/* ==========================================================================
   TOUCH TARGETS — must stay last
   These override sizing set in base.css and sections.css, which load before
   this file. On a touch screen every control clears 44px.
   ========================================================================== */
@media (pointer: coarse) {
  .btn,
  .nav__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  /* The menu button gets the same 44px, but NOT a display of its own. It is
     display:none until the nav decides to collapse, and setting a display
     here overrode that -- so MENU sat next to the open tabs on every touch
     screen. Size it; let the nav say whether it exists. */
  .nav__toggle {
    min-height: 44px;
    align-items: center;
  }
  .footer__links a,
  .notes__list a,
  .footer__email a {        /* the mailto the footer fills in from config */
    display: inline-block;
    padding-block: 15px;
  }
  /* The links run across and wrap. The 15px tap padding above already
     separates one wrapped line from the next, so the row gap goes to zero --
     but only the ROW gap. `gap: 0` would flatten the column gap too and run
     the four names together into one unreadable word. */
  .footer__links { row-gap: 0; }
  .frame__caption { gap: 1rem; }
}
