/* bergues-tourisme.fr : direction artistique « Brique jaune et polder »
   Brique de sable jaune du beffroi, polder gris-bleu, enceinte en étoile, douves vertes.
   Polices : Gloock (titres), Hanken Grotesk (texte), chargées par la Fonts API d'Astro (--bg-titre, --bg-texte). */

:root {
  --ciel: #E6EBEC;          /* fond, environ 70 % */
  --papier: #F4F6F6;        /* encadrés et cartes */
  --ardoise: #1F2B33;       /* texte, en-tête, pied */
  --brique: #C9A04E;        /* accent, environ 10 % : jamais en texte courant sur fond clair */
  --brique-foncee: #76571A; /* brique pour tout texte accentué (5,55 sur le ciel) */
  --eau: #3F6158;           /* liens, titres secondaires */
  --pierre: #8C969B;        /* filets */
  --pierre-foncee: #55626A; /* métadonnées (5,23 sur le ciel) */

  --titre: var(--bg-titre), Didot, Georgia, serif;
  --texte: var(--bg-texte), Arial, sans-serif;

  --measure-article: 820px;  /* largeur de lecture des articles (>= 820 px) */
  --measure-page: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 4.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body { margin: 0; background: var(--ciel); color: var(--ardoise); font-family: var(--texte); font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--eau); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ardoise); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--eau); outline-offset: 3px; border-radius: 2px; }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--brique); }
.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--ardoise); color: var(--ciel); padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; }
.wrap { max-width: var(--measure-page); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3, h4 { font-family: var(--titre); font-weight: 400; color: var(--ardoise); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.07; letter-spacing: -0.005em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.15rem); }
h3 { font-size: 1.35rem; color: var(--eau); }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ardoise); color: var(--ciel); border-bottom: 4px solid var(--brique); }
.header-inner { max-width: 1400px; margin-inline: auto; padding: 0 var(--gutter); min-height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ciel); text-decoration: none; flex: none; }
.brand img { border-radius: 4px; }
.brand-name { font-family: var(--titre); font-size: 1.45rem; line-height: 1; }
.brand:hover { color: var(--brique); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.15rem 1.25rem; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a { color: var(--ciel); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--brique); }
.main-nav a[aria-current] { border-bottom-color: var(--brique); }
.nav-toggle { display: none; background: none; border: 0; padding: 0.7rem; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ciel); margin: 5px 0; }

@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ardoise); padding: 0.5rem var(--gutter) 1.25rem; display: none; border-bottom: 4px solid var(--brique); }
  .nav-open .main-nav { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav a { display: block; padding: 0.75rem 0; font-size: 1.05rem; border-bottom: 1px solid rgb(230 235 236 / 0.18); }
}

/* ---------- Images : wrappers à ratio fixe ---------- */
.img-hero, .img-card, .img-body, .img-portrait { margin: 0; overflow: hidden; position: relative; background: var(--pierre); }
.img-hero { aspect-ratio: 16 / 9; }
.img-card, .img-body { aspect-ratio: 3 / 2; }
.img-portrait { aspect-ratio: 1 / 1; }
.img-hero img, .img-card img, .img-body img, .img-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.img-ph { width: 100%; height: 100%; background: linear-gradient(135deg, var(--pierre), var(--ciel)); }

/* Hero : bandeau bord à bord en haut de page, titre dessous */
.hero-band { width: 100%; max-height: min(75vh, 44vw); aspect-ratio: 16 / 9; }
.hero-band img { object-position: center 20%; }
.hero-band--vide { background: linear-gradient(120deg, var(--pierre) 0%, var(--ciel) 100%); border-bottom: 4px solid var(--brique); }
.hero-band figcaption { position: absolute; right: 0; bottom: 0; background: rgb(31 43 51 / 0.82); color: var(--ciel); font-size: 0.8rem; padding: 0.3rem 0.8rem; max-width: 80%; }
.img-body { margin: 2.2rem 0; }
.img-body figcaption, .img-caption { font-size: 0.85rem; color: var(--pierre-foncee); margin-top: 0.5rem; }
.article-body figure { margin: 2.2rem 0; }
.article-body figure.img-body { overflow: visible; background: none; aspect-ratio: auto; }
.article-body figure.img-body img { aspect-ratio: 3 / 2; height: auto; }

