/*
Theme Name: Élu — Sébastien Cristol
Theme URI:
Author: Sur mesure
Description: Thème WordPress sur mesure, sobre et institutionnel, pour le site personnel d'un élu. Registre factuel, surtout pas commercial. Sans page builder. Spectral + Inter, palette encre/blanc + un seul accent bleu profond.
Version: 1.1.7
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: elu-cristol
*/

/*
  ------------------------------------------------------------------
  Registre institutionnel, sobre et chaleureux. PAS commercial / luxe.
  Palette restreinte : encre/anthracite, blanc, un seul accent bleu profond.
  Pas de rouge (connoté), pas d'or (connoté commerce/luxe).
  ------------------------------------------------------------------
*/

:root {
  --encre: #1c2024;
  --encre-doux: #3b4149;
  --papier: #ffffff;
  --papier-casse: #f6f5f2;
  --trait: #e3e1dc;
  --accent: #1f3a5f;       /* bleu profond — accent du Département */
  --accent-fonce: #142943;
  --ardoise: #4b5563;      /* ardoise — accent de Castelnau (registre opposition) */
  --ardoise-fonce: #374151;

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --largeur-texte: 42rem;
  --largeur-page: 64rem;
  --rythme: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--encre);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--encre);
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-top: calc(var(--rythme) * 2);
}

h3 {
  font-size: 1.25rem;
  margin-top: calc(var(--rythme) * 1.4);
}

p,
ul,
ol {
  margin: 0 0 var(--rythme);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-fonce);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

/* Lien d'évitement clavier */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.contenu {
  width: 100%;
  max-width: var(--largeur-page);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.prose {
  max-width: var(--largeur-texte);
}

.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Boutons */
.bouton {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1.3rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.bouton:hover {
  background: var(--accent-fonce);
  color: #fff;
}

.bouton--secondaire {
  background: transparent;
  color: var(--accent);
}

.bouton--secondaire:hover {
  background: var(--papier-casse);
  color: var(--accent-fonce);
}

.section {
  padding-block: calc(var(--rythme) * 2.5);
}

.section--alt {
  background: var(--papier-casse);
  border-block: 1px solid var(--trait);
}

/* ---------- En-tête ---------- */
.entete {
  border-bottom: 1px solid var(--trait);
  background: var(--papier);
}

.entete__interieur {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.1rem;
}

.entete__identite {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.entete__nom {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--encre);
  line-height: 1.2;
}

.entete__fonctions {
  font-size: 0.82rem;
  color: var(--encre-doux);
  margin-top: 0.15rem;
}

/* Navigation (menu WordPress) */
.nav__liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.nav__liste a {
  display: inline-block;
  padding: 0.4rem 0;
  color: var(--encre-doux);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  border-bottom: 2px solid transparent;
}

.nav__liste a:hover {
  color: var(--accent);
}

.nav__liste .current-menu-item > a,
.nav__liste .current_page_item > a,
.nav__liste .current-menu-parent > a {
  color: var(--encre);
  border-bottom-color: var(--accent);
}

/* ---------- Pied de page ---------- */
.pied {
  margin-top: calc(var(--rythme) * 3);
  border-top: 1px solid var(--trait);
  background: var(--papier-casse);
}

.pied__interieur {
  padding-block: calc(var(--rythme) * 1.5);
}

.pied__mention {
  max-width: var(--largeur-texte);
  color: var(--encre-doux);
  font-size: 0.92rem;
}

.pied__liens {
  list-style: none;
  margin: 0 0 var(--rythme);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
}

.pied__copyright {
  margin: 0;
  font-size: 0.85rem;
  color: var(--encre-doux);
}

/* ---------- Accueil ---------- */
.cap {
  padding-block: calc(var(--rythme) * 3.5);
}

.cap__phrase {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.25;
  font-weight: 600;
  color: var(--encre);
  max-width: 24ch;
  margin: 0 0 calc(var(--rythme) * 1.5);
}

.cap__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

/* ---------- Cartes / liste de dossiers ---------- */
.liste-dossiers {
  list-style: none;
  margin: 0 0 var(--rythme);
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 48rem) {
  .liste-dossiers--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.carte-dossier {
  border-top: 2px solid var(--accent);
  padding-top: 0.9rem;
}

.carte-dossier__meta,
.dossier-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: var(--encre-doux);
}

.carte-dossier__mandat,
.dossier-meta__mandat {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 0.72rem;
}

.carte-dossier__titre {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}

.carte-dossier__titre a {
  text-decoration: none;
}

.carte-dossier__titre a:hover {
  text-decoration: underline;
}

.carte-dossier__resume {
  margin: 0;
  font-size: 0.95rem;
  color: var(--encre-doux);
}

/* Liste détaillée (archive dossiers) */
.dossiers {
  list-style: none;
  margin: calc(var(--rythme) * 1.5) 0 0;
  padding: 0;
}

.dossier {
  padding-block: var(--rythme);
  border-top: 1px solid var(--trait);
  max-width: var(--largeur-texte);
}

.dossier__titre {
  font-size: 1.35rem;
  margin: 0 0 0.3rem;
}

.dossier__titre a {
  text-decoration: none;
}

.dossier__titre a:hover {
  text-decoration: underline;
}

.dossier__resume {
  margin: 0;
  color: var(--encre-doux);
}

/* ---------- Page « Qui je suis » ---------- */
.qui {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 48rem) {
  .qui {
    grid-template-columns: 320px 1fr;
    gap: 3rem;
  }
}

.qui__portrait {
  margin: 0;
}

.qui__portrait img {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--trait);
}

.qui__portrait figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--encre-doux);
}

