/* Calm shared directory styles. Colours are overridden by :root values set in each page. Fonts are bundled locally (no external font CDN). */
@font-face {
  font-family: "Source Serif Pro";
  src: url("/fonts/SourceSerifPro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif Pro";
  src: url("/fonts/SourceSerifPro-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif Pro";
  src: url("/fonts/SourceSerifPro-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("/fonts/SourceSansPro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("/fonts/SourceSansPro-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("/fonts/SourceSansPro-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --primary: #3E5A6E;
  --primary-dark: #2C4150;
  --accent: #5A7384;
  --accent-soft: #E6EEF3;
  --bg: #F7F9FB;
  --card: #FFFFFF;
  --text: #252A2E;
  --muted: #4E5961;
  --line: #D9E1E7;
  --header-bg: #FFFFFF;
  --header-text: #252A2E;
  --footer-bg: #EEF3F6;
  --footer-text: #2C4150;
  --danger: #6B3A3A;
  --danger-soft: #F4E8E8;
  --ok-soft: #E6EEE8;
  --shadow: 0 1px 2px rgba(36, 40, 44, 0.04), 0 12px 32px rgba(36, 40, 44, 0.06);
  --shadow-hover: 0 1px 2px rgba(36, 40, 44, 0.05), 0 16px 40px rgba(36, 40, 44, 0.09);
  --radius: 18px;
  --max: 1120px;
  --font: "Source Sans Pro", "Helvetica Neue", "Segoe UI", Arial, system-ui, sans-serif;
  --serif: "Source Serif Pro", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1.0625rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.28; color: var(--primary-dark); margin: 0 0 0.65em; }
h1 { font-size: clamp(2.05rem, 4.2vw, 3.05rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1rem; }
.muted, .lede { color: var(--muted); }
.lede { font-size: 1.12rem; max-width: 40rem; line-height: 1.7; }

.wrap { width: min(100% - 2.4rem, var(--max)); margin-inline: auto; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 0.5rem 1rem; z-index: 100;
  border-radius: 8px;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Preview banner */
.preview-banner {
  background: var(--accent-soft);
  color: var(--primary-dark);
  text-align: center;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
}

/* Header — light, airy, no heavy dark bar */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(36, 40, 44, 0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 72px;
}
.logo {
  color: var(--primary-dark);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  white-space: nowrap;
}
.logo:hover { color: var(--primary); }
.logo span { color: var(--muted); font-weight: 400; margin-left: 0.2rem; }

nav.main-nav { margin-left: auto; display: flex; align-items: center; gap: 0.2rem; }
nav.main-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.95rem;
}
nav.main-nav a:hover, nav.main-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--primary-dark);
}

.search-box { position: relative; }
.search-box input {
  width: 230px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-size: 0.92rem;
  background: var(--bg);
  color: var(--text);
}
.search-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--card); }
.search-results {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 80vw);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 50;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 0.75rem 1rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.search-results a:hover { background: var(--bg); }
.search-results .sr-meta { display: block; color: var(--muted); font-size: 0.8rem; }
.search-results .empty { padding: 0.85rem 1rem; color: var(--muted); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

main { flex: 1; padding: 0.5rem 0 4.5rem; }

/* Hero */
.hero { padding: 4.25rem 0 3rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.85rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.7rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; text-decoration: none;
  border: 0; border-radius: 999px; padding: 0.72rem 1.35rem;
  font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(36, 40, 44, 0.08);
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary); box-shadow: none;
}
.btn-secondary:hover { background: var(--accent-soft); color: var(--primary-dark); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary-dark); border: 1.5px solid var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--primary-dark); }

/* Cards and grids */
.grid { display: grid; gap: 1.15rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.45rem 1.5rem;
  box-shadow: var(--shadow);
}
a.card, .tool-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
a.card:hover, .tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card a.stretched { text-decoration: none; color: inherit; display: block; }
.card h3 { margin-bottom: 0.4rem; }
.card .icon-bubble {
  width: 2.4rem; height: 2.4rem; border-radius: 12px;
  background: var(--accent-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 600; margin-bottom: 0.85rem;
}
.tool-card .tool-name { font-family: var(--serif); font-size: 1.2rem; color: var(--primary-dark); text-decoration: none; }
.tool-card p { font-size: 0.98rem; color: var(--muted); margin-bottom: 0.75rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary-dark);
}
.badge-verified { background: var(--ok-soft); color: var(--primary-dark); }
.badge-sample { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--accent-soft); color: var(--primary-dark); }
.badge-free { background: var(--ok-soft); color: var(--primary-dark); }

/* Ad placeholder */
.ad-slot {
  border: 1.5px dashed var(--line);
  background: repeating-linear-gradient(-45deg, var(--bg), var(--bg) 8px, var(--accent-soft) 8px, var(--accent-soft) 16px);
  color: var(--muted);
  text-align: center;
  padding: 1.6rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin: 2rem 0;
}
.ad-slot strong { display: block; color: var(--text); margin-bottom: 0.3rem; letter-spacing: 0.04em; }
.ad-slot .ad-slot-note { font-size: 0.88rem; }

