/* ═══════════════════════════════════════════════════════════════════════════
   SOCLE COMMUN du relookage — medecinetibetaine.org et astrologietibetaine.org

   Ce fichier ne contient AUCUNE couleur de marque : il ne connaît que des
   variables. La palette et les sélecteurs propres à chaque site vivent dans
   relook-mtt.css et relook-astro.css.

   Deux fichiers jumeaux qui divergent finissent toujours par ne plus se
   ressembler — d'où cette séparation, même si elle coûte un fichier de plus.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────── fondations */
body {
  font-family: var(--r-texte);
  background: var(--r-fond);
  color: var(--r-encre);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .section-title, .subsection-title, .hero h1 {
  font-family: var(--r-titre);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  /* Fraunces est une variable : on demande la taille optique et un soupçon de
     « wonk », qui donne le grain d'un caractère dessiné plutôt que calculé. */
  font-variation-settings: 'SOFT' 12, 'WONK' 1, 'opsz' 48;
  color: var(--r-navy);
}
h1 { font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 1.1rem + 1.9vw, 2.6rem); }
h3 { font-size: clamp(1.12rem, .98rem + .5vw, 1.4rem); letter-spacing: -.008em; }

/* Le tibétain enfin livré avec le site, et posé sur sa propre ligne de base :
   Noto Serif Tibetan a des empilements hauts qui heurtent la ligne du dessus. */
.tib, [lang="bo"] {
  font-family: var(--r-tib);
  line-height: 2.1;
  font-size: 1.06em;
}

/* L'œil-de-mouche : c'était du 12px gris clair à 2.2:1, illisible. */
.eyebrow, .section-head .eyebrow {
  font-family: var(--r-texte);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--r-or-chaud);
}

p, li { color: var(--r-encre); }
.muted, .section-subtitle, .foot, small { color: var(--r-doux); }

a { color: var(--r-teal-fonce); text-underline-offset: .18em; }
a:hover { color: var(--r-navy); }

/* ─────────────────────────────────────────────────── en-tête */
.site-header {
  background: rgba(251,250,246,.82);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--r-trait);
  box-shadow: none;
}
.site-header .container {
  display: flex; align-items: center; gap: 1.25rem;
  flex-wrap: wrap;                 /* ⚠️ le chevauchement marque ⨯ menu à 390px
                                      venait d'un nowrap : la marque et le menu
                                      se marchaient dessus. */
  padding-top: .7rem; padding-bottom: .7rem;
}
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 25%, var(--r-navy-doux), var(--r-navy));
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(212,162,76,.35), 0 6px 18px rgba(0,11,51,.18);
}
.brand .lbl {
  font-family: var(--r-titre); font-weight: 600; font-size: 1.02rem;
  color: var(--r-navy); line-height: 1.15; min-width: 0;
}
.brand .lbl span {
  display: block; font-family: var(--r-texte); font-weight: 400;
  font-size: .74rem; letter-spacing: .04em; color: var(--r-doux);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.main-nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.main-nav a {
  display: inline-flex; align-items: center; gap: .48rem;
  padding: .62rem .8rem;           /* zone tactile ≥ 44px de haut */
  min-height: 44px;
  border-radius: 10px;
  font-size: .93rem; font-weight: 500; color: var(--r-encre);
  text-decoration: none; white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.main-nav a:hover { background: rgba(35,183,158,.10); color: var(--r-navy); }
.main-nav a.on { color: var(--r-teal-fonce); font-weight: 600; }

/* ─────────────────────────────────────────────────── boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .74rem 1.35rem;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--r-texte); font-weight: 600; font-size: .95rem;
  letter-spacing: .005em; text-decoration: none; cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--r-teal) 0%, var(--r-teal-fonce) 100%);
  color: #fff; box-shadow: 0 1px 2px rgba(14,123,105,.3), 0 8px 22px rgba(14,123,105,.22);
}
.btn-primary:hover { box-shadow: 0 2px 4px rgba(14,123,105,.32), 0 14px 32px rgba(14,123,105,.3); }
.btn-outline {
  background: transparent; color: var(--r-navy); border-color: var(--r-trait);
}
.btn-outline:hover { border-color: var(--r-navy); background: rgba(0,11,51,.04); }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.42); }
.hero .btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }
/* L'or servait de fond à du texte blanc : 2.5:1. Fond sombre, texte or. */
.btn-gold, .btn.btn-gold {
  background: var(--r-navy); color: var(--r-or);
  border: 1px solid rgba(212,162,76,.5);
}

/* ─────────────────────────────────────────────────── sections */
section { padding: clamp(3.4rem, 7vw, 6.5rem) 0; }
.alt-bg { background: var(--r-fond-alt); }
.section-head { max-width: 62ch; margin-inline: auto; text-align: center; }
.section-subtitle { font-size: 1.06rem; color: var(--r-doux); }

/* ─────────────────────────────────────────────────── fiches de modules */
/* Il y en a 91. C'est le corps du site : c'est là que se joue la subtilité. */
.module-card {
  background: var(--r-carte);
  border: 1px solid var(--r-trait);
  border-radius: var(--r-rayon);
  box-shadow: var(--r-ombre-1);
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s ease, border-color .22s ease;
}
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--r-ombre-2);
  border-color: rgba(212,162,76,.45);
}
/* ─────────────────────────────────────────────────── onglets */
.tab-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 46px; padding: .6rem 1.1rem;
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--r-texte); font-weight: 600; font-size: .95rem;
  color: var(--r-doux); border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.tab-btn:hover { color: var(--r-navy); }
