/* ============================================================
   Section : Pages CMS (contenu statique, sous-pages, contact)
   ============================================================ */

/* ── Page générique ───────────────────────────────────────── */
.cms-page { }
.cms-page__title  { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: var(--space-lg); }
.cms-page__body   { font-size: 1.05rem; line-height: 1.8; max-width: 800px; }
.cms-page__image  { margin-bottom: var(--space-xl); border-radius: var(--radius); overflow: hidden; }

/* ── Sous-pages ───────────────────────────────────────────── */
.subpages {
    margin-top: 2.5rem;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

.subpages h2 {
    font-size: 1.1rem;
    margin-bottom: .75rem;
}

.subpages ul { list-style: none; padding: 0; }
.subpages li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.subpages a  { color: var(--primary); text-decoration: none; }

/* ── Contact ──────────────────────────────────────────────── */
.contact-page { max-width: 640px; margin: 0 auto; }
.contact-page h1 { font-size: 1.75rem; margin-bottom: var(--space-lg); }

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    margin-top: var(--space-xl);
}

.contact-block { margin-bottom: 1.25rem; }
.contact-block strong { display: block; margin-bottom: .25rem; }

.social-links {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

/* ── Auth (login/register) ────────────────────────────────── */
.auth-page { max-width: 440px; margin: 0 auto; }
.auth-page h1 { font-size: 1.75rem; margin-bottom: var(--space-lg); }

/* ── Carte embarquée ──────────────────────────────────────── */
.map-embed {
    height: 300px;
    border-radius: var(--radius);
    margin-top: var(--space-lg);
    border: 0;
    width: 100%;
}

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

/* ── Layout deux colonnes (with-sidebar) ───────────────────────────────────── */

.page-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.page-sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-subnav-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-muted);
  margin-bottom: .75rem;
}

.sidebar-subnav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--color-border);
}

.sidebar-subnav li a {
  display: block;
  padding: .4rem .75rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}

.sidebar-subnav li.active a,
.sidebar-subnav li a:hover {
  color: var(--color-primary);
  border-left: 2px solid var(--color-primary);
  margin-left: -2px;
}

@media (max-width: 768px) {
  .page-with-sidebar {
    grid-template-columns: 1fr;
  }
  .page-sidebar {
    position: static;
    order: -1;
  }
  .sidebar-subnav ul {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    border-left: none;
  }
  .sidebar-subnav li a {
    padding: .3rem .7rem;
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    font-size: .8rem;
  }
  .sidebar-subnav li.active a,
  .sidebar-subnav li a:hover {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    margin-left: 0;
  }
}

/* ── Sections embarquées (CTA, portfolio embed…) ────────────────────────────── */

.page-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
}

.cta-headline {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .75rem;
}

.cta-text {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.cta-form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .cta-form-row { grid-template-columns: 1fr; }
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-embed-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.section-embed-more {
  text-align: center;
  margin-top: 2rem;
}

.cta-success,
.cta-error {
  padding: 1rem 1.25rem;
  border-radius: var(--radius, 4px);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.cta-success {
  background: color-mix(in srgb, green 10%, transparent);
  border: 1px solid color-mix(in srgb, green 30%, transparent);
  color: #1a7a1a;
}

.cta-error {
  background: color-mix(in srgb, red 10%, transparent);
  border: 1px solid color-mix(in srgb, red 30%, transparent);
  color: #9a1a1a;
}

@media (prefers-color-scheme: dark) {
  .cta-success { color: #6fda6f; }
  .cta-error   { color: #da6f6f; }
}
:root[data-theme="dark"] .cta-success { color: #6fda6f; }
:root[data-theme="dark"] .cta-error   { color: #da6f6f; }
:root[data-theme="light"] .cta-success { color: #1a7a1a; }
:root[data-theme="light"] .cta-error   { color: #9a1a1a; }

.section-error {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-page {
  text-align: center;
  max-width: 480px;
}

.error-code {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--color-muted, #888);
  opacity: .25;
  margin-bottom: .25rem;
}

.error-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.error-text {
  color: var(--color-muted, #888);
  margin-bottom: 2rem;
}

/* ── Images de la page (1.42) ─────────────────────────────── */

/* Bandeau : pleine largeur de l'écran, titre de la page posé dessus */
.page-banner {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(220px, 38vh, 440px);
    margin-inline: calc(50% - 50vw);   /* sort du conteneur centré */
    margin-top: calc(-1 * var(--space-2xl)); /* collé sous l'en-tête (annule le haut de .site-main) */
    margin-bottom: var(--space-xl);
    overflow: hidden;
    background: var(--bg-alt);
}
.page-banner__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page-banner::after {                   /* voile pour que le titre reste lisible */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 65%);
}
.page-banner__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--max-w);            /* aligné sur .container */
    margin: 0 auto;
    padding: var(--space-xl) 1.25rem;
}
.page-banner__title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.75rem, 5vw, 3rem);
}

/* Illustration à gauche / à droite (côte à côte dès 768 px) ; titre au-dessus des deux,
   ou dans la colonne du texte (positions *-inline, cf. front/partials/page-body.twig) */
.page-media { display: grid; gap: var(--space-xl); align-items: start; }
.page-media__figure { margin: 0; }
.page-media__figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.page-media__text > :first-child { margin-top: 0; }

@media (min-width: 768px) {
    .page-media--left  { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
    .page-media--right { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
    .page-media--right .page-media__figure { order: 2; }
}

/* Illustration en fond de tout le bloc, titre compris */
.page-media--background {
    position: relative;
    display: block;
    padding: var(--space-2xl) var(--space-lg);
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.page-media--bleed {                    /* pleine largeur de l'écran (page seule, onepage) */
    margin-inline: calc(50% - 50vw);
    padding: 4rem 0;
    border-radius: 0;
}
.page-media--background .page-media__figure { position: absolute; inset: 0; }
.page-media--background .page-media__figure img { height: 100%; object-fit: cover; border-radius: 0; }
.page-media__panel { position: relative; }
.page-media--bleed .page-media__panel { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.page-media__box {                      /* voile clair : le texte reste lisible sur la photo */
    max-width: 42rem;
    padding: var(--space-lg);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
}
.page-media__box > :first-child { margin-top: 0; }

/* Section « Contenu d'une page » avec image en fond : le fond couvre toute la section
   (sa marge, son espace intérieur et son filet de séparation sont annulés) */
.section-page-content--bg { margin-top: 0; padding-top: 0; border-top: 0; }

/* Lien « Lire la suite » (section « Contenu d'une page » en affichage chapô) */
.page-more { margin: var(--space-md) 0 0; }

/* Diaporama sur un accueil de type page : pleine largeur, collé sous l'en-tête (comme le bandeau) */
.home-slider-bleed {
    margin-inline: calc(50% - 50vw);
    margin-top: calc(-1 * var(--space-2xl));
    margin-bottom: var(--space-xl);
}
