/*
Theme Name: CCDSM
Theme URI: https://ccdsm.fr
Author: Collectif Citoyen de Sainte-Marie
Description: Thème éditorial du site associatif CCDSM, centré sur les actualités et la participation locale.
Version: 0.2.0
Text Domain: ccdsm
*/

:root {
  --blue: #1f5f86;
  --blue-dark: #173e59;
  --blue-soft: #e8f0f4;
  --green: #607d46;
  --green-soft: #edf1e7;
  --yellow: #e6b91f;
  --yellow-soft: #fbf2c8;
  --ink: #202a31;
  --muted: #66727a;
  --paper: #f3f0e8;
  --cream: #fbfaf6;
  --white: #fff;
  --line: #ddd9ce;
  --max: 1180px;
  --shadow: 0 18px 55px rgba(24, 43, 55, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1rem; }
main { overflow: hidden; }
.site-shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 250, 246, .96);
  border-bottom: 1px solid rgba(221, 217, 206, .9);
  backdrop-filter: blur(14px);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: max-content;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--white);
  font-weight: 900;
  font-size: .88rem;
  letter-spacing: -.12em;
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  right: 0;
  bottom: 1px;
  border-radius: 50%;
  background: var(--yellow);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.08; }
.brand-copy strong { font-size: 1.04rem; letter-spacing: .08em; }
.brand-copy span { margin-top: .28rem; color: var(--muted); font-size: .72rem; }
.header-actions { display: flex; align-items: center; gap: 1.25rem; }
.nav-list { display: flex; align-items: center; gap: 1.35rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: #35424b; text-decoration: none; font-size: .91rem; font-weight: 700; }
.nav-list a:hover, .nav-list .current-menu-item > a { color: var(--blue); }
.header-cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--yellow);
  color: #2d2b20;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 850;
}

.eyebrow {
  color: var(--green);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.home-hero {
  position: relative;
  padding: clamp(3.25rem, 6vw, 5.4rem) 0 3.25rem;
  background:
    radial-gradient(circle at 92% 12%, rgba(230,185,31,.18), transparent 20rem),
    radial-gradient(circle at 4% 95%, rgba(96,125,70,.09), transparent 23rem),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}
.home-hero h1,
.section-heading h2,
.association-section h2,
.join-panel h2,
.archive-heading h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.035em;
}
.home-hero h1 {
  max-width: 10.5ch;
  margin: .7rem 0 1.2rem;
  font-size: clamp(2.8rem, 4.6vw, 4.55rem);
  line-height: .98;
}
.home-hero__lead {
  max-width: 610px;
  margin-bottom: 0;
  color: #48555d;
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.15rem; margin-top: 1.65rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: .72rem 1.15rem;
  border-radius: 999px;
  background: var(--blue-dark);
  color: var(--white);
  text-decoration: none;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23,62,89,.16); }
.text-link { display: inline-flex; align-items: center; gap: .42rem; color: var(--blue); font-weight: 850; text-decoration: none; }
.text-link span { transition: transform .18s ease; }
.text-link:hover span { transform: translateX(3px); }
.slogan-line {
  max-width: 520px;
  margin: 2rem 0 0;
  padding-top: 1.05rem;
  border-top: 1px solid #cbc7bb;
  color: #5b635f;
  font-size: .92rem;
  font-weight: 750;
}

