/* EZ Find Fast — accessible shopping guides
   Design goals: high contrast, large text, visible focus, no motion, works at 400% zoom. */

:root {
  /* Default theme: dark navy background, white text */
  color-scheme: dark;
  --bg: #0b1f3a;
  --surface: #132c52;
  --text: #ffffff;
  --muted: #dde5f0;
  --link: #cfe8ff;          /* 13.1:1 on navy */
  --link-visited: #e6d9ff;  /* 12.4:1 on navy */
  --accent: #ffd24a;
  --accent-text: #0b1f3a;
  --border: #8fa6c4;
  --focus: #ffd24a;
  --notice-bg: #1d3a66;
  --notice-border: #ffd24a;
}

/* White background theme, chosen with the toggle button */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f4f4f1;
  --text: #111111;
  --muted: #3d3d3d;
  --link: #00337f;          /* 11.8:1 on white */
  --link-visited: #4b1f78;  /* 11.9:1 on white */
  --accent: #0b1f3a;
  --accent-text: #ffffff;
  --border: #6b6b6b;
  --focus: #b3005e;
  --notice-bg: #fff6d6;
  --notice-border: #8a6d00;
}

/* Atkinson Hyperlegible Next: designed by the Braille Institute for readers with low vision.
   Variable font (weights 200-800), served from this site (SIL Open Font License, see fonts/OFL.txt).
   Text shows at once in the fallback font and switches when the font has loaded. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

html { font-size: 112.5%; } /* 18px base; respects user font-size settings */

/* Keep focused elements and jump targets clear of the floating theme button */
html { scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Atkinson Hyperlegible Next", Verdana, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Medium weight: thicker strokes are easier to read with low vision. */
  font-weight: 500;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Links are told apart by a thick underline, not only by color (their color is close to the text). */
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
/* The visited color appears only where it helps: product links in guides and articles, and the result list. */
.shop a:visited, .link-list a:visited { color: var(--link-visited); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.75rem 1rem;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

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

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

header.site {
  border-bottom: 2px solid var(--border);
  padding: 1rem 0;
}
header.site .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; justify-content: space-between; }
.brand { font-size: 1.4rem; font-weight: 800; color: var(--text); text-decoration: none; }
.brand:visited { color: var(--text); }
nav.site ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
nav.site a { font-weight: 600; }
nav.site a[aria-current="page"] { color: var(--text); text-decoration-thickness: 3px; }

main { padding: 1.5rem 0 3rem; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.5rem; line-height: 1.3; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }

.lead { font-size: 1.15rem; color: var(--muted); }

.notice {
  background: var(--notice-bg);
  border: 2px solid var(--notice-border);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

/* Search helper */
.search-box {
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 1rem 1.25rem 1.25rem;
  margin: 1.5rem 0;
}
.search-box h2 { margin-top: 0.25rem; }
label, legend { font-weight: 700; }
input[type="search"], select {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 4px;
  margin: 0.35rem 0 1rem;
}
fieldset { border: 2px solid var(--border); padding: 0.5rem 1rem 0.75rem; margin: 0 0 1rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.5rem 0; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: 0.2rem; flex: none; }
.check label { font-weight: 500; }
.hint { color: var(--muted); font-size: 0.95rem; margin: -0.5rem 0 1rem; }

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.7rem 1.4rem;
  min-height: 48px;
  color: var(--accent-text);
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}
button:hover { filter: brightness(1.1); }

/* Guide cards / product lists */
.guide-list { list-style: none; padding: 0; }
.guide-list li {
  border: 2px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.guide-list h3 { margin-top: 0; }

.item { border-top: 2px solid var(--border); padding-top: 0.5rem; }
.item .shop { font-weight: 700; }

footer.site {
  border-top: 2px solid var(--border);
  padding: 1.5rem 0 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}
footer.site ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* Floating theme toggle (top right) */
.theme-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20;
  font-size: 1rem;
  padding: 0.5rem 0.9rem;
  min-height: 44px;
  border: 2px solid var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.theme-toggle .icon { margin-right: 0.35rem; }
/* Keep header content clear of the floating button */
header.site .wrap { padding-right: 12rem; }
@media (max-width: 40rem) {
  header.site .wrap { padding-right: 1rem; padding-top: 3.25rem; }
}

/* Price comparison and favorites */
.offer-list { list-style: none; padding: 0; }
.offer {
  border: 2px solid var(--border);
  padding: 0.75rem 1.25rem 1rem;
  margin-bottom: 1rem;
}
.offer h2, .offer h3 { margin: 0.25rem 0 0.5rem; font-size: 1.2rem; }
.offer .total { color: var(--text); font-weight: 800; }
.offer .facts { margin: 0 0 0.75rem; padding-left: 1.25rem; }
button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
  font-size: 1rem;
  padding: 0.5rem 1rem;
}
button.secondary[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
input[type="number"] { width: 8rem; }
input[type="text"], input[type="number"] {
  font: inherit; font-size: 1.1rem; padding: 0.6rem 0.75rem;
  color: var(--text); background: var(--bg);
  border: 2px solid var(--border); border-radius: 4px;
  margin: 0.35rem 0 1rem; display: block;
}
#c-zip, #f-zip { width: 9rem; }
[hidden] { display: none !important; }

/* Short result links (one link per offer; the number is part of the link text). */
.link-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.link-list li { border-bottom: 1px solid var(--border); }
.link-list li:first-child { border-top: 1px solid var(--border); }
.link-list a { display: block; padding: 0.75rem 0.25rem; font-size: 1.1rem; font-weight: 600; }
.item-actions p { margin: 0 0 1rem; }
.guess { color: var(--muted); }
.more-options { margin-top: 1.25rem; }
footer.site .footer-heading { font-size: 1.1rem; margin: 1rem 0 0.5rem; }

/* Home page: a few large entry links, each followed by one line of description. */
.entry-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.entry-list li { border: 2px solid var(--border); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.entry-list a { font-size: 1.35rem; font-weight: 700; }
.entry-list p { margin: 0.5rem 0 0; }

/* Tables (screen reader tips) */
.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; }
th, td { overflow-wrap: anywhere; }
caption { text-align: left; font-weight: 700; padding: 0 0 0.5rem; }
th, td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
thead th { background: var(--surface); }
tbody th { font-weight: 700; }