.tab-btn.active, .tab-btn[aria-selected="true"] {
  color: var(--r-navy); border-bottom-color: var(--r-or);
}

/* ─────────────────────────────────────────────────── icônes */
/* relook.js remplace chaque émoji par un <svg class="r-ic">. */
.r-ic { width: 1.05em; height: 1.05em; flex: 0 0 auto; stroke-width: 1.6; }
.ic { display: inline-flex; align-items: center; }

/* ─────────────────────────────────────────────────── révélations */
/* Sobres : 14 px et une opacité. Une entrée spectaculaire fatigue au deuxième
   défilement — et la page en compte 91. */
.r-reveal { opacity: 0; transform: translateY(14px); }
.r-reveal.r-vu {
  opacity: 1; transform: none;
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.3,1);
}
@media (prefers-reduced-motion: reduce) {
  .r-reveal, .r-reveal.r-vu { opacity: 1; transform: none; transition: none; }
  .hero::before { animation: none; }
  .btn:hover, .module-card:hover { transform: none; }
}

/* ─────────────────────────────────────────────────── humeurs */
/* La seule interaction ajoutée, et elle porte du sens : les trois humeurs
   (rLung, mKhris pa, Bad kan) sont la grille de lecture de toute la médecine
   de Yuthok. Les choisir reteinte les accents de la page. */
.r-humeurs {
  display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
  margin: 2.2rem auto 0;
}
.r-humeur {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 44px; padding: .55rem 1rem;
  border: 1px solid var(--r-trait); border-radius: 999px;
  background: var(--r-carte); cursor: pointer;
  font-family: var(--r-texte); font-size: .9rem; font-weight: 500; color: var(--r-doux);
  transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.r-humeur .pastille {
  width: 10px; height: 10px; border-radius: 50%; background: var(--teinte);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teinte) 22%, transparent);
}
.r-humeur:hover { border-color: color-mix(in srgb, var(--teinte) 55%, var(--r-trait)); }
.r-humeur[aria-pressed="true"] {
  color: var(--r-navy); font-weight: 600;
  border-color: var(--teinte);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teinte) 16%, transparent);
}
.r-humeur-note {
  text-align: center; color: var(--r-doux); font-size: .93rem;
  max-width: 54ch; margin: 1rem auto 0; min-height: 3em;
}

/* ─────────────────────────────────────────────────── mobile */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .site-header .container { gap: .6rem; }
  .brand .lbl span { font-size: .68rem; }
  .main-nav { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .hero { min-height: 66vh; }
  .modules-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────── bandeau des humeurs */
/* Une respiration entre l'introduction et le programme : fond parchemin,
   filet d'or, rien d'autre. C'est l'interaction qui doit attirer l'œil. */
.r-humeurs-section {
  background: var(--r-fond);
  border-bottom: 1px solid var(--r-trait);
  padding: clamp(2.2rem, 4vw, 3.2rem) 0;
}
.r-humeurs-section .eyebrow { display: block; margin-bottom: .2rem; }
