/* American Dating Guides — see DESIGN.md (source of truth for every value below). */

/* Archivo (SIL OFL 1.1, assets/fonts/OFL-Archivo.txt), variable weight + width, latin subset, self-hosted.
   Source: @fontsource-variable/archivo 5.3.0 (archivo-latin-standard-normal.woff2). Preloaded in the layout. */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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;
}

:root {
  --night: #0b1220;
  --night-2: #151e31;
  --navy: #0a3161;
  --red: #d0102e;
  --red-hover: #a50d25;
  --red-on-night: #ff4057;
  --blue: #1550c8;
  --blue-visited: #6b2fb3;
  --blue-on-night: #7aa2ff;
  --cream: #f4f1ea;
  --paper: #ffffff;
  --ink: #14161a;
  --muted: #5c5a55;
  --muted-on-night: #a7adbb;
  --line: #e4e0d6;

  /* Variant 2 (flag blue page top): --hero-bg: var(--navy); --hero-accent: #ff6b7c; */
  --hero-bg: var(--night);
  --hero-accent: var(--red-on-night);

  --font: "Archivo", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --radius: 0;
  --wrap: 1180px;
  --read: 720px;
  --gutter: 16px;

  /* Text and veil on dark surfaces */
  --on-dark: #ffffff;
  --veil: rgba(11, 18, 32, 0.7); /* --night at 70 % over the home photo */

  /* Type scale (DESIGN.md, Typographie) */
  --fs-h1: clamp(2.1rem, 7vw, 4rem);
  --fs-h1-home: clamp(2.4rem, 8vw, 4.75rem);
  --fs-h2: clamp(1.6rem, 4vw, 2.25rem);
  --fs-h2-small: 1.6rem;   /* card, region and related headings */
  --fs-h3: 1.25rem;
  --fs-lead: 1.2rem;       /* brand, offer titles */
  --fs-body: 1.0625rem;
  --fs-ui: 1rem;
  --fs-table: 0.95rem;
  --fs-btn: 0.9375rem;
  --fs-nav: 0.9rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;     /* 12 px: never smaller */
  --lh-body: 1.65;
  --lh-title: 0.98;
  --lh-title-home: 0.95;
  --lh-heading: 1.05;
  --lh-tight: 1.25;
  --lh-card: 1.3;
  --lh-btn-small: 1.2;
  --track-title: -0.02em;
  --track-label: 0.14em;
  --track-nav: 0.08em;
  --track-btn: 0.06em;
  --track-btn-small: 0.02em;
  --stretch-title: 80%;
  --measure-title: 18ch;
  --measure-title-home: 16ch;
  --measure-lead: 60ch;

  /* Lines, focus, fixed sizes */
  --rule-thin: 1px;
  --rule: 4px;
  --focus-width: 3px;
  --focus-offset: 2px;
  --top3-pad: 6px;
  --list-indent: 18px;
  --logo-max: 44px;
  --avatar: 80px;
  --card-min: 160px;
  --region-min: 220px;
  --footer-bottom: 96px;  /* room for the sticky bar */
  --heart: 1.9em;         /* heart emblem height, relative to the wordmark */
  --tap: 44px;            /* minimum touch target */
  --burger-w: 22px;
  --burger-bar: 2px;
  --burger-gap: 7px;
  --fs-brand-mobile: 1.05rem;
  --hero-media-w: min(40%, 440px); /* featured image column beside the title */
  --flow-h2: 1.8em 0 0.5em;
  --flow-h3: 1.6em 0 0.4em;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--fs-body)/var(--lh-body) var(--font); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
.content a:visited { color: var(--blue-visited); }
:focus-visible { outline: var(--focus-width) solid var(--blue); outline-offset: var(--focus-offset); }
.site-header :focus-visible, .hero :focus-visible, .home-hero :focus-visible, .site-footer :focus-visible, .sticky-footer :focus-visible, .top3-item :focus-visible { outline-color: var(--red-on-night); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, .brand, .eyebrow, .btn, .top3-name, .offer-heading, .offer-label, .author-name { font-family: var(--font); }
h1, h2 { font-weight: 900; font-stretch: var(--stretch-title); letter-spacing: var(--track-title); }
h3 { font-weight: 800; }
.eyebrow { margin: 0 0 var(--s3); font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted-on-night); }
.title-accent { display: block; color: var(--hero-accent); }