.section { margin: 3.1rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.2rem; }
.section-head a { font-size: 0.95rem; }

/* Tool page */
.prose { max-width: 46rem; }
.prose li { margin-bottom: 0.4rem; }
.fact-source { font-size: 0.88rem; color: var(--muted); }
.fact-source a { word-break: break-all; }
.tool-hero { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.8rem; align-items: start; }
.side-box h2 { font-size: 1.05rem; }
.official-link { font-weight: 600; }

table.compare {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  border: 1px solid var(--line);
}
table.compare th, table.compare td {
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0.95rem;
  text-align: left;
  vertical-align: top;
}
table.compare th { background: var(--accent-soft); color: var(--primary-dark); font-weight: 600; }
table.compare tr:last-child td { border-bottom: 0; }
.uncertain { background: var(--accent-soft); }
.uncertain::after { content: " — not fully confirmed"; font-size: 0.8rem; color: var(--muted); }

.notice, .legal-notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 0.95rem 1.1rem;
  border-radius: 0 14px 14px 0;
  margin: 1.1rem 0 1.5rem;
}
.placeholder-field {
  display: inline-block;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px dashed #c9a3a3;
  padding: 0 0.3rem;
  font-weight: 600;
}

/* Forms */
form.stack label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; }
form.stack input, form.stack select, form.stack textarea {
  width: 100%; max-width: 36rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: var(--card);
  color: var(--text);
}
form.stack textarea { min-height: 8rem; }
.form-note { font-size: 0.92rem; color: var(--muted); }

/* Cookie banner — light elevated bar, not a dark slab */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  color: var(--text);
  z-index: 80;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 32px rgba(36, 40, 44, 0.08);
  display: none;
}
.cookie-banner.open { display: block; }
.cookie-inner { display: flex; gap: 1.1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-banner p { margin: 0; max-width: 46rem; font-size: 0.95rem; color: var(--muted); }
.cookie-banner a { color: var(--primary); }
.cookie-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; }

/* Footer — soft tint, dark text, no heavy block */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2.8rem 0 1.6rem;
  margin-top: auto;
  font-size: 0.95rem;
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--primary); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.6rem; margin-bottom: 1.6rem; }
.site-footer h2 { color: var(--primary-dark); font-size: 1rem; margin-bottom: 0.55rem; font-family: var(--serif); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.footer-legal { border-top: 1px solid var(--line); padding-top: 1.1rem; font-size: 0.85rem; color: var(--muted); }

/* Legal pages */
.legal-doc h2 { margin-top: 1.8rem; }

@media (max-width: 900px) {
  .grid-4, .grid-3, .tool-hero, .footer-grid, .grid-2 { grid-template-columns: 1fr; }
  .grid-2.keep-2 { grid-template-columns: 1fr 1fr; }
  .search-box input { width: 150px; }
  table.compare { display: block; overflow-x: auto; }
}
@media (max-width: 1200px) {
  .logo span { display: none; }
  .search-box input { width: 160px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  nav.main-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--header-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 0.7rem;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  nav.main-nav.open { display: flex; }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .header-inner { flex-wrap: wrap; padding: 0.55rem 0; }
  .grid-2.keep-2 { grid-template-columns: 1fr; }
  .hero { padding: 2.4rem 0 2rem; }
  .pros-cons { grid-template-columns: 1fr; }
  .editorial-flag { align-items: flex-start; }
  .tool-hero { grid-template-columns: 1fr; }
  .monogram, .monogram svg { width: 56px; height: 56px; flex-basis: 56px; }
}

/* Listing extras */
.editorial-flag { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.8rem 0 1rem; }
.editorial-flag .editorial-label { flex-basis: 100%; color: var(--muted); font-size: 0.9rem; margin: 0; }
.badge-editorial { background: var(--accent-soft); color: var(--primary-dark); }
.testing-note { border-color: var(--accent); }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1rem 0; }
.pros-cons h3 { margin-top: 0; font-size: 1.05rem; }

/* Affiliate CTA and richer listing layout */
.outbound-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.8rem; margin: 1rem 0 0.4rem; }
.outbound-cta .ad-label {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid var(--accent);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.outbound-note { flex-basis: 100%; color: var(--muted); font-size: 0.9rem; margin: 0; }
.tool-hero-top { display: flex; gap: 1rem; align-items: flex-start; }
.monogram { flex: 0 0 72px; width: 72px; height: 72px; }
.monogram svg { width: 72px; height: 72px; display: block; color: var(--primary); }
.figure { margin: 1.4rem 0 1.8rem; color: var(--primary); }
.figure svg, .figure img { width: 100%; height: auto; max-width: 840px; display: block; }
.figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.detailed-review h3 { margin-top: 1.4rem; font-size: 1.15rem; }
