/* =============================================================
   Roussines-en-Charente — Design System
   "Soft-premium institutional / rooted in place"
   Hand-built, framework-free, WCAG 2.2 AA
   ============================================================= */

/* ---------- Fonts (self-hosted, RGPD-safe) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/publicsans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/publicsans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/publicsans-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/publicsans-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Colour — palette drawn from Charente stone, pine, ochre */
  --paper:        #faf8f3;
  --surface:      #ffffff;
  --surface-alt:  #f2eee4;
  --ink:          #1b1b18;
  --muted:        #565048;
  --line:         #e4ded1;

  --primary:      #1e4a3e;  /* pine */
  --primary-700:  #163a30;  /* pine hover */
  --primary-050:  #eaf1ed;  /* pine tint */

  --accent:       #b5651d;  /* Charente ochre (decorative / large) */
  --accent-700:   #8c4e15;  /* ochre for text/links on light (AA) */
  --accent-050:   #f7ede0;

  --success:      #2e7d5b;
  --error:        #b3261e;
  --warning:      #8a5a00;
  --info:         #1f5c7a;

  /* Type */
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
  --step-0:  clamp(1.0625rem, 1.02rem + 0.25vw, 1.15rem);   /* body 17–18 */
  --step-1:  clamp(1.25rem, 1.16rem + 0.45vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.34rem + 0.8vw, 2rem);
  --step-3:  clamp(1.85rem, 1.55rem + 1.5vw, 2.75rem);
  --step-4:  clamp(2.25rem, 1.7rem + 2.7vw, 3.5rem);

  /* Space / shape */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem;
  --wrap: 74rem;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(27,27,24,.06), 0 2px 8px rgba(27,27,24,.05);
  --shadow-md: 0 6px 24px rgba(27,27,24,.09);
  --ring: 0 0 0 3px var(--paper), 0 0 0 6px var(--accent);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg { max-width: 100%; display: block; height: auto; }
a { color: var(--primary); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--primary-700); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; color: var(--ink); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 600; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { text-wrap: pretty; }
:target { scroll-margin-top: 6rem; }

