/* ==========================================================================
   layout.css
   Structure globale, grilles, sections, responsive
   ========================================================================== */

/* -----------------------------
   1) Base globale
   ----------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--lh-normal);
  color: var(--c-ink);
  background: var(--c-bg);
  font-family: var(--font-body);
  color: var(--c-text);
  background-color: #ffffff; /* fond principal clair */
}
.section {
  background: transparent;
}

.section--surface,
.section:nth-of-type(even) {
  background: #ffffff; /* blanc pur uniquement sur certaines sections */
}

/* Feature flags
   On s'appuie sur l'attribut [hidden] (géré par JS) pour masquer/afficher.
   Cela évite les conflits entre pages et reste compatible file://.
*/
[data-feature][hidden] {
  display: none !important;
}


/* Accessibilité */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
  background: var(--c-white);
  padding: var(--space-2) var(--space-3);
  z-index: var(--z-header);
  box-shadow: var(--shadow-md);
}

/* -----------------------------
   2) Conteneur
   ----------------------------- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* -----------------------------
   3) Header & navigation
   ----------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: var(--border-1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: var(--space-4);
}

.brand {
  text-decoration: none;
  color: var(--c-ink);
  font-family: var(--font-title);
  font-weight: var(--w-bold);
}

.brand-name {
  display: block;
  font-size: var(--text-lg);
  line-height: var(--lh-tight);
}

.brand-year {
  font-size: var(--text-sm);
  color: var(--c-muted);
}

.site-nav {
  display: none;
}

.nav-list {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list a {
  text-decoration: none;
  color: var(--c-ink);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
}

.nav-toggle {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: var(--text-sm);
  line-height: 1;
  font-weight: var(--w-medium);
}

.nav-toggle:focus-visible{
  outline: 3px solid rgba(225, 0, 122, 0.22);
  outline-offset: 2px;
}

/* Menu mobile */
.mobile-menu {
  border-top: var(--border-1);
  background: var(--c-white);
}

.mobile-nav-list {
  list-style: none;
  padding: var(--space-4);
  margin: 0;
}

.mobile-nav-list li + li {
  margin-top: var(--space-3);
}

.mobile-nav-list a {
  text-decoration: none;
  color: var(--c-ink);
  font-weight: var(--w-medium);
}

/* Desktop nav */
@media (min-width: 900px) {
  .site-nav {
    display: block;
  }
  .nav-toggle,
  .mobile-menu {
    display: none;
  }
}

/* -----------------------------
   4) Sections (rythme vertical)
   ----------------------------- */

.section {
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

/* Confort de lecture : un peu plus d'air entre le bloc "Nous rencontrer" et le bloc suivant */
#agenda.section{
  padding-bottom: var(--space-4);
}

/* Home : le bloc "Pourquoi je suis candidat ?" doit rester compact */
#pourquoi.section{
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.section-header {
  max-width: 720px;
  margin-bottom: var(--space-5);
}

.section-title {
  font-family: var(--font-title);
  font-size: var(--text-3xl);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-3);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--c-muted);
  margin: 0;
}

/* Variantes de fond */
.section.alt {
  background: var(--section-alt-bg);
}

/* -----------------------------
   5) Hero
   ----------------------------- */

.hero {
  padding-top: var(--space-8);
  padding-bottom: var(--space-10);
}

.hero-inner {
  display: grid;
  gap: var(--space-6);
}

.hero-content {
  max-width: 560px;
}

.hero-kicker {
  font-size: var(--text-sm);
  color: var(--c-muted);
  margin-bottom: var(--space-2);
}

.hero-title {
  font-family: var(--font-title);
  font-size: var(--text-4xl);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-4);
}

.hero-slogan {
  color: var(--c-rose);
  font-weight: var(--w-semibold);
}

