/*
Theme Name: ATLAS eSIM Blog
Theme URI: https://blog.atlas-esim.com
Description: Theme enfant GeneratePress pour le blog ATLAS eSIM. Identite visuelle de la marque, typographie editoriale, mode sombre, support RTL complet. Aucune police externe ni bibliotheque JS : le referencement du blog depend directement de sa vitesse.
Author: ATLAS eSIM
Template: generatepress
Version: 1.0.0
License: GPL v2 or later
Text Domain: atlas-blog
*/

/* ═══════════════════════════════════════════════════════════════
   1. SYSTEME DE DESIGN
   Les couleurs reprennent le degrade de la marque utilise sur
   atlas-esim.com : cyan -> bleu -> violet.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --atlas-cyan: #00d4ff;
  --atlas-blue: #0ea5e9;
  --atlas-violet: #7c3aed;
  --atlas-gradient: linear-gradient(135deg, #00d4ff 0%, #0ea5e9 50%, #7c3aed 100%);

  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0891b2;
  --accent-strong: #0e7490;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 2px 8px rgba(15, 23, 42, .06), 0 24px 48px -24px rgba(15, 23, 42, .25);

  /* Typographie fluide : s'adapte a la largeur sans point de rupture. */
  --step--1: clamp(.875rem, .84rem + .18vw, .95rem);
  --step-0: clamp(1.05rem, 1rem + .25vw, 1.15rem);
  --step-1: clamp(1.3rem, 1.2rem + .5vw, 1.55rem);
  --step-2: clamp(1.6rem, 1.4rem + .9vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 1.8vw, 3.2rem);

  --measure: 68ch;
}

/* ── Toujours en clair, sur tous les appareils ────────────────────────────
   `only light` fait deux choses : il neutralise un eventuel mode sombre, et
   surtout il desactive l'assombrissement automatique que Chrome sur Android
   applique de lui-meme aux sites lorsque le telephone est en theme sombre.
   Sans cette declaration, le fond devient noir sur mobile meme si la feuille
   de style ne prevoit aucun mode sombre. */
:root { color-scheme: only light; }

/* ═══════════════════════════════════════════════════════════════
   2. BASE
   ═══════════════════════════════════════════════════════════════ */

body {
  background: var(--bg);
  color: var(--text);
  font-size: var(--step-0);
  line-height: 1.7;
  /* Pile systeme : zero requete reseau, donc zero penalite au chargement. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Noto Naskh Arabic", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

/* Focus visible : obligation d'accessibilite, souvent supprimee a tort. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--atlas-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 800;
}

img { height: auto; }

/* ═══════════════════════════════════════════════════════════════
   3. EN-TETE
   ═══════════════════════════════════════════════════════════════ */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(12px);
}

/* Pas de filet degrade sous l'en-tete : la separation se fait par la simple
   bordure ci-dessus, plus sobre. */

/* ── Lockup : logo + mot-symbole ─────────────────────────────────────────
   GeneratePress ne place PAS de conteneur commun autour du logo et du titre :
   .site-logo et .site-branding sont deux freres directs de .inside-header.
   L'espacement se joue donc sur la marge du logo, pas sur un `gap`. */