/* ---------- Têtes de page ---------- */
.page-head { padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: 1.5rem; }
.page-head h1 { max-width: 22ch; }
.chapeau { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); max-width: 62ch; margin: 1rem 0 0; color: var(--ardoise); line-height: 1.55; }
.page-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.6rem; margin: 1.2rem 0 0; font-size: 0.9rem; color: var(--pierre-foncee); }
.page-meta .meta-cat { font-weight: 700; color: var(--eau); }
.pillar-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.bastion-mark { margin-top: 2.2rem; }
.bm-wall { fill: none; stroke: var(--eau); stroke-width: 1; opacity: 0.55; }
.bm-bastion { fill: var(--papier); stroke: var(--ardoise); stroke-width: 0.9; stroke-linejoin: round; }
.bm-bastion.is-on { fill: var(--brique); }
@media (max-width: 640px) { .pillar-head { grid-template-columns: 1fr; gap: 0; } .bastion-mark { margin: 0 0 0.5rem; width: 44px; height: 44px; } }

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; padding: 0; margin: 0 0 1.2rem; font-size: 0.88rem; color: var(--pierre-foncee); }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--pierre-foncee); }
.breadcrumbs a { color: var(--pierre-foncee); }

/* ---------- Article : sommaire + corps ---------- */
.article-grid { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); padding-bottom: 4rem; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 1.25rem); font-size: 0.92rem; max-height: calc(100vh - var(--header-h) - 2.5rem); overflow-y: auto; }
.toc:empty { display: none; }
.toc-title { font-family: var(--titre); font-size: 1.1rem; margin: 0 0 0.6rem; }
.toc ol { margin: 0; padding: 0 0 0 1.1rem; display: grid; gap: 0.45rem; }
.toc a { color: var(--ardoise); text-decoration: none; }
.toc a:hover { color: var(--eau); text-decoration: underline; }
.article-body { max-width: var(--measure-article); min-width: 0; }
.article-grid:has(.toc:empty) { grid-template-columns: minmax(0, 1fr); }
.article-body > h2, .pillar-body > h2 { margin: 3rem 0 1.5rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.article-body h3 { margin: 2rem 0 0.7rem; }
.article-body p { margin: 0 0 1.15rem; }
.article-body blockquote { margin: 1.8rem 0; padding: 0.2rem 0 0.2rem 1.4rem; border-left: 4px solid var(--brique); font-family: var(--titre); font-size: 1.3rem; line-height: 1.4; color: var(--ardoise); }
.article-body blockquote p { margin: 0; }
.article-body ul, .article-body ol { margin: 0 0 1.3rem; padding-left: 1.4rem; display: grid; gap: 0.5rem; }
.article-body li::marker { color: var(--brique-foncee); font-weight: 700; }
.article-body ol li::marker { font-family: var(--titre); font-weight: 400; }
@media (max-width: 960px) { .article-grid { grid-template-columns: minmax(0, 1fr); } .toc { position: static; } }

/* Appareillage de brique : filet discret sous chaque H2 (deux rangs décalés, joints en quinconce) */
.article-body > h2::after, .home-map h2::after, .home-latest h2::after, .listing-head h2::after, .wrap > h2::after {
  content: ""; display: block; width: 6.5rem; height: 12px; margin-top: 0.75rem;
  background:
    repeating-linear-gradient(90deg, var(--brique) 0 18px, transparent 18px 21px) 0 0 / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--brique) 0 18px, transparent 18px 21px) 10px 7px / 100% 5px no-repeat;
}