/* ---------- Mandats ---------- */
.mandat__role {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--rythme);
}

/* ---------- Démarche (listes à puces sobres) ---------- */
.demarche {
  list-style: none;
  margin: 0 0 var(--rythme);
  padding: 0;
}

.demarche li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.9rem;
}

.demarche li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  border-radius: 1px;
}

/* ---------- Dossier : citation + sources ---------- */
.corps blockquote {
  border-left: 3px solid var(--accent);
  margin-inline: 0;
  padding-left: 1rem;
  color: var(--encre-doux);
  font-style: italic;
}

.sources {
  margin-top: calc(var(--rythme) * 2);
  padding: var(--rythme);
  background: var(--papier-casse);
  border: 1px solid var(--trait);
  border-radius: 3px;
}

.sources h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.sources ul {
  margin: 0;
  padding-left: 1.2rem;
}

/* ---------- Formulaire de contact ---------- */
.contact__promesse {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--encre);
}

.contact__email {
  font-size: 1.3rem;
  font-weight: 600;
}

.contact__email--attente {
  color: var(--encre-doux);
  font-weight: 500;
}

.contact__separateur {
  border: 0;
  border-top: 1px solid var(--trait);
  margin-block: calc(var(--rythme) * 2);
}

.formulaire {
  max-width: 34rem;
}

.formulaire__champ {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: var(--rythme);
}

.formulaire__champ label {
  font-weight: 600;
  font-size: 0.95rem;
}

.formulaire input[type='text'],
.formulaire input[type='email'],
.formulaire textarea {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--encre-doux);
  border-radius: 3px;
  background: var(--papier);
}

.formulaire__rgpd label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--encre-doux);
}

.formulaire__rgpd input {
  margin-top: 0.25rem;
}

.message-succes {
  padding: 0.9rem 1.1rem;
  background: #eef3f8;
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--accent-fonce);
  margin-bottom: var(--rythme);
}

.message-erreur {
  padding: 0.9rem 1.1rem;
  background: var(--papier-casse);
  border: 1px solid var(--encre-doux);
  border-radius: 3px;
  margin-bottom: var(--rythme);
}

/* Liens « page suivante / précédente » génériques */
.fil {
  font-size: 0.92rem;
  margin-bottom: var(--rythme);
}

/* =======================================================================
 *  Accueil — héro + scission en deux mandats
 * ==================================================================== */

/* Héro d'accueil : épuré, accent fin en haut */
.hero {
  padding-block: calc(var(--rythme) * 3) calc(var(--rythme) * 2);
}

.hero__phrase {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.5vw, 2.7rem);
  line-height: 1.22;
  font-weight: 600;
  color: var(--encre);
  max-width: 22ch;
  margin: 0;
}

.hero__sous {
  margin-top: 1rem;
  max-width: 46ch;
  color: var(--encre-doux);
  font-size: 1.05rem;
}

/* Titre de section centré et sobre */
.titre-section {
  text-align: center;
  margin-bottom: 0.4rem;
}

.titre-section__sur {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--encre-doux);
  margin-bottom: 0.4rem;
}

/* La scission : deux panneaux cliquables côte à côte */
.split {
  display: grid;
  gap: 1.5rem;
  margin-top: calc(var(--rythme) * 1.6);
}

