/*
Theme Name: Électron Libre
Theme URI: https://www.ecole-laser-electron-libre.fr
Author: La rédaction
Description: Thème sur mesure, léger et rapide, pour ecole-laser-electron-libre.fr — design bleu/orange d'après la maquette Claude Design, mobile-first, zéro JavaScript, polices auto-hébergées.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: electron-libre
*/

/* ---------- Polices auto-hébergées (latin) ---------- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/archivo-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/archivo-italic-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('assets/fonts/sourcesans3-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('assets/fonts/sourcesans3-italic-var.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/plexmono-500.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F4F6FA;
  --ink: #16233D;
  --body: #22304C;
  --muted: #5C6B87;
  --faint: #8095B8;
  --line: #E2E7F0;
  --line-2: #DCE3EF;
  --blue: #0B4FCB;
  --navy: #16233D;
  --navy-2: #0B3A9B;
  --orange: #E8590C;
  --orange-2: #FF7A2F;
  --hero-txt: #C9D8F4;
  --kicker: #7FB0FF;
  --card: #ffffff;
  --radius: 12px;
  --font-head: 'Archivo', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; transition: color .15s ease, border-color .15s ease, background .15s ease; }
a:hover { color: var(--orange); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.el-wrap { max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); word-wrap: normal;
}
.skip-link:focus {
  position: fixed; top: 10px; left: 10px; z-index: 999; width: auto; height: auto;
  clip: auto; clip-path: none; background: #fff; color: var(--ink);
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 2px 10px rgba(22,35,61,.25);
}

/* ---------- Header ---------- */
.el-header { background: #fff; border-bottom: 1px solid var(--line); }
.el-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.el-logo img, .el-topbar .custom-logo { height: 46px; width: auto; display: block; }
.el-search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 7px 8px 7px 14px; background: #F7F9FC;
}
.el-search input {
  border: 0; background: transparent; font-family: var(--font-body);
  font-size: 14px; color: var(--ink); width: 150px; padding: 0;
}
.el-search input::placeholder { color: var(--faint); }
.el-search input:focus { outline: none; }
.el-search button {
  border: 0; background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center; padding: 4px;
}
.el-search__dot { width: 13px; height: 13px; border: 2px solid var(--faint); border-radius: 50%; display: block; position: relative; }
.el-search__dot::after {
  content: ''; position: absolute; width: 2px; height: 6px; background: var(--faint);
  transform: rotate(-45deg); bottom: -4px; right: -2px; border-radius: 2px;
}
.el-search button:hover .el-search__dot, .el-search button:hover .el-search__dot::after { border-color: var(--orange); background-color: transparent; }
.el-search button:hover .el-search__dot::after { background: var(--orange); }
.el-catnav-outer { border-top: 1px solid #EEF1F7; }
.el-catnav { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.el-catnav::-webkit-scrollbar { display: none; }
.el-catnav__link, .el-catnav li a {
  flex: 0 0 auto; padding: 12px 14px;
  font-family: var(--font-head); font-weight: 700; font-size: 13.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.el-catnav__link:hover, .el-catnav__link.is-current, .el-catnav li a:hover {
  color: var(--orange); border-bottom-color: var(--orange);
}
.el-catnav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }

/* ---------- Hero (accueil) ---------- */
.el-hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 44px 0 40px; }
.el-hero .el-wrap { display: flex; align-items: center; gap: clamp(28px, 4vw, 56px); }
.el-hero__text { flex: 1 1 auto; min-width: 0; }
.el-hero__art { display: none; flex: 0 0 clamp(250px, 27vw, 330px); }
.el-hero__art img {
  width: 100%; height: auto; display: block; border-radius: 20px;
  transform: rotate(-2deg);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 22px 48px rgba(3, 10, 28, .5);
}
.el-kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--kicker); margin: 0 0 14px;
}
.el-hero h1 {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(28px, 5.2vw, 46px); line-height: 1.08; margin: 0;
  text-wrap: balance;
}
.el-hero h1 em { font-style: italic; color: var(--orange-2); }
.el-hero__sub { font-size: 17px; line-height: 1.6; color: var(--hero-txt); max-width: 52ch; margin: 16px 0 24px; }
.el-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.el-btn {
  display: inline-block; background: var(--orange); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 14px 22px; border-radius: 8px; border: 1px solid var(--orange);
}
.el-btn:hover { background: var(--orange-2); border-color: var(--orange-2); color: #fff; }
.el-btn--ghost { background: transparent; border: 1px solid rgba(255,255,255,.45); }
.el-btn--ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.45); color: #fff; }

