/*
Theme Name: CGT CHU Moderne
Theme URI: https://cgtchumontpellier.syndicatcgt.fr/
Author: CGT CHU Montpellier
Description: Thème moderne et élégant pour le syndicat CGT du CHU de Montpellier. Responsive, accessible, couleur principale rouge CGT (#CC1012).
Version: 1.5.5
Requires at least: 5.9
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cgt-chu-moderne
Tags: blog, news, one-column, two-columns, custom-menu, featured-images, translation-ready
*/

/* =========================================================
   1. Variables & reset
   ========================================================= */
:root {
  --cgt-red: #CC1012;
  --cgt-red-dark: #A50D0F;
  --cgt-red-light: #FBEAEA;
  --cgt-yellow: #F4C430;
  --text: #343434;
  --text-light: #6b6b6b;
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --border: #e6e6e6;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.13);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --container: 1200px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
  /* Empêche les sous-menus hors écran de créer une barre de défilement horizontale.
     `clip` (et non `hidden`) ne casse pas le position: sticky de l'en-tête. */
  overflow-x: clip;
}

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

a { color: var(--cgt-red); text-decoration: none; transition: color .2s ease; }
a:hover, a:focus { color: var(--cgt-red-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.25;
  margin: 0 0 .6em;
  font-weight: 700;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }

:focus-visible {
  outline: 3px solid var(--cgt-red);
  outline-offset: 2px;
}

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: var(--bg); clip: auto !important; clip-path: none;
  color: var(--cgt-red); display: block; font-size: 1rem; font-weight: 700;
  height: auto; left: 5px; top: 5px; line-height: normal; padding: 15px 23px;
  text-decoration: none; width: auto; z-index: 100000; box-shadow: var(--shadow);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   2. Header
   ========================================================= */
.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 1px 0 var(--border);
}

/* La barre logo passe au-dessus du menu pour qu'il glisse derrière au scroll. */
.header-main {
  position: relative;
  z-index: 2;
  background: var(--bg);
}
.main-navigation { position: relative; z-index: 1; }

