/*
Theme Name: GeekHebdo
Theme URI: https://geekhebdo.com
Author: GeekHebdo
Author URI: https://geekhebdo.com
Description: Thème officiel de GeekHebdo — actu geek, gaming, tech et pop culture. Style magazine sombre par défaut, accent vert, typographie sans-serif. Compatible AMP (mode Transitional).
Version: 2.2.0
Requires at least: 6.0
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: geekhebdo
Tags: blog, news, magazine, amp, two-columns, custom-menu, featured-images, full-width-template
*/


:root {
  --gh-accent: #00e676;          /* vert GeekHebdo */
  --gh-accent-dark: #00b85d;
  --gh-ink: #0a0a0c;             /* noir header */
  --gh-panel: #14161a;           /* gris très foncé du bloc une */
  --gh-panel-soft: #1d2026;
  --gh-paper: #ffffff;
  --gh-paper-soft: #f4f6f5;
  --gh-line: #e3e6e4;
  --gh-text: #16171a;
  --gh-muted: #6b6f76;
  --gh-max: 1180px;
  --gh-radius: 6px;
  --gh-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gh-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--gh-sans);
  color: var(--gh-text);
  background: var(--gh-paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html { overflow-x: hidden; max-width: 100%; }

a { color: var(--gh-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

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

/* Titres (sans-serif, gras) */
h1, h2, h3, .gh-serif { font-family: var(--gh-sans); font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Header ---------- */
.gh-header { background: var(--gh-ink); color: #fff; }
.gh-header-inner {
  display: flex; align-items: center; gap: 26px;
  padding: 14px 20px; max-width: var(--gh-max); margin: 0 auto; flex-wrap: wrap;
}
.gh-logo {
  font-family: var(--gh-sans);
  font-weight: 800; font-size: 2rem; line-height: 1;
  color: #fff; letter-spacing: -0.03em;
  display: inline-flex; align-items: center; gap: 10px;
}
.gh-logo:hover { text-decoration: none; }
.gh-logo .gh-dot { color: var(--gh-accent); }
.gh-tagline { display: none; }

.gh-header-right { display: flex; align-items: center; gap: 18px; margin-left: auto; }

.gh-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; align-items: center; }
.gh-nav a {
  color: #f2f2f4; font-weight: 600; font-size: .95rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.gh-nav a:hover { color: var(--gh-accent); text-decoration: none; }
.gh-nav a.active { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 2px; }
/* petite pastille icône devant chaque rubrique */
.gh-nav a::before {
  content: ""; width: 16px; height: 16px; border-radius: 3px;
  background: var(--gh-accent); display: inline-block; opacity: .9;
  -webkit-mask: none; mask: none;
}
.gh-nav .menu-item:nth-child(1) a::before { background: #00e676; }
.gh-nav .menu-item:nth-child(2) a::before { background: #00b8d4; }
.gh-nav .menu-item:nth-child(3) a::before { background: #b388ff; }
.gh-nav .menu-item:nth-child(4) a::before { background: #ff5252; }
.gh-nav .menu-item:nth-child(5) a::before { background: #ffab00; }
.gh-nav .menu-item:nth-child(6) a::before { background: #ff7043; }
.gh-nav .menu-item:nth-child(7) a::before { background: #ec407a; }
.gh-nav .menu-item:nth-child(8) a::before { background: #26c6da; }

/* ---------- Burger (menu mobile, AMP-safe via checkbox CSS) ---------- */
.gh-burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; }
.gh-burger span { width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.gh-menu-checkbox { display: none; }

/* ---------- Bloc UNE (hero magazine) ---------- */
.gh-hero-block {
  background: var(--gh-panel); border-radius: var(--gh-radius);
  padding: 22px; margin: 28px auto; max-width: 1140px;
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px;
}
@media (max-width: 1180px) { .gh-hero-block { margin: 28px 20px; } }
@media (max-width: 880px) {
  .gh-hero-block { grid-template-columns: 1fr; margin: 20px 16px; padding: 16px; }
}
@media (max-width: 600px) {
  .gh-hero-block { margin: 16px 12px; }
  .gh-hero-caption { margin: -32px 10px 0; }
  .gh-hero-title { font-size: 1.35rem; }
}

.gh-hero-main { position: relative; border-radius: var(--gh-radius); overflow: hidden; display: block; }
.gh-hero-main img { width: 100%; display: block; aspect-ratio: 16/10; object-fit: cover; }
.gh-hero-main:hover { text-decoration: none; }
.gh-hero-caption {
  background: var(--gh-panel); border-left: 3px solid var(--gh-accent);
  padding: 16px 18px; margin: -40px 16px 0; position: relative;
}
.gh-hero-cat { color: var(--gh-accent); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.gh-hero-title { color: #fff; font-size: 1.7rem; line-height: 1.15; margin: 6px 0 0; }
.gh-hero-title a { color: #fff; }
.gh-hero-title a:hover { color: var(--gh-accent); text-decoration: none; }

.gh-hero-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gh-brief { display: grid; grid-template-columns: 1fr 84px; gap: 12px; border-bottom: 1px solid #33343a; padding-bottom: 14px; min-width: 0; }
.gh-brief > div { min-width: 0; }
.gh-brief:last-child { border-bottom: none; }
.gh-brief-title { color: #fff; font-family: var(--gh-sans); font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.gh-brief a:hover .gh-brief-title { color: var(--gh-accent); }
.gh-brief-date { color: #9a9ea6; font-size: .74rem; margin-top: 6px; }
.gh-brief-thumb img { width: 84px; height: 64px; object-fit: cover; border-radius: 4px; }

/* ---------- Layout principal ---------- */
.gh-section-title {
  font-size: 1.7rem; margin: 30px 0 18px; max-width: var(--gh-max);
  padding: 0 20px; margin-left: auto; margin-right: auto;
}
.gh-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 40px;
  padding: 0 20px 36px; max-width: var(--gh-max); margin: 0 auto;
}
.gh-layout > * { min-width: 0; }
@media (max-width: 880px) { .gh-layout { grid-template-columns: 1fr; } }

/* Grille magazine pour les cartes */
.gh-main-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-content: start; min-width: 0; }
.gh-main-col > * { min-width: 0; }
@media (max-width: 600px) { .gh-main-col { grid-template-columns: 1fr; } }

.gh-card { background: var(--gh-paper); border-radius: var(--gh-radius); overflow: hidden; margin: 0; }
.gh-card-thumb img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--gh-radius); }
.gh-card-body { padding: 12px 2px 6px; }
.gh-cat {
  display: inline-block; color: var(--gh-accent); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.gh-card-title { font-size: 1.25rem; line-height: 1.22; margin: 0 0 6px; }
.gh-card-title a { color: var(--gh-ink); }
.gh-card-title a:hover { color: var(--gh-accent-dark); text-decoration: none; }
.gh-meta { font-size: .78rem; color: var(--gh-muted); margin-bottom: 8px; }
.gh-excerpt { color: #43454a; font-size: .92rem; }
.gh-readmore { display: inline-block; margin-top: 10px; font-weight: 700; color: var(--gh-accent-dark); }

/* span pleine largeur pour cartes vedettes dans la grille */
.gh-card.gh-card-wide { grid-column: 1 / -1; }

/* ---------- Single ---------- */
.gh-single-title { font-size: 2.5rem; line-height: 1.1; margin: 12px 0 12px; color: var(--gh-ink); }
.gh-single-content { font-family: var(--gh-sans); font-size: 1.08rem; }
.gh-single-content h2 { margin-top: 1.6em; font-size: 1.7rem; }
.gh-single-content h3 { margin-top: 1.4em; font-size: 1.35rem; }
.gh-single-content blockquote {
  border-left: 4px solid var(--gh-accent); margin: 1.4em 0; padding: .4em 0 .4em 18px;
  font-style: italic; color: var(--gh-panel);
}
.gh-single-content pre {
  background: var(--gh-ink); color: #e6edf3; padding: 16px; border-radius: var(--gh-radius);
  overflow-x: auto; font-family: var(--gh-mono); font-size: .9rem;
}
.gh-featured { width: 100%; border-radius: var(--gh-radius); margin-bottom: 18px; }
.gh-single-subtitle { color: var(--gh-accent-dark); font-family: var(--gh-sans); font-weight: 600; font-size: 1.2rem; font-style: italic; }

/* ---------- Sidebar ---------- */
.gh-widget { background: var(--gh-paper-soft); border-radius: var(--gh-radius); padding: 18px 20px; margin-bottom: 24px; }
.gh-widget-title {
  font-family: var(--gh-sans); font-size: 1.1rem; border-bottom: 2px solid var(--gh-accent);
  padding-bottom: 8px; margin: 0 0 14px;
}
.gh-widget ul { list-style: none; margin: 0; padding: 0; }
.gh-widget li { padding: 8px 0; border-bottom: 1px solid var(--gh-line); font-size: .95rem; }
.gh-widget li:last-child { border-bottom: none; }

/* ---------- Footer ---------- */
.gh-footer { background: var(--gh-ink); color: #9a9ea6; padding: 40px 20px; margin-top: 40px; text-align: center; font-size: .9rem; }
.gh-footer a { color: var(--gh-accent); }

/* ---------- Pagination ---------- */
.gh-pagination { display: flex; gap: 8px; justify-content: center; margin: 20px 0; flex-wrap: wrap; grid-column: 1 / -1; }
.gh-pagination a, .gh-pagination span { padding: 8px 14px; border: 1px solid var(--gh-line); border-radius: 4px; font-weight: 600; }
.gh-pagination .current { background: var(--gh-accent); border-color: var(--gh-accent); color: #fff; }

/* ---------- Breadcrumb ---------- */
.gh-breadcrumb { font-size: .82rem; color: var(--gh-muted); margin-bottom: 8px; padding: 16px 20px 0; max-width: var(--gh-max); margin-left: auto; margin-right: auto; }
.gh-breadcrumb a { color: var(--gh-muted); font-weight: 600; }
.gh-breadcrumb a:hover { color: var(--gh-accent-dark); text-decoration: none; }
.gh-bc-sep { margin: 0 6px; opacity: .6; }
.gh-bc-current { color: var(--gh-text); }

/* ---------- Barre de progression ---------- */
.gh-progress-track { position: sticky; top: 0; left: 0; width: 100%; height: 3px; background: transparent; z-index: 999; }
.gh-progress-bar { height: 100%; width: 100%; background: var(--gh-accent); transform: scaleX(0); transform-origin: left center; will-change: transform; }

/* ---------- Partage ---------- */
.gh-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.gh-share-label { font-weight: 700; font-size: .9rem; color: var(--gh-muted); margin-right: 4px; }
.gh-share-btn { display: inline-block; padding: 6px 14px; border: 1px solid var(--gh-line); border-radius: 20px; font-size: .85rem; font-weight: 600; color: var(--gh-text); }
.gh-share-btn:hover { background: var(--gh-accent); border-color: var(--gh-accent); color: #fff; text-decoration: none; }

/* ---------- Articles liés (bas) ---------- */
.gh-related { margin: 40px 0 10px; }
.gh-related-title { font-size: 1.5rem; border-bottom: 2px solid var(--gh-accent); padding-bottom: 8px; margin-bottom: 18px; }
.gh-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 600px) { .gh-related-grid { grid-template-columns: 1fr; } }
.gh-related-card { display: block; border-radius: var(--gh-radius); overflow: hidden; background: var(--gh-paper); }
.gh-related-card:hover { text-decoration: none; }
.gh-related-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; border-radius: var(--gh-radius); }
.gh-related-name { display: block; padding: 10px 2px; font-family: var(--gh-sans); font-weight: 600; color: var(--gh-ink); font-size: 1rem; line-height: 1.3; }
.gh-related-card:hover .gh-related-name { color: var(--gh-accent-dark); }

/* ---------- Encart "Lire aussi" in-content ---------- */
.gh-inline-related { margin: 1.8em 0; border-left: 4px solid var(--gh-accent); background: var(--gh-paper-soft); border-radius: 0 var(--gh-radius) var(--gh-radius) 0; overflow: hidden; }
.gh-inline-link { display: flex; align-items: stretch; text-decoration: none; color: inherit; }
.gh-inline-link:hover { text-decoration: none; }
.gh-inline-thumb { width: 110px; min-width: 110px; object-fit: cover; display: block; align-self: stretch; }
.gh-inline-text { display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; }
.gh-inline-flag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gh-accent-dark); margin-bottom: 4px; }
.gh-inline-name { font-family: var(--gh-sans); font-weight: 600; font-size: 1.05rem; line-height: 1.3; color: var(--gh-ink); }
.gh-inline-link:hover .gh-inline-name { color: var(--gh-accent-dark); }
@media (max-width: 480px) { .gh-inline-thumb { width: 88px; min-width: 88px; } .gh-inline-name { font-size: .95rem; } }

/* ============================================================
   MODE SOMBRE
   ============================================================ */
html[data-theme="dark"] {
  --gh-paper: #0a0a0c; --gh-paper-soft: #1a1b1f; --gh-line: #2a2b30;
  --gh-text: #e6e7ea; --gh-muted: #9a9ea6; --gh-ink: #050506;
}
body.gh-dark {
  --gh-paper: #0a0a0c; --gh-paper-soft: #1a1b1f; --gh-line: #2a2b30;
  --gh-text: #e6e7ea; --gh-muted: #9a9ea6; --gh-ink: #050506;
  background: #0a0a0c; color: #e6e7ea;
}
html[data-theme="dark"] .gh-card-title a,
html[data-theme="dark"] .gh-single-title,
html[data-theme="dark"] .gh-related-name,
html[data-theme="dark"] .gh-inline-name,
body.gh-dark .gh-card-title a,
body.gh-dark .gh-single-title,
body.gh-dark .gh-related-name,
body.gh-dark .gh-inline-name { color: #f2f2f4; }
html[data-theme="dark"] .gh-excerpt,
html[data-theme="dark"] .gh-single-content,
body.gh-dark .gh-excerpt,
body.gh-dark .gh-single-content { color: #b6b9c0; }
html[data-theme="dark"] .gh-widget,
html[data-theme="dark"] .gh-inline-related,
body.gh-dark .gh-widget,
body.gh-dark .gh-inline-related { background: #1a1b1f; }

/* ---------- Colonne latérale des articles (widgetable, sticky) ---------- */
.gh-sidebar-article { align-self: start; }
@media (min-width: 881px) {
  .gh-sidebar-article { position: sticky; top: 20px; }
}
.gh-sidebar-article .gh-widget:first-child { margin-top: 0; }

/* ---------- Colonne de contenu d'article (pas une grille de cartes) ---------- */
.gh-article-col { min-width: 0; }
.gh-article-col .gh-single-content { max-width: 100%; }

/* ============================================================
   MENU RESPONSIVE (mobile / tablette) — fonctionne en AMP
   ============================================================ */
@media (max-width: 880px) {
  .gh-header-inner { position: relative; flex-wrap: nowrap; }
  .gh-header-right { margin-left: auto; }
  .gh-burger { display: flex; }

  /* Checkbox invisible mais fonctionnelle (le :checked pilote le menu) */
  .gh-menu-checkbox { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

  /* Menu en panneau déroulant SOUS le header : ne réserve aucun espace quand fermé */
  .gh-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--gh-ink);
    border-top: 1px solid rgba(255,255,255,.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    z-index: 200;
  }
  .gh-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    width: 100%;
  }
  .gh-nav .menu-item { width: 100%; }
  .gh-nav a {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .gh-nav a.active { border-bottom: 1px solid rgba(255,255,255,.08); }

  /* Ouverture via la checkbox (pur CSS, AMP-safe) */
  .gh-menu-checkbox:checked ~ .gh-nav { max-height: 80vh; overflow-y: auto; }

  /* Animation du burger en croix quand ouvert */
  .gh-menu-checkbox:checked ~ .gh-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .gh-menu-checkbox:checked ~ .gh-burger span:nth-child(2) { opacity: 0; }
  .gh-menu-checkbox:checked ~ .gh-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
