/* 200freespins.co.uk template layer (2026-11-10).
   Loaded after Base + Article CSS on every page by scripts/apply_template.py,
   which publishes it as /_astro/template.<hash>.css so caches never serve a stale copy.
   Uses the Astro build's existing tokens; defines no new colours. */

/* ---------- Header and menu: all widths ---------- */
.site-header {
  position: relative;
  z-index: var(--z-header);
  background: var(--color-bg-page);
  background: color-mix(in srgb, var(--color-bg-page) 97%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
}
.header-inner { flex-wrap: nowrap; gap: var(--space-5); min-height: 72px; }
.site-nav { min-width: 0; }
.site-nav ul { flex-wrap: nowrap; gap: var(--space-1); }
.site-nav li { flex: none; }
.site-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.site-nav a:hover { background: var(--color-bg-surface-alt); color: var(--color-text-default); text-decoration: none; }
.site-nav a:active { background: var(--color-border-subtle); }
.site-nav a:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.site-nav a[aria-current="page"] {
  background: var(--primitive-green-50);
  color: var(--primitive-green-700);
  box-shadow: inset 0 0 0 1px var(--primitive-green-100);
}
.age-badge { flex: none; padding: 2px var(--space-2); font-size: var(--text-xs); line-height: 1.4; }

/* ---------- Desktop: sticky header (menu fits in one row from 900px) ---------- */
@media (width >= 900px) {
  .site-header { position: sticky; top: 0; }
  .article :is(h2, h3)[id] { scroll-margin-top: 96px; }
}
@media (width >= 1024px) {
  .brand img { width: 168px; }
  .site-nav a { font-size: .9375rem; }
}

/* ---------- Comparison tables: offer name stays visible while you swipe ---------- */
.article tbody th[scope="row"],
.article thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-bg-page);
  box-shadow: 1px 0 0 var(--color-border-strong);
}
.article thead th:first-child { background: var(--color-bg-surface-alt); }

/* Key terms were 10px; 12px keeps significant terms readable on a phone. */
.article .offer__key-terms { font-size: .75rem; }

/* ---------- Phones and tablets: two-row header ---------- */
@media (width < 900px) {
  /* Row 1: logo + 18+. Row 2: full-width menu strip that swipes sideways. */
  .header-inner { flex-wrap: wrap; gap: 0 var(--space-3); min-height: 0; padding-block: var(--space-3) 0; }
  .brand { order: 1; }
  .brand img { width: 136px; }
  .age-badge { order: 2; }
  .site-nav {
    order: 3;
    flex: 1 0 100%;
    margin: var(--space-2) calc(var(--gutter) * -1) 0;
    border-top: var(--border-width) solid var(--color-border-subtle);
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
    mask-image: linear-gradient(to right, #000 82%, transparent);
  }
  .site-nav ul {
    overflow-x: auto;
    scrollbar-width: none;
    padding: var(--space-1) var(--space-8) var(--space-1) var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
  .site-nav ul::-webkit-scrollbar { display: none; }
  .site-nav a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---------- Phones ---------- */
@media (width < 768px) {
  :root { --gutter: var(--space-4); }

  /* Page rhythm: less dead space between sections on a small screen. */
  .article { padding-block: var(--space-5) var(--space-4); }
  .article h1 { font-size: clamp(1.75rem, 1.25rem + 2.5vw, 2rem); margin-bottom: var(--space-4); }
  .article h2 { margin: var(--space-7) 0 var(--space-3); padding-top: var(--space-4); }
  .article .declaration { font-size: var(--text-base); }

  /* Claim boxes: full-width button, tighter padding. */
  .article .offer { padding: var(--space-4); margin: var(--space-5) 0; }
  .article .offer__cta { width: 100%; max-width: none; min-height: 48px; font-size: var(--text-base); }
  .offer .offer__title { font-size: 1.125rem; }

  /* Tables run edge to edge so more columns fit on screen. */
  .article .table-scroll {
    margin-inline: calc(var(--gutter) * -1);
    border-inline: 0;
    border-radius: 0;
  }
  .article th, .article td { min-width: 8rem; padding: var(--space-2) var(--space-3); }
  .article tbody th[scope="row"], .article thead th:first-child { min-width: 7.5rem; max-width: 9rem; }
  .article tbody td:first-of-type { min-width: 12rem; }

  .site-footer { padding-block: var(--space-5) var(--space-7); }
  .footer-nav a { display: inline-block; padding-block: var(--space-2); }
}