/* ---------- Focus (visible, AA) ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
a:focus-visible, .btn:focus-visible { outline-offset: 3px; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: var(--sp-3); top: -100px;
  background: var(--primary); color: #fff; padding: .7rem 1rem;
  border-radius: 8px; z-index: 200; font-weight: 600; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: var(--sp-3); color: #fff; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(var(--sp-7), 6vw, var(--sp-9)); }
.section--tint { background: var(--surface-alt); }
.section--pine { background: var(--primary); color: #f3f1ea; }
.section--pine h2, .section--pine h3 { color: #fff; }
.stack > * + * { margin-top: var(--sp-4); }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 46ch; }
.eyebrow {
  font: 600 var(--step--1)/1 var(--font-body);
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-700);
  display: inline-block; margin-bottom: var(--sp-3);
}
.section--pine .eyebrow { color: #e7c9a3; }
.section-head { max-width: 52ch; margin-bottom: var(--sp-6); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 var(--step-0)/1 var(--font-body);
  padding: .8rem 1.35rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, transform .15s, border-color .15s;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-700); color: #fff; transform: translateY(-1px); }
.btn--accent { background: var(--accent-700); color: #fff; }
.btn--accent:hover { background: #723f11; color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary-050); color: var(--primary-700); }
.section--pine .btn--ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.section--pine .btn--ghost:hover { background: rgba(255,255,255,.12); color:#fff; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand__mark {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.25rem;
}
.brand__name { font-family: var(--font-head); font-weight: 600; font-size: 1.2rem; line-height: 1; }
.brand__sub { display: block; font-family: var(--font-body); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: .18rem; }

.nav__links { display: flex; align-items: center; gap: var(--sp-1); list-style: none; padding: 0; }
.nav__links a:not(.btn) {
  display: block; padding: .55rem .8rem; border-radius: 8px; text-decoration: none;
  color: var(--ink); font-weight: 500; font-size: var(--step--1);
}
.nav__links a:not(.btn):hover { background: var(--primary-050); color: var(--primary-700); }
.nav__links a[aria-current="page"]:not(.btn) { color: var(--primary-700); background: var(--primary-050); font-weight: 600; }
.nav__cta { margin-left: var(--sp-2); }

.nav__toggle {
  display: none; align-items: center; gap: .5rem; background: none; border: 2px solid var(--line);
  border-radius: 10px; padding: .5rem .8rem; font: 600 var(--step--1) var(--font-body); color: var(--ink); cursor: pointer;
}
.nav__toggle svg { width: 22px; height: 22px; }

@media (max-width: 60rem) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: fixed; inset: 4.5rem 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: var(--sp-3); box-shadow: var(--shadow-md);
    max-height: calc(100dvh - 4.5rem); overflow: auto;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .85rem .8rem; font-size: var(--step-0); border-radius: 10px; }
  .nav__cta { margin: var(--sp-2) 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: clip; background: var(--primary); color: #f2f0e9; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .32; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,58,48,.55), rgba(22,58,48,.88));
}
.hero__inner { position: relative; z-index: 2; padding-block: clamp(var(--sp-8), 12vw, calc(var(--sp-9) + 2rem)); max-width: 40ch; }
.hero h1 { color: #fff; font-size: var(--step-4); }
.hero__sub { font-size: var(--step-1); color: #e7e3d7; margin-top: var(--sp-4); max-width: 42ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.hero__loc { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--step--1); letter-spacing: .04em; color: #e7c9a3; margin-bottom: var(--sp-4); font-weight: 600; }

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--tasks { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--sp-5); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card--link { display: flex; flex-direction: column; gap: var(--sp-3); text-decoration: none; color: inherit; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.card__icon {
  width: 48px; height: 48px; border-radius: 12px; flex: none;
  background: var(--primary-050); color: var(--primary); display: grid; place-items: center;
}
.card--link:hover .card__icon { background: var(--primary); color: #fff; }
.card__icon svg { width: 26px; height: 26px; }
.card__thumb { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.card--photo:hover .card__thumb { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.card h3 { font-size: var(--step-1); }
.card__meta { font-size: var(--step--1); color: var(--muted); }
.card__more { margin-top: auto; color: var(--accent-700); font-weight: 600; font-size: var(--step--1); display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.card__more svg { width: 1.15em; height: 1.15em; flex: none; }
.card--link:hover .card__more { gap: .6rem; }

/* News cards */
.newscard { overflow: clip; padding: 0; display: flex; flex-direction: column; }
.newscard__img { aspect-ratio: 16/10; background: var(--surface-alt); }
.newscard__img img { width: 100%; height: 100%; object-fit: cover; }
.newscard__body { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.newscard time { font-size: var(--step--1); color: var(--accent-700); font-weight: 600; letter-spacing: .02em; }
.newscard h3 { font-size: var(--step-1); }
.newscard p { color: var(--muted); font-size: var(--step--1); }
.newscard a.stretched::after { content: ""; position: absolute; inset: 0; }
.newscard { position: relative; }

/* Document / PDF list */
.doclist { list-style: none; padding: 0; display: grid; gap: var(--sp-2); }
.doclist a {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); font-weight: 500;
}
.doclist a:hover { border-color: var(--primary); background: var(--primary-050); }
.doclist .doc__ico { flex: none; width: 40px; height: 40px; border-radius: 8px; background: var(--accent-050); color: var(--accent-700); display: grid; place-items: center; font-size: .7rem; font-weight: 700; }
.doclist .doc__type { margin-left: auto; font-size: .7rem; color: var(--muted); border: 1px solid var(--line); padding: .15rem .5rem; border-radius: 999px; }

