/* ============================================================
   app.css · Kids Pro Theme
   Moderne · Coloré · Professionnel · RTL Arabe · Mobile-first
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Amiri:wght@400;700&display=swap');

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  /* --- Fonds --- */
  --bg:          #FFFBF5;
  --bg-alt:      #FFF4E6;
  --surface:     #FFFFFF;
  --surface-2:   #FAFAF7;

  /* --- Texte --- */
  --ink:         #1F1B16;
  --ink-soft:    #5C5550;
  --ink-mute:    #9C9590;
  --border:      #F0E8DD;
  --border-dark: #E0D5C5;

  /* --- Couleurs principales --- */
  --primary:     #FF7A45;
  --primary-dk:  #E85A1F;
  --primary-sf:  #FFE8DE;

  --secondary:   #00B8A9;
  --secondary-sf:#D0F2EE;

  --yellow:      #FFC93C;
  --yellow-sf:   #FFF3CC;

  --pink:        #FF6B9D;
  --pink-sf:     #FFE0EB;

  --purple:      #8B5CF6;
  --purple-sf:   #EDE4FF;

  --green:       #10B981;
  --green-sf:    #D1FAE5;

  --red:         #EF4444;
  --red-sf:      #FEE2E2;

  /* --- Rayons --- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* --- Ombres --- */
  --shadow-xs: 0 1px 2px rgba(80,60,40,.05);
  --shadow-sm: 0 2px 8px rgba(80,60,40,.07);
  --shadow-md: 0 6px 20px rgba(80,60,40,.10);
  --shadow-lg: 0 16px 40px rgba(80,60,40,.14);

  /* --- Typographie --- */
  --font-ui:     'Cairo', system-ui, -apple-system, sans-serif;
  --font-body:   'Amiri', 'Cairo', serif;

  /* --- Tailles --- */
  --fs-base:     17px;
  --fs-content:  19px;
  --lh-content:  1.9;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

a {
  color: var(--primary-dk);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--primary); }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
main  { padding: 32px 0 80px; }

/* ============================================================
   TYPOGRAPHIE
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-ui);
  color: var(--ink);
  line-height: 1.3;
  margin: 0 0 .6em;
  font-weight: 800;
  letter-spacing: -.015em;
}
h1 { font-size: 2.1rem; font-weight: 900; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; font-weight: 700; }

/* Titre de section — barre colorée en dessous */
.title {
  display: inline-block;
  position: relative;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 48px 0 28px;
  padding-bottom: 14px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 72px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(to left, var(--primary), var(--yellow));
}

.muted { color: var(--ink-soft); }
.ok    { color: var(--green); font-weight: 600; }
.err   { color: var(--red); font-weight: 600; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--r-full);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-dk), var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--primary-dk);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #c94810, var(--shadow-md);
  color: #fff;
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-dk), var(--shadow-xs);
}

.btn.alt {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--border-dark);
  box-shadow: 0 4px 0 var(--border-dark);
}
.btn.alt:hover {
  background: var(--surface-2);
  color: var(--primary-dk);
  border-color: var(--primary);
  box-shadow: 0 5px 0 var(--primary);
}
.btn.alt:active {
  box-shadow: 0 2px 0 var(--primary);
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(80,60,40,.04);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  min-height: 68px;
}

.logo {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.logo b {
  color: var(--primary);
  font-weight: 900;
}
.logo span { color: var(--ink); }
.logo:hover { color: var(--primary); }

.tools { display: flex; align-items: center; gap: 12px; }

.langs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}
.langs a {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: all .15s;
}
.langs a:hover {
  color: var(--primary);
  background: #fff;
}
.langs a[aria-current="true"] {
  background: var(--primary);
  color: #fff;
}

.burger {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
}
.burger:hover {
  background: var(--primary-sf);
  border-color: var(--primary);
  color: var(--primary-dk);
}

/* ============================================================
   NAV
   ============================================================ */
nav .menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 4px 0 14px;
  font-family: var(--font-ui);
  font-size: .95rem;
  font-weight: 600;
}
nav .menu > li { position: relative; }
nav .menu > li > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--ink-soft);
  border-radius: var(--r-full);
  transition: all .15s;
}
nav .menu > li > a:hover {
  background: var(--primary-sf);
  color: var(--primary-dk);
}

