@import "./tokens.css";

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.35rem); }
h4 { font-size: 1rem; font-weight: 600; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Layout container --- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo svg, .site-logo img {
  height: 44px;
  width: auto;
}

/* Nav */
.site-nav { display: flex; align-items: center; gap: 0.25rem; }

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.header-cta {
  display: none;
}

@media (min-width: 640px) {
  .header-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-secondary);
    color: #111;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: opacity 0.2s;
  }
  .header-cta:hover { opacity: 0.88; }
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.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); }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
}

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  flex-direction: column;
  background: var(--color-primary);
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.nav-drawer.is-open { display: flex; }

.nav-drawer a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-drawer a:last-child { border-bottom: none; }

.nav-drawer a[aria-current="page"],
.nav-drawer a:hover { color: var(--color-secondary); }

@media (min-width: 768px) {
  .nav-drawer { display: none !important; }
}

/* --- Hero section --- */
.hero {
  background: linear-gradient(145deg, var(--color-primary) 0%, #095e73 100%);
  color: #fff;
  padding: 4rem 0 3rem;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.hero-content h1 {
  color: #fff;
  margin-bottom: 1.25rem;
}

.hero-content .intro {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.88);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  text-align: center;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); opacity: 0.92; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: none; opacity: 1; }

.btn-primary {
  background: var(--color-secondary);
  color: #111827;
  border-color: var(--color-secondary);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.55);
}

.btn-secondary:hover { border-color: #fff; }

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }

/* --- Sections --- */
section { padding: 3.5rem 0; }

.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

.section-title {
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.section-subtitle {
  font-size: 1rem;
  color: #4b5563;
  margin-bottom: 2.5rem;
  max-width: 640px;
}

/* --- Atouts cards (3-col) --- */
.atouts-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .atouts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .atouts-grid { grid-template-columns: repeat(3, 1fr); }
}

.atout-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.atout-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(13,116,144,0.1);
}

.atout-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.atout-card h3 {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
  font-size: 1.05rem;
}

.atout-card p {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0;
}

/* --- CTA band --- */
.cta-band {
  background: var(--color-secondary);
  padding: 2.5rem 0;
}

.cta-band-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

@media (min-width: 640px) {
  .cta-band-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.cta-band h2 {
  font-size: 1.35rem;
  color: #111827;
}

.cta-band p {
  font-size: 0.95rem;
  color: #374151;
  margin-bottom: 0;
}

/* --- Programs section (home preview) --- */
.programs-preview {
  background: #f9fafb;
}

.programs-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .programs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .programs-grid { grid-template-columns: repeat(3, 1fr); }
}

.program-card {
  background: var(--color-bg);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.program-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.program-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--color-secondary) 20%, transparent);
  color: #92400e;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.65rem;
}

.program-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.program-card p {
  font-size: 0.875rem;
  color: #4b5563;
  flex: 1;
}

/* --- Full program article (programmes page) --- */
.program-article {
  display: grid;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.program-article:last-of-type { border-bottom: none; }

@media (min-width: 768px) {
  .program-article { grid-template-columns: 1fr 1fr; align-items: start; }
}

.program-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.meta-pill {
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
}

.program-article ul {
  margin-top: 0.75rem;
  padding-left: 0;
}

.program-article ul li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.4rem;
}

.program-article ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* --- About page --- */
.about-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .about-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

.about-highlight {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  border-left: 4px solid var(--color-primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-primary);
  font-weight: 600;
}

/* --- Contact page --- */
.contact-grid {
  display: grid;
  gap: 2.5rem;
}

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

.contact-info dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-top: 1.25rem;
}

.contact-info dt:first-child { margin-top: 0; }

.contact-info dd {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-left: 0;
  margin-top: 0.25rem;
}