.featured-story,
.welcome-panel {
  overflow: hidden;
  border: 1px solid #e2ded3;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.featured-story { background: var(--white); }
.featured-story__visual {
  display: block;
  aspect-ratio: 16 / 8.6;
  overflow: hidden;
  background: linear-gradient(145deg, var(--blue-dark), var(--blue));
  color: var(--white);
  text-decoration: none;
}
.featured-story__visual img { width: 100%; height: 100%; object-fit: cover; }
.featured-story__visual.is-placeholder { display: grid; place-items: center; }
.featured-story__visual.is-placeholder span { font-family: Georgia, serif; font-size: 2rem; }
.featured-story__body { padding: 1.45rem 1.55rem 1.65rem; }
.featured-story h2 { margin: .3rem 0 .65rem; font-family: Georgia, serif; font-size: clamp(1.55rem, 2.4vw, 2.2rem); font-weight: 500; line-height: 1.08; }
.featured-story h2 a, .story-link { text-decoration: none; }
.featured-story p { color: #58636b; }
.story-link { color: var(--blue); font-weight: 850; }
.meta { color: var(--muted); font-size: .8rem; }

.welcome-panel {
  position: relative;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--blue-dark);
  color: var(--white);
}
.welcome-panel::before {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -75px;
  top: -78px;
  border: 28px solid rgba(230,185,31,.92);
  border-radius: 50%;
}
.welcome-panel::after {
  content: "";
  position: absolute;
  width: 95px;
  height: 95px;
  right: 38px;
  bottom: -50px;
  border-radius: 50%;
  background: rgba(96,125,70,.9);
}
.welcome-panel > * { position: relative; z-index: 1; }
.welcome-panel__label { color: var(--yellow); font-size: .72rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.welcome-panel h2 { max-width: 13ch; margin: .65rem 0 .95rem; font-family: Georgia, serif; font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1.06; font-weight: 500; }
.welcome-panel p { max-width: 48ch; color: #dce7ed; }
.welcome-panel__points { display: grid; gap: .5rem; margin-top: .8rem; }
.welcome-panel__points span { padding-top: .52rem; border-top: 1px solid rgba(255,255,255,.15); font-size: .9rem; font-weight: 750; }

.quick-values { background: var(--cream); border-bottom: 1px solid var(--line); }
.quick-values__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.quick-values__grid > div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .85rem;
  padding: 1.35rem 1.4rem;
  border-right: 1px solid var(--line);
}
.quick-values__grid > div:first-child { padding-left: 0; }
.quick-values__grid > div:last-child { border-right: 0; }
.quick-values__grid span { grid-row: 1 / 3; color: var(--yellow); font-weight: 900; }
.quick-values__grid strong { font-size: .96rem; }
.quick-values__grid p { margin: .05rem 0 0; color: var(--muted); font-size: .85rem; }

.section { padding: clamp(3.8rem, 6vw, 5.8rem) 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1.8rem; }
.section-heading h2 { margin: .32rem 0 0; font-size: clamp(2.15rem, 3.8vw, 3.55rem); line-height: 1; }
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; }
.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 12px 34px rgba(24,43,55,.08); }
.post-card__image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--blue-soft); text-decoration: none; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.post-card:hover .post-card__image img { transform: scale(1.025); }
.post-card__image.is-placeholder { display: grid; place-items: center; background: linear-gradient(145deg, var(--blue-soft), var(--green-soft)); color: var(--blue-dark); font-weight: 900; letter-spacing: .15em; }
.post-card__body { padding: 1.15rem 1.2rem 1.35rem; }
.post-card h3 { margin: .38rem 0 .55rem; font-family: Georgia, serif; font-size: 1.36rem; font-weight: 500; line-height: 1.14; }
.post-card h3 a { text-decoration: none; }
.post-card p { color: #59656c; font-size: .94rem; }
.empty-journal {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  padding: 2rem 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.empty-journal__number { color: var(--yellow); font-weight: 900; }
.empty-journal h3 { max-width: 10ch; margin: .25rem 0 0; font-family: Georgia, serif; font-size: clamp(2rem, 3.8vw, 3.3rem); line-height: 1.02; font-weight: 500; }
.empty-journal p { max-width: 610px; color: var(--muted); font-size: 1.04rem; }

.association-section { background: var(--paper); border-block: 1px solid var(--line); }
.association-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.association-section h2 { max-width: 13ch; margin: .35rem 0 0; font-size: clamp(2.2rem, 4vw, 3.8rem); line-height: 1.02; }
.association-copy { max-width: 650px; color: #4f5c64; font-size: 1.04rem; }
.button-secondary { margin-top: .55rem; background: var(--green); }

.join-section { padding-top: 3rem; }
.join-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 3.4rem);
  border-radius: 24px;
  background: var(--blue-dark);
  color: var(--white);
}
.eyebrow-light { color: #d7deab; }
.join-panel h2 { max-width: 18ch; margin: .35rem 0 0; font-size: clamp(2rem, 3.6vw, 3.35rem); line-height: 1.03; }
.button-light { flex: 0 0 auto; background: var(--yellow); color: #2e2b20; }

.archive-header { padding: 3.5rem 0 2rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.archive-heading h1 { margin: .4rem 0 0; font-size: clamp(2.7rem, 4.6vw, 4.4rem); line-height: 1; }
.archive-intro { max-width: 650px; margin-top: 1rem; color: var(--muted); }
.pagination-wrap { margin-top: 2rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.nav-links a, .nav-links span { padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.nav-links .current { background: var(--blue-dark); color: #fff; border-color: var(--blue-dark); }

.entry-shell { width: min(calc(100% - 40px), 820px); margin-inline: auto; padding: clamp(3rem, 6vw, 5rem) 0; }
.entry-shell h1 { margin: 0 0 1rem; font-family: Georgia, serif; font-size: clamp(2.5rem, 5vw, 4.6rem); line-height: 1; font-weight: 500; letter-spacing: -.035em; }
.entry-meta { margin-bottom: 2rem; color: var(--muted); }
.entry-content { font-size: 1.05rem; }
.entry-content h2, .entry-content h3 { margin-top: 2.2rem; font-family: Georgia, serif; line-height: 1.12; }
.entry-content a { color: var(--blue); }
.entry-content img { border-radius: 16px; }

.site-footer { margin-top: 3rem; padding: 3.2rem 0 2rem; background: #132f43; color: #dfe8ed; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; }
.footer-brand { margin-bottom: .5rem; color: #fff; font-family: Georgia, serif; font-size: 1.35rem; }
.footer-tagline { color: #bfcdd5; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: .55rem 1.1rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem 1rem; list-style: none; margin: 0; padding: 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.13); color: #9eb0bb; font-size: .82rem; }

@media (max-width: 980px) {
  .header-inner { min-height: auto; padding: .85rem 0; align-items: flex-start; }
  .header-actions { align-items: flex-end; flex-direction: column-reverse; gap: .65rem; }
  .nav-list { gap: .8rem; }
  .home-hero__grid { grid-template-columns: 1fr 1fr; gap: 2.4rem; }
  .home-hero h1 { font-size: clamp(2.7rem, 6vw, 4rem); }
}

@media (max-width: 760px) {
  .site-shell { width: min(calc(100% - 28px), var(--max)); }
  .site-header { position: static; }
  .header-inner { flex-direction: column; gap: .9rem; }
  .header-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .main-nav { overflow-x: auto; margin-inline: -14px; padding-inline: 14px; }
  .nav-list { width: max-content; gap: 1rem; }
  .header-cta { align-self: flex-start; }
  .home-hero { padding-top: 2.7rem; }
  .home-hero__grid, .association-grid, .empty-journal { grid-template-columns: 1fr; }
  .home-hero h1 { max-width: 12ch; }
  .welcome-panel { min-height: 310px; }
  .quick-values__grid { grid-template-columns: 1fr; }
  .quick-values__grid > div, .quick-values__grid > div:first-child { padding: 1rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-values__grid > div:last-child { border-bottom: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .posts-grid { grid-template-columns: 1fr; }
  .join-panel { align-items: flex-start; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-links, .site-footer ul { justify-content: flex-start; }
  .footer-bottom { flex-direction: column; }
}

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