/* AisleBench site styles. Colours, type and rules: docs/BRAND_FOUNDATION.md, docs/WEB_DESIGN.md. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-var.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #16262E;
  --paper: #F5F1E8;
  --card: #FBF9F4;
  --line: #DDD5C4;
  --secondary: #3B4B53;      /* ~8:1 on Paper */
  --teal: #16766F;           /* links and controls on Paper; never on Ink */
  --teal-hover: #0F5A54;
  --teal-on-ink: #45A79E;    /* the lightened teal, for Ink surfaces only */
  --footer-text: #C9CFCB;    /* ~8.5:1 on Ink */
  --amber: #D99A2B;          /* fill only, never text */
  --gutter: 20px;
  --measure: 1088px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* No fixed heights anywhere: the footer follows the content, and the page
   background fills a short screen (docs/WEB_DESIGN.md, phone review). */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--teal);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--teal-hover);
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Ink frame: header and footer ---------- */

.site-header {
  background: var(--ink);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-header img {
  display: block;
  height: 44px;
  width: auto;
}

.site-header a,
.site-footer a {
  color: var(--teal-on-ink);
}

.site-header a:hover,
.site-footer a:hover {
  color: var(--paper);
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--teal-on-ink);
}

.header-contact {
  display: none;
  font-size: 15px;
  font-weight: 500;
}

.site-footer {
  background: var(--ink);
  color: var(--footer-text);
  font-size: 14px;
  line-height: 1.5;
}

.site-footer .wrap {
  padding-top: 32px;
  padding-bottom: 32px;
}

.site-footer p {
  margin: 0;
}

/* Two tiers, like a publisher's footer: what a visitor needs, then the
   company details the Companies Act requires, set small. Space separates
   them; a rule made the footer look heavy. */
.footer-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 28px;
  font-size: 13px;
}

/* ---------- Holding page ---------- */

.intro {
  padding: 56px 0 0;
}

.intro h1 {
  margin: 0;
  max-width: 900px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 7vw + 0.5rem, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.explainer {
  margin: 16px 0 0;
  font-size: clamp(1.1rem, 1vw + 0.9rem, 1.375rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--secondary);
}

.about {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}

.about p {
  margin: 0;
  max-width: 34em;
}

.about strong {
  font-weight: 600;
}

.cards {
  display: grid;
  gap: 20px;
  margin: 40px 0 48px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.card--data {
  border-top: 6px solid var(--amber);
}

.card h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 1vw + 1.25rem, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  font-size: 16px;
  color: var(--secondary);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid var(--teal);
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: var(--teal);
}

.button:hover {
  background: var(--teal);
  color: var(--paper);
}

.card .button {
  margin-top: auto;
  align-self: stretch;
}

/* ---------- 404 ---------- */

.not-found {
  padding: 72px 0;
}

.not-found h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  line-height: 1.1;
}

.not-found p {
  margin: 0;
}

/* ---------- Wider screens ---------- */

@media (min-width: 768px) {
  :root {
    --gutter: 48px;
  }

  .site-header .wrap {
    padding-top: 26px;
    padding-bottom: 26px;
  }

  .site-header img {
    height: 56px;
  }

  .header-contact {
    display: inline;
  }

  .intro {
    padding-top: 88px;
  }

  .about {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
    margin-top: 56px;
  }

  .about p {
    font-size: 19px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    margin: 48px 0 64px;
  }

  .card {
    padding: 32px 36px 36px;
  }

  .card--data {
    padding-top: 27px;
  }

  .card .button {
    align-self: flex-start;
  }

  .site-footer .wrap {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .footer-main {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
  }
}

@media (min-width: 1100px) {
  :root {
    --gutter: 96px;
  }
}

/* ---------- Navigation (pages beyond the holding page) ---------- */

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
  font-weight: 500;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---------- Shared page parts ---------- */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quiet {
  color: var(--secondary);
  font-size: 14px;
}

.page-intro {
  padding: 40px 0 0;
}

.kicker {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--secondary);
}

.page-intro h1 {
  margin: 0;
  max-width: 24em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw + 1rem, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.standfirst {
  margin: 16px 0 0;
  max-width: 40em;
  font-size: clamp(1.05rem, 0.5vw + 1rem, 1.2rem);
  color: var(--secondary);
}

.timing {
  margin: 16px 0 0;
  font-size: 15px;
  font-weight: 500;
}

.block {
  margin: 32px 0;
}

.block h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 1vw + 1.15rem, 1.75rem);
  line-height: 1.2;
}

.lede {
  margin: 0 0 16px;
  max-width: 40em;
}

.meta {
  margin: 12px 0 0;
  max-width: 48em;
  font-size: 14px;
  line-height: 1.5;
  color: var(--secondary);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  border-bottom: 1.5px solid var(--ink);
}

th.num,
td.num {
  text-align: right;
}

tbody th {
  font-weight: 600;
}

/* ---------- Standard / Member switch (no script: two radios) ---------- */

.mode > input {
  position: absolute;
  opacity: 0;
}

.mode > label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  margin: 0 0 16px;
  border: 1.5px solid var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--card);
}

.mode > label[for="mode-std"] {
  border-radius: 4px 0 0 4px;
}

.mode > label[for="mode-mem"] {
  margin-left: -1.5px;
  border-radius: 0 4px 4px 0;
}

.mode > input:checked + label {
  background: var(--ink);
  color: var(--paper);
}

.mode > input:focus-visible + label {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.results .mem,
.results .mem-inline {
  display: none;
}

#mode-mem:checked ~ .table-scroll .results .std {
  display: none;
}

#mode-mem:checked ~ .table-scroll .results .mem {
  display: table-cell;
}