nav .menu .sub {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px;
  list-style: none;
  margin: 8px 0 0;
  z-index: 60;
  box-shadow: var(--shadow-lg);
}
nav .menu .has-sub:hover .sub { display: block; }
nav .menu .sub a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-weight: 500;
  transition: all .12s;
}
nav .menu .sub a:hover {
  background: var(--primary-sf);
  color: var(--primary-dk);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  margin: 32px auto 48px;
  max-width: 1200px;
  padding: 56px 48px;
  background: linear-gradient(135deg, #FFF8F0 0%, #FFFBF5 100%);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
/* blobs décoratifs */
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255,201,60,.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255,122,69,.20) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: 2.6rem;
  font-weight: 900;
  margin: 0 0 20px;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--ink);
}
.hero p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 32px;
  line-height: 1.7;
  max-width: 520px;
}
.hero .btn { margin-left: 6px; margin-right: 6px; margin-bottom: 8px; }

/* Aperçu de fiche (remplace le sheet) */
.sheet {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: rotate(-1.5deg);
  position: relative;
}
.sheet::before {
  content: '🎨';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  background: var(--yellow-sf);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  box-shadow: var(--shadow-sm);
  border: 3px solid #fff;
}
.sheet h2 {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  margin: 16px 0 18px;
  padding-bottom: 14px;
  text-align: center;
  color: var(--primary-dk);
  border-bottom: 2px dashed var(--border);
  font-weight: 800;
}
.sheet .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
}
.sheet .row:last-child { border-bottom: 0; }
.sheet .row span {
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink);
  font-family: var(--font-ui);
}
.sheet .row i {
  flex: 1;
  max-width: 80px;
  height: 3px;
  background: var(--yellow);
  border-radius: 3px;
  margin-right: 12px;
}

/* ============================================================
   SECTION : CATÉGORIES (cartes colorées)
   ============================================================ */
.grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.cat-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  overflow: hidden;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--card-color, var(--primary));
}

.cat-head {
  display: block;
  padding: 24px 20px 20px;
  color: var(--ink);
  height: 100%;
}
.cat-head:hover { color: var(--ink); }

/* icône en cercle coloré */
.cat-head .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  font-size: 1.9rem;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  background: var(--card-bg, var(--primary-sf));
  transition: transform .25s ease;
}
.cat-card:hover .ico { transform: scale(1.08) rotate(-4deg); }

.cat-head b {
  display: block;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink);
  line-height: 1.35;
}
.cat-head small {
  display: block;
  color: var(--ink-soft);
  font-size: .88rem;
  line-height: 1.55;
}
.cat-head .count {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  background: var(--card-color, var(--primary));
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  border-radius: var(--r-full);
  font-family: var(--font-ui);
}

/* Rotation de couleurs par carte (6 couleurs) */
.cat-card:nth-child(6n+1) {
  --card-color: var(--primary);
  --card-bg:    var(--primary-sf);
}
.cat-card:nth-child(6n+2) {
  --card-color: var(--secondary);
  --card-bg:    var(--secondary-sf);
}
.cat-card:nth-child(6n+3) {
  --card-color: #D4A017;
  --card-bg:    var(--yellow-sf);
}
.cat-card:nth-child(6n+4) {
  --card-color: var(--pink);
  --card-bg:    var(--pink-sf);
}
.cat-card:nth-child(6n+5) {
  --card-color: var(--purple);
  --card-bg:    var(--purple-sf);
}
.cat-card:nth-child(6n) {
  --card-color: var(--green);
  --card-bg:    var(--green-sf);
}

/* ============================================================
   CARTES D'ARTICLES
   ============================================================ */
.recent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  color: var(--ink);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.card .thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--primary-sf);
  border-radius: var(--r-sm);
  font-size: 1.8rem;
}
.card .t { flex: 1; min-width: 0; }
.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.01em;
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--primary-dk); }
.card p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: .94rem;
  line-height: 1.6;
}
.card small {
  display: block;
  color: var(--ink-mute);
  font-size: .82rem;
  font-weight: 500;
}

/* ============================================================
   CHIPS
   ============================================================ */
