/* ─────────────────────────────────────────────────────────────────────────
   CAMP PAGE — a camp's own page in the Gathering look (METIS-pub#490).

   Built to the design record in specs/future/camp-page/ (round 3 version A,
   then round 4): the name and the camp's words on the left; the video, the
   hosts, the organisation and the ticket on the right; each organisation as a
   section; the experiences day by day, a line each, on dark green. Started
   from the mock's `cp-` rules (source/mock.css) for the chosen rounds only.
   The right column scrolls with the page: no `position: sticky` (Approvals
   row 8), although the screenshots were taken with it.

   Everything else is front.css (bands, the content column, the lockup, the
   hosts) and the theme (`.tg-*`, scoped to `[data-app="gathering"]`). This
   file is `@layer base`, as front.css is; the theme and the shared video
   card are `@layer components` and win whatever the specificity, so the
   video is placed from a wrapper (`.cp-video`), never restyled.

   No literal colour, size, radius, shadow or duration: tokens only, and
   `color-mix` is `in oklab`. Lengths that are layout are rem. Nothing here
   moves on hover: `.cp-line` and the video rise through `.lift` only
   (tests_lift.py).
   ───────────────────────────────────────────────────────────────────────── */

@layer base {
  /* The camp's colour is its gathering's, from the theme's `--country-main`
     (METIS-pub#585), not an inline style, which would beat the theme. */
  .cp-main { --country: var(--country-main); }

  /* ── The opening: two columns ───────────────────────────────────────── */
  .cp-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
    grid-template-areas: "head side" "body side";
    grid-template-rows: auto 1fr;
    column-gap: var(--space-16);
    row-gap: var(--space-8);
    align-items: start;
  }

  /* A wide video needs a wider column to be worth watching. */
  .cp-cols--wide { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); }

  .cp-cols__head {
    grid-area: head;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
  }

  .cp-cols__body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
  }

  .cp-cols__side {
    grid-area: side;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
  }

  /* The lockup's link to the gathering: the text's colour, underlined. */
  .cp-plainlink {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--tg-hairline);
    text-underline-offset: 0.2em;
  }

  .cp-plainlink:hover { color: var(--tg-link); }

  /* The camp's logo in the lockup, ringed in the country's colour: the same
     two-hexagon build as a face. */
  .cp-lockup__logo {
    display: block;
    flex: none;
    width: var(--space-12);
    padding: calc(var(--space-1) * 0.5);
    clip-path: var(--tg-hex-clip);
    background: var(--country);
  }

  .cp-lockup__logo .tg-hex {
    display: block;
    width: 100%;
    background: var(--white);
  }

  /* The camp's "why", as the page's standfirst. */
  .cp-lede {
    max-width: 40rem;
    margin: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: var(--tg-w-light);
    font-size: var(--tg-fs-intro);
    line-height: 1.35;
    color: var(--color-text-muted);
  }

  .cp-meta {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: var(--tg-ls-eyebrow);
    text-transform: uppercase;
    color: var(--fp-label);
  }

  /* ── The right column ───────────────────────────────────────────────── */
  /* Placement only: the card is the shared one (video-card.css). Upright,
     it is phone-shaped and at most 17rem wide; wide, it fills the column. */
  .cp-video {
    display: block;
    width: 100%;
    max-width: 17rem;
  }

  .cp-video--wide { max-width: none; }

  .cp-video > .video-card {
    display: block;
    width: 100%;
  }

  /* No video and no host's face: the camp's logo, large, ringed in the
     country's colour. */
  .cp-bighex {
    display: block;
    width: 100%;
    max-width: 12rem;
    padding: var(--space-3);
    background: var(--country);
  }

  .cp-bighex__in {
    display: block;
    width: 100%;
    background: var(--white);
  }

  .cp-orglist {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .cp-orgline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-md);
  }

  .cp-orgline__logo {
    display: block;
    flex: none;
    width: var(--space-8);
    padding: calc(var(--space-1) * 0.5);
    clip-path: var(--tg-hex-clip);
    background: var(--color-surface);
  }

  .cp-orgline__logo .tg-hex {
    display: block;
    width: 100%;
    background: var(--white);
  }

  .cp-ticket { align-self: flex-start; }

  /* ── The organisations ──────────────────────────────────────────────── */
  .cp-orgs {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
  }

  .cp-org {
    display: grid;
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
    gap: var(--space-16);
    align-items: start;
  }

  /* One link over the whole block: the name's `.stretched-link` covers it,
     and the block rises through `.lift .lift--ground` as `.cp-line` does —
     the same inset, so the text stays where it was. */
  .cp-org__id {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: 0;
    margin: calc(var(--space-3) * -1);
    padding: var(--space-3);
    border-radius: var(--radius-md);
  }

  .cp-org__logo {
    display: block;
    width: 7rem;
    margin-bottom: var(--space-2);
    padding: var(--space-1);
    clip-path: var(--tg-hex-clip);
    background: var(--country);
  }

  .cp-org__logo .tg-hex {
    display: block;
    width: 100%;
    background: var(--white);
  }

  .cp-org__name { --tg-fs-title: var(--tg-fs-numeral); }

  .cp-org__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 42rem;
    min-width: 0;
  }

  /* ── The programme, day by day ──────────────────────────────────────── */
  .cp-progband .d1-programme-teaser-head { margin-bottom: var(--space-12); }

  .cp-days {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
  }

  /* The programme band is .tg-dark, which remaps --color-text/-accent/-border
     but not --fp-label (declared on .fp-main, so fixed to the canvas colours)
     nor --tg-hairline (green on green). Re-derive the label here, from the
     remapped tokens, and draw the rules with --color-border, which .tg-dark
     does remap. */
  .cp-progband {
    --fp-label: color-mix(in oklab, var(--color-accent) 70%, var(--color-text));
    --cp-rule: var(--color-border);
  }

  .cp-day {
    display: grid;
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: var(--space-8);
    align-items: start;
    padding-top: var(--space-6);
    border-top: 1px solid var(--cp-rule, var(--tg-hairline));
  }

  .cp-day__head {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
  }

  .cp-day__title { --tg-fs-title: var(--tg-fs-numeral); }

  .cp-agenda {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  /* One experience: its time, then its name and a line about it. The whole
     line is the name's link (`.stretched-link`), so it takes the lift's
     ground and its own radius; the negative margin keeps the text on the
     column's edge while the hover ground reaches past it. */
  .cp-line {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: var(--space-4);
    margin-inline: calc(var(--space-3) * -1);
    padding: var(--space-3);
    border-top: 1px solid var(--cp-rule, var(--tg-hairline));
    border-radius: var(--radius-md);
  }

  .cp-line:first-child { border-top: 0; }

  /* Lines whose time names its day too — a place's page (METIS-pub#606): "Saturday 24 October · 09:30 – 11:00"
     needs a wider column than a bare time. */
  .cp-agenda--dated .cp-line { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); }

  .cp-line__when {
    padding-top: calc(var(--space-1) * 0.75);
    font-family: var(--font-mono);
    font-size: var(--text-md);
    letter-spacing: var(--tg-ls-eyebrow);
    color: var(--fp-label);
  }

  /* The place beside the time, linked to its page (METIS-pub#606): the
     label's colour, underlined, above the line's stretched link. */
  .cp-line__when a { color: inherit; }

  .cp-line__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
  }

  .cp-line__name {
    font-family: var(--font-display);
    font-size: var(--tg-fs-intro);
    line-height: 1.2;
  }

  .cp-line__name a {
    color: inherit;
    text-decoration: none;
  }

  .cp-line:hover .cp-line__name a { color: var(--tg-link); }

  .cp-line__blurb {
    max-width: 46rem;
    font-size: var(--text-md);
    line-height: 1.5;
    color: var(--color-text-muted);
  }

  /* ── Phone ──────────────────────────────────────────────────────────── */
  /* One column, in source order: the name and its words, then the video,
     hosts and ticket, then the description. */
  @media (max-width: 48rem) {
    .cp-cols,
    .cp-cols--wide {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "head" "side" "body";
      grid-template-rows: auto;
    }

    .cp-org,
    .cp-day {
      grid-template-columns: minmax(0, 1fr);
      gap: var(--space-6);
    }

    .cp-line {
      grid-template-columns: 3.5rem minmax(0, 1fr);
      gap: var(--space-3);
    }

    /* A dated line on a phone: the day and time above the name. */
    .cp-agenda--dated .cp-line {
      grid-template-columns: minmax(0, 1fr);
      gap: var(--space-1);
    }
  }
}