@media (min-width: 46rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

/* Chaque mandat = une tuile « hero » : photo de fond centrée (cover),
   voile dégradé, texte superposé. Façon en-tête, jamais une vignette rognée. */
.panneau {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 380px;
  border-radius: 4px;
  overflow: hidden;
  border-top: 4px solid var(--accent);
  background-color: var(--encre);
  background-size: cover;
  background-position: center;
  text-decoration: none;
  color: #fff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.panneau--castelnau {
  border-top-color: var(--ardoise);
}

/* Voile dégradé pour la lisibilité du texte sur la photo */
.panneau__voile {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(16, 20, 25, 0.9) 0%,
    rgba(16, 20, 25, 0.55) 42%,
    rgba(16, 20, 25, 0.12) 100%
  );
}

.panneau__contenu {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 1.6rem;
}

.panneau:hover,
.panneau:focus-visible {
  box-shadow: 0 10px 30px rgba(16, 20, 25, 0.3);
  transform: translateY(-3px);
  color: #fff;
}

.panneau__role {
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 0.28rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.9rem;
}

.panneau--castelnau .panneau__role {
  background: var(--ardoise);
}

.panneau__titre {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: #fff;
}

.panneau__desc {
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 1.1rem;
  font-size: 0.97rem;
}

.panneau__lien {
  font-weight: 600;
  color: #fff;
}

.panneau:hover .panneau__lien {
  text-decoration: underline;
}

/* =======================================================================
 *  Pages de mandat (Département / Castelnau)
 * ==================================================================== */

.mandat-hero {
  border-top: 4px solid var(--accent);
  background: var(--papier-casse);
  border-bottom: 1px solid var(--trait);
  padding-block: calc(var(--rythme) * 2);
}

.mandat-hero--castelnau {
  border-top-color: var(--ardoise);
}

.mandat-hero__role {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 0.3rem 0.65rem;
  border-radius: 2px;
  margin-bottom: 0.9rem;
}

.mandat-hero--castelnau .mandat-hero__role {
  background: var(--ardoise);
}

.mandat-hero h1 {
  margin: 0 0 0.4rem;
}

.mandat-hero__sous {
  color: var(--encre-doux);
  font-size: 1.1rem;
  margin: 0;
}

/* Bannière photo (image mise en avant de la page de mandat) */
.mandat-banniere {
  margin: 0;
}

.mandat-banniere img {
  display: block;
  width: 100%;
  height: clamp(200px, 34vw, 380px);
  object-fit: cover;
  border-bottom: 1px solid var(--trait);
}

/* En-tête « header » de page de mandat : photo + titre superposé */
/* En-tête « hero » de page de mandat : photo de fond centrée (cover),
   voile dégradé, titre superposé. Bloc haut, jamais rogné à la serpe. */
.mandat-entete {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(360px, 56vh, 560px);
  border-top: 4px solid var(--accent);
  background-color: var(--encre);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.mandat-entete--castelnau {
  border-top-color: var(--ardoise);
}

/* Voile dégradé pour rendre le titre lisible sur la photo */
.mandat-entete__voile {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(16, 20, 25, 0.86) 0%,
    rgba(16, 20, 25, 0.4) 45%,
    rgba(16, 20, 25, 0.08) 85%
  );
}

.mandat-entete__contenu {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-block: 1.8rem;
}

.mandat-entete h1 {
  color: #fff;
  margin: 0.3rem 0 0.3rem;
}

.mandat-entete .mandat-hero__sous {
  color: rgba(255, 255, 255, 0.92);
}

.mandat-entete--castelnau .mandat-hero__role {
  background: var(--ardoise);
}

/* Mise en page : contenu + encadré coordonnées */
.mandat-grille {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 52rem) {
  .mandat-grille {
    grid-template-columns: 1fr 20rem;
  }
}

/* Carte (OpenStreetMap) */
.carte {
  margin: 0 0 var(--rythme);
}

.carte__cadre {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--trait);
  border-radius: 4px;
  overflow: hidden;
  background: var(--papier-casse);
}

.carte__cadre iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.carte__legende {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--encre-doux);
}

/* Encadré coordonnées d'élu */
.coordonnees {
  background: var(--papier-casse);
  border: 1px solid var(--trait);
  border-left: 4px solid var(--accent);
  border-radius: 3px;
  padding: 1.3rem 1.4rem;
}

.coordonnees--castelnau {
  border-left-color: var(--ardoise);
}

.coordonnees h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.coordonnees p {
  margin-bottom: 0.6rem;
  font-size: 0.96rem;
}

.coordonnees__libelle {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--encre-doux);
  font-weight: 600;
}
