/* ============================================================================
   LES TOURNESOLS — Crissier · Magazine de la gastronomie vaudoise
   Design sur mesure — palette tournesol (or / olive / crème / encre).
   Mobile-first · zéro dépendance · slots photos avec dégradés de secours.
   ========================================================================== */

:root {
  --encre: #2A2119;            /* brun encre */
  --encre-2: #4A3D2E;
  --encre-3: #71624E;
  --soleil: #E9A820;           /* jaune tournesol */
  --soleil-clair: #F4C95D;
  --soleil-fonce: #B97A0A;
  --olive: #3E5227;            /* vert feuille */
  --olive-2: #2C3B1C;
  --olive-3: #5E7344;
  --vin: #7A2E3F;              /* bordeaux vignoble */
  --creme: #FAF5EA;
  --papier: #FFFDF7;
  --ligne: #E8DEC9;
  --ombre: 0 1px 2px rgba(42, 33, 25, .06), 0 10px 30px -12px rgba(42, 33, 25, .22);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 68rem;
  --r: 14px;
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--encre);
  background: var(--creme);
  overflow-wrap: break-word;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.15;
  color: var(--encre);
  margin: 0 0 .5em;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(1.9rem, 1.3rem + 2.8vw, 3rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.2vw, 2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; }

a { color: var(--olive); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--soleil-fonce); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--olive); color: #fff; padding: .6rem 1rem;
  z-index: 100; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; color: #fff; }

:focus-visible { outline: 3px solid var(--soleil); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--soleil-clair); color: var(--encre); }

/* ------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 245, 234, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ligne);
}

.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding-block: .65rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  text-decoration: none; color: var(--encre); margin-right: auto;
}

.brand-mark { width: 42px; height: 42px; flex: none; border-radius: 10px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--serif); font-size: 1.18rem; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.brand-text small {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--encre-3);
  white-space: nowrap;
}

.nav-toggle { display: none; }

.site-nav { display: flex; flex-wrap: wrap; gap: .15rem .25rem; }

.site-nav a {
  text-decoration: none; color: var(--encre-2);
  font-size: .92rem; font-weight: 600;
  padding: .42rem .68rem; border-radius: 99px;
}
.site-nav a:hover { background: var(--soleil-clair)33; color: var(--encre); }
.site-nav a[aria-current="page"] { background: var(--olive); color: var(--creme); }

/* Burger mobile — pur CSS */
@media (max-width: 860px) {
  .nav-toggle {
    display: block; order: 3;
    width: 44px; height: 44px; margin: 0 -.5rem 0 0;
    appearance: none; -webkit-appearance: none;
    background:
      linear-gradient(var(--encre) 0 0) center/22px 2px no-repeat,
      linear-gradient(var(--encre) 0 0) center calc(50% - 5px)/22px 2px no-repeat,
      linear-gradient(var(--encre) 0 0) center calc(50% + 5px)/22px 2px no-repeat;
    cursor: pointer; border: 0; border-radius: 10px;
  }
  .nav-toggle:checked { background:
      linear-gradient(var(--encre) 0 0) center/24px 2px no-repeat,
      transparent, transparent;
      transform: rotate(45deg) scale(1.06);
  }
  .site-nav {
    display: none;
    position: absolute; inset: 100% 0 auto 0;
    flex-direction: column; padding: .5rem 1.25rem 1rem;
    background: var(--papier);
    border-bottom: 1px solid var(--ligne);
    box-shadow: var(--ombre);
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: .8rem .5rem; border-radius: 10px; font-size: 1.05rem; }
  .site-nav a + a { border-top: 1px solid var(--ligne); }
}

/* ------------------------------------------------------------- hero */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 85% 15%, rgba(233, 168, 32, .38), transparent 55%),
    radial-gradient(90% 120% at 10% 90%, rgba(62, 82, 39, .5), transparent 60%),
    linear-gradient(128deg, var(--olive-2) 0%, var(--olive) 44%, #6B7A3D 74%, var(--soleil-fonce) 100%);
  color: var(--creme);
  overflow: hidden;
}

.hero-media { position: absolute; inset: 0; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(24, 32, 14, .82) 0%, rgba(24, 32, 14, .55) 42%, rgba(24, 32, 14, .12) 75%, transparent 100%);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

.hero-inner { position: relative; z-index: 1; padding-block: clamp(3.5rem, 10vw, 7rem); max-width: 46rem; }

.hero-kicker {
  display: inline-block;
  font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--soleil-clair);
  border: 1px solid rgba(244, 201, 93, .45);
  padding: .3rem .8rem; border-radius: 99px; margin: 0 0 1.1rem;
}