#mode-mem:checked ~ .table-scroll .results .mem-inline {
  display: inline;
}

.results td,
.results th {
  padding-top: 12px;
  padding-bottom: 12px;
}

.results tbody td.num:nth-of-type(1),
.results tbody td.num:nth-of-type(2) {
  font-weight: 600;
  font-size: 17px;
}

/* ---------- Item by item ---------- */

.items th[scope="row"] {
  font-weight: 500;
  white-space: nowrap;
}

.items td.low {
  font-weight: 700;
}

.cell-note {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--secondary);
  white-space: nowrap;
}

.items-wide {
  display: none;
}

.phone-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1.5px solid var(--ink);
}

.phone-list li {
  display: grid;
  grid-template-columns: 1fr 4.5rem;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.pl-item {
  font-weight: 500;
}

.pl-price {
  font-weight: 700;
}

.pl-where {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--secondary);
}

/* ---------- The full list ---------- */

.snap {
  border-top: 1px solid var(--line);
}

.snap:last-of-type {
  border-bottom: 1px solid var(--line);
}

.snap summary {
  min-height: 44px;
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
}

.snap-table {
  margin: 0 0 16px;
  font-size: 14px;
}

.departure {
  font-size: 13px;
  color: var(--ink);
  background: #F6E6C4;
  padding: 0 4px;
  border-radius: 2px;
}

/* Phones: the full-list table becomes stacked rows. */
@media (max-width: 767px) {
  .snap-table thead {
    display: none;
  }

  .snap-table tr,
  .snap-table th,
  .snap-table td {
    display: block;
    border: 0;
    padding: 2px 0;
    text-align: left;
  }

  .snap-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .snap-table td.num {
    font-weight: 600;
  }

  .results th:nth-child(6),
  .results td:nth-child(6) {
    display: none;
  }
}

/* ---------- Methodology ---------- */

.prose-wrap {
  max-width: calc(760px + 2 * var(--gutter));
}

.contents {
  margin: 24px 0 8px;
  padding-top: 12px;
  border-top: 1.5px solid var(--ink);
}

.contents summary {
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}

.contents ul {
  margin: 0;
  padding-left: 1.2em;
  font-size: 15px;
}

.prose h2 {
  margin: 36px 0 12px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 1vw + 1.15rem, 1.75rem);
  line-height: 1.2;
}

.prose h3 {
  margin: 32px 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.prose p,
.prose li {
  max-width: 40em;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 6px;
}

.prose-table {
  margin: 16px 0;
}

.back {
  margin: 40px 0 64px;
  font-size: 15px;
}

@media (min-width: 768px) {
  .items-wide {
    display: block;
  }

  .items-phone {
    display: none;
  }

  .page-intro {
    padding-top: 48px;
  }

  .block {
    margin: 40px 0;
  }
}

/* Narrow phones (320-400px): keep the header and results table inside the screen. */
@media (max-width: 400px) {
  .site-header .wrap {
    gap: 12px;
  }

  .site-header img {
    height: 36px;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 14px;
  }

  .results th,
  .results td {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 14px;
  }

  .results tbody td.num:nth-of-type(1),
  .results tbody td.num:nth-of-type(2) {
    font-size: 15px;
  }
}

.wide-only {
  display: none;
}

@media (min-width: 768px) {
  .wide-only {
    display: inline;
  }

  .phone-only {
    display: none;
  }
}

/* ---------- Home: this week's result first (WEB_DESIGN §1, Homepage) ---------- */

.home-intro {
  padding: 32px 0 0;
}

.master {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
}

.explainer-small {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--secondary);
}

.home-result {
  margin-top: 32px;
}

.home-result h1 {
  margin: 0;
  max-width: 24em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw + 1rem, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.home-result .timing {
  margin-bottom: 24px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

.button--solid {
  background: var(--teal);
  color: var(--paper);
}

.button--solid:hover {
  background: var(--teal-hover);
  border-color: var(--teal-hover);
  color: var(--paper);
}

/* Results table: the figures sit centred under their headings. Every total is £xx.xx and every
   index xxx.x in tabular numerals, so centring keeps the decimal points in line. */
.results th.num,
.results td.num {
  text-align: center;
}

/* Item grid and the full list: prices centred under their headings, like the totals table. */
.items th.num,
.items td.num,
.snap-table th.num,
.snap-table td.num,
.snap-table th.offer,
.snap-table td.offer {
  text-align: center;
}

/* ---------- Basket totals over time ---------- */

.chart {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1000px;
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart .axis {
  font: 12px var(--sans);
  fill: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.chart .end-label {
  font: 600 13px var(--sans);
  fill: var(--ink);
}

.chart-wide {
  display: none;
}

@media (min-width: 768px) {
  .chart-wide {
    display: block;
  }

  .chart-phone {
    display: none;
  }
}

@media (max-width: 767px) {
  .snap-table td.offer {
    text-align: left;
  }
}

/* Home: say what AisleBench is first (H1), then this week's result (H2). 25 Oct 2026. */
.home-intro h1 {
  margin: 28px 0 0;
  max-width: 20em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw + 1rem, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.home-lede {
  margin: 16px 0 0;
  max-width: 38em;
  font-size: clamp(1.05rem, 0.5vw + 1rem, 1.2rem);
}

.home-result {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.home-result h2 {
  margin: 0;
  max-width: 26em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 1.6vw + 1rem, 2rem);
  line-height: 1.2;
}

/* Phones: every call to action fills its section's width, so the buttons line up (25 Oct 2026). */
@media (max-width: 767px) {
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions .button {
    width: 100%;
  }

  .button {
    padding: 10px 16px;
    line-height: 1.35;
    text-align: center;
  }
}
