:root {
  --ink: #21332e;
  --muted: #5f6f68;
  --line: #e2ded0;
  --paper: #fffaf0;
  --soft: #fff4d7;
  --mint: #cfeec5;
  --leaf: #2f965a;
  --leaf-dark: #176a3e;
  --rose: #de4665;
  --sun: #f5c54b;
  --blue: #2d87bd;
  --violet: #7f61c9;
  --orange: #f28b3c;
  --cyan: #2fa6a0;
  --section-color: var(--leaf);
  --section-soft: #e9f7df;
  --white: #ffffff;
  --shadow: 0 18px 46px rgba(37, 48, 43, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(245,197,75,.22), rgba(255,250,240,0) 320px),
    linear-gradient(135deg, rgba(222,70,101,.11), rgba(47,166,160,.09) 48%, rgba(47,150,90,.1)),
    var(--paper);
}

body[data-section="accueil"] { --section-color: var(--leaf); --section-soft: #e7f5db; }
body[data-section="actualites"] { --section-color: var(--sun); --section-soft: #fff5cf; }
body[data-section="activite"] { --section-color: var(--orange); --section-soft: #fff0dd; }
body[data-section="enfance"] { --section-color: var(--orange); --section-soft: #fff0dd; }
body[data-section="parentalite"] { --section-color: var(--rose); --section-soft: #ffe8ed; }
body[data-section="formation"] { --section-color: var(--blue); --section-soft: #e3f2fb; }
body[data-section="numerique"] { --section-color: var(--violet); --section-soft: #eee8ff; }
body[data-section="solidarite"] { --section-color: var(--cyan); --section-soft: #e2f7f3; }
body[data-section="environnement"] { --section-color: var(--leaf); --section-soft: #e7f5db; }
body[data-section="sante"] { --section-color: var(--cyan); --section-soft: #e2f7f3; }
body[data-section="citoyennete"] { --section-color: var(--violet); --section-soft: #eee8ff; }
body[data-section="calendrier"] { --section-color: var(--blue); --section-soft: #e3f2fb; }
body[data-section="contact"] { --section-color: var(--leaf-dark); --section-soft: #edf4e7; }

button, input { font: inherit; }

button { cursor: pointer; }

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 52px);
  border-bottom: 1px solid rgba(36, 48, 43, .12);
  background: rgba(255, 250, 240, .95);
  backdrop-filter: blur(14px);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--leaf), var(--sun), var(--rose), var(--blue), var(--violet));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  text-decoration: none;
}

.brand img {
  width: 58px;
  height: 46px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 1.05rem;
  color: var(--leaf-dark);
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: none;
}

.site-nav button,
.section-menu button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 700;
  line-height: 1.15;
}

.site-nav .top-nav-item {
  min-height: 42px;
  padding-inline: 15px;
  font-size: .98rem;
}

.site-nav .top-nav-item.is-active {
  color: var(--leaf-dark);
  border-color: rgba(47, 150, 90, .3);
  background: #eef8ec;
}

.pole-icon {
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #fff;
  background: var(--pole-color, var(--section-color));
  box-shadow: 0 5px 12px rgba(36, 48, 43, .18);
}

.pole-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.pole-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pole-accueil { --pole-color: var(--leaf); --pole-soft: #e7f5db; }
.pole-actualites { --pole-color: var(--sun); --pole-soft: #fff5cf; }
.pole-activite { --pole-color: var(--orange); --pole-soft: #fff0dd; }
.pole-enfance { --pole-color: var(--orange); --pole-soft: #fff0dd; }
.pole-parentalite { --pole-color: var(--rose); --pole-soft: #ffe8ed; }
.pole-formation { --pole-color: var(--blue); --pole-soft: #e3f2fb; }
.pole-numerique { --pole-color: var(--violet); --pole-soft: #eee8ff; }
.pole-solidarite { --pole-color: var(--cyan); --pole-soft: #e2f7f3; }
.pole-environnement { --pole-color: var(--leaf); --pole-soft: #e7f5db; }
.pole-sante { --pole-color: var(--cyan); --pole-soft: #e2f7f3; }
.pole-citoyennete { --pole-color: var(--violet); --pole-soft: #eee8ff; }
.pole-calendrier { --pole-color: var(--blue); --pole-soft: #e3f2fb; }
.pole-contact { --pole-color: var(--leaf-dark); --pole-soft: #edf4e7; }

.pole-button .pole-icon {
  color: #fff;
  background: var(--pole-color, var(--section-color));
}

.site-nav button:hover,
.site-nav button.is-active,
.section-menu button:hover,
.section-menu button.is-active {
  color: #17231e;
  border-color: color-mix(in srgb, var(--section-color) 34%, transparent);
  background: color-mix(in srgb, var(--section-soft) 76%, white);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: clamp(520px, 72vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--white);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(25,37,32,.82), rgba(47,106,62,.5) 42%, rgba(45,135,189,.18)),
    linear-gradient(0deg, rgba(25,37,32,.68), rgba(245,197,75,.1) 45%);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-content {
  position: relative;
  width: min(760px, calc(100% - 32px));
  margin: 0 clamp(16px, 6vw, 86px) clamp(42px, 10vh, 94px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--leaf-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero .eyebrow { color: #bde8c1; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(3.2rem, 7vw, 6.8rem);
  line-height: .92;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 650px;
  color: rgba(255,255,255,.92);
  font-size: clamp(1.08rem, 2.1vw, 1.45rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  border-radius: 6px;
  padding: 12px 17px;
  font-weight: 750;
}

.primary-action {
  border: 1px solid var(--sun);
  background: var(--sun);
  color: #2a220f;
  box-shadow: 0 8px 20px rgba(245, 197, 75, .25);
}

.secondary-action {
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(47, 135, 189, .3);
  color: var(--white);
}

.quick-strip {
  width: min(1180px, calc(100% - 32px));
  margin: -28px auto 34px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(36,48,43,.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: linear-gradient(90deg, var(--leaf), var(--orange), var(--rose), var(--blue));
}

.quick-strip button {
  min-height: 116px;
  border: 0;
  padding: 18px;
  text-align: left;
  background: var(--white);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.quick-strip .quick-pole-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 22px;
}

.quick-strip .quick-pole-card .pole-icon {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.quick-strip .quick-pole-card .pole-icon svg {
  width: 25px;
  height: 25px;
}

.quick-copy {
  display: grid;
  gap: 5px;
}

.quick-strip button:hover {
  background: color-mix(in srgb, var(--tile-soft, var(--soft)) 78%, white);
}

.quick-strip button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--tile-color, var(--leaf));
}

.quick-strip button:nth-child(1) { --tile-color: var(--orange); --tile-soft: #fff0dd; }
.quick-strip button:nth-child(2) { --tile-color: var(--blue); --tile-soft: #e3f2fb; }
.quick-strip button:nth-child(3) { --tile-color: var(--rose); --tile-soft: #ffe8ed; }
.quick-strip button:nth-child(4) { --tile-color: var(--cyan); --tile-soft: #e2f7f3; }

.quick-strip strong,
.quick-strip span {
  display: block;
}

.quick-strip strong {
  margin-bottom: 7px;
  font-size: 1rem;
  color: color-mix(in srgb, var(--tile-color, var(--leaf)) 74%, #17231e);
}

.quick-strip span {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.35;
}

.layout-band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 18px 0 56px;
}

.section-menu {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 22px rgba(37,48,43,.06);
}

.section-menu p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-menu div {
  display: grid;
  gap: 8px;
}

.section-menu button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  min-height: 50px;
  background: var(--white);
  border-color: rgba(36, 48, 43, .08);
}

.site-nav .pole-icon {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
}

.site-nav .pole-icon svg {
  width: 18px;
  height: 18px;
}

.panel {
  display: grid;
  gap: 18px;
}

.section-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: stretch;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid color-mix(in srgb, var(--section-color) 22%, var(--line));
  border-top: 9px solid var(--section-color);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--section-soft) 76%, white), var(--white) 42%),
    var(--white);
  box-shadow: 0 8px 22px rgba(37,48,43,.08);
}

.section-accueil { --section-color: var(--leaf); --section-soft: #e7f5db; }
.section-actualites { --section-color: var(--sun); --section-soft: #fff5cf; }
.section-activite { --section-color: var(--orange); --section-soft: #fff0dd; }
.section-enfance { --section-color: var(--orange); --section-soft: #fff0dd; }
.section-parentalite { --section-color: var(--rose); --section-soft: #ffe8ed; }
.section-formation { --section-color: var(--blue); --section-soft: #e3f2fb; }
.section-numerique { --section-color: var(--violet); --section-soft: #eee8ff; }
.section-solidarite { --section-color: var(--cyan); --section-soft: #e2f7f3; }
.section-environnement { --section-color: var(--leaf); --section-soft: #e7f5db; }
.section-sante { --section-color: var(--cyan); --section-soft: #e2f7f3; }
.section-citoyennete { --section-color: var(--violet); --section-soft: #eee8ff; }
.section-calendrier { --section-color: var(--blue); --section-soft: #e3f2fb; }
.section-contact { --section-color: var(--leaf-dark); --section-soft: #edf4e7; }

.section-copy h2 {
  margin-bottom: 14px;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1;
  color: color-mix(in srgb, var(--section-color) 58%, var(--ink));
}

.section-copy p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.section-bullets {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.section-bullets li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
}

.section-bullets li::before {
  content: "";
  flex: 0 0 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--section-color);
}

.section-image {
  min-height: 260px;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.focus-box,
.contact-box {
  border: 1px solid color-mix(in srgb, var(--section-color) 25%, var(--line));
  border-radius: 8px;
  padding: 22px;
  background: var(--section-soft);
}

.focus-box h3,
.contact-box h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.focus-box p,
.contact-box p {
  color: var(--muted);
  line-height: 1.55;
}

.cards-grid,
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.article-card {
  display: grid;
  gap: 9px;
  min-height: 178px;
  border: 1px solid color-mix(in srgb, var(--card-color, var(--section-color)) 18%, var(--line));
  border-top: 6px solid var(--card-color, var(--section-color));
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-soft, var(--section-soft)) 34%, white), var(--white) 42%);
  text-align: left;
  overflow: hidden;
}

.article-card:nth-child(6n+1) { --card-color: var(--leaf); --card-soft: #e7f5db; }
.article-card:nth-child(6n+2) { --card-color: var(--orange); --card-soft: #fff0dd; }
.article-card:nth-child(6n+3) { --card-color: var(--rose); --card-soft: #ffe8ed; }
.article-card:nth-child(6n+4) { --card-color: var(--blue); --card-soft: #e3f2fb; }
.article-card:nth-child(6n+5) { --card-color: var(--cyan); --card-soft: #e2f7f3; }
.article-card:nth-child(6n+6) { --card-color: var(--violet); --card-soft: #eee8ff; }

.article-card:hover {
  border-color: color-mix(in srgb, var(--card-color, var(--section-color)) 45%, var(--line));
  box-shadow: 0 8px 24px rgba(37,48,43,.1);
}

.article-card time,
.article-card .tagline {
  color: var(--muted);
  font-size: .82rem;
}

.media-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--card-color, var(--section-color)) 16%, white);
  color: color-mix(in srgb, var(--card-color, var(--section-color)) 60%, var(--ink));
  font-size: .78rem;
  font-weight: 800;
}

.read-more {
  align-self: end;
  color: var(--leaf-dark);
  font-size: .86rem;
  font-weight: 850;
}

.article-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.22;
  color: color-mix(in srgb, var(--card-color, var(--section-color)) 48%, var(--ink));
}

.article-card p {
  color: var(--muted);
  line-height: 1.5;
}

.empty-state {
  border: 1px dashed rgba(97,112,106,.36);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: rgba(255,255,255,.6);
}

.news-band {
  padding: 56px clamp(16px, 4vw, 52px) 70px;
  background:
    linear-gradient(180deg, rgba(245,197,75,.25), rgba(255,250,240,.2)),
    #fff2cf;
  border-top: 1px solid rgba(36,48,43,.08);
}

.section-heading {
  width: min(1180px, 100%);
  margin: 0 auto 20px;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.section-heading p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.news-tools {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}

.news-tools label {
  display: grid;
  gap: 7px;
  max-width: 390px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 750;
}

.news-tools input {
  min-height: 44px;
  border: 1px solid #d5cdb9;
  border-radius: 6px;
  padding: 0 12px;
  background: var(--white);
  color: var(--ink);
}

.news-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(16px, 4vw, 52px);
  background: var(--ink);
  color: var(--white);
}

.footer p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.72);
}

.footer a {
  display: block;
  margin-bottom: 6px;
  color: rgba(255,255,255,.9);
}

.article-dialog {
  width: min(760px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.article-dialog::backdrop {
  background: rgba(21, 28, 25, .58);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

#dialog-content {
  padding: 34px;
}

#dialog-content h2 {
  max-width: 650px;
  margin-right: 42px;
  line-height: 1.05;
}

#dialog-content p {
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-line;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.media-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.media-item img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--line);
}

.media-item span {
  font-size: .86rem;
  font-weight: 800;
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }

  .site-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    display: none;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open { display: grid; }

  .site-nav button { text-align: left; }

  .quick-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .layout-band {
    grid-template-columns: 1fr;
  }

  .section-menu {
    position: static;
  }

  .section-menu div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-hero {
    grid-template-columns: 1fr;
  }

  .cards-grid,
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    padding-inline: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    width: 48px;
  }

  .hero {
    min-height: 590px;
  }

  .hero-media::after {
    background:
      linear-gradient(0deg, rgba(25,37,32,.82), rgba(25,37,32,.34)),
      linear-gradient(90deg, rgba(25,37,32,.62), rgba(25,37,32,.1));
  }

  .hero-content {
    width: calc(100% - 28px);
    margin-inline: 14px;
  }

  .hero-actions {
    display: grid;
  }

  .quick-strip {
    grid-template-columns: 1fr;
    margin-top: 0;
    width: 100%;
    border-radius: 0;
    border-inline: 0;
  }

  .layout-band {
    width: calc(100% - 24px);
    padding-top: 26px;
  }

  .section-menu div,
  .cards-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .section-hero {
    padding: 20px;
  }

  .footer {
    display: grid;
  }
}
