/* ==========================================================================
   britishsummertime.co.uk — design system
   Plain sans (Inter) everywhere; Fraunces reserved for display numerals only.
   White bg, single amber accent, hairline borders. Utility-first, dense.
   ========================================================================== */

/* ----- Fonts (self-hosted, variable) ----- */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-opsz-normal.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
/* metric-matched fallback to cut layout shift while Inter loads */
@font-face {
  font-family: "Inter-fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* ----- Tokens ----- */
:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-2: #eef1f4;
  --ink: #161d28;
  --ink-2: #51606f;          /* muted text, AA on white */
  --line: #e2e6ea;
  --line-strong: #cfd5dc;
  --navy: #182234;           /* dark instrument panels */
  --navy-2: #20304b;
  --navy-line: #31405b;
  --accent: #ef8b1f;         /* amber — decorative / on dark */
  --accent-deep: #a8530c;    /* amber for links/small text on white (AA) */
  --accent-ink: #3a1f06;     /* text on amber fills */
  --ok: #1f7a4d;
  --maxw: 1140px;
  --gut: clamp(16px, 4vw, 28px);
  --radius: 6px;
  --radius-lg: 10px;
  --sans: "Inter", "Inter-fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "cv05", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 650; }
h1, h2, h3, h4 { line-height: 1.16; color: var(--ink); font-weight: 700; letter-spacing: -0.018em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.85rem); }
h2 { font-size: clamp(1.42rem, 1.1rem + 1.3vw, 1.92rem); margin-top: 1.7em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin: .3rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.2rem 0; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; background: var(--surface); padding: .1em .35em; border-radius: 4px; }

