/* ============================================
   CPE Gamin Gamine - style.css
   ============================================ */

/* --- Variables --- */
:root {
  --bg: #FFFFFF;
  --bg-tinted: #EEF3FA;
  --bg-cream: #FFFAEB;
  --text: #1A1A2E;
  --rouge: #D9342B;
  --rouge-soft: #FCEEEE;
  --bleu: #2B4D8C;
  --bleu-soft: #E7EEF8;
  --jaune: #F4C430;
  --jaune-soft: #FFF4D1;
  --gris: #6B6B7B;
  --ligne: #E1E5EE;

  --font-display: "Fraunces", Georgia, serif;
  --font-brand: "Caveat", "Fraunces", cursive;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --container: 1100px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-y: clamp(2rem, 5vw, 3.5rem);

  --radius: 10px;
  --shadow: 0 1px 3px rgba(26, 26, 46, 0.06), 0 4px 14px rgba(26, 26, 46, 0.06);
  --shadow-card: 0 2px 8px rgba(26, 26, 46, 0.05), 0 12px 32px rgba(26, 26, 46, 0.05);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bleu); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--rouge); }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.25rem, 5vw, 3rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.1rem); margin-bottom: 0.4em; }
h3 { font-size: 1.125rem; font-weight: 600; }

p { margin: 0 0 0.9em; }
ul { margin: 0 0 0.9em; padding-left: 1.25rem; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container--narrow { max-width: 720px; }

.section { padding-block: var(--section-y); }
.section--tinted { background: var(--bg-tinted); }
.section--cream { background: var(--bg-cream); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- Top stripe: rappel des panneaux de façade --- */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--rouge) 0 33.33%,
    var(--bleu)  33.33% 66.66%,
    var(--jaune) 66.66% 100%);
  z-index: 200;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  padding: 0.75rem 1rem; background: var(--text); color: var(--bg);
  z-index: 100; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* --- Header --- */
.site-header {
  position: sticky; top: 4px; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
body.scrolled .site-header {
  border-color: var(--ligne);
  box-shadow: var(--shadow);
}
.site-header__inner {
  display: flex; align-items: baseline; justify-content: space-between;
  min-height: 60px;
}

/* --- Brand wordmark: handwriting style --- */
.brand {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: var(--rouge);
}
.brand__mark {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--rouge);
  letter-spacing: 0.005em;
}

.primary-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 1.5rem;
}
.primary-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  border-bottom-color: var(--rouge);
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none; border: 0; padding: 0.5rem;
  cursor: pointer;
  width: 44px; height: 44px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text); margin: 5px auto;
  transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: fixed; inset: 64px 0 0 0;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    padding: 2rem var(--gutter);
  }
  .primary-nav[data-open="true"] { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; gap: 1.5rem; }
  .primary-nav a { font-size: 1.25rem; }
  body.menu-open { overflow: hidden; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .brand__mark { font-size: 1.6rem; }
}

/* --- Hero --- */
.hero { padding-block: clamp(1.25rem, 3.5vw, 2.25rem) clamp(2rem, 4.5vw, 3rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
  align-items: center;
}
.hero__copy h1 { margin-top: 0; }
.hero__lead {
  font-size: 1.075rem; color: var(--gris);
  margin-bottom: 1.1rem;
}
.hero__media {
  margin: 0;
  position: relative;
}
.hero__media::before {
  content: "";
  position: absolute;
  inset: -10px -10px 14px 18px;
  background: var(--jaune);
  border-radius: var(--radius);
  z-index: 0;
  opacity: 0.45;
}
.hero__media img {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  z-index: 1;
}

/* Pills */
.pills {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  list-style: none; padding: 0; margin: 0 0 1.25rem;
}
.pill {
  font-size: 0.83rem; font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--ligne);
}
.pill--rouge { color: var(--rouge); background: var(--rouge-soft); border-color: rgba(217, 52, 43, 0.25); }
.pill--bleu  { color: var(--bleu);  background: var(--bleu-soft);  border-color: rgba(43, 77, 140, 0.25); }
.pill--jaune { color: #7d5d05;       background: var(--jaune-soft); border-color: rgba(244, 196, 48, 0.5); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  font-weight: 500; font-size: 0.98rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.1s, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--rouge); color: white; }
.btn--primary:hover { background: #b82a23; color: white; }

@media (max-width: 768px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .hero__media::before { inset: -8px -8px 12px 12px; }
}

/* --- Mission --- */
.lead { font-size: 1.075rem; color: var(--text); max-width: 62ch; margin-bottom: 0.75em; }

/* --- Valeurs --- */
.values-title { margin-top: 1.5rem; font-family: var(--font-display); font-size: 1.35rem; }
.values {
  list-style: none; padding: 0; margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1.5rem;
}
.value {
  padding: 0.85rem 0 0.25rem;
  border-top: 3px solid var(--jaune);
}
.value h4 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.value:nth-child(2) { border-top-color: var(--rouge); }
.value:nth-child(3) { border-top-color: var(--bleu); }
.value:nth-child(4) { border-top-color: var(--jaune); }
.value p { margin: 0; color: var(--gris); font-size: 0.93rem; }

@media (max-width: 640px) {
  .values { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* --- Permits table --- */
.permits {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.permits thead {
  background: var(--bleu);
  color: white;
}
.permits th,
.permits td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.95rem;
}
.permits th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.permits tbody tr + tr { border-top: 1px solid var(--ligne); }
.permits td:last-child { color: var(--gris); white-space: nowrap; font-size: 0.9rem; }

/* --- Governance callout --- */
.governance {
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  background: white;
  border: 1px solid var(--ligne);
  border-left: 4px solid var(--bleu);
  border-radius: var(--radius);
}
.governance h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--bleu);
}
.governance p { margin: 0; }

@media (max-width: 640px) {
  .permits, .permits thead, .permits tbody, .permits tr, .permits th, .permits td { display: block; }
  .permits thead { display: none; }
  .permits tr { padding: 0.9rem 1rem; border-top: 1px solid var(--ligne); }
  .permits tbody tr:first-child { border-top: 0; }
  .permits td { padding: 0.15rem 0; white-space: normal; }
  .permits td:last-child { font-size: 0.85rem; }
}

/* --- Timeline --- */
.timeline {
  list-style: none; padding: 0; margin: 1.25rem 0 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0.65rem; left: 0; right: 0;
  height: 2px; background: var(--bleu-soft);
  z-index: 0;
}
.timeline__item {
  position: relative;
  padding-top: 1.85rem;
  z-index: 1;
}
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 1.1rem; height: 1.1rem;
  background: white; border: 3px solid var(--bleu);
  border-radius: 50%;
}
.timeline__item--now::before { background: var(--rouge); border-color: var(--rouge); }
.timeline__item time {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--bleu);
  display: block;
  margin-bottom: 0.25rem;
}
.timeline__item--now time { color: var(--rouge); }
.timeline__item p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--gris);
  line-height: 1.45;
}

