/*
  Shared look of the static, crawlable pages (guides). The Flutter app is a
  canvas search engines cannot read, so these pages are plain HTML next to it
  (see .claude/skills/seo). Colours follow ARCHITECTURE.md's palette; fonts are
  Latin subsets of the app's bundled ones (about 50 KB in total).
*/
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url(/fonts/CormorantGaramond-500.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/Inter-400.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/Inter-600.woff2) format("woff2"); }

:root {
  --canvas: #F7F5F0;
  --card: #FDFBF2;
  --ink: #3D1D18;
  --muted: #555555;
  --accent: #736249; /* the darker gold: the palette gold is too light for text on ivory */
  --line: #E4DED2;
  --band: #3D1D18; /* the logo's brown: footer and call to action */
  --ivory: #FDFBF2;
  --wide: 1100px;
  --gutter: clamp(16px, 4vw, 24px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #40342E;
    --card: #332924;
    --ink: #FDFBF2;
    --muted: #C8B99A;
    --accent: #C4A77D;
    --line: #524540;
    --band: #332924;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.7 Inter, system-ui, -apple-system, sans-serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.site-header, .site-footer, main {
  max-width: 720px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}
/*
  The logo is a mask over a plain colour, so one file serves every page: the
  theme's ink on privacy and terms, ivory over the guides' photos. The words
  stay in the link for screen readers, and show if the CSS doesn't load.
*/
.brand {
  flex: none;
  display: block;
  width: clamp(112px, 34vw, 150px);
  aspect-ratio: 407.77 / 130.26;
  overflow: hidden;
  white-space: nowrap;
  text-indent: 100%;
  background: var(--ink);
  -webkit-mask: url(/leclair-logo.svg) center / contain no-repeat;
  mask: url(/leclair-logo.svg) center / contain no-repeat;
}
/* Forced colours wipe backgrounds, and the logo is one. */
@media (forced-colors: active) { .brand { forced-color-adjust: none; background: CanvasText; } }
.lang { font-size: .875rem; color: var(--muted); }
.lang a { color: inherit; }

main { padding-top: 8px; padding-bottom: 48px; }
.crumbs { font-size: .875rem; color: var(--muted); margin: 0 0 8px; }
.crumbs a { color: inherit; }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; line-height: 1.15; overflow-wrap: break-word; }
h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); margin: .2em 0 .3em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2rem); margin: 2.2em 0 .4em; }
h3 { font-size: 1.35rem; margin: 1.6em 0 .3em; }
.lead { font-size: 1.15rem; color: var(--muted); }
.meta { font-size: .875rem; color: var(--muted); }

figure { margin: 28px 0; }
figure img { width: 100%; height: auto; display: block }
figcaption { font-size: .875rem; color: var(--muted); margin-top: 8px; }

ul, ol { padding-left: 1.3em; }
li { margin: .35em 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 16px 0; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
.table-wrap { overflow-x: auto; }

.note, .cta {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 18px 20px;
  margin: 28px 0;
}
.cta p { margin: 0 0 12px; }
.button {
  display: inline-block;
  background: var(--ink);
  color: var(--canvas);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
}
.button:hover { opacity: .9; }

.cards { list-style: none; display: grid; }
.cards li { margin: 0; }
/* The same brown band as the app's footer, edge to edge. */
.site-footer {
  max-width: none;
  margin-top: 48px;
  padding: 32px max(16px, calc((100% - 720px) / 2)) 40px;
  background: var(--band);
  font-size: .875rem;
  color: #F7F5F0;
}
.site-footer a { color: inherit; }
/* The padding makes a 44 px target; the negative margin keeps the line of links low. */
.instagram { display: inline-block; padding: 12px; margin: -12px 0 -12px -8px; line-height: 0; vertical-align: middle; }
.lang a { text-decoration: none; padding: 4px 2px; }
.lang a:hover { text-decoration: underline; }
.lang [aria-current] { color: var(--ink); font-weight: 600; }

/*
  The guides: a small magazine, not a stack of boxes. The photo leads, the type
  is big, and hairlines do the work cards used to do. Only pages with
  <body class="guide">; privacy and terms share this file and stay plain.
*/
.guide { overflow-x: clip; }
.guide main { max-width: none; padding: 0; }

/* The header floats over the hero, so it is always ivory. */
.guide .site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.guide .brand { background: var(--ivory); }
.guide .lang, .guide .lang [aria-current] { color: var(--ivory); }

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(88svh, 800px);
  overflow: hidden;
  background: #3D1D18;
  color: var(--ivory);
}
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The veil: dark enough behind the text on the brightest photo, clear in the middle. */
.hero::after, .band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(30 16 12 / .86), rgb(30 16 12 / .5) 38%, rgb(30 16 12 / 0) 66%),
    linear-gradient(to bottom, rgb(30 16 12 / .64), rgb(30 16 12 / 0) 26%);
}
.hero-text {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 120px var(--gutter) clamp(32px, 6vw, 64px);
}
.hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.04; max-width: 15em; margin: 0 0 .3em; letter-spacing: -.005em; }
.hero .crumbs, .hero .meta, .hero .lead { color: var(--ivory); margin: 0 0 12px; }
.hero .lead { max-width: 34em; margin: 0; }
.hero .meta { margin: 0; opacity: .85; }

