/* journal.css — "Warm Community Magazine" theme for parrainage-tesla.
   Bespoke vocabulary: masthead, broadsheet, spread, columns, postcard, ink-btn,
   panel, dispatch, ledger, folio, crumbs, token, pullquote, byline. */

:root {
  /* Warm coral/rose + cream tokens (light) */
  --cream: #fcf5ec;
  --paper: #fffaf3;
  --paper-2: #f6ebdd;
  --ink: #2c2320;
  --ink-soft: #5f524a;
  --muted: #8a7b6e;
  --line: #e4d5c4;
  --coral: #e15b4c;
  --coral-deep: #c4442f;
  --rose: #d1436a;
  --rose-soft: #f7d9cf;
  --gold: #caa24a;
  --ok-bg: #e7f0e2;
  --ok-ink: #3d6b2f;
  --no-bg: #f7e0dc;
  --no-ink: #b23a2a;
  --focus: #7a3bd0;

  --serif: "Baskerville", "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif;
  --sans: "Verdana", "Geneva", Tahoma, sans-serif;
  --mono: "Courier New", Courier, monospace;

  --measure: 68ch;
  --gap: clamp(1rem, 2.4vw, 2rem);
  --radius: 14px;
  --shadow: 0 10px 30px -18px rgba(60, 34, 22, .55);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #201a18;
    --paper: #2a2320;
    --paper-2: #332b27;
    --ink: #f3e7db;
    --ink-soft: #d3c3b5;
    --muted: #b09e90;
    --line: #443a34;
    --coral: #ff7a5c;
    --coral-deep: #ff9b83;
    --rose: #ef7a9c;
    --rose-soft: #4a2f2c;
    --gold: #e0bd67;
    --ok-bg: #26362250;
    --ok-ink: #a7d492;
    --no-bg: #4a2b2650;
    --no-ink: #ff9b8b;
    --focus: #c9a6ff;
    --shadow: 0 12px 34px -18px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --cream: #201a18; --paper: #2a2320; --paper-2: #332b27; --ink: #f3e7db;
  --ink-soft: #d3c3b5; --muted: #b09e90; --line: #443a34; --coral: #ff7a5c;
  --coral-deep: #ff9b83; --rose: #ef7a9c; --rose-soft: #4a2f2c; --gold: #e0bd67;
  --ok-bg: #26362250; --ok-ink: #a7d492; --no-bg: #4a2b2650; --no-ink: #ff9b8b;
  --focus: #c9a6ff; --shadow: 0 12px 34px -18px rgba(0,0,0,.7);
}
:root[data-theme="light"] {
  --cream: #fcf5ec; --paper: #fffaf3; --paper-2: #f6ebdd; --ink: #2c2320;
  --ink-soft: #5f524a; --muted: #8a7b6e; --line: #e4d5c4; --coral: #e15b4c;
  --coral-deep: #c4442f; --rose: #d1436a; --rose-soft: #f7d9cf; --gold: #caa24a;
  --ok-bg: #e7f0e2; --ok-ink: #3d6b2f; --no-bg: #f7e0dc; --no-ink: #b23a2a;
  --focus: #7a3bd0; --shadow: 0 10px 30px -18px rgba(60,34,22,.55);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.12; color: var(--ink); }
h1 { font-size: clamp(2rem, 5.4vw, 3.5rem); letter-spacing: -.01em; margin: .2em 0 .35em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.15rem); margin: 1.6em 0 .5em; }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--coral-deep); text-underline-offset: 2px; }
a:hover { color: var(--rose); }
strong { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; z-index: 50; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.broadsheet { width: min(1160px, 92vw); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .95em; }
.lede-scene { margin: 1rem 0 2rem; }
.lede-scene .scene-art { width: 100%; max-width: 720px; display: block; margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Masthead ---------- */
.masthead {
  background: var(--paper);
  border-bottom: 3px double var(--ink);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.1);
}
.masthead__inner {
  display: grid; grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand edition theme" "nav nav nav";
  align-items: center; gap: .4rem 1rem; padding: .7rem 0;
}
.masthead__brand { grid-area: brand; display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.masthead__mark { color: var(--coral); font-size: 1.6rem; }
.masthead__name { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; display: block; line-height: 1; }
.masthead__kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.edition-line { grid-area: edition; margin: 0; text-align: center; font-size: .74rem; color: var(--muted); letter-spacing: .04em; }
.theme-toggle { grid-area: theme; background: transparent; border: 1.5px solid var(--line); color: var(--ink); border-radius: 999px; width: 38px; height: 38px; cursor: pointer; font-size: 1.1rem; }
.theme-toggle:hover { border-color: var(--coral); }

.mainnav { grid-area: nav; }
.mainnav__toggle { display: none; }
.mainnav__list { display: flex; flex-wrap: wrap; gap: .2rem 1rem; list-style: none; margin: .2rem 0 0; padding: .3rem 0 0; border-top: 1px solid var(--line); }
.mainnav__link { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--ink-soft); padding: .25rem 0; border-bottom: 2px solid transparent; }
.mainnav__link:hover, .mainnav__link[aria-current="page"] { color: var(--coral-deep); border-bottom-color: var(--coral); }

/* ---------- Breadcrumb ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1.2rem 0 .4rem; font-size: .78rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--coral); }
.crumbs__sep { color: var(--line); }

/* ---------- Layout primitives ---------- */
.spread { padding: 1.4rem 0; }
.spread--tint { background: var(--paper); border-block: 1px solid var(--line); }
.spread--tint .broadsheet { padding-block: .5rem; }
main.broadsheet { padding-bottom: 3rem; }

.columns { column-gap: clamp(1.4rem, 3vw, 2.6rem); }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--ink-soft); }