.contact-info dd a { color: var(--color-primary); text-decoration: underline; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-group label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.form-group textarea { resize: vertical; min-height: 130px; }

.form-rgpd {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.5;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* Map */
.map-wrap {
  margin-top: 2rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.map-wrap iframe {
  width: 100%;
  height: 300px;
  border: none;
  display: block;
}

/* --- Footer --- */
.site-footer {
  background: #0a1929;
  color: rgba(255,255,255,0.75);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand p {
  font-size: 0.875rem;
  margin-top: 0.75rem;
  max-width: 280px;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 0.9rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.45rem; }

.footer-col ul a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}

.footer-col ul a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-phone {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-secondary);
  font-family: var(--font-display);
  display: block;
  margin-top: 0.5rem;
}

/* --- Visual placeholders --- */
.visual-placeholder {
  display: block;
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-aspect="4:3"]  { aspect-ratio: 4 / 3; }
.visual-placeholder[data-aspect="1:1"]  { aspect-ratio: 1 / 1; }
.visual-placeholder[data-aspect="3:4"]  { aspect-ratio: 3 / 4; }
.visual-placeholder[data-aspect="21:9"] { aspect-ratio: 21 / 9; }

.visual-placeholder[data-tone="secondary"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-secondary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-secondary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="accent"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-accent, var(--color-primary)) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)) 60%,
      color-mix(in srgb, var(--color-secondary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="muted"] {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
}

/* --- Accroche bas page --- */
.accroche {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 2.5rem;
}

/* --- Page hero (inner pages) --- */
.page-hero {
  background: linear-gradient(145deg, var(--color-primary) 0%, #095e73 100%);
  color: #fff;
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.page-hero h1 { color: #fff; margin-bottom: 0.75rem; }

.page-hero p {
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1rem;
  justify-content: center;
}

.breadcrumb a { color: rgba(255,255,255,0.75); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { color: rgba(255,255,255,0.4); }

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-secondary);
  color: #111;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* --- Utility --- */
.text-center { text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }

/* --- Phone CTA bar (mobile sticky) --- */
.phone-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--color-secondary);
  padding: 0.75rem 1.25rem;
  justify-content: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

.phone-bar a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #111;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .phone-bar { display: none; }
}

/* Offset bottom for sticky phone bar on mobile */
@media (max-width: 767px) {
  body { padding-bottom: 56px; }
}

/* ============================================
   Motion pass — animations discrètes (WEB-7847)
   Toutes les règles sont conditionnées par
   prefers-reduced-motion: no-preference.
   ============================================ */
@media (prefers-reduced-motion: no-preference) {

  /* --- Hero entrance (page load, staggered) --- */
  .hero .hero-content > h1,
  .hero .hero-content > .intro,
  .hero .hero-actions,
  .hero .visual-placeholder {
    animation: rise-in 720ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero .hero-content > h1        { animation-delay:  60ms; }
  .hero .visual-placeholder       { animation-delay: 140ms; }
  .hero .hero-content > .intro    { animation-delay: 200ms; }
  .hero .hero-actions             { animation-delay: 320ms; }

  @keyframes rise-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* --- Section headers : révélation au scroll (CSS scroll-driven) --- */
  /* Progressive enhancement : sans support, aucun style n'est appliqué,
     les titres restent visibles par défaut. */
  @supports (animation-timeline: view()) {
    .section-label,
    .section-title,
    .section-subtitle,
    .accroche,
    .page-hero h1,
    .page-hero > .container > p {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }

    @keyframes reveal-up {
      from { opacity: 0; transform: translateY(20px); }
      to   { opacity: 1; transform: translateY(0); }
    }
  }

  /* --- Atout cards : icône vivante au survol --- */
  .atout-icon {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
  }
  .atout-card:hover .atout-icon {
    transform: scale(1.12) rotate(-6deg);
  }

  /* --- Program cards : lift + placeholder qui respire au survol --- */
  .program-card {
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
  }
  .program-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(13, 116, 144, 0.14);
  }
  .program-card .visual-placeholder {
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
                filter 0.4s ease;
    will-change: transform;
  }
  .program-card:hover .visual-placeholder {
    transform: scale(1.03);
    filter: saturate(1.12) brightness(1.03);
  }

  /* --- Btn primary : ligne de lumière au survol --- */
  .btn-primary {
    background-image: linear-gradient(
      120deg,
      var(--color-primary) 0%,
      color-mix(in srgb, var(--color-primary) 78%, #fff) 50%,
      var(--color-primary) 100%
    );
    background-size: 220% 100%;
    background-position: 0% 50%;
    transition: background-position 0.55s ease,
                transform 0.15s ease,
                box-shadow 0.2s ease;
  }
  .btn-primary:hover {
    background-position: 100% 50%;
  }

  /* --- CTA band : dégradé qui respire (18s, très lent) --- */
  .cta-band {
    background: linear-gradient(
      120deg,
      var(--color-secondary) 0%,
      color-mix(in srgb, var(--color-secondary) 82%, #fff) 50%,
      var(--color-secondary) 100%
    );
    background-size: 220% 220%;
    animation: cta-drift 22s ease-in-out infinite;
  }
  @keyframes cta-drift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
  }

  /* --- Header CTA téléphone : petit halo au hover --- */
  .header-cta {
    transition: transform 0.2s ease, box-shadow 0.25s ease, background-color 0.2s ease;
  }
  .header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(13, 116, 144, 0.22);
  }

  /* --- Focus visible élégant --- */
  a:focus-visible,
  button:focus-visible,
  .btn:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    transition: outline-offset 0.18s ease;
  }
}

/* Reduced-motion : couper explicitement les animations d'ambiance
   (les hover restent instantanés, sans transition). */
@media (prefers-reduced-motion: reduce) {
  .cta-band { animation: none; background: var(--color-secondary); }
  .hero .hero-content > h1,
  .hero .hero-content > .intro,
  .hero .hero-actions,
  .hero .visual-placeholder { animation: none; }
}
