/* ============================================================
   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(--text-muted);
  margin-bottom: .75rem;
}

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

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

.sidebar-subnav li.active a,
.sidebar-subnav li a:hover {
  color: var(--primary);
  border-left: 2px solid var(--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(--border);
    border-radius: 2rem;
    font-size: .8rem;
  }
  .sidebar-subnav li.active a,
  .sidebar-subnav li a:hover {
    border-color: var(--primary);
    background: var(--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(--border);
}

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

.cta-text {
  color: var(--text-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(--text-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(--text-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);
}

/* Section indépendante (case du builder) : vraie <section> à part, sur toute la largeur de
   l'écran, contenu aligné sur le conteneur du site. Fond et style : classe CSS de la section
   (champ du builder) ou .section-standalone--{type} dans le thème. */
.section-standalone {
    margin-inline: calc(50% - 50vw);
}
.section-standalone__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
}
/* Le bloc n'a plus besoin de son filet de séparation : c'est une section à part */
.section-standalone .page-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
/* Titre : celui d'une section (comme les sections de l'accueil, .section-header h2,
   layout.css), plus celui d'un bloc. Dans un thème, styler les deux ensemble :
   .section-header h2, .section-standalone :is(.section-embed-title, .cta-headline) */
.section-standalone :is(.section-embed-title, .cta-headline) {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
}

/* Surtitre d'une page (champ « Surtitre ») : petit texte au-dessus du titre */
.page-kicker {
    margin: 0 0 .5rem;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.page-banner__kicker { color: #fff; opacity: .85; }

/* Mots mis en valeur dans un titre (« Nos *services* », App\Core\TitleMarkup) :
   style par défaut discret, à redéfinir dans le thème (couleur, italique, police…) */
.title-accent { color: var(--primary); }
.page-banner__title .title-accent { color: inherit; font-style: italic; }

/* ── Sections : surtitre, blocs côte à côte (1.65) ─────────────────────────── */
.section-kicker {
    margin: 0 0 .5rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
/* Classes communes à toutes les sections du builder (core et modules), à styler
   dans un thème : .section-kicker (surtitre), .section-title (titre h2),
   .section-intro (texte d'introduction). Chaque gabarit garde aussi sa classe propre
   (.cta-headline, .cta-text…). */
.section-intro { color: var(--text-muted); }
.section-text { margin: 0 0 var(--space-md); }

/* Blocs « moitié » voisins : une grille de deux colonnes dès 768 px */
.section-cols {
    display: grid;
    gap: var(--space-xl);
    margin-top: 4rem;
}
@media (min-width: 768px) {
    .section-cols { grid-template-columns: 1fr 1fr; align-items: start; }
}
.section-cols .page-section { margin-top: 0; padding-top: 0; border-top: 0; }

/* ── Formulaire de contact : champs sur deux colonnes ─────────────────────── */
.contact-fields { display: grid; gap: 0 var(--space-md); }
@media (min-width: 640px) {
    .contact-fields { grid-template-columns: 1fr 1fr; }
    .contact-fields__wide { grid-column: 1 / -1; }
}
.cta-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); }
.cta-form-note { margin: 0; max-width: 28rem; font-size: .8rem; color: var(--text-muted); }

/* ── Section « Coordonnées » ──────────────────────────────────────────────── */
.contact-list { margin: var(--space-md) 0 0; }
.contact-list__item { padding: var(--space-sm) 0; border-top: 1px solid var(--border); }
.contact-list__item:last-child { border-bottom: 1px solid var(--border); }
.contact-list dt {
    margin-bottom: .25rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.contact-list dd { margin: 0; }
.contact-list dd a { color: inherit; text-decoration: none; }
.contact-list dd a:hover { text-decoration: underline; }
.contact-list__socials { display: flex; gap: var(--space-sm); font-size: 1.25rem; }

/* ── Section « Carte » ────────────────────────────────────────────────────── */
.contact-map__head { display: grid; gap: var(--space-md); margin-bottom: var(--space-lg); }
@media (min-width: 768px) {
    .contact-map__head { grid-template-columns: 1.4fr 1fr; align-items: end; }
}
.contact-map__text { margin: 0; color: var(--text-muted); }
.contact-map__frame { position: relative; aspect-ratio: 16 / 7; min-height: 280px; background: var(--bg-alt); }
.contact-map__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.contact-map__consent {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-sm);
    margin: 0; padding: var(--space-md); text-align: center; color: var(--text-muted);
}
.contact-map__frame iframe[src] + .contact-map__consent { display: none; }
.contact-map__links { display: flex; flex-wrap: wrap; gap: var(--space-lg); margin: var(--space-md) 0 0; font-weight: 600; }
.contact-map__links a { color: inherit; text-decoration: none; }
.contact-map__links a:hover { text-decoration: underline; }

/* ── Section « Sous-pages » : cartes (1.72) ──────────────────────────────── */
/* Les cartes ont les classes des cartes des modules (card-item, card-img, card-title,
   card-excerpt, card-actions, components.css) : seules la grille et la colonne sont ici. */
.subpage-cards {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}
.subpage-card .card-body { display: flex; flex-direction: column; flex: 1; gap: var(--space-sm); }
.subpage-card .card-title { margin: 0; }
.subpage-card .card-excerpt p { margin: 0 0 .5rem; }
.subpage-card .card-excerpt > :last-child { margin-bottom: 0; }
