@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ============================================================
   DESIGN TOKENS — Bibliothèque linguistique
   (Distinct de Datcha&samovar, Protocole slave, Bibliothèque&papier)
   ============================================================ */
:root {
  /* Couleurs */
  --encre: #1A2D4F;
  --encre-clair: #2D4470;
  --terracotta: #B85C3C;
  --terracotta-clair: #D07451;
  --creme: #F5F0E6;
  --creme-alt: #E8DFCC;
  --blanc: #FFFFFF;
  --noir-doux: #1A1A1A;
  --gris-chaud: #6B6560;
  --gris-clair: #B5AFA5;
  --bordure: #DDD5C6;

  /* Dérivés opacité */
  --encre-60: rgba(26, 45, 79, 0.60);
  --encre-80: rgba(26, 45, 79, 0.80);
  --noir-80: rgba(26, 26, 26, 0.80);

  /* Polices */
  --ff-display: 'Crimson Pro', Georgia, serif;
  --ff-body: 'IBM Plex Sans', -apple-system, system-ui, sans-serif;

  /* Mesures */
  --measure-article: 720px;
  --measure-wide: 1200px;
  --measure-hero: 1440px;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 380ms;
  --dur-slow: 600ms;
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--noir-doux);
  background: var(--creme);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--encre); }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--encre);
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.015em; }
h2 {
  font-size: clamp(1.55rem, 3.1vw, 2.15rem);
  margin: 3rem 0 1rem;
  padding-bottom: 0.75rem;
  position: relative;
}
h2::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 40px; height: 2px;
  background: var(--terracotta);
}
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin: 2rem 0 0.75rem; color: var(--encre-clair); }
p { margin-bottom: 1.25rem; }
ul, ol { margin: 0 0 1.25rem 1.5rem; }
li { margin-bottom: 0.5rem; }
strong { color: var(--encre); font-weight: 600; }
em { font-family: var(--ff-display); font-style: italic; color: var(--encre-clair); }

/* Signature unique : initiale cyrillique en filigrane dans les H2 des pages principales */
.article-body h2 {
  position: relative;
}
.article-body h2[data-cyr]::before {
  content: attr(data-cyr);
  position: absolute;
  top: -1.8rem;
  right: -0.3rem;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 5.5rem;
  color: var(--encre);
  opacity: 0.07;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}
.article-body h2 > * { position: relative; z-index: 1; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--creme);
  border-bottom: 1px solid var(--bordure);
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header.scrolled {
  background: var(--blanc);
  box-shadow: 0 2px 12px rgba(26, 45, 79, 0.06);
}
.header-inner {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.site-logo {
  font-family: var(--ff-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--encre);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.site-logo .logo-accent {
  color: var(--terracotta);
  font-style: italic;
  font-weight: 600;
}
.site-logo:hover { color: var(--encre-clair); }
.site-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.site-nav a {
  font-size: 0.93rem;
  color: var(--noir-doux);
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--terracotta);
  transition: width var(--dur) var(--ease);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { width: 100%; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.menu-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--encre);
  margin: 5px 0;
  transition: all var(--dur) var(--ease);
}

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--creme);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    box-shadow: 0 4px 16px rgba(26, 45, 79, 0.08);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all var(--dur) var(--ease);
  }
  body.nav-open .site-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--encre);
  color: var(--creme);
  text-align: center;
}
.hero-image {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 45, 79, 0.55) 0%, rgba(26, 45, 79, 0.70) 100%);
  z-index: 2;
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: var(--measure-article);
  padding: 4rem var(--gutter);
}
.hero-kicker {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta-clair);
  margin-bottom: 1.25rem;
}
.hero h1 {
  color: var(--creme);
  margin-bottom: 1.5rem;
}
.hero-lead {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  color: rgba(245, 240, 230, 0.92);
  max-width: 620px;
  margin: 0 auto 2rem;
  font-weight: 400;
  line-height: 1.5;
}
.hero-home { min-height: 78vh; }
.hero-page { min-height: 48vh; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font-family: var(--ff-body);
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  /* Carré, pas de radius */
  border-radius: 0;
}
.btn-primary {
  background: var(--terracotta);
  color: var(--blanc);
  border-color: var(--terracotta);
}
.btn-primary:hover {
  background: var(--encre);
  color: var(--creme);
  border-color: var(--encre);
}
.btn-outline {
  background: transparent;
  color: var(--creme);
  border-color: var(--creme);
}
.btn-outline:hover {
  background: var(--creme);
  color: var(--encre);
}
.btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   LAYOUT + CONTAINERS
   ============================================================ */
main { display: block; }
.container {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.article-container {
  max-width: var(--measure-article);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: 5rem 0; }
.section-alt { background: var(--creme-alt); }
.section-dark { background: var(--encre); color: var(--creme); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--creme); }
.section-dark h2::after { background: var(--terracotta-clair); }

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title .kicker {
  display: block;
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 1rem;
}
.section-title h2 { display: inline-block; }
.section-title h2::after { left: 50%; transform: translateX(-50%); }