.header-main .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.site-branding { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-branding .custom-logo { max-height: 62px; width: auto; }

.site-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.site-title a { color: var(--text); text-decoration: none; }
.site-title a:hover { color: var(--cgt-red); }
.site-title .title-accent { color: var(--cgt-red); }

.site-description {
  margin: 2px 0 0;
  font-size: .85rem;
  color: var(--text-light);
  font-weight: 500;
}

/* --- Réseaux sociaux --- */
.header-actions { display: flex; align-items: center; gap: 12px; }

.social-links { display: flex; align-items: center; gap: 10px; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: background .2s, transform .15s, filter .2s;
}
.social-links svg { width: 19px; height: 19px; fill: currentColor; display: block; }

/* Couleurs officielles des marques (appliquées partout) */
.social-links a.social-facebook  { color: #1877F2; }
.social-links a.social-instagram { color: #E4405F; }
.social-links a.social-youtube   { color: #FF0000; }
.social-links a:hover { filter: brightness(1.12); }

/* En-tête (fond blanc) : pastille claire, logo en couleur */
.header-social a { background: var(--bg-soft); }
.header-social a:hover { background: #ececec; transform: translateY(-2px); }

/* Pied de page (fond sombre) : pastille translucide, logo en couleur */
.footer-social { margin-top: 18px; }
.footer-social a { background: rgba(255, 255, 255, .12); }
.footer-social a:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }

/* Version dans le tiroir mobile : masquée en desktop */
.menu-social { display: none; }

/* --- Navigation --- */
.main-navigation { background: var(--cgt-red); border-top: none; }
.main-navigation .container { padding: 0 20px; }

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.main-navigation li { position: relative; }

.menu-admin-note {
  font-size: .8rem;
  color: var(--text-light);
  padding: 8px 0;
  margin: 0;
}
.menu-admin-note a { font-weight: 600; }

/* Éléments injectés par le JS pour le menu mobile : masqués en desktop. */
.menu-close,
.menu-title,
.submenu-toggle { display: none; }

.main-navigation a {
  display: block;
  padding: 14px 16px;
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
  color: #fff;
  background: rgba(0, 0, 0, .12);
  border-bottom-color: var(--cgt-yellow); /* touche de jaune discrète */
  text-decoration: none;
}

/* Sous-menus (desktop) */
.main-navigation ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 1000;
  padding: 6px 0;
  display: block;
}
.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-navigation ul ul a {
  padding: 10px 18px;
  color: var(--text);
  border-bottom: none;
  border-left: 3px solid transparent;
  font-weight: 500;
}
.main-navigation ul ul a:hover,
.main-navigation ul ul .current-menu-item > a {
  color: var(--cgt-red);
  border-left-color: var(--cgt-yellow); /* accent jaune discret */
  background: var(--cgt-red-light);
}
.main-navigation ul ul ul { top: 0; left: 100%; border-radius: var(--radius); }

/* Items proches du bord droit : le sous-menu s'ouvre vers la gauche (classe posée par le JS). */
.main-navigation .submenu-align-right > ul { left: auto; right: 0; }
.main-navigation .submenu-align-right ul ul { left: auto; right: 100%; }

/* Bouton burger */
.menu-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--cgt-red);
  border-radius: 8px;
  color: var(--cgt-red);
  font-weight: 700;
  font-size: .9rem;
  padding: 8px 14px;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.menu-toggle .burger {
  display: inline-block;
  width: 20px; height: 14px;
  position: relative;
}
.menu-toggle .burger span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s, opacity .25s, top .25s;
}
.menu-toggle .burger span:nth-child(1) { top: 0; }
.menu-toggle .burger span:nth-child(2) { top: 6px; }
.menu-toggle .burger span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* =========================================================
   3. Hero (page d'accueil)
   ========================================================= */
.hero {
  padding: clamp(20px, 4vw, 40px) 0 0;
}
/* Bloc bannière : contenu (pas pleine largeur), arrondi, image en remplissage */
.hero-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: clamp(260px, 34vw, 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--cgt-red) 0%, #8f0b0d 100%);
}
/* Image de fond qui remplit (cover) tout le bloc */
.hero-banner .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
/* Voile sombre pour la lisibilité du texte par-dessus l'image */
.hero-banner.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.15) 45%, rgba(0,0,0,.6) 100%);
  z-index: 1;
}
.hero-banner .hero-inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin-bottom: auto;
  margin-top: auto;
}
.hero-banner h1 { color: #fff; margin-bottom: .4em; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.hero-banner p { font-size: 1.1rem; margin: 0; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
/* Bouton centré en bas, par-dessus l'image */
.hero-banner .hero-btn {
  position: relative;
  z-index: 2;
  margin-top: clamp(20px, 4vw, 32px);
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: #fff; color: var(--cgt-red); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(0,0,0,.25); color: var(--cgt-red-dark); }
.btn-outline { border-color: #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: var(--cgt-red); }
.btn-red { background: var(--cgt-red); color: #fff; }
.btn-red:hover { background: var(--cgt-red-dark); color: #fff; }

/* =========================================================
   4. Contenu & grille d'articles
   ========================================================= */
.site-content { padding: clamp(32px, 5vw, 64px) 0; }

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
}
.content-layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.content-layout.no-sidebar .single-article { margin-left: auto; margin-right: auto; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.section-heading h2 { margin: 0; }
.section-heading::after {
  content: "";
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, var(--cgt-red) 0%, var(--cgt-yellow) 38%, transparent 75%);
  border-radius: 3px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
}

/* --- Carte article --- */
.post-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}

.post-card-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-thumb .thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cgt-red-light), #fff);
}
.post-card-thumb .thumb-placeholder svg { width: 52px; height: 52px; fill: var(--cgt-red); opacity: .45; }

.post-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }

.post-card .cat-badge,
.cat-badge {
  display: inline-block;
  background: var(--cgt-red-light);
  color: var(--cgt-red);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
  align-self: flex-start;
  text-decoration: none;
}
a.cat-badge:hover { background: var(--cgt-red); color: #fff; text-decoration: none; }

.post-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--cgt-red); text-decoration: none; }

/* Toute la carte cliquable : le lien du titre s'étend sur la carte entière. */
.post-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
/* Le badge catégorie reste cliquable indépendamment (mène à la catégorie). */
.post-card .cat-badge { position: relative; z-index: 2; }

.post-card .post-excerpt {
  color: var(--text-light);
  font-size: .92rem;
  margin: 0 0 16px;
  flex: 1;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: .82rem;
  color: var(--text-light);
}
.post-meta svg { width: 14px; height: 14px; fill: var(--cgt-red); vertical-align: -2px; margin-right: 5px; }
.post-meta a { color: var(--text-light); }
.post-meta a:hover { color: var(--cgt-red); }

/* --- Article seul --- */
.single-article {
  background: var(--bg);
  max-width: 800px;
}
.single-article .entry-header { margin-bottom: 28px; }
.single-article .entry-header .post-meta { margin-top: 14px; font-size: .9rem; }
.single-article .entry-thumbnail { border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; box-shadow: var(--shadow); }