@media (max-width: 768px) {
  .timeline {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .timeline::before {
    top: 0; bottom: 0; left: 0.5rem; right: auto;
    width: 2px; height: auto;
  }
  .timeline__item {
    padding-top: 0;
    padding-left: 2rem;
    padding-bottom: 1.25rem;
  }
  .timeline__item::before { top: 0.15rem; }
}

/* --- Services --- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-top: 1.1rem;
}
.service-card {
  background: white;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--rouge);
}
.service-card:nth-child(2) { border-top-color: var(--bleu); }
.service-card h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.service-card__cap {
  color: var(--rouge);
  font-weight: 500;
  font-size: 0.92rem;
  margin: 0 0 0.85rem;
}
.service-card:nth-child(2) .service-card__cap { color: var(--bleu); }
.service-card ul {
  list-style: none; padding: 0;
  margin: 0 0 0.85rem;
}
.service-card ul li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--ligne);
  font-size: 0.93rem;
}
.service-card ul li:last-child { border-bottom: 0; }
.service-card__hours {
  font-size: 0.86rem;
  color: var(--gris);
  margin: 0;
  padding-top: 0.45rem;
  border-top: 2px solid var(--jaune);
  display: inline-block;
}
.services-note {
  margin-top: 1.25rem;
  padding: 0.85rem 1.15rem;
  background: var(--jaune-soft);
  border-radius: var(--radius);
  border: 1px solid rgba(244, 196, 48, 0.4);
  font-size: 0.93rem;
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* --- Direction (3 colonnes) --- */
.direction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-top: 1rem;
}
.direction-card {
  background: white;
  padding: 1.25rem 1.25rem 1.15rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--rouge);
}
.direction-card:nth-child(2) { border-top-color: var(--bleu); }
.direction-card:nth-child(3) { border-top-color: var(--jaune); }
.direction-card__role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gris);
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.direction-card__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.55rem;
}
.direction-card__scope {
  font-size: 0.88rem;
  color: var(--gris);
  margin: 0;
  line-height: 1.45;
}
.direction-note {
  margin-top: 1.25rem;
  font-size: 0.93rem;
  color: var(--gris);
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .direction-grid { grid-template-columns: 1fr; gap: 0.85rem; }
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-top: 1.1rem;
}
.contact-card {
  background: white;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--rouge);
}
.contact-card:nth-child(2) { border-top-color: var(--bleu); }
.contact-card h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--rouge);
}
.contact-card:nth-child(2) h3 { color: var(--bleu); }
.contact-card address {
  font-style: normal;
  margin-bottom: 0.55rem;
}
.contact-card__tel {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0.35rem 0 0.2rem;
}
.contact-card__tel a {
  color: var(--rouge);
  text-decoration: none;
}
.contact-card:nth-child(2) .contact-card__tel a { color: var(--bleu); }
.contact-card__tel a:hover { text-decoration: underline; }
.contact-card__fax {
  font-size: 0.83rem;
  color: var(--gris);
  margin: 0;
}
.contact-hours {
  text-align: center;
  margin-top: 1.1rem;
  color: var(--gris);
  font-size: 0.93rem;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* --- Footer --- */
.site-footer {
  background: var(--text);
  color: var(--bg);
  padding-block: 1.5rem;
  margin-top: 1rem;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer p { margin: 0; font-size: 0.88rem; }
.site-footer__meta {
  color: rgba(255, 255, 255, 0.65);
}
.site-footer a {
  color: var(--bg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