.subtitle {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  color: var(--ink);
  margin: 32px 0 16px;
  font-weight: 700;
}
.chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 28px;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 18px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: .92rem;
  font-weight: 600;
  transition: all .15s;
}
.chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-family: var(--font-ui);
  font-size: .9rem;
  color: var(--ink-soft);
  margin: 20px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.breadcrumb a {
  color: var(--ink-soft);
  font-weight: 500;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--primary-dk); }
.breadcrumb span[aria-hidden] { color: var(--ink-mute); }
.breadcrumb span[aria-current] {
  color: var(--ink);
  font-weight: 700;
}

/* ============================================================
   PAGE FICHE / POST — LISIBILITÉ MAX
   ============================================================ */
.ws-page { max-width: 940px; margin: 0 auto; padding: 20px; }

.ws-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0 28px;
  font-family: var(--font-ui);
}
.dl-count {
  color: var(--ink-soft);
  font-size: .92rem;
  font-weight: 500;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}

.paper {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 56px 56px 48px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}
/* barre colorée en haut */
.paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to left, var(--primary), var(--yellow), var(--secondary));
}

.ws-head {
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.ws-head h1 {
  font-family: var(--font-ui);
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0 0 24px;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -.02em;
}
.ws-head .meta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-ui);
  font-size: .92rem;
  color: var(--ink-soft);
  padding: 14px 0;
  margin-bottom: 20px;
  border-bottom: 2px dotted var(--border);
}
.ws-head .meta span {
  font-weight: 500;
  letter-spacing: .3px;
}
.ws-head .ins {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 16px auto 0;
  font-style: italic;
  line-height: 1.7;
  max-width: 60ch;
}

.ws-info {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: .88rem;
  color: var(--ink-soft);
  margin-top: 16px;
}
.ws-info span {
  padding: 6px 16px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  font-weight: 600;
}
.ws-cat {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
}

.ws-cover { margin: 0 0 36px; }
.ws-cover img {
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* 🔥 CONTENU DU POST — GRAND ET CLAIR */
.ws-content {
  font-family: var(--font-body);
  font-size: var(--fs-content);        /* 19px */
  line-height: var(--lh-content);      /* 1.9 */
  color: var(--ink);
  max-width: 72ch;
  margin: 0 auto;
  font-weight: 400;
}
.ws-content > * + * { margin-top: 1.2em; }
.ws-content p {
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.ws-content h2 {
  font-family: var(--font-ui);
  font-size: 1.7rem;
  font-weight: 900;
  margin: 2.2em 0 .8em;
  line-height: 1.3;
  color: var(--ink);
  padding-right: 18px;
  border-right: 5px solid var(--primary);
  border-radius: 2px;
  letter-spacing: -.02em;
}
.ws-content h3 {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 800;
  margin: 1.8em 0 .7em;
  line-height: 1.35;
  color: var(--ink);
}
.ws-content h4 {
  font-family: var(--font-ui);
  font-size: 1.12rem;
  font-weight: 700;
  margin: 1.5em 0 .6em;
  color: var(--ink);
}
.ws-content ul,
.ws-content ol {
  padding-right: 1.8em;
  padding-left: 0;
  margin: 0;
}
.ws-content li {
  margin-bottom: .6em;
  line-height: 1.85;
  padding-right: 4px;
}
.ws-content li::marker {
  color: var(--primary);
  font-weight: 700;
}
.ws-content img {
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin: 1.6em auto;
  max-width: 100%;
  height: auto;
  display: block;
}
.ws-content a {
  color: var(--primary-dk);
  border-bottom: 2px solid var(--primary-sf);
  font-weight: 500;
  transition: all .15s;
}
.ws-content a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.ws-content strong {
  background: linear-gradient(180deg, transparent 60%, var(--yellow) 60%);
  padding: 0 2px;
  font-weight: 700;
}
.ws-content em { font-style: italic; }
.ws-content blockquote {
  margin: 1.8em 0;
  padding: 1.2em 1.6em;
  background: var(--primary-sf);
  border-right: 4px solid var(--primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.8;
}
.ws-content blockquote p { margin: 0; }
.ws-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  background: #fff;
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  font-size: .95em;
}
.ws-content th,
.ws-content td {
  padding: .8em 1em;
  border: 1px solid var(--border);
  text-align: right;
  line-height: 1.6;
}
.ws-content th {
  background: var(--surface-2);
  font-family: var(--font-ui);
  font-weight: 700;
}
.ws-content hr {
  border: 0;
  height: 2px;
  background: linear-gradient(to left, transparent, var(--border), transparent);
  margin: 2.4em 0;
}
.ws-content code {
  font-family: 'Courier New', monospace;
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: .88em;
  direction: ltr;
  display: inline-block;
  color: var(--primary-dk);
}
.ws-content pre {
  background: var(--surface-2);
  padding: 20px;
  border-radius: var(--r-sm);
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  font-size: .88em;
  border: 1px solid var(--border);
}

/* tags */
.ws-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.ws-tags .tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  transition: all .15s;
}
.ws-tags .tag:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.ws-foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--ink-mute);
  font-size: .95rem;
  font-weight: 500;
}