/* The reading column. Figures step out of it, edge to edge on a phone. */
.prose { max-width: calc(680px + 2 * var(--gutter)); margin: 0 auto; padding: clamp(40px, 8vw, 72px) var(--gutter) 0; }
.prose > .lead { font: 500 clamp(1.55rem, 4vw, 2rem)/1.3 "Cormorant Garamond", Georgia, serif; color: var(--ink); margin: 0 0 1em; }
.prose h2 { padding-top: 1em; border-top: 1px solid var(--line); }
.prose h2:first-of-type + p::first-letter {
  float: left;
  font: 500 4.4em/.78 "Cormorant Garamond", Georgia, serif;
  padding: .06em .08em 0 0;
  color: var(--accent);
}
.prose li::marker { color: var(--accent); }
.prose figure { margin: 48px calc(-1 * var(--gutter)); }
.prose figcaption { padding: 0 var(--gutter); }
@media (min-width: 1040px) {
  .prose figure { width: 1000px; margin-left: calc(50% - 500px); margin-right: 0; }
  .prose figcaption { padding: 0; }
}

/* A call to action is a brown block, the one strong colour on the page. */
.guide .cta { background: var(--band); color: var(--ivory); border: 0; padding: clamp(24px, 5vw, 40px); margin: 48px 0; }
.guide .button { background: var(--ivory); color: #3D1D18; padding: 14px 28px; transition: opacity .2s; }

/* The index: rows of photo and title, left and right in turn. */
.cards { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: clamp(48px, 9vw, 96px) auto 0; padding: 0 var(--gutter); gap: clamp(56px, 9vw, 104px); counter-reset: guide; }
.cards a { display: grid; gap: 20px; color: var(--ink); text-decoration: none; }
.cover { display: block; overflow: hidden; aspect-ratio: 5 / 4; background: var(--card); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { display: block; }
.card-body::before {
  counter-increment: guide;
  content: counter(guide, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
  color: var(--accent);
}
.card-body strong { display: block; font: 500 clamp(1.9rem, 4.4vw, 2.8rem)/1.1 "Cormorant Garamond", Georgia, serif; margin-bottom: 12px; }
.card-body > span { color: var(--muted); }
.cards a:hover strong, .next a:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
@media (min-width: 820px) {
  .cards a { grid-template-columns: 7fr 5fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
  .cards li:nth-child(even) a { grid-template-columns: 5fr 7fr; }
  .cards li:nth-child(even) .cover { order: 2; }
}

/* Last stop of the index: a photo band that runs into the footer. */
.guide .cta.band {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(80svh, 620px);
  overflow: hidden;
  margin: clamp(64px, 10vw, 120px) 0 0;
  padding: 0;
  background: #3D1D18;
}
.band > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band-text { position: relative; z-index: 1; width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 96px var(--gutter) clamp(32px, 6vw, 56px); }
.band-text p { max-width: 30em; font-size: 1.15rem; margin-bottom: 20px; }

/* The end of an article: the other guides, with their photos. */
.next { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: clamp(56px, 9vw, 96px) auto 0; padding: 0 var(--gutter) clamp(56px, 9vw, 96px); }
.next h2 { margin: 0 0 24px; }
.next ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
.next li { margin: 0; }
.next a { display: block; color: var(--ink); text-decoration: none; }
.next .cover { margin-bottom: 14px; }
.next strong { display: block; font: 500 1.6rem/1.15 "Cormorant Garamond", Georgia, serif; }
@media (min-width: 600px) { .next ul { grid-template-columns: 1fr 1fr; } }

.guide .site-footer { margin-top: 0; padding-left: max(var(--gutter), calc((100% - var(--wide)) / 2)); padding-right: max(var(--gutter), calc((100% - var(--wide)) / 2)); }

/*
  Motion, Wonderous style, in CSS alone: no script, and a browser without
  scroll timelines simply shows the finished page. Everything here sits behind
  the reduced-motion query, so that fallback is the same for those readers.
*/
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: .12s; }
  .hero-text > :nth-child(3) { animation-delay: .24s; }
  .cover img { transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
  a:hover .cover img { transform: scale(1.04); }

  @supports (animation-timeline: view()) {
    .hero > img {
      animation: drift linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
    .cards li, .next li, .prose figure, .band-text {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
/* Scaled up, so the slide never shows the edge of the photo. */
@keyframes drift {
  from { transform: translateY(-4%) scale(1.1); }
  to { transform: translateY(4%) scale(1.1); }
}

/* The affiliate note is small print, but it stays readable: the disclosure has to be seen. */
.site-footer p + p { font-size: .75rem; line-height: 1.6; opacity: .8; }