.inside-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.site-logo {
  margin: 0;
  margin-inline-end: .6rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Pousse la navigation a l'oppose du lockup. */
.site-branding { margin-inline-end: auto; }

.site-logo img,
.header-image {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
  /* Ombre portee coloree : donne du relief sans alourdir le rendu. */
  box-shadow: 0 1px 6px -2px rgba(8, 145, 178, .4);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.site-logo:hover img { transform: rotate(-4deg) scale(1.06); }

@media (max-width: 767px) {
  .site-logo { margin-inline-end: .5rem; }
  .site-logo img,
  .header-image { width: 28px; height: 28px; border-radius: 7px; }
}

/* Taille du mot-symbole, calibree sur le logo : on vise un rapport d'environ
   1,9 entre la hauteur de la tuile et celle du texte, proportion habituelle
   d'un lockup equilibre. */
.site-branding .main-title {
  font-size: clamp(.95rem, .89rem + .3vw, 1.1rem);
  line-height: 1.15;
  margin: 0;
}

.site-branding .main-title a {
  font-weight: 900;
  letter-spacing: -.03em;
  background: var(--atlas-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-branding .site-description {
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .01em;
}

@media (prefers-reduced-motion: reduce) {
  .site-logo:hover img { transform: none; }
}

.main-navigation,
.main-navigation .main-nav > ul { background: transparent; }

.main-navigation a {
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--text);
  position: relative;
}

.main-navigation .main-nav ul li > a::after {
  content: "";
  position: absolute;
  inset-inline: 1.2em;
  bottom: .8em;
  height: 2px;
  background: var(--atlas-gradient);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform .25s ease;
}

.main-navigation .main-nav ul li:hover > a::after,
.main-navigation .main-nav ul li.current-menu-item > a::after { transform: scaleX(1); }

/* ═══════════════════════════════════════════════════════════════
   4. LISTE D'ARTICLES — grille de cartes
   ═══════════════════════════════════════════════════════════════ */

body.blog .site-main,
body.archive .site-main,
body.search .site-main {
  display: grid;
  /* `min(100%, 320px)` evite tout debordement horizontal sur les petits
     ecrans : sans le `min()`, une largeur plancher de 320 px forcerait la
     grille a depasser la fenetre sur un telephone de 360 px avec ses marges. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  body.blog .site-main,
  body.archive .site-main,
  body.search .site-main { gap: 2rem; }
}

body.blog .site-main > *:not(article),
body.archive .site-main > *:not(article) { grid-column: 1 / -1; }

body.blog article,
body.archive article,
body.search article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

body.blog article:hover,
body.archive article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

body.blog .inside-article,
body.archive .inside-article {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

body.blog .post-image,
body.archive .post-image { margin: 0; overflow: hidden; }

body.blog .post-image img,
body.archive .post-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

body.blog article:hover .post-image img,
body.archive article:hover .post-image img { transform: scale(1.05); }

body.blog .entry-title,
body.archive .entry-title { font-size: var(--step-1); margin: 0 0 .6rem; }

body.blog .entry-title a,
body.archive .entry-title a { color: var(--text); text-decoration: none; }

body.blog .entry-title a:hover,
body.archive .entry-title a:hover { color: var(--accent); }

body.blog .entry-summary,
body.archive .entry-summary { color: var(--muted); font-size: var(--step--1); }

/* Article epingle : mis en avant sur toute la largeur. */
body.blog article.sticky { grid-column: 1 / -1; }

@media (min-width: 900px) {
  body.blog article.sticky { display: grid; grid-template-columns: 1.1fr 1fr; }
  body.blog article.sticky .post-image img { height: 100%; aspect-ratio: auto; min-height: 320px; }
  body.blog article.sticky .inside-article { justify-content: center; padding: 2.5rem; }
  body.blog article.sticky .entry-title { font-size: var(--step-2); }
}

/* ═══════════════════════════════════════════════════════════════
   5. META ET CATEGORIES
   ═══════════════════════════════════════════════════════════════ */

.entry-meta {
  font-size: .8rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: .9rem;
}

.entry-meta a { color: var(--muted); text-decoration: none; }
.entry-meta a:hover { color: var(--accent); }

.cat-links a,
.entry-categories a {
  display: inline-block;
  background: var(--atlas-gradient);
  color: #fff !important;
  padding: .22em .8em;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   6. ARTICLE — confort de lecture
   ═══════════════════════════════════════════════════════════════ */

body.single .entry-title {
  font-size: var(--step-3);
  margin-bottom: 1rem;
  max-width: 20ch;
}

body.single .entry-content { max-width: var(--measure); }

body.single .entry-content > p:first-of-type {
  font-size: 1.18em;
  color: var(--muted);
  line-height: 1.65;
  border-inline-start: 4px solid transparent;
  border-image: var(--atlas-gradient) 1;
  padding-inline-start: 1.2rem;
  margin-bottom: 2rem;
}

body.single .entry-content h2 {
  font-size: var(--step-2);
  margin: 2.8rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

body.single .entry-content h3 {
  font-size: var(--step-1);
  margin: 2rem 0 .7rem;
  color: var(--accent-strong);
}

body.single .entry-content strong { color: var(--text); font-weight: 700; }

body.single .post-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* Tableaux : nombreux dans les guides, ils doivent rester lisibles sur mobile. */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: var(--step--1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

@media (min-width: 700px) {
  .entry-content table { display: table; white-space: normal; }
}

.entry-content thead { background: var(--atlas-gradient); }
.entry-content th {
  color: #fff;
  font-weight: 700;
  text-align: start;
  padding: .85rem 1rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.entry-content td { padding: .85rem 1rem; border-top: 1px solid var(--border); }
.entry-content tbody tr:nth-child(even) { background: var(--surface); }

.entry-content ul, .entry-content ol { padding-inline-start: 1.4rem; }
.entry-content li { margin-bottom: .55rem; }

.entry-content ul li::marker { color: var(--atlas-blue); }
.entry-content ol li::marker { color: var(--atlas-violet); font-weight: 700; }

.entry-content a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-thickness: 2px;
  font-weight: 500;
}
.entry-content a:hover { text-decoration-color: var(--accent); }

.entry-content code {
  background: var(--surface-2);
  padding: .15em .45em;
  border-radius: 6px;
  font-size: .9em;
}

/* ═══════════════════════════════════════════════════════════════
   7. BARRE DE PROGRESSION DE LECTURE
   Repere utile sur des guides de 1500 mots.
   ═══════════════════════════════════════════════════════════════ */

.atlas-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 0;
  background: var(--atlas-gradient);
  z-index: 999;
  transition: width .1s linear;
}

/* ═══════════════════════════════════════════════════════════════
   8. PIED DE PAGE
   ═══════════════════════════════════════════════════════════════ */

.site-footer,
.site-info {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}

.site-info a { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   9. RTL — l'arabe est l'une des 4 langues du blog
   Les proprietes logiques ci-dessus gerent l'essentiel ;
   seules les exceptions sont traitees ici.
   ═══════════════════════════════════════════════════════════════ */

[dir="rtl"] body,
html[lang^="ar"] body { line-height: 1.9; }

[dir="rtl"] .entry-content ul li::marker,
[dir="rtl"] .entry-content ol li::marker { unicode-bidi: plaintext; }

[dir="rtl"] .atlas-progress { inset-inline-start: auto; inset-inline-end: 0; }

/* ═══════════════════════════════════════════════════════════════
   10. MOUVEMENT REDUIT ET IMPRESSION
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  body.blog article:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .atlas-progress, .main-navigation { display: none; }
  body.single .entry-content { max-width: none; }
}

/* ═══════════════════════════════════════════════════════════════
   11. MOBILE — ajustements specifiques
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  body { font-size: 1rem; line-height: 1.65; }

  /* En-tete non collant sur mobile : il mangerait une part trop grande
     d'un ecran de 640 px de haut. */
  .site-header { position: static; }

  /* Titre d'article : la valeur fluide reste trop haute sur petit ecran. */
  body.single .entry-title { font-size: 1.6rem; max-width: none; }
  body.single .entry-content h2 { font-size: 1.3rem; margin-top: 2rem; }
  body.single .entry-content h3 { font-size: 1.12rem; }

  /* Chapo : la bordure degradee et le retrait grignotent trop de largeur. */
  body.single .entry-content > p:first-of-type {
    font-size: 1.05em;
    padding-inline-start: .9rem;
    margin-bottom: 1.5rem;
  }

  /* Cartes : moins de rembourrage, l'image porte deja le message. */
  body.blog .inside-article,
  body.archive .inside-article { padding: 1.15rem; }

  body.blog .entry-title,
  body.archive .entry-title { font-size: 1.15rem; }

  /* L'article epingle repasse en carte simple : la mise en page deux
     colonnes n'a pas de sens sous 900 px. */
  body.blog article.sticky .inside-article { padding: 1.15rem; }

  /* Pas d'effet de survol sur ecran tactile : il reste « colle » apres
     un appui et donne l'impression d'un bug. */
  body.blog article:hover,
  body.archive article:hover { transform: none; box-shadow: var(--shadow); }
  body.blog article:hover .post-image img { transform: none; }

  /* Listes et tableaux : on recupere de la largeur utile. */
  .entry-content ul,
  .entry-content ol { padding-inline-start: 1.1rem; }
  .entry-content th,
  .entry-content td { padding: .7rem .8rem; }
}

/* Aucun debordement horizontal, quel que soit le contenu. */
html, body { overflow-x: hidden; }