/* ============================================================
   ARTICLES SIMILAIRES
   ============================================================ */
.ws-related { margin-top: 72px; }
.ws-related h2 {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 24px;
  padding-right: 14px;
  border-right: 4px solid var(--secondary);
  color: var(--ink);
}
.related-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.related-list a {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--ink);
  height: 100%;
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.related-list a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}
.related-list img,
.related-list .placeholder {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  border: 1px solid var(--border);
}
.related-list b {
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 700;
}
.related-list small {
  color: var(--ink-soft);
  font-size: .86rem;
  line-height: 1.5;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form {
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.form label {
  display: block;
  margin-bottom: 20px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .98rem;
  color: var(--ink);
}
.form input,
.form textarea,
.form select {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: 1rem;
  background: var(--surface-2);
  color: var(--ink);
  transition: all .18s;
}
.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-sf);
}
.form textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.7;
}

.search { display: flex; gap: 10px; margin-bottom: 28px; }
.search input {
  flex: 1;
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-radius: var(--r-full);
  font-family: var(--font-ui);
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  transition: all .18s;
}
.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-sf);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 56px 0;
  flex-wrap: wrap;
  font-family: var(--font-ui);
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 16px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-weight: 700;
  font-size: .92rem;
  transition: all .15s;
}
.pagination a:hover {
  background: var(--primary-sf);
  border-color: var(--primary);
  color: var(--primary-dk);
  transform: translateY(-2px);
}
.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  margin-top: 100px;
  padding: 56px 0 32px;
  background: var(--ink);
  color: var(--ink-mute);
  font-family: var(--font-ui);
  font-size: .92rem;
}
footer .cols {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
footer a {
  color: var(--ink-mute);
  font-weight: 500;
  transition: color .15s;
}
footer a:hover { color: var(--primary); }
.flogo {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
}
.flogo b { color: var(--primary); }

footer small {
  display: block;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--ink-mute);
}

