/* First Observer Desk — custom styles layered on top of Pico.css classless
   Palette + layout inspired by the primary reference (editorial roundup):
   white ground, navy headline ink, blue category accents, pill CTAs. */

:root {
  --ink: #101828;
  --body-text: #232b3a;
  --muted: #5c6577;
  --accent-blue: #155eef;
  --accent-blue-dark: #0b3e91;
  --accent-blue-pale: #e7f0ff;
  --accent-green: #12805c;
  --accent-green-dark: #0c6249;
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --border: #e2e6ee;
  --strong-bg: #101828; /* solid dark fills (ribbon, tags, pills, table head) */
  --on-strong: #ffffff;
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 12px 28px rgba(16, 24, 40, 0.1);
  --radius: 12px;
  --radius-lg: 18px;
  --maxw: 760px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--body-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding-bottom: 88px; /* room for sticky CTA bar so it never covers content */
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-blue);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ---------- Advertising ribbon ---------- */
.ad-ribbon {
  background: var(--strong-bg);
  color: var(--on-strong);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0.55rem 1rem;
}

.ad-ribbon strong {
  color: #ffd166;
}

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  margin: 0;
}

.masthead .masthead-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.masthead .wordmark {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.masthead .wordmark span {
  color: var(--accent-blue);
}

.masthead nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0;
  padding: 0;
}

.masthead nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-block;
  padding: 0.4rem 0.1rem;
}

.masthead nav a:hover {
  color: var(--accent-blue);
}

@media (min-width: 480px) {
  .masthead .masthead-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Page shell ---------- */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1rem;
}

article.advertorial,
article.static-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

/* ---------- Article header ---------- */
.disclosure-link-row {
  font-size: 0.85rem;
  margin: 1rem 0 0.6rem;
}

.disclosure-link-row a {
  font-weight: 700;
  text-decoration: underline;
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.8rem;
}

h1 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-size: clamp(1.75rem, 5.5vw, 2.75rem);
  margin: 0 0 0.7rem;
}

.dek {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  color: var(--body-text);
  margin: 0 0 1.1rem;
  max-width: 62ch;
}

.byline {
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  margin: 0 0 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

/* ---------- Media ---------- */
.media-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  margin: 0 0 0.6rem;
}

.media-frame.hero {
  aspect-ratio: 16 / 10;
}

.media-frame.inline {
  aspect-ratio: 4 / 3;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

figure {
  margin: 1.8rem 0;
}

figure.hero-figure {
  margin: 0 0 1.6rem;
}

.caption {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: italic;
  margin: 0;
}

/* ---------- Body copy & headings ---------- */
article.advertorial h2 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(1.3rem, 3.6vw, 1.7rem);
  margin: 2.2rem 0 0.8rem;
}

article.advertorial h3 {
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.8vw, 1.3rem);
  margin: 0 0 0.6rem;
}

article.advertorial p {
  margin: 0 0 1rem;
}

article.advertorial section {
  margin: 0 0 0.4rem;
}

.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.6rem 0;
}

.toc p {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--ink);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

.toc li {
  margin: 0.2rem 0;
}

/* ---------- Badge pill (Idéal pour) ---------- */
.badge {
  display: inline-block;
  background: var(--accent-blue-pale);
  color: var(--accent-blue-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  margin: 0 0 0.6rem;
}

/* ---------- Callout / featured provider card ---------- */
.callout-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem;
  margin: 1.6rem 0 2rem;
  background: var(--bg);
}

.callout-tag {
  display: inline-block;
  background: var(--strong-bg);
  color: var(--on-strong);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin: 0 0 0.8rem;
}

.callout-card .media-frame {
  margin: 0.8rem 0 1rem;
}

.affiliate-line {
  font-size: 0.86rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.8rem;
  margin: 0.6rem 0 1rem;
}

/* ---------- CTA buttons ---------- */
.cta-button {
  display: inline-block;
  background: var(--accent-green);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  text-align: center;
  transition: background-color 0.15s ease, transform 0.15s ease;
  min-height: 44px;
  line-height: 1.3;
}

.cta-button:hover {
  background: var(--accent-green-dark);
  transform: translateY(-1px);
}

.cta-button.secondary {
  background: transparent;
  color: var(--accent-blue) !important;
  border: 2px solid var(--accent-blue);
  padding: 0.7rem 1.4rem;
}

.cta-button.secondary:hover {
  background: var(--accent-blue-pale);
}

