/* TimeNow styles
   One typeface (Newsreader), paper-and-ink pages, and a "sky" color that
   follows the time of day behind every live clock. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-normal.woff2") format("woff2");
  font-weight: 300 650;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 300 650;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f3f6fa;
  --ink: #14213d;
  --ink-2: #4a5672;
  --rule: #d3dbe7;
  --tint: #e6ecf4;
  --brass: #8a5f1a;
  /* Overwritten on load by the script in <head> */
  --sky: #b3d4ee;
  --sky-ink: #14213d;

  --serif: "Newsreader", Georgia, Cambria, "Times New Roman", serif;
  --wide: 74rem;
  --measure: 41rem;
  --pad: clamp(1.1rem, 4vw, 2.75rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1730;
    --ink: #e6ebf5;
    --ink-2: #a7b2c7;
    --rule: #27324f;
    --tint: #17213f;
    --brass: #d7ab5c;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

svg { display: block; }

/* Live text is invisible (but keeps its space) until the script fills it in. */
[data-pending] { visibility: hidden; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--brass);
}
a:hover { color: var(--brass); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 3px;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 20;
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
}
.skip:focus { left: 0.75rem; }

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- Sky: the live time-of-day color ---------- */

.sky {
  background-color: var(--sky);
  color: var(--sky-ink);
  transition: background-color 1.6s ease, color 1.6s ease;
}
.sky a:hover { color: inherit; }
.sky a { text-decoration-color: currentColor; }
.sky :focus-visible { outline-color: currentColor; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  color: inherit;
}
.brand:hover { color: inherit; }
.brand svg { width: 1.5rem; height: 1.5rem; flex: none; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.35rem;
  font-size: 1.02rem;
}
.nav a { text-decoration: none; }
.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: currentColor;
  color: inherit;
}

.nowchip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  background-color: var(--sky);
  color: var(--sky-ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.nav .nowchip:hover { text-decoration: none; color: var(--sky-ink); }
.nowchip small { margin-left: 0.18em; font-size: 0.72em; font-weight: 600; }

/* ---------- Home: the clock ---------- */

.hero {
  padding-block: clamp(1.25rem, 5vh, 4rem) clamp(2.25rem, 6vh, 3.75rem);
}

.where {
  margin: 0 0 0.9rem;
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
}

.clock {
  margin: 0;
  font-size: clamp(4.4rem, 23.5vw, 17rem);
  font-weight: 330;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.clock .sec {
  font-size: 0.42em;
  font-weight: 360;
  letter-spacing: -0.02em;
  opacity: 0.8;
}
.clock .period {
  margin-left: 0.32em;
  font-size: 0.2em;
  font-weight: 520;
  letter-spacing: 0.01em;
}

.today {
  margin: 0.4rem 0 0.1rem;
  font-size: clamp(1.32rem, 2.4vw, 1.75rem);
  font-weight: 450;
  line-height: 1.25;
}

.zone { margin: 0; font-size: 1.06rem; }

.status {
  margin: 1.35rem 0 0;
  max-width: 42rem;
  font-size: 1.02rem;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.15rem;
}

.facts {
  margin: 2.1rem 0 0;
  padding-top: 1.05rem;
  max-width: 46rem;
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in srgb, currentColor 30%, transparent);
  font-size: 1.06rem;
  line-height: 1.55;
}

/* ---------- Buttons ---------- */

.btn,
.seg button,
.linkbtn {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.btn {
  font-size: 0.98rem;
  line-height: 1.2;
  padding: 0.5rem 1.05rem;
  background: transparent;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 999px;
}
.btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 999px;
}
.seg button {
  font-size: 0.98rem;
  line-height: 1.2;
  padding: 0.42rem 0.92rem;
  background: transparent;
  border: 0;
  border-radius: 999px;
}
.seg button[aria-pressed="true"] {
  background: var(--sky-ink);
  color: var(--sky);
}

.linkbtn {
  padding: 0;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

/* ---------- Full screen (desk clock) ---------- */

.hero-band:fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-band:fullscreen .hero { padding: 0; }
.hero-band:fullscreen .where,
.hero-band:fullscreen .zone,
.hero-band:fullscreen .status,
.hero-band:fullscreen .facts,
.hero-band:fullscreen .seg { display: none; }
.hero-band:fullscreen .clock { font-size: min(26vw, 56vh); }
.hero-band:fullscreen .today { font-size: min(4.2vw, 6vh); margin-top: 2vh; }
.hero-band:fullscreen .controls { justify-content: center; margin-top: 5vh; opacity: 0.7; }

.hero-band:-webkit-full-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
}
.hero-band:-webkit-full-screen .hero { padding: 0; }
.hero-band:-webkit-full-screen .where,
.hero-band:-webkit-full-screen .zone,
.hero-band:-webkit-full-screen .status,
.hero-band:-webkit-full-screen .facts,
.hero-band:-webkit-full-screen .seg { display: none; }
.hero-band:-webkit-full-screen .clock { font-size: min(26vw, 56vh); }
.hero-band:-webkit-full-screen .today { font-size: min(4.2vw, 6vh); margin-top: 2vh; }
.hero-band:-webkit-full-screen .controls { justify-content: center; margin-top: 5vh; opacity: 0.7; }

/* ---------- Sections ---------- */

.section { padding-top: clamp(3.25rem, 7vw, 5.25rem); }

h1, h2, h3 { text-wrap: balance; }

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.3rem, 5.2vw, 3.5rem);
  font-weight: 520;
  line-height: 1.08;
  letter-spacing: -0.022em;
}

