/* ==========================================================================
   Saulzet — Site officiel de la commune
   Identité tirée du blason : le saule, la gerbe de blé, le sinople, l'eau.
   ========================================================================== */

:root {
  --paper: #f4f5eb;
  --card: #fdfdf9;
  --ink: #22301f;
  --ink-soft: #4c5a47;
  --saule: #2f4a33;
  --feuille: #6b8f5e;
  --ble: #c99a2c;
  --ble-fonce: #a67d1d;
  --ancoutay: #7ba3a8;
  --ligne: #d9dcc8;

  --font-display: "Young Serif", "Georgia", serif;
  --font-body: "Albert Sans", "Segoe UI", sans-serif;

  --w-max: 1120px;
  --radius-feuille: 130px 22px 130px 22px;
  --shadow: 0 10px 30px -18px rgba(34, 48, 31, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--saule); text-decoration-color: var(--ble); text-underline-offset: 3px; }
a:hover { color: var(--ble-fonce); }

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

.wrap {
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; }

h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.22rem; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--feuille);
  margin-bottom: 0.9rem;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 12px;
  flex: none;
  background: var(--feuille);
  clip-path: ellipse(50% 32% at 50% 50%);
  border-radius: 100% 0 100% 0;
}

.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.topbar {
  background: var(--saule);
  color: #e9eedd;
  font-size: 0.85rem;
  padding: 0.4rem 0;
}

.topbar .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar a { color: #f2e8c8; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--ink);
}

.brand img { height: 52px; width: auto; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
}

.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  list-style: none;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { border-bottom-color: var(--ble); color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--saule); font-weight: 700; }

.nav-cta {
  background: var(--saule);
  color: #fff !important;
  padding: 0.55rem 1.15rem !important;
  border-radius: 999px;
  border: none !important;
}

.nav-cta:hover { background: var(--ble-fonce); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--ligne);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 1.2rem;
  color: var(--ink);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Le fil de l'Ancoutay — signature
   -------------------------------------------------------------------------- */

.fil {
  display: block;
  margin: clamp(2rem, 5vw, 3.5rem) auto;
  width: min(420px, 70%);
  height: 26px;
  color: var(--ancoutay);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 .accent { color: var(--saule); }

.hero .lead { margin-top: 1.2rem; }

.hero-facts {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.8rem;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.hero-facts strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
}

.hero-actions { margin-top: 2rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--saule);
}

.btn-primary { background: var(--saule); color: #fff; }
.btn-primary:hover { background: var(--ble-fonce); border-color: var(--ble-fonce); color: #fff; }
.btn-ghost { color: var(--saule); background: transparent; }
.btn-ghost:hover { background: var(--saule); color: #fff; }

.hero-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.hero-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.hero-mosaic .tall {
  grid-row: span 2;
  border-radius: var(--radius-feuille);
  min-height: 340px;
}

.hero-mosaic .small-1 { border-radius: 22px 22px 22px 90px; min-height: 160px; }
.hero-mosaic .small-2 { border-radius: 22px 90px 22px 22px; min-height: 160px; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.2rem;
  flex-wrap: wrap;
}

.section-head .more { font-weight: 600; white-space: nowrap; }

.section-alt { background: var(--card); border-block: 1px solid var(--ligne); }

.section-dark {
  background: var(--saule);
  color: #eef1e2;
}

.section-dark h2 { color: #fff; }
.section-dark .eyebrow { color: var(--ble); }
.section-dark .eyebrow::before { background: var(--ble); }
.section-dark a { color: #f2e8c8; }

/* --------------------------------------------------------------------------
   Actualités
   -------------------------------------------------------------------------- */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.news-card {
  background: var(--card);
  border: 1px solid var(--ligne);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.news-date {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ble-fonce);
}

.news-card h3 a { text-decoration: none; color: var(--ink); }
.news-card h3 a:hover { color: var(--saule); text-decoration: underline; text-decoration-color: var(--ble); }

.news-card p { color: var(--ink-soft); font-size: 0.97rem; flex-grow: 1; }

.news-card .tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--feuille) 16%, transparent);
  color: var(--saule);
}

/* --------------------------------------------------------------------------
   Accès rapides
   -------------------------------------------------------------------------- */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.quick-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 1.4rem 1.3rem;
  text-decoration: none;
  color: #eef1e2;
  transition: background 0.25s ease, transform 0.25s ease;
}

.quick-card:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-3px); color: #fff; }

.quick-card .pictos {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.8rem;
  display: block;
}