/* ---------- Encadrés ---------- */
.box-title { font-family: var(--titre); font-size: 1.2rem; font-weight: 400; margin: 0 0 0.5rem; }
.key-takeaway, .east-lens, .on-site, .sources-box { margin: 2rem 0; padding: 1.2rem 1.4rem; background: var(--papier); }
.key-takeaway p, .east-lens p, .on-site p, .sources-box p { margin: 0; }
.key-takeaway { border-left: 4px solid var(--eau); }
.east-lens { border: 1px solid var(--pierre); border-left: 6px solid var(--brique); }
.east-lens .box-title { color: var(--brique-foncee); font-size: 1.35rem; }
.on-site { background: transparent; border: 1px dashed var(--pierre-foncee); }
.on-site .box-title { color: var(--eau); }
.sources-box { background: transparent; border-top: 1px solid var(--pierre); padding-inline: 0; font-size: 0.93rem; color: var(--pierre-foncee); }
.sources-box ul { margin: 0.6rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.sources-box a { color: var(--eau); }

/* ---------- FAQ ---------- */
.faq { margin: 3rem 0 2rem; }
.faq h2 { margin-bottom: 1.2rem; }
.faq-item { border-top: 1px solid var(--pierre); }
.faq-item:last-child { border-bottom: 1px solid var(--pierre); }
.faq-item h3 { margin: 0; font-size: 1.05rem; font-family: var(--texte); font-weight: 600; color: var(--ardoise); }
.faq-item button { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; gap: 1rem; width: 100%; padding: 1rem 0; cursor: pointer; }
.faq-item button:focus-visible { outline: 3px solid var(--eau); outline-offset: 2px; }
.faq-plus { flex: none; width: 1rem; height: 1rem; position: relative; margin-top: 0.3rem; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; background: var(--eau); left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
.faq-plus::after { transform: rotate(90deg); transition: transform 0.2s; }
.faq-item.open .faq-plus::after { transform: rotate(0); }
.faq-answer { padding: 0 2rem 1.1rem 0; }
.faq-answer p { margin: 0; }

/* ---------- Tableaux ---------- */
.article-body table { width: 100%; border-collapse: collapse; margin: 1.8rem 0; font-size: 0.97rem; background: var(--papier); }
.article-body th, .article-body td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--pierre); vertical-align: top; }
.article-body th { font-family: var(--titre); font-weight: 400; font-size: 1.02rem; background: var(--ardoise); color: var(--ciel); }
.article-body tbody tr:nth-child(even) { background: var(--ciel); }
@media (max-width: 720px) { .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: normal; } .article-body th, .article-body td { min-width: 8.5rem; } }

/* ---------- Cartes et grilles ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 2rem 1.75rem; }
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.card[hidden] { display: none; }
.card { background: var(--papier); border: 1px solid var(--pierre); border-bottom: 4px solid var(--brique); display: flex; }
.card-link { display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none; }
.card-body { padding: 1.1rem 1.25rem 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; margin: 0; font-size: 0.85rem; color: var(--pierre-foncee); }
.card-cat { font-weight: 700; color: var(--eau); }
.card-title { font-size: 1.3rem; line-height: 1.22; color: var(--ardoise); }
.card-summary { margin: 0; font-size: 0.95rem; color: var(--ardoise); line-height: 1.5; }
.card-link:hover .card-title { text-decoration: underline; text-decoration-color: var(--brique); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
.card-link:focus-visible { outline-offset: -3px; }

/* ---------- Filtre du blog ---------- */
.category-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.6rem 0 0.6rem; }
.chip { display: inline-block; padding: 0.45rem 1rem; border: 1px solid var(--pierre-foncee); background: transparent; color: var(--ardoise); text-decoration: none; font-size: 0.95rem; font-weight: 500; border-radius: 2px; }
.chip:hover { background: var(--papier); color: var(--ardoise); }
.chip.is-active { background: var(--ardoise); color: var(--ciel); border-color: var(--ardoise); }
.filter-status { font-size: 0.9rem; color: var(--pierre-foncee); margin: 0.4rem 0 0; min-height: 1.4em; }
.filter-empty { color: var(--pierre-foncee); }
.listing { padding-bottom: 4rem; }
.listing-head h2 { margin-top: 2rem; }