/* Header: heart emblem + wordmark; menu in a row on desktop, burger (<details>) on mobile */
.site-header { background: var(--night); color: var(--on-dark); position: relative; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); padding-top: var(--s3); padding-bottom: var(--s3); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--on-dark); font-weight: 900; font-size: var(--fs-lead); letter-spacing: var(--track-title); text-decoration: none; white-space: nowrap; }
.brand-heart { width: auto; height: var(--heart); flex: none; }
.brand-accent { color: var(--red-on-night); }
.site-header ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.site-header nav a { color: var(--on-dark); text-decoration: none; font-weight: 700; font-size: var(--fs-nav); }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--red-on-night); }
.site-header nav a.nav-cta { display: inline-block; background: var(--red); color: var(--on-dark); padding: var(--s2) var(--s3); font-size: var(--fs-label); letter-spacing: var(--track-nav); text-transform: uppercase; }
.site-header nav a.nav-cta:hover { background: var(--red-hover); color: var(--on-dark); }
.nav-mobile { display: none; }
.nav-mobile summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s2); color: var(--on-dark); font-weight: 700; font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: var(--burger-w); height: var(--burger-bar); background: currentColor; transition: transform .2s; }
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: calc(-1 * var(--burger-gap)); }
.burger::after { top: var(--burger-gap); }
.nav-mobile[open] .burger { background: transparent; }
.nav-mobile[open] .burger::before { transform: translateY(var(--burger-gap)) rotate(45deg); }
.nav-mobile[open] .burger::after { transform: translateY(calc(-1 * var(--burger-gap))) rotate(-45deg); }
.nav-mobile nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--night); border-top: var(--rule-thin) solid var(--night-2); padding: var(--s2) var(--gutter) var(--s5); }
.nav-mobile ul { flex-direction: column; align-items: stretch; gap: 0; }
.nav-mobile li a { display: block; padding: var(--s3) 0; font-size: var(--fs-ui); border-bottom: var(--rule-thin) solid var(--night-2); }
.nav-mobile li a.nav-cta { margin-top: var(--s4); padding: var(--s3); text-align: center; font-size: var(--fs-btn); border-bottom: 0; }
/* The full menu needs about 1000 px: burger below 1024 px. */
@media (max-width: 1023px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
}
@media (max-width: 767px) {
  .brand { font-size: var(--fs-brand-mobile); }
}
@media (max-width: 399px) {
  .burger-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-mobile summary { min-width: var(--tap); justify-content: center; }
}

/* Page top */
.hero { background: var(--hero-bg); color: var(--on-dark); }
.hero-inner { padding-top: var(--s4); padding-bottom: var(--s6); }
.hero-inner.narrow { max-width: calc(var(--read) + 2 * var(--gutter)); }
.hero .breadcrumbs + .eyebrow { margin-top: var(--s4); }
.hero h1 { font-size: var(--fs-h1); line-height: var(--lh-title); margin: var(--s4) 0 var(--s3); max-width: var(--measure-title); }
.hero .breadcrumbs ol { margin: 0; color: var(--muted-on-night); }
.hero .breadcrumbs a, .hero .byline a { color: var(--on-dark); }
.hero .byline, .hero .lead { color: var(--muted-on-night); margin: 0; }
.hero .lead { margin-top: var(--s2); max-width: var(--measure-lead); }
/* Article page top: title left, featured image right (stacked under the title on mobile).
   Ratios mirror HERO_RATIO_MOBILE / HERO_RATIO_WIDE in src/templates.mjs; crops follow data/focal-points.json. */
.hero-split .hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: center; }
.hero-media { margin: 0; }
.hero-media img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: var(--pos-m, 50% 30%); }
.hero-wide-media .hero-media img { aspect-ratio: auto; }
@media (min-width: 768px) {
  .hero-split .hero-inner { grid-template-columns: minmax(0, 1fr) var(--hero-media-w); gap: var(--s6); padding-bottom: var(--s7); }
  .hero-media img { aspect-ratio: 4 / 5; object-position: var(--pos-d, 50% 30%); }
  .hero-wide-media .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-wide-media .hero-media img { aspect-ratio: auto; }
}
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1); padding: 0; font-size: var(--fs-small); }
.breadcrumbs li + li::before { content: "›"; margin-right: var(--s1); }
.byline { font-size: var(--fs-small); }
.disclosure-band { background: var(--cream); border-bottom: var(--rule-thin) solid var(--line); }
.disclosure-band .wrap { max-width: calc(var(--read) + 2 * var(--gutter)); }
.disclosure { margin: 0; padding: var(--s2) 0; font-size: var(--fs-small); color: var(--muted); }

/* Article */
.article { max-width: calc(var(--read) + 2 * var(--gutter)); }
.content h2 { font-size: var(--fs-h2); line-height: var(--lh-heading); margin: var(--flow-h2); }
.content h3 { font-size: var(--fs-h3); line-height: var(--lh-tight); margin: var(--flow-h3); }
.content img { display: block; margin: var(--s4) auto; }
.content table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: var(--fs-table); }
.content th { background: var(--night); color: var(--on-dark); }
.content th, .content td { border-bottom: var(--rule-thin) solid var(--line); padding: var(--s2) var(--s3); text-align: left; }
.content blockquote { margin: var(--s5) 0; padding: var(--s3) var(--s4); background: var(--cream); border-left: var(--rule) solid var(--red); }