/* ---------- Lede / hero ---------- */
.lede { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.4rem, 3vw, 3rem); align-items: center; padding: 1.6rem 0 1rem; }
.lede__kicker { font-family: var(--sans); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--coral-deep); margin: 0 0 .3rem; }
.lede__title { margin-top: 0; }
.lede__intro { font-size: 1.12rem; color: var(--ink-soft); max-width: 40ch; }
.scene-art { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Postcard (code unit) ---------- */
.postcard {
  position: relative; background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px; padding: 1.3rem 1.3rem 1.1rem;
  margin: 0; box-shadow: 8px 8px 0 -2px var(--coral), var(--shadow);
  transform: rotate(-1deg); max-width: 380px;
  background-image: repeating-linear-gradient(180deg, transparent, transparent 33px, var(--line) 33px, var(--line) 34px);
  background-position: 0 96px;
}
.postcard::before {
  content: ""; position: absolute; inset: 6px; border: 1px dashed var(--line);
  border-radius: 8px; pointer-events: none;
}
.postcard__stamp { position: absolute; top: 10px; right: 12px; color: var(--coral); transform: rotate(6deg); }
.postcard__head { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .5rem; }
.postcard__eyebrow { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.postcard__hand { font-family: var(--serif); font-style: italic; color: var(--rose); font-size: .95rem; }
.postcard__label { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: .3rem 0 .1rem; }
.postcard__code {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 700; letter-spacing: .02em;
  margin: 0; color: var(--coral-deep); word-break: break-all; min-height: 1.9rem;
}
.postcard__link-preview { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin: .1rem 0 .8rem; word-break: break-all; }
.postcard__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.postcard__hint { font-size: .82rem; color: var(--ink-soft); margin: .8rem 0 0; }

/* ---------- Buttons ---------- */
.ink-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: var(--sans); font-size: .9rem; font-weight: 700; letter-spacing: .02em;
  padding: .7rem 1.05rem; border-radius: 999px; border: 2px solid var(--ink);
  cursor: pointer; text-decoration: none; line-height: 1; transition: transform .08s ease, background .15s ease;
}
.ink-btn:active { transform: translateY(1px); }
.ink-btn--solid { background: var(--coral); color: #fff; border-color: var(--coral-deep); }
.ink-btn--solid:hover { background: var(--coral-deep); color: #fff; }
.ink-btn--outline { background: transparent; color: var(--ink); }
.ink-btn--outline:hover { background: var(--paper-2); color: var(--ink); }
.ink-btn.is-copied { background: var(--ok-ink); border-color: var(--ok-ink); color: #fff; }

/* ---------- Tokens (pill replacement) ---------- */
.token { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: .18rem .55rem; border-radius: 999px; margin-right: .35rem; }
.token--ok { background: var(--ok-bg); color: var(--ok-ink); }
.token--no { background: var(--no-bg); color: var(--no-ink); }

/* ---------- Verified stamp ---------- */
.verified-stamp { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--ok-ink); font-weight: 700; margin: .5rem 0; }

/* ---------- Panels grid ---------- */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap); margin: 1rem 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.panel__glyph { color: var(--coral); margin-bottom: .4rem; }
.panel__title { margin: .1rem 0 .3rem; font-size: 1.2rem; }
.panel__body { color: var(--ink-soft); font-size: .95rem; }
.panel__body p:last-child { margin-bottom: 0; }

/* ---------- Ledger (table) ---------- */
.ledger-frame { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.ledger { border-collapse: collapse; width: 100%; min-width: 560px; background: var(--paper); }
.ledger caption { caption-side: top; text-align: left; padding: .8rem 1rem; font-size: .82rem; color: var(--muted); font-style: italic; }
.ledger th, .ledger td { text-align: left; padding: .8rem 1rem; border-top: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
.ledger thead th { background: var(--paper-2); font-family: var(--serif); font-size: 1rem; border-top: none; }
.ledger tbody th { font-family: var(--serif); color: var(--coral-deep); font-size: 1.05rem; }

/* ---------- Dispatch (testimonials) ---------- */
.dispatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--gap); }
.dispatch { background: var(--paper); border-left: 4px solid var(--coral); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.1rem 1.2rem; margin: 0; box-shadow: var(--shadow); }
.dispatch__text { font-family: var(--serif); font-style: italic; font-size: 1.08rem; margin: 0 0 .6rem; color: var(--ink); }
.dispatch__text::before { content: "“"; color: var(--coral); font-size: 1.6rem; margin-right: .1rem; }
.dispatch__who { font-size: .82rem; color: var(--muted); font-weight: 700; }
.dispatch__place { display: block; font-weight: 400; }

/* ---------- Pull quote ---------- */
.pullquote { border-block: 2px solid var(--coral); padding: .8rem 0; margin: 1.4rem 0; }
.pullquote p { font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 1.9rem); font-style: italic; color: var(--coral-deep); margin: 0; text-align: center; }

/* ---------- Feature grid (two column editorial) ---------- */
.feature-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(1.4rem, 3vw, 2.6rem); align-items: start; }
.marginalia { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.1rem; font-size: .9rem; }
.marginalia h3 { margin-top: 0; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); margin: 1rem 0; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q { font-family: var(--serif); font-size: 1.12rem; font-weight: 700; cursor: pointer; padding: .9rem 0; list-style: none; position: relative; padding-right: 2rem; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; position: absolute; right: .2rem; top: .8rem; color: var(--coral); font-size: 1.4rem; }
details[open] .faq__q::after { content: "–"; }
.faq__a { padding: 0 0 1rem; color: var(--ink-soft); }
.faq__a p:last-child { margin-bottom: 0; }