/* ---------- Sections ---------- */
.el-sec { padding-top: 36px; }
.el-h2 { font-family: var(--font-head); font-weight: 800; font-size: 20px; margin: 0 0 4px; color: var(--ink); }
.el-sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.el-sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.el-sechead .el-h2 { margin: 0; }
.el-sechead a { font-size: 14px; font-weight: 600; }

/* ---------- Univers ---------- */
.el-univers { display: grid; grid-template-columns: 1fr; gap: 12px; }
.el-ucard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; display: block; color: var(--ink);
}
.el-ucard:hover { border-color: var(--orange); color: var(--ink); }
.el-ucard__tint { display: block; width: 34px; height: 34px; border-radius: 9px; margin-bottom: 12px; }
.el-ucard__name {
  display: block; font-family: var(--font-head); font-weight: 700; font-size: 14px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink);
}
.el-ucard__blurb { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

/* ---------- Étiquette catégorie & méta ---------- */
.el-cat {
  font-family: var(--font-head); font-weight: 700; font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--orange);
}
a.el-cat:hover { text-decoration: underline; }
.el-meta {
  margin: 0; font-family: var(--font-mono); font-size: 11px; color: var(--faint);
  letter-spacing: .05em; text-transform: uppercase;
}

/* ---------- Média des cartes ---------- */
.el-media {
  background: repeating-linear-gradient(135deg, #E7ECF6 0 10px, #DDE4F1 10px 20px);
  overflow: hidden; display: block;
}
.el-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Carte à la une ---------- */
.el-feature {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; color: var(--ink);
}
.el-feature:hover { border-color: var(--orange); color: var(--ink); }
.el-feature .el-media { height: clamp(180px, 34vw, 300px); }
.el-feature__body { padding: 20px; }
.el-feature__title {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(20px, 3.4vw, 28px); line-height: 1.2;
  margin: 8px 0; color: var(--ink); text-wrap: pretty;
}
.el-feature__excerpt { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 62ch; }
.el-feature__excerpt p { margin: 0; }
.el-feature .el-meta { margin-top: 14px; }

/* ---------- Grille de cartes ---------- */
.el-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.el-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.el-card:hover { border-color: var(--orange); }
.el-card__link { display: flex; flex-direction: column; flex: 1; color: var(--ink); }
.el-card__link:hover { color: var(--ink); }
.el-card .el-media { height: 150px; }
.el-card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.el-card__title { font-family: var(--font-head); font-weight: 700; font-size: 17.5px; line-height: 1.3; margin: 0; color: var(--ink); text-wrap: pretty; }
.el-card__excerpt { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.el-card__excerpt p { margin: 0; }
.el-card__body .el-meta { margin-top: auto; padding-top: 8px; }

/* ---------- Listes (blog / catégorie) ---------- */
.el-listhead { padding: 14px 0 24px; border-bottom: 1px solid var(--line); }
.el-listhead h1 {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(26px, 4.6vw, 38px); line-height: 1.12; margin: 0 0 10px; color: var(--ink);
}
.el-listhead .el-intro { margin: 0; color: var(--muted); font-size: 16.5px; line-height: 1.6; max-width: 62ch; }
.el-rows { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; }
.el-row {
  display: flex; flex-direction: column; gap: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; color: var(--ink);
}
.el-row:hover { border-color: var(--orange); color: var(--ink); }
.el-row .el-media { border-radius: 8px; height: 180px; }
.el-row__body { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.el-row__title { font-family: var(--font-head); font-weight: 700; font-size: 19px; line-height: 1.28; margin: 0; color: var(--ink); text-wrap: pretty; }
.el-row__excerpt { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.el-row__excerpt p { margin: 0; }
.el-row__body .el-meta { margin-top: auto; padding-top: 6px; }

/* ---------- Pagination ---------- */
.el-pager { padding: 26px 0 0; }
.el-pager ul.page-numbers {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  flex-wrap: wrap; list-style: none; margin: 0; padding: 0;
}
.el-pager ul.page-numbers li { margin: 0; }
.el-pager li .page-numbers {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.el-pager li a.page-numbers:hover { border-color: var(--orange); color: var(--orange); }
.el-pager li .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.el-pager li .page-numbers.dots { border: 0; background: transparent; }

/* ---------- Fil d'Ariane ---------- */
.el-crumb {
  padding-top: 16px; font-family: var(--font-mono); font-size: 11.5px;
  color: var(--faint); letter-spacing: .05em; text-transform: uppercase;
}
.el-crumb a { color: var(--faint); }
.el-crumb a:hover { color: var(--orange); }

/* ---------- Article ---------- */
.el-article { max-width: 760px; padding: 14px 20px 0; margin: 0; }
.el-article__title {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(28px, 5vw, 42px); line-height: 1.1;
  margin: 10px 0 14px; color: var(--ink); text-wrap: balance;
}
.el-lede { margin: 0 0 16px; font-size: 18.5px; line-height: 1.6; color: #3D4E6E; }
.el-metabar {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--faint);
  letter-spacing: .04em; text-transform: uppercase;
}
.el-figure { margin: 20px 0; border-radius: var(--radius); overflow: hidden; }
.el-figure img { display: block; width: 100%; height: auto; }

/* Sommaire */
.el-toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 26px; }
.el-toc__label {
  margin: 0 0 10px; font-family: var(--font-head); font-weight: 700; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.el-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.el-toc a { font-size: 15.5px; }

/* Contenu */
.el-content { font-size: 17.5px; line-height: 1.7; color: var(--body); }
.el-content p { margin: 0 0 16px; }
.el-content h2 {
  font-family: var(--font-head); font-weight: 800; font-size: 25px;
  line-height: 1.2; margin: 28px 0 12px; color: var(--ink); scroll-margin-top: 24px;
}
.el-content h3 { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.25; margin: 24px 0 10px; color: var(--ink); }
.el-content h4 { font-family: var(--font-head); font-weight: 700; font-size: 17px; margin: 20px 0 8px; color: var(--ink); }
.el-content ul, .el-content ol { margin: 0 0 18px; padding-left: 22px; }
.el-content li { margin-bottom: 6px; line-height: 1.65; }
.el-content a { text-decoration: underline; text-decoration-color: rgba(11,79,203,.35); text-underline-offset: 2px; }
.el-content a:hover { text-decoration-color: var(--orange); }
.el-content img { border-radius: 10px; margin: 6px 0; }
.el-content blockquote {
  margin: 24px 0; padding: 18px 20px; border-left: 4px solid var(--orange);
  background: #fff; border-radius: 0 10px 10px 0;
}
.el-content blockquote p { margin: 0; font-size: 18px; line-height: 1.6; font-style: italic; }
.el-content .el-note, .el-content .wp-block-group {
  background: #EDF3FF; border: 1px solid #C9DBFB; border-radius: var(--radius);
  padding: 18px 20px; margin: 24px 0;
}
.el-content table { border-collapse: collapse; width: 100%; margin: 0 0 18px; font-size: 15.5px; }
.el-content th, .el-content td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.el-content th { font-family: var(--font-head); font-weight: 700; background: #F7F9FC; }
.el-content .table-scroll, .el-content figure.wp-block-table { overflow-x: auto; }
.el-content iframe { max-width: 100%; }
.el-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.el-content .wp-caption { max-width: 100%; }
.el-content .wp-caption-text { font-size: 13.5px; color: var(--faint); margin-top: 6px; }

/* Étiquettes */
.el-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0; border-top: 1px solid var(--line); margin-top: 24px; }
.el-tags a {
  border: 1px solid var(--line-2); background: #fff; border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.el-tags a:hover { border-color: var(--orange); color: var(--orange); }

/* À lire aussi */
.el-related { display: grid; grid-template-columns: 1fr; gap: 14px; }
.el-mini { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); }
.el-mini:hover { border-color: var(--orange); color: var(--ink); }
.el-mini .el-media { height: 120px; }
.el-mini__body { padding: 14px; }
.el-mini__title { font-family: var(--font-head); font-weight: 700; font-size: 16.5px; line-height: 1.3; margin: 6px 0 0; color: var(--ink); text-wrap: pretty; }

/* ---------- Pages statiques ---------- */
.el-page { max-width: 760px; padding: 14px 20px 0; }
.el-page__title {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(26px, 4.6vw, 38px); line-height: 1.12; margin: 10px 0 18px; color: var(--ink);
}

/* ---------- 404 / recherche ---------- */
.el-empty { text-align: center; padding: 70px 20px 30px; }
.el-empty__code { font-family: var(--font-mono); font-size: 13px; letter-spacing: .18em; color: var(--faint); margin: 0 0 12px; }
.el-empty h1 { font-family: var(--font-head); font-weight: 800; font-size: clamp(26px, 4.6vw, 38px); margin: 0 0 10px; color: var(--ink); }
.el-empty p { color: var(--muted); max-width: 52ch; margin: 0 auto 22px; }
.el-empty .el-search { display: inline-flex; margin: 0 auto 18px; }

/* ---------- Pied de page ---------- */
.el-footer { background: var(--navy); color: var(--hero-txt); margin-top: 40px; padding: 34px 0 24px; }
.el-footer__grid { display: grid; grid-template-columns: 1fr; gap: 26px; }
.el-footer__logochip { display: inline-block; background: #fff; border-radius: 8px; padding: 6px 10px; }
.el-footer__logochip img { height: 44px; width: auto; display: block; }
.el-footer__base { margin: 14px 0 0; font-size: 15px; line-height: 1.6; max-width: 36ch; }
.el-footer__title {
  font-family: var(--font-head); font-weight: 700; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; color: #fff; margin: 0 0 12px;
}
.el-footer__links { display: flex; flex-direction: column; gap: 8px; }
.el-footer__links a { color: var(--hero-txt); font-size: 15px; }
.el-footer__links a:hover { color: var(--orange-2); }
.el-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.14); margin-top: 26px; padding-top: 16px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
}
.el-footer__bottom p { margin: 0; font-size: 13.5px; color: #8EA3C8; max-width: 60ch; }

/* ---------- Écrans moyens et larges ---------- */
@media (min-width: 681px) {
  .el-univers { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .el-grid { grid-template-columns: repeat(2, 1fr); }
  .el-related { grid-template-columns: repeat(3, 1fr); }
  .el-row { flex-direction: row; }
  .el-row .el-media { flex: 1 1 200px; max-width: 260px; height: 130px; }
  .el-row__body { flex: 3 1 260px; }
  .el-article, .el-page { padding-left: 20px; padding-right: 20px; margin: 0 auto 0 0; }
}
@media (min-width: 900px) {
  .el-hero__art { display: block; }
}
@media (min-width: 980px) {
  .el-grid { grid-template-columns: repeat(3, 1fr); }
  .el-search input { width: 190px; }
}
@media (max-width: 680px) {
  .el-logo img, .el-topbar .custom-logo { height: 38px; }
  .el-search input { width: 96px; }
  .el-footer__bottom { flex-direction: column; }
}