.quick-card h3 { color: #fff; margin-bottom: 0.35rem; font-size: 1.08rem; }
.quick-card p { font-size: 0.9rem; color: #cfd8bd; }

/* --------------------------------------------------------------------------
   Découvrir — patrimoine
   -------------------------------------------------------------------------- */

.discover-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.discover-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.discover-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.discover-card:hover img { transform: scale(1.05); }

.discover-card .overlay {
  position: relative;
  width: 100%;
  padding: 2.2rem 1.4rem 1.3rem;
  background: linear-gradient(to top, rgba(24, 34, 21, 0.88), rgba(24, 34, 21, 0));
  color: #fff;
}

.discover-card h3 { color: #fff; margin-bottom: 0.2rem; }
.discover-card p { font-size: 0.9rem; color: #dbe3ca; }

.discover-card.wide { grid-column: span 2; }

/* --------------------------------------------------------------------------
   Infos pratiques
   -------------------------------------------------------------------------- */

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--ligne);
  border-radius: 18px;
  padding: 1.8rem;
}

.info-card + .info-card { margin-top: 1.2rem; }

.hours { list-style: none; margin-top: 0.8rem; }

.hours li {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--ligne);
}

.hours li:last-child { border-bottom: none; }
.hours .day { font-weight: 600; }
.hours .closed { color: var(--ink-soft); }

.contact-lines { list-style: none; margin-top: 0.8rem; display: grid; gap: 0.55rem; }
.contact-lines li { display: flex; gap: 0.7rem; align-items: baseline; }
.contact-lines .k { font-weight: 700; color: var(--saule); min-width: 5.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* --------------------------------------------------------------------------
   Pages intérieures
   -------------------------------------------------------------------------- */

.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--ligne);
  background:
    radial-gradient(ellipse 900px 320px at 85% -10%, color-mix(in srgb, var(--feuille) 14%, transparent), transparent),
    var(--paper);
}

.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-hero .lead { margin-top: 0.9rem; }

.prose { max-width: 68ch; }
.prose p + p { margin-top: 1rem; }
.prose ul { margin: 1rem 0 1rem 1.2rem; }
.prose li + li { margin-top: 0.35rem; }

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(1.8rem, 4vw, 3.5rem);
  align-items: center;
}

.split.reverse { grid-template-columns: 0.8fr 1.2fr; }

.split figure img {
  border-radius: var(--radius-feuille);
  box-shadow: var(--shadow);
  width: 100%;
  object-fit: cover;
}

.split figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.person {
  background: var(--card);
  border: 1px solid var(--ligne);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
}

.person .role {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ble-fonce);
}

.person h3 { margin-top: 0.3rem; }
.person p { color: var(--ink-soft); font-size: 0.93rem; margin-top: 0.3rem; }

.assoc-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.assoc-list li {
  background: var(--card);
  border: 1px solid var(--ligne);
  border-left: 4px solid var(--feuille);
  border-radius: 12px;
  padding: 1rem 1.3rem;
}

.assoc-list strong { display: block; }
.assoc-list span { color: var(--ink-soft); font-size: 0.92rem; }

.callout {
  border-radius: 18px;
  border: 1.5px solid var(--ble);
  background: color-mix(in srgb, var(--ble) 9%, var(--card));
  padding: 1.6rem 1.8rem;
  margin: 2rem 0;
}

.callout h3 { color: var(--ble-fonce); margin-bottom: 0.4rem; }

/* --------------------------------------------------------------------------
   Contenu éditorial (articles et rubriques importés)
   -------------------------------------------------------------------------- */

.article-body { max-width: 76ch; overflow-wrap: break-word; }
.article-body img { border-radius: 14px; margin: 1.2rem 0; height: auto; box-shadow: var(--shadow); }
.article-body h2, .article-body h3, .article-body h4 { margin: 2rem 0 0.7rem; }
.article-body ul, .article-body ol { margin: 1rem 0 1rem 1.3rem; }
.article-body p { margin: 0.8rem 0; }
.article-body figure { margin: 1.4rem 0; }
.article-body figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.4rem; }
.article-body blockquote { border-left: 4px solid var(--ble); padding-left: 1.2rem; color: var(--ink-soft); margin: 1.4rem 0; }
.article-body iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; margin: 1.4rem 0; }
.article-body hr { border: none; border-top: 1px solid var(--ligne); margin: 2rem 0; }

.article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.4rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

.article-body td, .article-body th {
  border: 1px solid var(--ligne);
  padding: 0.5rem 0.8rem;
  vertical-align: top;
}

.article-body th { background: color-mix(in srgb, var(--feuille) 10%, var(--card)); text-align: left; }

.page-hero .eyebrow a { color: inherit; text-decoration: none; }
.page-hero .eyebrow a:hover { text-decoration: underline; }

.news-year { padding: 1.6rem 0; }

.year-mark {
  font-family: var(--font-display);
  color: var(--feuille);
  border-bottom: 1px solid var(--ligne);
  padding-bottom: 0.4rem;
  margin-bottom: 1.6rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: #c6cdb6;
  padding: 3rem 0 1.5rem;
  margin-top: clamp(2rem, 5vw, 4rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.site-footer h3 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.9rem;
}

.site-footer ul { list-style: none; display: grid; gap: 0.45rem; }
.site-footer a { color: #c6cdb6; text-decoration: none; }
.site-footer a:hover { color: var(--ble); text-decoration: underline; }

.footer-brand { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.footer-brand img { height: 56px; }
.footer-brand .brand-name { color: #fff; }

.footer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.2rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .news-card, .quick-card, .discover-card img { transition: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .news-grid, .discover-grid, .people-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .discover-card.wide { grid-column: span 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split, .split.reverse { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .news-grid, .discover-grid, .people-grid, .quick-grid, .assoc-list, .info-grid { grid-template-columns: 1fr; }
  .discover-card.wide { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--ligne);
    box-shadow: var(--shadow);
  }

  .site-nav.open { display: block; }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
  }

  .site-nav li { border-bottom: 1px solid var(--ligne); }
  .site-nav li:last-child { border-bottom: none; padding-top: 0.8rem; }
  .site-nav a { display: block; padding: 0.8rem 0; }
  .nav-cta { text-align: center; }
}
