/* Car Agent Guide. Caribbean editorial palette; all sizes in rem. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --wash: #effaf8;
  --wash-2: #e2f5f9;
  --card: #ffffff;
  --text: #0b2545;
  --muted: #3d5a74;
  --accent-text: #066b67;
  --ocean-text: #0b5574;
  --turq: #0e9f99;
  --aqua: #5fd4cb;
  --line: #cfe6e3;
  --chip: #e3f6f3;
  --coral: #b4352b;
  --coral-bg: #fff1ee;
  --btn-bg: #0b5574;
  --btn-text: #ffffff;
  --focus: #0b5574;
  --shadow: 0 0.75rem 2rem rgba(11, 37, 69, 0.08);
  --nav-bg: #ffffff;
  --nav-glass: rgba(255, 255, 255, 0.82);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071a2b;
  --wash: #0a2236;
  --wash-2: #0b2a3d;
  --card: #0d2a40;
  --text: #e7f6f4;
  --muted: #a9c6cf;
  --accent-text: #6fe0d6;
  --ocean-text: #8fd3ea;
  --line: rgba(111, 224, 214, 0.24);
  --chip: rgba(95, 212, 203, 0.14);
  --coral: #ff9f94;
  --coral-bg: rgba(255, 140, 125, 0.12);
  --btn-bg: #5fd4cb;
  --btn-text: #062033;
  --focus: #8fe8df;
  --shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
  --nav-bg: #071a2b;
  --nav-glass: rgba(7, 26, 43, 0.82);
}

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 7rem; }
html[data-font-size="md"] { font-size: 112.5%; }
html[data-font-size="lg"] { font-size: 125%; }
html[data-font-size="xl"] { font-size: 137.5%; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere;
}
h1, h2, h3 { font-family: "Playfair Display", Georgia, "Times New Roman", serif; color: var(--text); line-height: 1.15; margin: 0; font-variant-numeric: lining-nums; }
p { margin: 0; }
a { color: var(--ocean-text); }
button { font: inherit; color: inherit; }
.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; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--card); color: var(--text); padding: 0.5rem 0.875rem; border-radius: 0.5rem; }
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 0.5rem); }
:focus-visible { outline: 0.1875rem solid var(--focus); outline-offset: 0.125rem; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 30;
  padding: calc(env(safe-area-inset-top, 0px) + 0.5rem) calc(env(safe-area-inset-right, 0px) + 1rem) 0.5rem calc(env(safe-area-inset-left, 0px) + 1rem);
  background: var(--nav-bg); border-bottom: 0.0625rem solid var(--line);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav { background: var(--nav-glass); -webkit-backdrop-filter: blur(0.875rem); backdrop-filter: blur(0.875rem); }
}
.nav-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1.25rem; }
.brand { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark { width: 2.25rem; height: 2.25rem; flex: none; border-radius: 0.625rem; display: grid; place-items: center; color: #062033; font: 800 0.8125rem/1 "Inter", system-ui, sans-serif; background: linear-gradient(135deg, #5fd4cb, #0e9f99); }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name b { font-family: "Playfair Display", Georgia, serif; font-size: 1.0625rem; }
.brand-name small { font-size: 0.75rem; color: var(--muted); }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.nav-links a { text-decoration: none; padding: 0.375rem 0.75rem; border-radius: 999px; font-weight: 600; font-size: 0.875rem; color: var(--muted); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--chip); }
.prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.size-group { display: flex; border: 0.0625rem solid var(--line); border-radius: 999px; padding: 0.125rem; }
.size-btn { background: none; border: 0; border-radius: 999px; min-width: 2rem; height: 2rem; padding: 0 0.375rem; cursor: pointer; color: var(--muted); font-weight: 700; line-height: 1; }
.size-btn.s1 { font-size: 0.75rem; } .size-btn.s2 { font-size: 0.875rem; } .size-btn.s3 { font-size: 1rem; } .size-btn.s4 { font-size: 1.125rem; }
.size-btn[aria-pressed="true"] { background: var(--chip); color: var(--text); }
.theme-btn { display: inline-flex; align-items: center; gap: 0.375rem; height: 2.25rem; padding: 0 0.75rem; border-radius: 999px; border: 0.0625rem solid var(--line); background: none; cursor: pointer; font-size: 0.875rem; font-weight: 600; color: var(--text); }

/* hero: white with a soft aqua wash */
.hero { background: var(--wash); background: linear-gradient(160deg, var(--wash) 0%, var(--bg) 55%, var(--wash-2) 100%); border-bottom: 0.0625rem solid var(--line); padding: 2.5rem 1.25rem 2.25rem; text-align: center; }
.hero-inner { max-width: 62rem; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 800; letter-spacing: -0.01em; }
.lead { font-size: 1.0625rem; color: var(--muted); margin: 0.875rem auto 0; max-width: 44rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.625rem; margin-top: 1.375rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.5rem 1.125rem; border-radius: 999px; font-weight: 700; font-size: 0.9375rem; text-decoration: none; }
.btn.primary { background: var(--btn-bg); color: var(--btn-text); }
.btn.ghost { border: 0.125rem solid var(--ocean-text); color: var(--ocean-text); }