/* ---------- Accueil et plan étoilé ---------- */
.home-intro { padding-block: clamp(1.5rem, 3vw, 2.5rem) 1rem; }
.home-intro h1 { max-width: 20ch; }
.home-map, .home-latest { padding-block: clamp(2rem, 5vw, 3.5rem); }
.home-map h2, .home-latest h2 { margin-bottom: 1.8rem; }
.more { margin: 2rem 0 0; font-weight: 600; }
.bastion-map { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: center; }
.bastion-svg { width: 100%; height: auto; overflow: visible; }
.moat { fill: none; stroke: var(--eau); stroke-width: 18; stroke-linejoin: round; opacity: 0.38; }
.bastion polygon { fill: #EFE5C9; stroke: var(--ardoise); stroke-width: 2.6; stroke-linejoin: round; cursor: pointer; transition: fill 0.15s; }
.bastion:hover polygon, .bastion:focus-visible polygon { fill: var(--brique); }
.bastion:focus-visible { outline: none; }
.bastion:focus-visible polygon { stroke-width: 4; stroke: var(--eau); }
.bastion-label { font-family: var(--texte); font-size: 17px; font-weight: 600; fill: var(--ardoise); pointer-events: none; }
.bastion-core { fill: var(--ardoise); }
.bastion-list { list-style: none; margin: 0; padding: 0; display: grid; }
.bastion-list li { border-top: 1px solid var(--pierre); }
.bastion-list li:last-child { border-bottom: 1px solid var(--pierre); }
.bastion-list a { display: grid; gap: 0.1rem; padding: 0.8rem 0.2rem; text-decoration: none; color: var(--ardoise); }
.bastion-list strong { font-family: var(--titre); font-weight: 400; font-size: 1.2rem; color: var(--eau); }
.bastion-list span { font-size: 0.92rem; color: var(--pierre-foncee); }
.bastion-list a:hover strong { color: var(--ardoise); text-decoration: underline; text-decoration-color: var(--brique); text-decoration-thickness: 3px; }
@media (max-width: 900px) { .bastion-map { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .bastion-label { display: none; } .bastion-svg { max-width: 22rem; margin-inline: auto; } }

/* ---------- Contact ---------- */
.contact-form { display: grid; gap: 1.1rem; max-width: 38rem; }
.contact-form label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.97rem; }
.contact-form .req { font-weight: 400; color: var(--pierre-foncee); }
.contact-form input, .contact-form select, .contact-form textarea { font: inherit; font-weight: 400; padding: 0.7rem 0.8rem; border: 1px solid var(--pierre-foncee); background: var(--papier); color: var(--ardoise); border-radius: 2px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.9rem; color: var(--pierre-foncee); margin: 0; }
.btn { font: inherit; font-weight: 700; padding: 0.8rem 1.6rem; border: 0; background: var(--brique); color: var(--ardoise); cursor: pointer; justify-self: start; border-radius: 2px; border-bottom: 3px solid var(--brique-foncee); }
.btn:hover { background: var(--ardoise); color: var(--ciel); border-bottom-color: var(--brique); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.form-status { margin: 0; font-weight: 600; min-height: 1.4em; }
.form-status.is-ok { color: var(--eau); }
.form-status.is-error { color: #8A2C1E; }

/* ---------- Divers ---------- */
.related ul { padding-left: 1.2rem; }
.lost-list { padding-left: 1.2rem; display: grid; gap: 0.4rem; margin-top: 1.5rem; }
.mark-row { display: flex; align-items: center; gap: 1rem; }
.mark-row .bastion-mark { margin: 0; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ardoise); color: var(--ciel); border-top: 4px solid var(--brique); margin-top: 2rem; }
.footer-body { max-width: var(--measure-page); margin-inline: auto; padding: 3rem var(--gutter) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.footer-name { font-family: var(--titre); font-size: 1.7rem; margin: 0 0 0.6rem; }
.footer-note { margin: 0; max-width: 40ch; font-size: 0.95rem; color: var(--ciel); }
.footer-title { font-family: var(--titre); font-size: 1.15rem; margin: 0 0 0.7rem; color: var(--brique); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.95rem; }
.site-footer a { color: var(--ciel); text-decoration-color: var(--brique); }
.site-footer a:hover { color: var(--brique); }
.footer-copy { margin: 2.2rem 0 0; padding-top: 1.2rem; border-top: 1px solid rgb(230 235 236 / 0.2); font-size: 0.85rem; color: var(--pierre); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.indep { max-width: 46rem; margin: 1rem 0 0; font-size: 0.95rem; color: var(--pierre-foncee); border-left: 3px solid var(--brique, currentColor); padding-left: 0.8rem; }

/* Interviews : carte de l'interlocuteur et questions de la rédaction */
.article-body .interview-expert-card { margin: 1.5rem 0 2rem; padding: 1rem 1.25rem; background: var(--papier); border-left: 4px solid var(--brique); border-radius: 0 4px 4px 0; }
.article-body .interview-expert-card p { margin: 0; font-size: 1rem; }
.article-body .interview-expert-card p + p { margin-top: 0.4rem; color: var(--pierre-foncee); }
.article-body p.journalist-question { margin: 2rem 0 0.75rem; padding-left: 0.9rem; border-left: 3px solid var(--eau); font-family: var(--titre); font-size: 1.0625rem; font-style: normal; line-height: 1.45; color: var(--eau); }
.article-body p.journalist-question strong { color: var(--ardoise); }
.article-body figure.img-portrait { max-width: 24rem; margin: 2.2rem auto; aspect-ratio: 1 / 1; border-radius: 4px; }

.footer-brand { min-width: 0; }
.pillar-articles { margin-top: 3rem; }
.contact-form { grid-template-columns: minmax(0, 1fr); }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; box-sizing: border-box; min-width: 0; }
/* Garde-fou interview (hook check_interview_css) : si une Q/R passe un jour en blockquote, ne pas hériter du style de citation */
blockquote.journalist-question, blockquote.expert-answer { font-size: 1rem !important; font-style: normal !important; line-height: 1.6 !important; }
