/* ==========================================================================
   Toppers' copy page — page head, year pills, year sections, topper cards,
   copy buttons, chips. Requires tokens.css + base.css. (The gate lives in gate.css.)
   ========================================================================== */

/* Page head ------------------------------------------------------------ */
.page-head { padding-block: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-line); }
.page-head__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.page-head__text { display: grid; gap: var(--s-2); min-width: 0; }
.page-head__actions { min-width: 0; }
.auth-cta { display: grid; gap: var(--s-1); }
.auth-cta__buttons { display: flex; gap: var(--s-2); }
.auth-cta__buttons .btn { flex: 1 1 0; min-width: 0; }
.auth-cta__note { color: var(--c-text-muted); font-size: var(--fs-sm); }
.auth-cta[hidden] { display: none; }
.pills-wrap { min-width: 0; }
.page-head__title { font-size: var(--fs-h1); }
.page-head__intro { max-width: 70ch; color: var(--c-text-muted); }
.auth-status { font-size: var(--fs-base); color: var(--c-text); }
.auth-status__email { font-weight: 700; }
.link-btn {
  display: inline;
  padding: 0;
  font: inherit;
  color: var(--c-link-text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.link-btn:hover { color: var(--c-slate); }

/* Breadcrumb */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 var(--s-1); font-size: var(--fs-sm); color: var(--c-text-muted); }
.crumbs li + li::before { content: "\203A"; margin-right: var(--s-1); color: var(--c-text-muted); }
.crumbs a { color: var(--c-link-text); text-decoration: none; display: inline-flex; align-items: center; min-height: 28px; }
.crumbs a:hover { text-decoration: underline; }

/* Year pills: one row, scrolls inside its own box on phones */
.pills-wrap { margin-inline: calc(-1 * var(--gutter)); }
.pills {
  display: flex;
  gap: var(--s-1);
  overflow-x: auto;
  padding-inline: var(--gutter);
  padding-block: 2px var(--s-1);
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--s-2);
  font-family: var(--ff-display);
  font-size: 1rem;
  color: var(--c-slate);
  background: var(--c-white);
  border: 1px solid var(--c-slate);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.pill:hover { background: var(--c-slate); color: var(--c-white); }

@media (min-width: 960px) {
  .page-head { padding-block: var(--s-4) var(--s-5); }
  .page-head__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "crumbs crumbs" "text actions" "years years";
    column-gap: var(--s-6);
    row-gap: var(--s-3);
  }
  .page-head__inner > .crumbs { grid-area: crumbs; }
  .page-head__text { grid-area: text; }
  .page-head__actions { grid-area: actions; align-self: start; justify-self: end; width: 280px; padding-top: var(--s-1); }
  .page-head__inner > .year-nav { grid-area: years; }
  .auth-cta__buttons { flex-direction: column; }
  .auth-cta__note, .auth-status { text-align: left; }
}

/* Year sections --------------------------------------------------------- */
.year { scroll-margin-top: var(--s-3); padding-block: var(--s-5); }
.year:nth-of-type(even) { background: var(--c-surface); }
.year__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-2);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 3px solid var(--c-red);
}
.year__title { font-size: var(--fs-h2); }
.year__meta { color: var(--c-text-muted); font-size: var(--fs-sm); white-space: nowrap; }
@media (min-width: 960px) {
  .year { padding-block: var(--s-6); }
  .year__head { margin-bottom: var(--s-4); }
}

/* Topper card ----------------------------------------------------------- */
.topper { gap: var(--s-1); }
.topper__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-2);
}
.topper__name { font-size: var(--fs-h3); }
.air {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.6rem;
  font-family: var(--ff-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  color: var(--c-white);
  background: var(--c-charcoal);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.topper__count { color: var(--c-text-muted); font-size: var(--fs-sm); }
.copy-list { display: grid; gap: var(--s-1); margin-top: var(--s-1); }

/* Copy button: chevron signed out, download icon once signed in */
.copy-btn {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  width: 100%;
  min-height: var(--tap-min);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.copy-btn:hover { background: var(--c-white); border-color: var(--c-slate); }
.copy-btn__icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--c-text-muted); }
.copy-btn__icon--open { display: none; }
.copy-btn:hover .copy-btn__icon--go { color: var(--c-red-text); }
.copy-btn__subject { flex: 1 1 auto; min-width: 0; }
.copy-btn__test { flex: 0 0 auto; font-size: var(--fs-sm); color: var(--c-text-muted); white-space: nowrap; }
.is-signed-in .copy-btn { background: var(--c-white); border-color: var(--c-slate); }
.is-signed-in .copy-btn:hover { background: var(--c-slate); color: var(--c-white); }
.is-signed-in .copy-btn:hover .copy-btn__icon,
.is-signed-in .copy-btn:hover .copy-btn__test { color: inherit; }
.is-signed-in .copy-btn__icon--go { display: none; }
.is-signed-in .copy-btn__icon--open { display: block; color: var(--c-red-text); }

/* Chips: copies without a named topper (compact grid) */
.chip-grid {
  display: grid;
  gap: var(--s-1);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.copy-btn--chip { background: var(--c-white); }

/* "Want your own answers checked?" */
.next-grid { max-width: 760px; margin-inline: auto; }

.topper__story { margin-top: var(--s-1); }
.topper__story a { display: inline-flex; align-items: center; min-height: var(--tap-min); }

/* A listed copy whose file is not online yet */
.copy-btn--soon { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: default; opacity: .6; }
.copy-btn__soon { margin-left: auto; font-size: var(--fs-sm); color: var(--c-text-muted); font-style: italic; }

/* Phones and tablets: the floating WhatsApp button (56px + 8px gap) and the Enquire chip sit over the bottom-right corner.
   Keep a clear band at the end of the content so the last rows can always be scrolled above them. */
@media (max-width: 959px) {
  main { padding-bottom: calc(56px + var(--s-2) + var(--s-4)); }
}