.tnum { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.narrow { max-width: 760px; }

/* ----- a11y ----- */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 2px; border-radius: 3px; }
.on-dark :focus-visible, .clock-card :focus-visible, .site-footer :focus-visible { outline-color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ----- Header / nav ----- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; gap: 22px;
  max-width: var(--maxw); margin-inline: auto; padding: 10px var(--gut);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { font-weight: 750; }
.brand span { color: var(--ink-2); font-weight: 600; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--ink); text-decoration: none; font-weight: 550; font-size: .96rem;
  padding: 8px 11px; border-radius: var(--radius);
}
.nav-links a:hover { background: var(--surface); }
.nav-links a[aria-current="page"] { color: var(--accent-deep); }
.nav-cta {
  background: var(--navy); color: #fff !important; padding: 8px 14px !important;
  border-radius: var(--radius); font-weight: 600;
}
.nav-cta:hover { background: var(--navy-2); }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 860px) {
  .nav-burger {
    display: inline-flex; flex-direction: column; gap: 4px; justify-content: center;
    width: 42px; height: 38px; padding: 9px; border: 1px solid var(--line-strong);
    border-radius: var(--radius); background: var(--bg); cursor: pointer;
  }
  .nav-burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle { position: absolute; opacity: 0; width: 42px; height: 38px; right: var(--gut); top: 12px; margin: 0; cursor: pointer; }
  .nav-toggle:focus-visible ~ .nav-burger { outline: 3px solid var(--accent-deep); outline-offset: 2px; }
  .nav-links {
    position: fixed; inset: 56px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gut) 16px;
    max-height: 0; overflow: hidden; visibility: hidden;
  }
  .nav-toggle:checked ~ .nav-links { max-height: 80vh; visibility: visible; box-shadow: 0 16px 30px -20px rgba(0,0,0,.4); }
  .nav-links a { padding: 13px 8px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.02rem; }
  .nav-cta { margin-top: 10px; text-align: center; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ----- Breadcrumb ----- */
.breadcrumb { font-size: .85rem; color: var(--ink-2); padding: 14px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li::after { content: "/"; margin-left: 6px; color: var(--line-strong); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--ink-2); }

/* ----- Hero (split: editorial text + instrument clock) ----- */
.hero { padding: clamp(26px, 4vw, 48px) 0 8px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 4vw, 52px); align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero .lead { font-size: 1.16rem; color: var(--ink-2); max-width: 46ch; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 14px; }
.answer-pill {
  display: inline-flex; align-items: baseline; gap: 10px; margin: 6px 0 18px;
  font-family: var(--serif); font-weight: 600;
}
.answer-pill .big { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem); color: var(--accent-deep); font-variation-settings: "opsz" 40; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ----- Clock instrument card ----- */
.clock-card {
  background: linear-gradient(180deg, #1b2840 0%, #141d2e 100%);
  color: #eef2f8; border-radius: var(--radius-lg); padding: 26px 26px 22px;
  border: 1px solid var(--navy-line);
}
.clock-card .zone-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 650;
  letter-spacing: .04em; color: var(--navy); background: var(--accent); padding: 4px 11px; border-radius: 999px;
}
.clock-card .zone-badge.gmt { background: #cdd7e6; }
.clock-time {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: clamp(3.4rem, 2.2rem + 6vw, 5.2rem); font-weight: 300; line-height: 1; letter-spacing: -.02em;
  margin: 14px 0 4px; color: #fff; min-height: 1em;
}
.clock-time .sec { color: var(--accent); font-weight: 400; }
.clock-date { color: #aab6c9; font-size: 1.02rem; }
.clock-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--navy-line); font-size: .9rem; color: #c2cddd; }
.clock-meta b { color: #fff; font-weight: 600; }
.clock-offset { font-family: var(--serif); font-weight: 600; }

/* ----- Cards / panels ----- */
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 26px); }
.panel.tint { background: var(--surface); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.section { padding: clamp(30px, 5vw, 56px) 0; }
.section.tinted { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 64ch; margin-bottom: 22px; }
.section-head p { color: var(--ink-2); margin: 0; }

/* ----- Converter tool ----- */
.tool { background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; }
.tool-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool-head h2, .tool-head h3 { margin: 0; font-size: 1.12rem; }
.tool-body { padding: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 11px 12px; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--accent-deep); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.swap-btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink);
}
.swap-btn:hover { background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chip {
  font: inherit; font-size: .86rem; font-weight: 550; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.result {
  margin-top: 16px; padding: 18px 20px; background: var(--navy); color: #fff; border-radius: var(--radius);
}
.result .r-time { font-family: var(--serif); font-variant-numeric: tabular-nums; font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.6rem); font-weight: 600; line-height: 1.05; color: #fff; }
.result .r-meta { color: #b9c4d6; margin-top: 4px; font-size: .96rem; }
.result .r-diff { color: var(--accent); font-weight: 600; }

/* ----- World clock grid ----- */
.worldclock { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.wc {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; background: var(--bg);
}
.wc .wc-city { font-weight: 600; font-size: .96rem; }
.wc .wc-off { font-size: .76rem; color: var(--ink-2); }
.wc .wc-time { font-variant-numeric: tabular-nums; font-size: 1.45rem; font-weight: 500; margin-top: 6px; letter-spacing: -.01em; }
.wc .wc-day { font-size: .76rem; color: var(--ink-2); }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table.data { border-collapse: collapse; width: 100%; font-size: .96rem; }
table.data caption { text-align: left; padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
table.data th, table.data td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--surface); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface); }
table.data .em { font-weight: 600; }
.next-row { background: #fff7ec !important; }
.next-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ----- Answer block + callout (AEO/GEO) ----- */
.answer-block { margin: 1.4rem 0; }
.callout {
  border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 13px 18px; margin: 1.1rem 0;
}
.callout p { margin: 0; }
.callout strong:first-child { color: var(--accent-deep); }
.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 1.4rem 0; }
.keyfact { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.keyfact .kf-num { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; color: var(--accent-deep); line-height: 1; }
.keyfact .kf-lab { font-size: .85rem; color: var(--ink-2); margin-top: 5px; }

/* ----- Countdown ----- */
.countdown { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 2px; }
.cd-unit { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 10px 14px; min-width: 64px; text-align: center; }
.cd-unit .cd-n { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 600; line-height: 1; }
.cd-unit .cd-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #aab6c9; margin-top: 4px; }

/* ----- FAQ (native details) ----- */
.faq { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent-deep); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq summary:hover { background: var(--surface); }
.faq .faq-a { padding: 0 20px 18px; color: var(--ink); }
.faq .faq-a p:last-child { margin-bottom: 0; }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; border-radius: var(--radius); padding: 11px 18px; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #e07d10; text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); text-decoration: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* ----- Link lists / related ----- */
.linklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.linklist a {
  display: block; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); font-weight: 550;
}
.linklist a:hover { border-color: var(--accent); background: var(--surface); }
.linklist a .ll-sub { display: block; font-weight: 400; font-size: .82rem; color: var(--ink-2); margin-top: 2px; }

/* ----- Ad slot (reserved, zero-CLS) ----- */
.ad-slot { margin: 26px auto; text-align: center; min-height: 100px; }
.ad-slot .ad-label { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: #646d79; margin-bottom: 6px; }
.ad-slot ins { display: block; }

/* ----- Prose container ----- */
.prose { font-size: 1.04rem; }
.prose :is(h2, h3) { scroll-margin-top: 80px; }
.prose a { color: var(--accent-deep); }
.note { font-size: .9rem; color: var(--ink-2); }
.source-list { font-size: .88rem; color: var(--ink-2); }
.source-list a { color: var(--accent-deep); }

/* ----- Footer ----- */
.site-footer { background: var(--navy); color: #c4cedd; margin-top: 48px; padding: 44px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 12px; }
.site-footer a { color: #c4cedd; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 7px 0; font-size: .94rem; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand span { color: #aab6c9; }
.footer-brand p { color: #9aa7b9; font-size: .92rem; margin-top: 12px; max-width: 34ch; }
.site-footer-disclaimer {
  max-width: var(--maxw); margin: 30px auto 18px; padding: 14px 18px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius);
}
.site-footer-disclaimer p { font-size: .74rem; line-height: 1.6; color: rgba(255,255,255,.5); margin: 0; }
.site-footer-disclaimer a { color: rgba(255,255,255,.72); text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--navy-line); margin-top: 14px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; font-size: .82rem; color: #8d9cb0; }
.footer-legal nav { display: flex; flex-wrap: wrap; gap: 14px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ----- Utilities ----- */
.muted { color: var(--ink-2); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.lead-tag { display:inline-block; font-size:.82rem; font-weight:600; color:var(--ink-2); background:var(--surface); border:1px solid var(--line); padding:3px 10px; border-radius:999px; }
.updated { font-size: .84rem; color: var(--ink-2); }