.hero-lead {
  font-size: var(--text-lg);
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

/* Hero avec vidéo : ne pas contraindre le parent (sinon risque de tronquage en paysage) */
.hero-media--video{
  aspect-ratio: auto;
  overflow: visible;
  border-radius: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}


/* Desktop hero */
@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

/* -----------------------------
   6) Vidéo
   ----------------------------- */

.video-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

.video-poster {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  border: 0;
  background: #000;
  color: #fff;
}

.video-actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

/* -----------------------------
   7) Ambitions / carrousel
   ----------------------------- */

.ambitions {
  background: var(--section-ambitions-bg);
}

.ambitions-carousel {
  position: relative;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.carousel-track {
  display: flex;
  gap: var(--space-7);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-4);
}

.slide {
  min-width: 100%;
  scroll-snap-align: start;
  background: var(--c-white);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-md);
}

.slide-header {
  max-width: 720px;
  margin-bottom: var(--space-6);
}

.slide-title {
  font-family: var(--font-title);
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-2);
}

.slide-tagline {
  color: var(--c-muted);
  margin-bottom: var(--space-3);
}

.cards-grid {
  display: grid;
  gap: var(--space-5);
}

/* Desktop grid */
@media (min-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* -----------------------------
   8) Quartiers
   ----------------------------- */

.quartiers-layout {
  display: grid;
  gap: var(--space-7);
}

.quartiers-map {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  position: relative;
}

.quartiers-list {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

@media (min-width: 900px) {
  .quartiers-layout {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* -----------------------------
   9) Agir ensemble
   ----------------------------- */

.actions-grid {
  display: grid;
  gap: var(--space-6);
}

.action-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

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

/* -----------------------------
   10) Footer
   ----------------------------- */

.site-footer {
  background: var(--c-surface-2);
  color: var(--c-text);
  padding: var(--space-4) 0;
}

.footer-inner {
  display: grid;
  gap: var(--space-6);
}

.footer-links{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap: 12px;
  flex-wrap:wrap;
}

.footer-links a {
  color: var(--c-text);
  text-decoration: none;
  margin-right: 0;
  font-size: var(--text-sm);
}

.footer-sep{
  opacity: .65;
  line-height: 1;
}

.footer-mobilise{
  margin-top: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: .95rem;
}

.footer-logos {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}
/* -----------------------------
   System pages (Legal / Contact / Soutenir)
   ----------------------------- */
.system-page .system-hero{
  background: #f6f6f6;
  padding: var(--space-6) 0 var(--space-6);
}
.system-page .system-hero .system-title{
  font-family: var(--font-title);
  font-size: var(--text-3xl);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-2);
}
.system-page .system-hero .system-subtitle{
  margin: 0;
  color: var(--c-muted);
  max-width: 72ch;
}
.system-page .system-hero .system-meta{
  margin: var(--space-2) 0 0;
  color: var(--c-muted);
  font-size: var(--text-sm);
  max-width: 72ch;
}
.system-page .system-content{
  padding: var(--space-8) 0;
}
.system-page .system-measure{
  max-width: 760px;
}
.system-page h2{
  margin-top: var(--space-8);
  padding-left: 12px;
  border-left: 3px solid var(--c-rose);
}
.system-page .info-box{
  background: #fafafa;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: var(--space-5) 0;
}

/* Offset anchor scrolling to account for sticky header */
.section[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}


/* Variante home : hero plus humain (pile centrée) */
.hero-inner--stacked{
  justify-items: start;
  text-align: left;
}
.hero-inner--stacked .hero-content{
  max-width: 760px;
}
.hero-inner--stacked .hero-actions{
  justify-content: flex-start;
}
.hero-inner--stacked .hero-media--video{
  width: 100%;
  max-width: 80%;
  margin: 0 auto;
  padding: 0.75rem;
  background: var(--c-bg);
  border-radius: var(--radius-lg);
}
.hero-inner--stacked .video-frame--hero{
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
}

@media (max-width: 900px){
  .hero-inner--stacked .hero-media--video{max-width: 100%; padding: 0; background: transparent;}
}


/* Home: bloc Pourquoi je suis candidat */
.why-card{
  background: var(--rose-light);
  border: 2px solid var(--magenta-web);
}
.why-card__inner{
  display:flex;
  gap: 1rem;
  align-items: center;
}
.why-card__avatar{
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}
.why-card__content{
  text-align: left;
}
@media (max-width: 700px){
  .why-card__inner{flex-direction: column; text-align:center;}
  .why-card__content{text-align:center;}
}