/* ---------- Notices / disclosure ---------- */
.notice { font-size: .82rem; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; margin: .8rem 0; }
.notice--disclosure { border-color: var(--coral); }
.notice--placeholder { border-color: var(--gold); border-left: 4px solid var(--gold); background: var(--paper-2); color: var(--ink-soft); }
.notice code { font-family: var(--mono); font-size: .95em; }

/* ---------- Byline ---------- */
.byline { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin: 2rem 0 1rem; }
.byline__who { display: flex; gap: 1rem; align-items: center; }
.byline__avatar svg { border-radius: 50%; box-shadow: var(--shadow); }
.byline__name { margin: 0; font-weight: 700; font-size: 1.05rem; }
.byline__flag { color: var(--muted); font-weight: 400; font-size: .78rem; }
.byline__role { margin: .15rem 0; color: var(--ink-soft); font-size: .9rem; }
.byline__sources { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.byline__sh { font-size: .95rem; margin: 0 0 .4rem; }
.byline__sources ul { margin: 0; padding-left: 1.1rem; font-size: .86rem; }

/* ---------- Blog index cards ---------- */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); margin: 1.4rem 0; }
.article-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; }
.article-card h3 { margin: .2rem 0 .4rem; }
.article-card h3 a { text-decoration: none; color: var(--ink); }
.article-card h3 a:hover { color: var(--coral-deep); }
.article-card__meta { font-size: .76rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.article-card__excerpt { color: var(--ink-soft); font-size: .92rem; flex: 1; }
.article-card__more { font-weight: 700; font-size: .85rem; }

/* ---------- Article body ---------- */
.article-header { max-width: var(--measure); }
.article-meta { font-size: .82rem; color: var(--muted); margin: .4rem 0 1rem; }
.article-body { max-width: var(--measure); }
.article-body h2 { margin-top: 1.8rem; }
.article-body ul, .article-body ol { color: var(--ink-soft); }
.article-body li { margin: .3rem 0; }
.article-body figure { margin: 1.4rem 0; }
.article-body figcaption { font-size: .8rem; color: var(--muted); font-style: italic; margin-top: .3rem; }
.news-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.news-photo figcaption a { color: inherit; }
.related { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; }
.related ul { padding-left: 1.1rem; }

/* ---------- How-to steps ---------- */
.how-steps { display: grid; gap: 1.4rem; margin: 1rem 0; }
.how-step { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; margin: 0; }
.how-step__num { width: 42px; height: 42px; border-radius: 50%; background: var(--coral); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }
.how-step h3 { margin-top: 0; }
.screenshot-placeholder { margin: .6rem 0 .2rem; border: 1px dashed var(--line); border-radius: 10px; overflow: hidden; max-width: 340px; }
.screenshot-placeholder svg { display: block; width: 100%; height: auto; }

/* ---------- CTA strip ---------- */
.cta-strip { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.4rem; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; margin: 2rem 0; box-shadow: var(--shadow); }
.cta-strip h2 { margin: 0; }
.cta-strip p { margin: .3rem 0 0; color: var(--ink-soft); }

/* ---------- Cookie consent (RGPD) ---------- */
.consent { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--paper); border-top: 3px double var(--ink); padding: 1rem; display: none; }
.consent.is-shown { display: block; }
.consent__inner { width: min(1000px, 92vw); margin-inline: auto; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.consent p { margin: 0; font-size: .86rem; max-width: 58ch; }
.consent__row { display: flex; gap: .5rem; }

/* ---------- Footer ---------- */
.folio { background: var(--paper); border-top: 3px double var(--ink); margin-top: 2rem; padding: 2rem 0 2.4rem; }
.folio__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap); margin-bottom: 1.4rem; }
.folio__h { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--coral-deep); margin: 0 0 .5rem; font-family: var(--sans); }
.folio__col ul { list-style: none; margin: 0; padding: 0; }
.folio__col a { color: var(--ink-soft); text-decoration: none; font-size: .9rem; line-height: 2; }
.folio__col a:hover { color: var(--coral); }
.folio__legal { font-size: .78rem; color: var(--muted); margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .lede, .feature-grid { grid-template-columns: 1fr; }
  .cta-strip { grid-template-columns: 1fr; }
  .masthead__inner { grid-template-columns: 1fr auto; grid-template-areas: "brand theme" "edition edition" "nav nav"; }
  .edition-line { text-align: left; }
  .mainnav__toggle { display: inline-block; background: transparent; border: 1.5px solid var(--line); color: var(--ink); border-radius: 8px; padding: .4rem .8rem; font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
  .mainnav__list { display: none; flex-direction: column; gap: .1rem; }
  .mainnav__list.is-open { display: flex; }
  .postcard { margin: 1.2rem auto 0; transform: rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition: none !important; scroll-behavior: auto !important; }
  .postcard { transform: none; }
}