.cta-wrap {
  margin: 1.2rem 0;
}

.cta-wrap.center {
  text-align: center;
}

/* ---------- Table (accent: bordered, shaded header, zebra rows) ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.2rem 0;
}

table.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.92rem;
}

table.compare th,
table.compare td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

table.compare thead th {
  background: var(--strong-bg);
  color: var(--on-strong);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

table.compare tbody tr:nth-child(even) {
  background: var(--bg-alt);
}

table.compare tbody tr:last-child td {
  border-bottom: none;
}

.table-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 1.2rem;
}

/* ---------- Trust / badge row (accent borrow) ---------- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.5rem;
  padding: 0;
  list-style: none;
}

.badge-row li {
  background: var(--strong-bg);
  color: var(--on-strong);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-row li::before {
  content: "\2713";
  color: #7ee2b8;
  font-weight: 800;
}

/* ---------- Limits block ---------- */
.limits {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem;
  margin: 1.6rem 0;
}

.limits h2 {
  margin-top: 0 !important;
}

.limits ul {
  margin: 0 0 0.6rem;
  padding-left: 1.2rem;
}

.limits li {
  margin: 0.35rem 0;
}

/* ---------- Provider fact list ---------- */
.fact-list {
  padding-left: 1.2rem;
  margin: 0 0 1.2rem;
}

.fact-list li {
  margin: 0.4rem 0;
}

/* ---------- Alt background sections for rhythm ---------- */
.section-alt {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.4rem 0.2rem;
  margin: 1.8rem 0;
}

/* ---------- Disclosure aside & footer (shared, every page) ---------- */
aside.disclosure {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.4rem 1rem;
  border-top: 1px solid var(--border);
}

aside.disclosure p {
  max-width: var(--maxw);
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--body-text);
  line-height: 1.6;
}

aside.disclosure a {
  font-weight: 700;
}

footer.base {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 1.6rem 1rem 2rem;
}

footer.base .company {
  max-width: 1040px;
  margin: 0 auto 1.1rem;
  font-size: 0.9rem;
  color: var(--body-text);
  line-height: 1.65;
}

footer.base .company p {
  margin: 0;
}

footer.base nav.page_links {
  max-width: 1040px;
  margin: 0 auto;
}

footer.base nav.page_links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

footer.base nav.page_links a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-block;
  padding: 0.3rem 0;
}

footer.base nav.page_links a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

@media (min-width: 480px) {
  footer.base nav.page_links ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
  }
}

/* ---------- Sticky CTA bar ---------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgba(16, 24, 40, 0.12);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.sticky-cta.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-cta p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--body-text);
  display: none;
}

.sticky-cta .cta-button {
  padding: 0.65rem 1.1rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

@media (min-width: 480px) {
  .sticky-cta p {
    display: block;
  }
}

/* ---------- Static (legal/about) pages ---------- */
article.static-page h1 {
  margin-bottom: 1rem;
}

.page-date {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1.4rem;
}

article.static-page h2 {
  color: var(--ink);
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  margin: 1.8rem 0 0.6rem;
}

article.static-page p,
article.static-page li {
  color: var(--body-text);
}

article.static-page address {
  font-style: normal;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}

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

@media (min-width: 768px) {
  main {
    padding: 0 1.5rem;
  }

  article.advertorial,
  article.static-page {
    padding: 2.2rem 0 3.5rem;
  }
}

@media (min-width: 1024px) {
  .media-frame.hero {
    aspect-ratio: 16 / 8;
  }
}

/* ---------- Dark mode ----------
   Pico.css switches itself to a dark theme (and styles <article> as a dark
   card) when the browser prefers dark. Re-map our palette so text, surfaces
   and accents stay readable on top of it. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f4fa;
    --body-text: #d5dbe6;
    --muted: #a3adc0;
    --accent-blue: #8ab4ff;
    --accent-blue-dark: #c6dbff;
    --accent-blue-pale: #1c2b4d;
    --bg: #13171f;
    --bg-alt: #1b212d;
    --border: #2f3849;
    --strong-bg: #263146;
    --on-strong: #f8fafc;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }

  /* Pico paints <article> with its own dark card colour; keep ours. */
  article.advertorial,
  article.static-page {
    background-color: transparent;
    box-shadow: none;
  }

  /* Pico gives td/th their own background and colour. */
  table.compare td {
    background-color: transparent;
    color: var(--body-text);
  }

  .sticky-cta {
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.5);
  }
}