/* topics */
.topics { padding: 2rem 1.25rem 1rem; }
.topics-head { text-align: center; margin-bottom: 1.25rem; }
.topics-head h2 { font-size: clamp(1.5rem, 4vw, 2.125rem); }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.875rem; }
.filter-btn { border: 0.0625rem solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 0.375rem 0.875rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.filter-btn[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.count { font-size: 0.875rem; color: var(--muted); margin-top: 0.625rem; }
.loading { text-align: center; color: var(--muted); }
.load-error { text-align: center; color: var(--coral); background: var(--coral-bg); border-radius: 0.75rem; padding: 1rem; }

.entries { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); align-items: start; }
.entries > * { min-width: 0; }
.entry {
  position: relative; overflow: hidden; background: var(--card); border: 0.0625rem solid var(--line);
  border-radius: 1rem; padding: 1.5rem 1.25rem 1.25rem; box-shadow: var(--shadow); text-align: center;
}
.entry::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 0.25rem; background: linear-gradient(90deg, #0e9f99, #5fd4cb); }
.entry[hidden] { display: none; }
.entry h3 { font-size: 1.375rem; font-weight: 700; }
.entry .summary { font-weight: 600; margin-top: 0.5rem; }
.entry .tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.375rem; margin-top: 0.75rem; padding: 0; list-style: none; }
.entry .tags li { font-size: 0.75rem; font-weight: 600; color: var(--accent-text); background: var(--chip); border-radius: 999px; padding: 0.125rem 0.5rem; }
.entry .body { margin-top: 0.875rem; display: flex; flex-direction: column; gap: 0.625rem; }
.entry .body ul { text-align: left; margin: 0; padding-left: 1.125rem; display: flex; flex-direction: column; gap: 0.375rem; }
.entry .body li::marker { color: var(--turq); }
.facts { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9375rem; }
.facts th, .facts td { display: block; text-align: center; padding: 0; }
.facts tr { display: block; padding: 0.625rem 0.75rem; border-top: 0.0625rem solid var(--line); }
.facts th { font-size: 0.8125rem; font-weight: 700; color: var(--accent-text); }
.ask { display: inline-block; margin-top: 1rem; font-weight: 700; }

/* sources and disclaimer */
.sources, .plain { padding: 2rem 1.25rem; text-align: center; }
.sources { background: var(--wash); border-top: 0.0625rem solid var(--line); border-bottom: 0.0625rem solid var(--line); }
.sources h2, .plain h2 { font-size: clamp(1.375rem, 3.5vw, 1.875rem); }
.source-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin-top: 1.25rem; }
.source { background: var(--card); border: 0.0625rem solid var(--line); border-radius: 0.875rem; padding: 1rem; }
.source h3 { font-size: 1.125rem; }
.source p { font-size: 0.9375rem; color: var(--muted); margin-top: 0.25rem; }
.fine { font-size: 0.875rem; color: var(--muted); margin-top: 1rem; }
.plain p { max-width: 48rem; margin: 0.75rem auto 0; color: var(--muted); }
.site-foot { text-align: center; font-size: 0.875rem; color: var(--muted); padding: 1.5rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem); border-top: 0.0625rem solid var(--line); }

/* tablet and up: normal editorial alignment */
@media (min-width: 768px) {
  .hero { text-align: left; padding: 3.5rem 2rem 3rem; }
  .hero-inner { max-width: none; }
  .lead { margin-left: 0; }
  .hero-actions { justify-content: flex-start; }
  .topics, .sources, .plain { padding-left: 2rem; padding-right: 2rem; }
  .topics-head { text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
  .filters { justify-content: flex-start; margin-top: 0; }
  .count { margin-top: 0; }
  .entry { text-align: left; padding: 1.75rem 1.5rem 1.5rem; }
  .entry .tags { justify-content: flex-start; }
  .facts tr { display: table-row; padding: 0; }
  .facts th, .facts td { display: table-cell; text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-top: 0.0625rem solid var(--line); vertical-align: top; }
  .facts th { width: 38%; }
  .sources, .plain { text-align: left; }
  .plain p { margin-left: 0; }
  .nav-row { justify-content: space-between; }
}
@media (min-width: 1280px) {
  .hero, .topics, .sources, .plain { padding-left: 3rem; padding-right: 3rem; }
}