.hero h1 { color: #fff; margin-bottom: .4em; }

.hero-sub { font-size: clamp(1.02rem, .95rem + .5vw, 1.3rem); color: rgba(250, 245, 234, .92); max-width: 38ch; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

.btn {
  display: inline-block;
  padding: .72rem 1.35rem; border-radius: 99px;
  font-weight: 700; font-size: .98rem; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--soleil); color: var(--encre); box-shadow: 0 8px 22px -8px rgba(233, 168, 32, .7); }
.btn-primary:hover { color: var(--encre); background: var(--soleil-clair); }
.btn-ghost { color: var(--creme); border: 1.5px solid rgba(250, 245, 234, .55); }
.btn-ghost:hover { color: #fff; border-color: #fff; }

/* ------------------------------------------------------------- sections & cartes */
.section { padding-block: clamp(2.2rem, 6vw, 4rem); }

.section-head { margin-bottom: 1.6rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.4rem; }
.section-head h2 { margin: 0; }
.section-head h2::after { content: ""; display: block; width: 3.2rem; height: 4px; margin-top: .45rem; border-radius: 2px; background: var(--soleil); }
.section-head p { margin: 0; color: var(--encre-3); font-size: .98rem; }

.grid-cards {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

.card {
  background: var(--papier);
  border: 1px solid var(--ligne);
  border-radius: var(--r);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(42, 33, 25, .05);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--ombre); }

.card-link { display: block; text-decoration: none; }

.card-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card-title { margin: 0; font-size: 1.18rem; }
.card-title a { color: var(--encre); text-decoration: none; }
.card-title a:hover { color: var(--olive); text-decoration: underline; text-underline-offset: 3px; }
.card-excerpt { margin: 0; color: var(--encre-2); font-size: .95rem; flex: 1; }
.card-meta { margin: .35rem 0 0; font-size: .82rem; color: var(--encre-3); }
.card-meta a { color: inherit; }

/* Slots photos : dégradé de secours si l'image est absente (retirée via onerror) */
.media {
  margin: 0;
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.hero-slot { aspect-ratio: 16 / 9; }

.rub-tables { background:
  radial-gradient(90% 90% at 20% 10%, rgba(255, 253, 247, .25), transparent 50%),
  linear-gradient(135deg, #8A5A12, var(--soleil) 55%, #F0BE55); }
.rub-terroir { background:
  radial-gradient(90% 90% at 80% 15%, rgba(244, 201, 93, .5), transparent 55%),
  linear-gradient(140deg, var(--olive-2), var(--olive) 60%, var(--olive-3)); }
.rub-vins { background:
  radial-gradient(90% 90% at 25% 85%, rgba(233, 168, 32, .4), transparent 55%),
  linear-gradient(140deg, #4A1C28, var(--vin) 60%, #96505E); }
.rub-carnets { background:
  radial-gradient(90% 90% at 15% 20%, rgba(255, 253, 247, .35), transparent 55%),
  linear-gradient(140deg, #C98A0D, var(--soleil) 50%, #F7D67E); }

/* motif tournesol discret sur les vignettes sans photo */
.media:not(:has(img))::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 30%, rgba(255, 253, 247, .5) 0 6.5%, transparent 7.5%),
    radial-gradient(circle at 78% 30%, transparent 0 10%, rgba(255, 253, 247, .35) 10.8% 12%, transparent 12.8%);
  opacity: .8;
}

.kicker {
  font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  margin: 0;
}
.kicker-tables  { color: var(--soleil-fonce); }
.kicker-terroir { color: var(--olive-3); }
.kicker-vins    { color: var(--vin); }
.kicker-carnets { color: #9A6A00; }
.media .kicker, .kicker:empty { display: none; }

/* ------------------------------------------------------------- à la une */
.grid-une { display: grid; gap: 1.6rem; }
.feature { display: flex; flex-direction: column; background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r); overflow: hidden; box-shadow: var(--ombre); }
.feature-body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.feature-title { margin: 0; font-size: clamp(1.45rem, 1.2rem + 1.4vw, 2.1rem); }
.feature-title a { color: var(--encre); text-decoration: none; }
.feature-title a:hover { color: var(--olive); }
.grid-side { display: grid; gap: 1.4rem; }

@media (min-width: 960px) {
  .grid-une { grid-template-columns: 1.55fr 1fr; align-items: stretch; }
  .feature { justify-content: space-between; }
  .grid-side { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .grid-side .card:first-child { grid-row: 1 / -1; }
}

/* ------------------------------------------------------------- bandeau rédaction */
.bandeau {
  background:
    radial-gradient(80% 120% at 90% 0%, rgba(233, 168, 32, .16), transparent 60%),
    var(--olive-2);
  color: var(--creme);
  padding-block: clamp(2.4rem, 6vw, 4rem);
}
.bandeau h2 { color: #fff; }
.bandeau > .wrap > p { color: rgba(250, 245, 234, .85); max-width: 52ch; }

/* ------------------------------------------------------------- article */
.article { padding-block: clamp(1.2rem, 4vw, 2.6rem) clamp(2.2rem, 6vw, 4rem); }

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  font-size: .82rem; color: var(--encre-3);
  margin-bottom: 1.4rem;
}
.breadcrumb a { color: var(--encre-3); }
.breadcrumb a:hover { color: var(--olive); }
.breadcrumb span[aria-hidden] { opacity: .55; }
.bc-here { color: var(--encre-2); max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.article-head { max-width: 52rem; }
.article-head h1 { margin-top: .2rem; }
.article-head .kicker { margin-bottom: .9rem; }

.standfirst {
  font-family: var(--serif);
  font-size: clamp(1.12rem, 1rem + .7vw, 1.4rem);
  line-height: 1.5;
  color: var(--encre-2);
  margin: .6rem 0 1rem;
}

.byline { font-size: .9rem; color: var(--encre-3); }
.byline a { font-weight: 600; }

.article-fig {
  margin: 1.6rem auto;
  width: min(100% - 2.5rem, 60rem);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--ombre);
}
.article-fig img { width: 100%; height: 100%; object-fit: cover; }

.prose { max-width: 44rem; font-size: 1.08rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose ul, .prose ol { color: var(--encre-2); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--soleil-fonce); font-weight: 700; }
.prose ol li::marker { color: var(--olive); }
.prose strong { color: var(--encre); }
.prose blockquote {
  margin: 1.8rem 0; padding: 1.1rem 1.4rem;
  border-left: 4px solid var(--soleil);
  background: var(--papier);
  border-radius: 0 var(--r) var(--r) 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--encre);
}
.prose blockquote p { margin: 0; color: inherit; }
.prose sup { font-size: .72em; }

.share-note {
  margin-top: 2.2rem; padding: .8rem 1.1rem;
  background: var(--papier); border: 1px dashed var(--ligne); border-radius: 10px;
  font-size: .86rem; color: var(--encre-3);
}

.related { margin-top: 2.6rem; }
.related h2 { font-size: 1.3rem; }
.related-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.related-list li {
  padding: .7rem .95rem; margin-bottom: .5rem;
  background: var(--papier); border: 1px solid var(--ligne); border-radius: 10px;
}
.related-list a { font-weight: 600; text-decoration: none; }
.related-list a:hover { text-decoration: underline; }
.rel-meta { color: var(--encre-3); font-size: .84rem; }

/* ------------------------------------------------------------- auteurs */
.author-box {
  display: flex; gap: 1.1rem;
  margin-top: 2.4rem; padding: 1.3rem 1.4rem;
  background: var(--papier);
  border: 1px solid var(--ligne);
  border-radius: var(--r);
}
.author-box.compact { margin-top: 0; flex-direction: column; gap: .8rem; }
.author-name { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.author-name a { color: var(--encre); text-decoration: none; }
.author-name a:hover { color: var(--olive); }
.author-role { margin: .1rem 0 .5rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--soleil-fonce); font-weight: 700; }
.author-bio { margin: 0 0 .7rem; font-size: .94rem; color: var(--encre-2); }
.author-box.compact .author-bio { font-size: .9rem; }
.author-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.author-list li { margin-bottom: .3rem; }
.author-list a { text-decoration: none; }
.author-list a:hover { text-decoration: underline; }

.avatar {
  flex: none;
  width: 64px; height: 64px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, var(--soleil-clair), var(--soleil) 60%, var(--soleil-fonce));
  color: var(--encre);
  font-weight: 800; font-size: 1.15rem; letter-spacing: .02em;
  text-decoration: none;
  box-shadow: inset 0 0 0 3px rgba(255, 253, 247, .55);
}
.avatar:hover { color: var(--encre); }
.avatar-big { width: 96px; height: 96px; font-size: 1.7rem; cursor: default; }

.authors-row {
  display: grid; gap: 1.3rem; margin-top: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.author-hero {
  display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: flex-start;
  margin-bottom: 2.4rem;
}
.author-hero h1 { margin-bottom: .15em; }
.author-hero .author-role { margin-top: 0; }
.author-hero .author-bio { max-width: 56ch; font-size: 1.02rem; }

.author-page, .article-page { padding-block: clamp(1.2rem, 4vw, 2.6rem) clamp(2.2rem, 6vw, 4rem); }
.about-authors { margin-top: 1rem; }

/* ------------------------------------------------------------- footer */
.site-footer {
  background: var(--encre);
  color: #CFC4B2;
  padding-block: clamp(2.4rem, 6vw, 3.6rem) 0;
  margin-top: clamp(2rem, 6vw, 4rem);
}
.footer-grid {
  display: grid; gap: 2rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  padding-bottom: 2.2rem;
}
.f-col { display: flex; flex-direction: column; gap: .45rem; }
.f-title {
  font-family: var(--sans);
  font-size: .78rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase;
  color: var(--soleil-clair);
  margin: 0 0 .5rem;
}
.f-col a { color: #D8CEBD; text-decoration: none; font-size: .95rem; }
.f-col a:hover { color: #fff; text-decoration: underline; }
.f-logo { font-family: var(--serif); font-size: 1.5rem; color: #fff; margin: 0; }
.f-tag { font-size: .92rem; max-width: 34ch; }
.f-note { font-size: .8rem; color: #9C907C; }
.f-bottom { border-top: 1px solid #453A2C; padding-block: 1.1rem; }
.f-bottom p { margin: 0; font-size: .82rem; }
.f-bottom a { color: var(--soleil-clair); }

/* ------------------------------------------------------------- divers */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
}

@media print {
  .site-header, .site-footer, .hero-cta, .related, .share-note, .breadcrumb { display: none; }
  body { background: #fff; }
}