/* Buttons */
.btn { display: inline-block; background: var(--red); color: var(--on-dark); text-decoration: none; font-weight: 800; font-size: var(--fs-btn); letter-spacing: var(--track-btn); text-transform: uppercase; padding: var(--s3) var(--s5); border-radius: var(--radius); }
.btn:hover { background: var(--red-hover); color: var(--on-dark); }
.btn:visited { color: var(--on-dark); }

/* Offers */
.offer { background: var(--cream); border-top: var(--rule) solid var(--red); padding: var(--s4); margin: var(--s6) 0; text-align: center; }
.offer img { margin: 0 auto var(--s3); }
.offer-heading { font-weight: 900; font-size: var(--fs-lead); margin: 0 0 var(--s3); }
.offer-heading a { color: var(--ink); text-decoration: none; }
.offer-banner { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); text-align: left; align-items: center; }
.offer-banner .offer-label { font-weight: 900; font-size: var(--fs-lead); margin: 0; }
.offer-banner .offer-media img { margin: 0; }
.offer-logo { max-height: var(--logo-max); width: auto; margin: var(--s1) 0 var(--s3) !important; }
@media (min-width: 640px) { .offer-banner { grid-template-columns: 2fr 3fr; } }

/* Top 3: three columns on every screen (no stack of three tall photos on mobile) */
.top3 { background: var(--cream); padding: var(--s4); margin: var(--s5) 0; }
.top3-heading { margin: 0 0 var(--s3); font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.top3-grid { display: grid; gap: var(--s2); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.top3-item { background: var(--night); color: var(--on-dark); display: flex; flex-direction: column; }
.top3-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.top3-name { font-weight: 800; font-size: var(--fs-label); line-height: var(--lh-tight); margin: 0; padding: var(--top3-pad); flex: 1; overflow-wrap: normal; }
.top3-rank { color: var(--red-on-night); }
.top3-item .btn { display: block; text-align: center; padding: var(--s2) var(--s1); font-size: var(--fs-label); letter-spacing: var(--track-btn-small); line-height: var(--lh-btn-small); }
@media (min-width: 640px) { .top3-name { font-size: var(--fs-ui); padding: var(--s3); } .top3-item .btn { font-size: var(--fs-small); padding: var(--s3); } }

/* Sticky bar (shown by a few lines of JS once the reader scrolls) */
.sticky-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--night); text-align: center; padding: var(--s2) var(--gutter); }
.sticky-footer .btn { padding: var(--s2) var(--s5); }

/* Author, related, cards */
.author-box { display: flex; gap: var(--s4); align-items: center; background: var(--cream); padding: var(--s4); margin: var(--s6) 0; }
.author-box img { width: var(--avatar); height: var(--avatar); object-fit: cover; border-radius: 50%; flex: none; }
.author-name { font-weight: 900; margin: 0; }
.author-box p { margin: var(--s1) 0; }
.cards h2, .related h2 { font-size: var(--fs-h2-small); line-height: var(--lh-heading); }
.card-grid { list-style: none; padding: 0; display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); }
.card a { display: block; text-decoration: none; color: var(--on-dark); background: var(--night); font-weight: 800; height: 100%; }
.card a:hover span { color: var(--red-on-night); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: var(--pos, 50% 30%); display: block; background: var(--night-2); }
.card span { display: block; padding: var(--s2) var(--s3); line-height: var(--lh-card); }

/* Home */
.home-hero { background: var(--night) var(--hero) center / cover no-repeat; position: relative; color: var(--on-dark); }
.home-hero::before { content: ""; position: absolute; inset: 0; background: var(--veil); }
.home-hero .wrap { position: relative; padding-top: var(--s8); padding-bottom: var(--s8); }
.home-hero h1 { font-size: var(--fs-h1-home); line-height: var(--lh-title-home); margin: 0; max-width: var(--measure-title-home); }
.home { max-width: calc(var(--read) + 2 * var(--gutter)); }
.regions { display: grid; gap: var(--s2) var(--s6); grid-template-columns: repeat(auto-fit, minmax(var(--region-min), 1fr)); }
.region h2 { font-size: var(--fs-h2-small); border-top: var(--rule) solid var(--red); padding-top: var(--s2); }
.region h2 a { color: var(--ink); text-decoration: none; }
.city-list { padding-left: var(--list-indent); columns: 2; }

/* Footer */
.site-footer { margin-top: var(--s7); padding: var(--s6) 0 var(--footer-bottom); background: var(--night); color: var(--muted-on-night); font-size: var(--fs-small); }
.site-footer a { color: var(--blue-on-night); }
.footer-menu { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