.entry-content { font-size: 1.05rem; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content h2 {
  padding-left: 14px;
  border-left: 4px solid var(--cgt-red);
}
.entry-content blockquote {
  margin: 1.5em 0;
  padding: 18px 24px;
  background: var(--cgt-red-light);
  border-left: 4px solid var(--cgt-red);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content img { border-radius: var(--radius); }
.entry-content ul li::marker { color: var(--cgt-red); }
.entry-content a { text-decoration: underline; text-decoration-color: rgba(204,16,18,.4); text-underline-offset: 3px; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.entry-content th { background: var(--cgt-red); color: #fff; }
.entry-content tr:nth-child(even) { background: var(--bg-soft); }

.entry-tags { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tags a {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .82rem;
  font-weight: 600;
}
.entry-tags a:hover { background: var(--cgt-red); border-color: var(--cgt-red); color: #fff; text-decoration: none; }

.post-navigation-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.post-navigation-links a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  font-size: .92rem;
  transition: border-color .2s, box-shadow .2s;
}
.post-navigation-links a:hover { border-color: var(--cgt-red); box-shadow: var(--shadow); text-decoration: none; }
.post-navigation-links .nav-label { display: block; font-size: .75rem; color: var(--cgt-red); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; font-weight: 700; }
.post-navigation-links .nav-next { text-align: right; }

/* --- En-tête d'archive --- */
.archive-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: clamp(28px, 4vw, 48px) 0;
  margin-bottom: 0;
}
.archive-header h1 { margin: 0; }
.archive-header .archive-description { color: var(--text-light); margin: 8px 0 0; }
.archive-header h1 .archive-kicker {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--cgt-red);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

/* --- Pagination --- */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.pagination .page-numbers:hover { border-color: var(--cgt-red); color: var(--cgt-red); }
.pagination .page-numbers.current { background: var(--cgt-red); border-color: var(--cgt-red); color: #fff; }
.pagination .page-numbers.dots { border: none; }

/* =========================================================
   5. Sidebar / widgets
   ========================================================= */
.widget-area .widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}
.widget-title, .widget .wp-block-heading {
  font-size: 1.05rem;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--cgt-red);
  display: inline-block;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text); }
.widget ul li a:hover { color: var(--cgt-red); }
.widget select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; color: var(--text); }

/* Formulaire de recherche */
.search-form { display: flex; gap: 8px; }
.search-form .search-field {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
}
.search-form .search-field:focus { border-color: var(--cgt-red); outline: none; box-shadow: 0 0 0 3px rgba(204,16,18,.15); }
.search-form .search-submit {
  background: var(--cgt-red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s;
}
.search-form .search-submit:hover { background: var(--cgt-red-dark); }

/* =========================================================
   6. Footer
   ========================================================= */
.site-footer {
  background: #222222;
  color: #cfcfcf;
  margin-top: 40px;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ff8a8b; text-decoration: none; }

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 40px;
  padding: clamp(40px, 6vw, 64px) 0;
}
.footer-widgets .widget { background: none; border: none; padding: 0; margin: 0; }
.footer-widgets .widget-title, .footer-widgets .wp-block-heading {
  color: #fff;
  border-bottom-color: var(--cgt-red);
}
.footer-widgets .widget ul li { border-bottom-color: rgba(255,255,255,.09); }
.footer-widgets .widget ul li a { color: #cfcfcf; }
.footer-widgets .widget ul li a:hover { color: #fff; }
.footer-widgets .widget p { color: #cfcfcf; margin: 0; }
.footer-widgets .widget select {
  background: #2c2c2c;
  color: #fff;
  border-color: rgba(255,255,255,.15);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  font-size: .85rem;
}
.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.footer-bottom .cgt-mark { color: var(--cgt-red); font-weight: 800; }
.footer-bottom-links { display: flex; align-items: center; gap: 18px; }
.footer-bottom-links ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.footer-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
  font-size: .82rem;
  color: #fff;
}
.footer-login:hover { background: var(--cgt-red); border-color: var(--cgt-red); color: #fff; text-decoration: none; }

/* Bouton retour en haut */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cgt-red);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s, background .2s;
  z-index: 900;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--cgt-red-dark); }
.back-to-top svg { width: 20px; height: 20px; fill: #fff; }

/* =========================================================
   7. Divers (404, alignements WP, commentaires)
   ========================================================= */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 .error-code {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 800;
  color: var(--cgt-red);
  line-height: 1;
  margin: 0;
}
.error-404 .search-form { max-width: 420px; margin: 28px auto 0; }

.alignwide { margin-left: -40px; margin-right: -40px; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: var(--text-light); text-align: center; margin-top: 8px; }

.comments-area { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); max-width: 800px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.comment-list .children { list-style: none; margin: 16px 0 0; padding-left: clamp(12px, 4vw, 40px); }
.comment-author img { border-radius: 50%; }
.comment-form input[type="text"], .comment-form input[type="email"],
.comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: .95rem; color: var(--text);
}
.comment-form .submit { background: var(--cgt-red); color: #fff; border: none; border-radius: 999px; padding: 12px 28px; font-weight: 700; cursor: pointer; font-family: inherit; }
.comment-form .submit:hover { background: var(--cgt-red-dark); }

/* =========================================================
   8. Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .widget-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
  }
  .widget-area .widget { margin-bottom: 0; }
}

@media (max-width: 782px) {
  .menu-toggle { display: inline-flex; }

  /* Réseaux : cachés dans l'en-tête, affichés en ligne en bas du tiroir */
  .header-social { display: none; }
  .menu-social {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 16px;
    padding: 24px 20px;
    margin: 0;
    border-top: 1px solid var(--border);
  }
  /* Pas de pastille autour des logos dans le tiroir : icônes de marque seules */
  .menu-social a { background: none; width: auto; height: auto; }
  .menu-social svg { width: 26px; height: 26px; }
  .menu-social a:hover { background: none; transform: translateY(-2px); }

  .main-navigation { border-top: none; }

  /* Tiroir plein écran qui glisse depuis le haut */
  .main-navigation .menu-wrap {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 1200;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
    padding: 72px 0 40px;
    transform: translateX(100%);
    transition: transform .3s ease;
    visibility: hidden;
  }
  .main-navigation.toggled .menu-wrap { transform: translateX(0); visibility: visible; }
  body.menu-open { overflow: hidden; }

  /* Bouton fermer dans le tiroir */
  .menu-wrap .menu-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--cgt-red-light);
    color: var(--cgt-red);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .menu-wrap .menu-title {
    display: block;
    padding: 0 20px 12px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cgt-red);
  }

  .main-navigation ul { flex-direction: column; }
  .main-navigation li { border-bottom: 1px solid var(--border); }
  /* Pas de bordure sous le dernier item : évite le double trait avant les réseaux */
  .main-navigation #primary-menu > li:last-child { border-bottom: none; }

  /* Dans le tiroir (fond blanc), le texte des entrées redevient foncé
     (on cible les liens du menu, pas les logos réseaux qui gardent leurs couleurs) */
  .main-navigation .menu-wrap li a { color: var(--text); }

  /* Ligne : lien + bouton chevron côte à côte */
  .main-navigation .menu-item-has-children > a { position: relative; }
  .main-navigation li > a {
    padding: 16px 20px;
    border-left: 4px solid transparent;
    font-size: 1.02rem;
  }
  .main-navigation .menu-wrap .current-menu-item > a,
  .main-navigation .menu-wrap .current-menu-ancestor > a {
    color: var(--cgt-red);
    border-left-color: var(--cgt-yellow); /* accent jaune discret */
    background: var(--cgt-red-light);
    border-bottom-color: transparent;
  }

  /* Bouton chevron injecté par le JS */
  .submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 58px;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .main-navigation .menu-item-has-children { position: relative; }
  .submenu-toggle svg { width: 18px; height: 18px; fill: currentColor; transition: transform .25s ease; }
  .submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .submenu-toggle[aria-expanded="true"] { color: var(--cgt-red); }

  /* Sous-menus repliés par défaut, dépliage animé */
  .main-navigation ul ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    min-width: 0;
    padding: 0;
    background: var(--bg-soft);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .main-navigation ul ul.is-open { max-height: 2000px; }
  .main-navigation ul ul > li { border-bottom-color: rgba(0,0,0,.06); }
  .main-navigation ul ul a { padding-left: 34px; font-size: .96rem; font-weight: 500; }
  .main-navigation ul ul ul a { padding-left: 52px; }

  .posts-grid { grid-template-columns: 1fr; }
  .post-navigation-links { grid-template-columns: 1fr; }
  .footer-widgets { gap: 32px; }
  .footer-bottom .container { justify-content: center; text-align: center; }
  .back-to-top { right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero .btn { display: block; text-align: center; margin-right: 0; }
  .post-card-body { padding: 16px 18px 18px; }
}