/* ============================================================
   ARTICLE BODY
   ============================================================ */
.article-summary {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--encre-clair);
  padding: 2rem 0;
  border-top: 1px solid var(--bordure);
  border-bottom: 1px solid var(--bordure);
  margin-bottom: 2.5rem;
}
.article-body {
  font-size: 1.06rem;
  line-height: 1.75;
}
.article-body h2:first-child { margin-top: 0; }
.article-body img {
  margin: 2.5rem auto;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.article-body blockquote {
  border-left: 3px solid var(--terracotta);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.18rem;
  color: var(--encre-clair);
}

/* ============================================================
   CARDS
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}
.card {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  /* Rectangulaire, pas de radius */
  border-radius: 0;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(26, 45, 79, 0.10);
  border-color: var(--terracotta);
}
.card-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--creme-alt);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
.card:hover .card-image img { transform: scale(1.03); }
.card-body { padding: 1.75rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-kicker {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.5rem;
}
.card-title {
  font-family: var(--ff-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--encre);
}
.card-desc {
  font-size: 0.95rem;
  color: var(--gris-chaud);
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.6;
}
.card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-link::after { content: " →"; }

/* ============================================================
   FAQ (<details> natif)
   ============================================================ */
.faq {
  max-width: var(--measure-article);
  margin: 3rem auto;
}
.faq details {
  border-bottom: 1px solid var(--bordure);
  padding: 1.3rem 0;
}
.faq summary {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--encre);
  transition: color var(--dur) var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--ff-display);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--terracotta);
  transition: transform var(--dur) var(--ease);
  flex-shrink: 0;
}
.faq summary:hover { color: var(--terracotta); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > :not(summary) {
  margin-top: 1rem;
  color: var(--gris-chaud);
  line-height: 1.7;
}

/* ============================================================
   TABLES
   ============================================================ */
.article-body table,
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.article-body th,
.article-body td,
.table th,
.table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--bordure);
}
.article-body th,
.table th {
  background: var(--creme-alt);
  font-family: var(--ff-display);
  font-weight: 600;
  color: var(--encre);
  border-bottom: 2px solid var(--terracotta);
  font-size: 1rem;
}

/* ============================================================
   ANNUAIRE
   ============================================================ */
.annuaire-region {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--bordure);
}
.annuaire-region:last-child { border-bottom: none; }
.annuaire-disclaimer {
  background: var(--creme-alt);
  border-left: 3px solid var(--terracotta);
  padding: 1.35rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.96rem;
  color: var(--encre-clair);
}
.annuaire-disclaimer strong { color: var(--encre); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  padding: 3rem 2.5rem;
  text-align: center;
}
.contact-card .btn { margin: 1rem 0 1.5rem; }
.contact-meta {
  font-size: 0.9rem;
  color: var(--gris-chaud);
  margin-top: 1.5rem;
}

/* ============================================================
   DISCLAIMER LEGAL (ancien propriétaire)
   ============================================================ */
.legal-callout {
  background: var(--creme-alt);
  border-top: 2px solid var(--terracotta);
  border-bottom: 2px solid var(--terracotta);
  padding: 2rem;
  margin: 2.5rem 0;
  font-family: var(--ff-body);
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--encre);
}
.legal-callout strong { color: var(--encre); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--encre);
  color: var(--gris-clair);
  padding: 4rem 0 2rem;
}
.footer-grid {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand {
  font-family: var(--ff-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--creme);
  margin-bottom: 1rem;
}
.footer-brand .logo-accent {
  color: var(--terracotta-clair);
  font-style: italic;
  font-weight: 600;
}
.footer-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--gris-clair);
  max-width: 380px;
}
.footer-col h4 {
  font-family: var(--ff-body);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta-clair);
  margin-bottom: 1.25rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.75rem; }
.footer-col a { color: var(--gris-clair); font-size: 0.95rem; }
.footer-col a:hover { color: var(--creme); }
.footer-bottom {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 2rem var(--gutter) 0;
  border-top: 1px solid rgba(245, 240, 230, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--gris-clair);
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   UTILS
   ============================================================ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-size: 0.84rem;
  color: var(--gris-chaud);
  margin: 2rem auto 1rem;
  max-width: var(--measure-article);
  padding: 0 var(--gutter);
}
.breadcrumb a { color: var(--gris-chaud); }
.breadcrumb a:hover { color: var(--terracotta); }
.breadcrumb-sep { margin: 0 0.5rem; color: var(--gris-clair); }

/* ============================================================
   404
   ============================================================ */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--gutter);
  background: var(--creme);
}
.error-page h1 { font-size: clamp(3rem, 8vw, 5rem); color: var(--terracotta); margin-bottom: 1rem; }
.error-page p { font-size: 1.18rem; margin-bottom: 2rem; color: var(--encre-clair); max-width: 560px; }