h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 540;
  line-height: 1.15;
  letter-spacing: -0.012em;
}

h3 {
  margin: 2rem 0 0.4rem;
  font-size: 1.32rem;
  font-weight: 560;
  line-height: 1.3;
}

.lede {
  max-width: var(--measure);
  margin: 0 0 1.6rem;
  color: var(--ink-2);
}

/* ---------- World clock ---------- */

.cities {
  display: grid;
  gap: 3px;
  max-width: 46rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 18px;
  overflow: hidden;
}

.city {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  background-color: var(--row-sky, var(--tint));
  color: var(--row-ink, var(--ink));
  transition: background-color 1.6s ease, color 1.6s ease;
}

.city-name { display: flex; flex-direction: column; line-height: 1.3; }
.city-name strong { font-size: 1.2rem; font-weight: 560; }
.city-meta { font-size: 0.95rem; }

.city-time { text-align: right; line-height: 1.15; }
.city-time .t {
  display: block;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.city-time .t small { margin-left: 0.2em; font-size: 0.55em; font-weight: 560; }
.city-day { font-size: 0.92rem; }

@media (min-width: 62rem) {
  /* Two columns on wide screens: west on the left, east on the right */
  .cities {
    max-width: none;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(6, auto);
    grid-auto-flow: column;
  }
}

/* ---------- Prose ---------- */

.prose { max-width: var(--measure); }
.prose > h2 { margin-top: 2.7rem; }
.prose > h2:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--ink-2); }
.prose strong { font-weight: 600; }

.table-wrap { margin: 1.4rem 0 1.9rem; overflow-x: auto; }
.table-note { margin-top: -1.2rem; font-size: 0.98rem; color: var(--ink-2); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
th { font-weight: 600; }
thead th { border-bottom-color: var(--ink-2); }

.callout {
  margin: 1.7rem 0 2.1rem;
  padding: 1.05rem 1.3rem;
  border-radius: 14px;
  background-color: var(--sky);
  color: var(--sky-ink);
  font-size: 1.08rem;
  line-height: 1.55;
  transition: background-color 1.6s ease, color 1.6s ease;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 0.6rem; }
.callout a { text-decoration-color: currentColor; }
.callout a:hover { color: inherit; }
.callout :focus-visible { outline-color: currentColor; }
.callout .controls { margin-top: 0.85rem; }

/* ---------- Articles ---------- */

.article-head {
  max-width: var(--measure);
  padding-top: clamp(1.75rem, 5vw, 3.5rem);
}
.crumb { margin: 0 0 1.1rem; font-size: 1rem; }
.standfirst {
  margin: 0 0 1rem;
  font-size: clamp(1.2rem, 2vw, 1.42rem);
  line-height: 1.45;
  color: var(--ink-2);
}
.byline { margin: 0 0 2.2rem; font-size: 0.98rem; color: var(--ink-2); }

.related {
  max-width: var(--measure);
  margin-top: 3.25rem;
  padding-top: 0.25rem;
}
.related h2 { font-size: 1.5rem; }

/* ---------- Guide list ---------- */

.guide-list {
  max-width: 48rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.guide-list li { border-bottom: 1px solid var(--rule); }
.guide-list a {
  display: block;
  padding: 1.1rem 0 1.15rem;
  text-decoration: none;
}
.guide-list a:hover { color: inherit; }
.g-title {
  display: block;
  font-size: 1.36rem;
  font-weight: 550;
  line-height: 1.25;
}
.guide-list a:hover .g-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--brass);
}
.g-sum { display: block; margin-top: 0.3rem; color: var(--ink-2); }
.g-read { display: block; margin-top: 0.3rem; font-size: 0.95rem; color: var(--ink-2); }

/* ---------- FAQ ---------- */

.faq { max-width: var(--measure); border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 1.18rem;
  font-weight: 550;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 1.15rem; }
.faq .answer p { margin: 0 0 0.8rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Plain pages ---------- */

.page { max-width: var(--measure); padding-top: clamp(1.75rem, 5vw, 3.5rem); }
.page > h2 { margin-top: 2.4rem; font-size: clamp(1.45rem, 2.4vw, 1.75rem); }
.page p, .page ul { margin: 0 0 1.1rem; }
.page ul { padding-left: 1.25rem; }
.page li { margin-bottom: 0.5rem; }
.updated { color: var(--ink-2); font-size: 1rem; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-block: 2.2rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 1rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem 3rem;
}
.footer-about { max-width: 24rem; margin: 0.5rem 0 0; }
.site-footer .brand { color: var(--ink); font-size: 1.15rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.copyright { margin: 1.6rem 0 0; font-size: 0.95rem; }

/* ---------- Small screens ---------- */

@media (max-width: 34rem) {
  body { font-size: 1.08rem; }
  .nav { gap: 0.35rem 1rem; font-size: 0.98rem; }
  .city { padding: 0.75rem 0.95rem; }
  .city-time .t { font-size: 1.5rem; }
  th, td { padding-right: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .sky, .callout, .city { background: none !important; color: #000 !important; }
  .controls, .nav, .status { display: none !important; }
}