/* ============================================================
   RESPONSIVE — TABLETTE (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 48px 32px;
    gap: 40px;
  }
  .hero h1 { font-size: 2.1rem; }
  .hero p { font-size: 1.08rem; }
  .paper { padding: 44px 32px 36px; }
  .ws-head h1 { font-size: 1.8rem; }
  .ws-content { font-size: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
  :root {
    --fs-base:    16px;
    --fs-content: 18px;
    --lh-content: 1.85;
  }

  .wrap { padding: 0 16px; }
  main  { padding: 16px 0 60px; }

  /* Header */
  .bar { padding: 10px 0; min-height: 60px; }
  .logo { font-size: 1.3rem; }
  .burger { display: inline-flex; }
  .langs { display: none; }

  /* Nav mobile */
  nav#nav { display: none; padding-bottom: 12px; }
  nav#nav.open { display: block; }
  nav .menu {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    font-size: 1rem;
  }
  nav .menu > li > a {
    display: flex;
    padding: 14px 16px;
    min-height: 48px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
  }
  nav .menu .sub {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 4px 16px 4px 0;
    margin: 4px 0 0;
    min-width: 0;
  }
  nav .menu .has-sub.open .sub { display: block; }
  nav .menu .sub a {
    padding: 12px 14px;
    min-height: 44px;
    background: #fff;
  }

  /* Titres */
  .title { font-size: 1.3rem; margin: 36px 0 20px; padding-bottom: 12px; }
  .title::after { width: 52px; height: 4px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.35rem; }

  /* Hero */
  .hero {
    padding: 40px 22px;
    margin: 20px auto 28px;
    border-radius: var(--r-lg);
  }
  .hero h1 { font-size: 1.7rem; line-height: 1.2; }
  .hero p { font-size: 1.02rem; }
  .hero .btn { width: 100%; justify-content: center; margin: 4px 0; }
  .sheet { padding: 24px 20px; }
  .sheet h2 { font-size: 1.05rem; }

  /* Grilles */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-head { padding: 18px 14px 16px; }
  .cat-head .ico {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
    border-radius: var(--r-sm);
    margin-bottom: 12px;
  }
  .cat-head b { font-size: 1rem; }
  .cat-head small { font-size: .82rem; }

  .recent { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 18px; gap: 12px; }
  .card .thumb { width: 48px; height: 48px; font-size: 1.5rem; }
  .card h3 { font-size: 1.02rem; }

  /* Fiche/Post */
  .ws-page { padding: 12px; }
  .paper {
    padding: 32px 20px 28px;
    border-radius: var(--r-lg);
  }
  .ws-head { padding-bottom: 24px; margin-bottom: 28px; }
  .ws-head h1 { font-size: 1.55rem; line-height: 1.3; }
  .ws-head .meta {
    flex-direction: column;
    gap: 10px;
    font-size: .88rem;
    text-align: right;
  }
  .ws-info { font-size: .82rem; gap: 8px; }
  .ws-info span { padding: 5px 12px; }

  /* 🔥 Contenu mobile */
  .ws-content { font-size: 18px; line-height: 1.85; max-width: 100%; }
  .ws-content p { text-align: right; }
  .ws-content h2 {
    font-size: 1.4rem;
    margin: 1.8em 0 .7em;
    padding-right: 14px;
    border-right: 4px solid var(--primary);
  }
  .ws-content h3 { font-size: 1.22rem; margin: 1.5em 0 .6em; }
  .ws-content h4 { font-size: 1.08rem; }
  .ws-content ul,
  .ws-content ol { padding-right: 1.4em; }
  .ws-content table {
    font-size: .85em;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Actions fiche */
  .ws-actions { gap: 10px; }
  .ws-actions .btn { width: 100%; justify-content: center; }
  .dl-count { font-size: .85rem; padding: 5px 12px; }

  /* Formulaires */
  .form { padding: 24px 18px; border-radius: var(--r-lg); }
  .search { flex-direction: column; }
  .search .btn { width: 100%; }

  /* Footer */
  footer { padding: 40px 0 24px; margin-top: 60px; }
  footer .cols { gap: 28px; flex-direction: column; }
  footer ul { gap: 14px; flex-direction: column; }

  /* Breadcrumb */
  .breadcrumb { font-size: .85rem; margin: 14px 0 8px; }

  /* Pagination */
  .pagination a,
  .pagination span { min-width: 44px; min-height: 44px; padding: 6px 12px; }
}

/* ============================================================
   PETITS MOBILES (≤ 400px)
   ============================================================ */
@media (max-width: 400px) {
  :root { --fs-content: 17px; }
  .hero h1 { font-size: 1.5rem; }
  .ws-head h1 { font-size: 1.35rem; }
  .title { font-size: 1.15rem; }
  .grid { grid-template-columns: 1fr; }
  .cat-head { padding: 20px 18px 18px; }
}

/* ============================================================
   IMPRESSION
   ============================================================ */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  header, footer, nav, .no-print, .ws-actions, .ws-related, .ws-tags,
  .breadcrumb, .pagination { display: none !important; }
  .wrap, .ws-page { max-width: 100%; padding: 0; }
  .paper {
    box-shadow: none;
    border: 0;
    padding: 0;
    background: #fff !important;
    color: #000;
  }
  .paper::before { display: none; }
  .ws-head { border-bottom: 1px solid #333; }
  .ws-head h1 { color: #000; }
  .ws-head .meta { font-size: 10pt; color: #333; border-bottom-color: #ccc; }
  .ws-content {
    font-size: 12pt;
    line-height: 1.8;
    color: #000;
    max-width: 100%;
  }
  .ws-content h2 { color: #000; border-right: 3px solid #666; }
  .ws-content h3 { color: #000; }
  .ws-content strong { background: none; font-weight: bold; }
  .ws-cover img { border: 1px solid #ccc; max-height: 400px; object-fit: contain; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 70%; color: #666; }
  .ws-content a[href]::after { content: none; }
  .card, .cat-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}