/* Info / contact blocks */
.infogrid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.info-item { display: flex; gap: var(--sp-3); }
.info-item .card__icon { width: 44px; height: 44px; }
.info-item h3 { font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; }
.info-item p, .info-item a { color: var(--muted); font-size: var(--step--1); }
.info-item a { color: var(--primary); }

/* Events list */
.events { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
.event { display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.event__date { flex: none; width: 4.2rem; text-align: center; background: var(--primary-050); border-radius: 10px; padding: .5rem 0; }
.event__date .d { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--primary); }
.event__date .m { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: .25rem; }
.event h3 { font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; }
.event p { font-size: var(--step--1); color: var(--muted); }

/* Prose (article/legal pages) */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { margin-top: var(--sp-7); font-size: var(--step-2); }
.prose h3 { margin-top: var(--sp-5); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .35rem; }
.prose a { color: var(--accent-700); }

/* Gallery */
.gallery { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.gallery img { border-radius: var(--radius-sm); aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--line); }

/* Callout / alert */
.callout {
  border-left: 4px solid var(--accent); background: var(--accent-050);
  padding: var(--sp-4) var(--sp-5); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout--info { border-color: var(--info); background: #eef4f7; }

/* Breadcrumb */
.crumb { padding-block: var(--sp-4); font-size: var(--step--1); }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; color: var(--muted); }
.crumb li::after { content: "›"; margin-left: .5rem; color: var(--line); }
.crumb li:last-child::after { content: ""; }
.crumb a { color: var(--primary); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* Page header band */
.page-head { background: var(--surface-alt); border-bottom: 1px solid var(--line); padding-block: var(--sp-7); }
.page-head h1 { font-size: var(--step-3); }
.page-head p { color: var(--muted); max-width: 55ch; margin-top: var(--sp-3); font-size: var(--step-1); }

/* Forms */
.field { display: grid; gap: .4rem; margin-bottom: var(--sp-4); }
.field label { font-weight: 600; font-size: var(--step--1); }
.field .req { color: var(--error); }
.field input, .field textarea, .field select {
  font: inherit; font-size: var(--step-0); padding: .75rem .85rem; border: 2px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); outline: 3px solid var(--accent); outline-offset: 1px; }
.field .hint { font-size: var(--step--1); color: var(--muted); }
.form-note { font-size: var(--step--1); color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-700); color: #d9e2dc; padding-block: var(--sp-8) var(--sp-6); margin-top: var(--sp-8); }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 48rem) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-family: var(--font-body); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #a9c0b4; margin-bottom: var(--sp-3); }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: .4rem; }
.footer-brand .brand__name { color: #fff; }
.footer-brand p { color: #b9c9c0; font-size: var(--step--1); margin-top: var(--sp-3); max-width: 34ch; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: var(--sp-6); padding-top: var(--sp-4); display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); justify-content: space-between; font-size: var(--step--1); color: #a9c0b4; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: var(--sp-4); }

/* ---------- FAQ (details/summary) ---------- */
.faq { max-width: 60rem; }
.faq__item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-top: var(--sp-3); overflow: hidden; }
.faq__item summary {
  cursor: pointer; padding: var(--sp-4) var(--sp-5); font-weight: 600; font-size: var(--step-0);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-family: var(--font-head); font-size: 1.6rem; color: var(--accent-700); line-height: 1; transition: transform .15s ease; }
.faq__item[open] summary::after { content: "–"; }
.faq__item summary:hover { color: var(--primary-700); }
.faq__answer { padding: 0 var(--sp-5) var(--sp-5); color: var(--muted); }
.faq__answer a { color: var(--accent-700); }
.faq__answer > * + * { margin-top: var(--sp-3); }

/* ---------- "En bref" facts list ---------- */
.facts { list-style: none; padding: var(--sp-2) 0 0; margin: 0; display: grid; gap: 0; }
.facts li { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.facts li:last-child { border-bottom: 0; }
.facts dt, .facts .k { color: var(--muted); }
.facts .v { font-weight: 600; text-align: right; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flow-tight > * + * { margin-top: var(--sp-2); }
