:root {
  --ink: #18313a;
  --muted: #5b6b70;
  --paper: #fffaf2;
  --white: #ffffff;
  --blue: #0f5e9c;
  --green: #16856a;
  --red: #b64231;
  --yellow: #d99b1f;
  --line: #d7dfdb;
  --shadow: 0 20px 45px rgba(24, 49, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: var(--paper);
  line-height: 1.55;
}

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

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 250, 242, 0.94);
  border-bottom: 1px solid rgba(24, 49, 58, 0.12);
  backdrop-filter: blur(14px);
}

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

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.main-nav a {
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--blue);
}

.hero {
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  padding: clamp(90px, 12vw, 150px) clamp(18px, 6vw, 72px) 56px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(18, 44, 45, 0.82), rgba(18, 44, 45, 0.45), rgba(18, 44, 45, 0.16)),
    url("assets/territoire-xaintrie.png") center / cover;
}

.hero-content {
  width: min(820px, 100%);
}

.kicker {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .kicker {
  color: #f6d27d;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.55rem, 6vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 3.8vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-text {
  max-width: 660px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1.02rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link {
  color: var(--ink);
  background: #f6d27d;
}

.secondary-link {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.54);
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.stat {
  min-height: 116px;
  padding: 24px clamp(18px, 3vw, 36px);
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat strong {
  display: block;
  color: var(--blue);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.section {
  padding: clamp(58px, 8vw, 104px) clamp(18px, 6vw, 72px);
}

.split,
.territory {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(30px, 6vw, 72px);
  align-items: center;
}

.section-copy p,
.contact-section p,
.governance-copy p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.02rem;
}

.caf-panel {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 22px;
  align-items: start;
  padding: clamp(22px, 4vw, 36px);
  color: var(--white);
  background: var(--blue);
  box-shadow: var(--shadow);
}

.caf-panel img,
.partner-highlight img {
  width: 116px;
  background: var(--white);
}

.caf-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.section-heading {
  max-width: 860px;
  margin-bottom: 34px;
}

.section-heading p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.activity-card {
  min-height: 245px;
  padding: 22px;
  background: var(--white);
  border-top: 6px solid var(--green);
  box-shadow: 0 1px 0 rgba(24, 49, 58, 0.08);
}

.activity-card p {
  margin: 0;
  color: var(--muted);
}

.activity-card .activity-location {
  margin-top: 16px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.activity-card .tag {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.accent-blue {
  border-color: var(--blue);
}

.accent-green {
  border-color: var(--green);
}

.accent-red {
  border-color: var(--red);
}

.accent-yellow {
  border-color: var(--yellow);
}

.territory,
.partners {
  background: #eef4f0;
}

.commune-section {
  background: var(--white);
}

.commune-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 1px 0 rgba(24, 49, 58, 0.08);
}

.commune-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.commune-table caption {
  padding: 16px 18px;
  color: var(--blue);
  font-weight: 800;
  text-align: left;
}

.commune-table th,
.commune-table td {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.commune-table thead th {
  color: var(--white);
  background: var(--ink);
}

.commune-table tbody th {
  width: 220px;
  color: var(--blue);
}

.commune-table td {
  color: var(--muted);
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.media-block {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
}

.media-block img {
  width: 100%;
}

.media-block figcaption {
  padding: 12px 16px 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.governance-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}

.governance-copy {
  display: grid;
  gap: 18px;
}

.governance-copy h3 {
  color: var(--blue);
}

.governance-copy p {
  margin: 0;
}

.compact {
  align-self: start;
}

.partner-highlight {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  max-width: 980px;
  margin-bottom: 28px;
  padding: 24px;
  color: var(--white);
  background: var(--green);
}

.partner-highlight p {
  margin: 0;
  font-size: 1.08rem;
}

.partner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.partner-list span {
  padding: 10px 13px;
  color: var(--ink);
  font-weight: 700;
  background: var(--white);
  border: 1px solid var(--line);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(26px, 5vw, 64px);
  align-items: start;
}

address {
  display: grid;
  gap: 8px;
  padding: 26px;
  font-style: normal;
  color: var(--muted);
  background: var(--white);
  border-left: 6px solid var(--red);
}

address strong {
  color: var(--ink);
}

address a {
  color: var(--blue);
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 6vw, 72px);
  color: rgba(255, 255, 255, 0.86);
  background: var(--ink);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 800;
}

@media (max-width: 1040px) {
  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .stat:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 72vh;
    padding-top: 82px;
  }

  .stats-band,
  .split,
  .territory,
  .governance-layout,
  .contact-section,
  .partner-highlight,
  .caf-panel {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .activity-card {
    min-height: auto;
  }

  .site-footer {
    flex-direction: column;
  }
}
