/* ════════════════════════════════════════
   ANIMALIA — style.css
   Le cabinet de curiosités
════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --parch: #ebe7dc;
  --parch-dark: #d9d3c1;
  --ink: #171b24;
  --ink-light: #343c4c;
  --ink-muted: #666c78;
  --accent: #24475f;
  --accent-dark: #162e40;
  --accent-light: #cfdbe3;
  --danger: #7a1c1c;
  --danger-light: #f0dada;
  --gold: #9a7a2c;
  --gold-light: #e4d6a8;
  --border: rgba(23, 27, 36, 0.2);
  --card: #f6f3ea;
  --on: #f2f5f8;
  --fd: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--parch);
  color: var(--ink);
}

/* ══════════════════════════════════
   NAVIGATION (structure commune aux 5 sites)
══════════════════════════════════ */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem 1.6rem;
  padding: 1.1rem 3rem;
  border-bottom: 1px solid var(--border);
  background: rgba(235, 231, 220, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-logo {
  font-family: var(--fd);
  font-size: 1.45rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-logo em { color: var(--accent); font-style: italic; }

.nav-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.6rem; list-style: none; }
.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-light);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--accent); }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s ease, opacity .3s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════
   BARRE DE RECHERCHE (structure commune)
══════════════════════════════════ */
.search-wrap {
  max-width: 580px;
  margin: 0 auto 1.5rem;
  display: flex;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.search-wrap input {
  flex: 1; min-width: 0; border: none; background: transparent;
  padding: .95rem 1.1rem; font-family: 'EB Garamond', serif;
  font-size: 1.05rem; color: var(--ink); outline: none;
}
.search-wrap input::placeholder { color: var(--ink-muted); font-style: italic; }
.search-wrap button {
  background: var(--accent); border: none; color: var(--on);
  padding: 0 1.6rem; font-family: 'EB Garamond', serif; font-size: .88rem;
  letter-spacing: .1em; cursor: pointer; transition: background .2s;
}
.search-wrap button:hover { background: var(--accent-dark); }
.hero-tag {
  display: inline-block; font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-light);
  padding: .3rem 1rem; margin-bottom: 1.6rem;
}
.lead { max-width: 44ch; font-size: 1.14rem; font-style: italic; color: var(--ink-muted); line-height: 1.6; margin: 1.2rem 0 1.8rem; }

/* ══════════════════════════════════
   HERO — tiroir d'entomologie
══════════════════════════════════ */
.an-hero {
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr);
  gap: clamp(1.5rem,4vw,4rem);
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(2rem,5vw,4.5rem) clamp(1rem,4vw,3rem);
}
.an-hero h1 {
  font-family: var(--fd); font-weight: 400;
  font-size: clamp(3rem,7.2vw,5.6rem); line-height: 1.02;
}
.an-hero h1 em { color: var(--accent); font-style: italic; }
.an-drawer { width: 100%; height: auto; filter: drop-shadow(0 14px 20px rgba(0,0,0,.28)); }

/* ══════════════════════════════════
   LE CABINET — mur de vitrines
══════════════════════════════════ */
.an-salle {
  background: #141f2b;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 2px, transparent 2px 48px);
  padding: clamp(2.5rem,5vw,4.5rem) clamp(1rem,4vw,3rem) clamp(3rem,6vw,5.5rem);
  color: #e8eef4;
}
.an-in { max-width: 1180px; margin: 0 auto; }
.an-in h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(2rem,4vw,3rem); }
.an-sub { color: #93a6b8; font-style: italic; margin: .5rem 0 2rem; max-width: 60ch; }

.wall { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); grid-auto-rows: minmax(168px,auto); gap: 1.4rem; }
.plate {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: #3a2f22;
  padding: 10px; background: linear-gradient(135deg,#e0c27a,#9a7a2c 55%,#7d5c22);
  box-shadow: 0 14px 26px rgba(0,0,0,.5); transition: transform .25s;
}
.plate:hover { transform: translateY(-4px) rotate(-.4deg); }
.plate-in {
  flex: 1; min-height: 120px; background: radial-gradient(circle at 50% 40%,#e0dcc6,#c9c5ac);
  display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 28px rgba(0,0,0,.3);
}
.plate-in span { font-size: var(--e,4.5rem); line-height: 1; filter: sepia(.55) saturate(1.15) drop-shadow(0 5px 4px rgba(0,0,0,.3)); }
.plate-in img { width: 62%; height: 62%; object-fit: contain; filter: sepia(.35) saturate(1.1) drop-shadow(0 5px 4px rgba(0,0,0,.3)); }
.plaque { background: #f3edd8; margin-top: 8px; padding: .55rem .85rem; display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .7rem; }
.plaque b { font-family: var(--fd); font-weight: 400; font-size: 1.15rem; color: #171b24; }
.plaque em { font-size: .86rem; color: #6a5a3c; }
.plaque .n { margin-left: auto; font-size: .8rem; letter-spacing: .06em; color: #6a5a3c; }

.p1 { grid-column: span 6; grid-row: span 2; --e: 10rem; }
.p2 { grid-column: span 6; --e: 5.4rem; }
.p3 { grid-column: span 3; --e: 4.4rem; }
.p4 { grid-column: span 3; --e: 4.4rem; }
.p5 { grid-column: span 7; --e: 5rem; }
.p6 { grid-column: span 5; --e: 5rem; }

.vit {
  grid-column: 1/-1; display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.6fr); gap: 1.6rem 2rem;
  padding: clamp(1.2rem,3vw,2rem); background: linear-gradient(#26141a,#180c10);
  border: 1px solid #6d4a3a; box-shadow: 0 0 0 6px #141f2b, 0 0 0 8px #8a6a2c, 0 18px 30px rgba(0,0,0,.5);
  color: #eadfd3;
}
.vit b { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: #d2ad55; }
.vit h3 { font-family: var(--fd); font-weight: 400; font-size: 2rem; margin: .4rem 0 .6rem; }
.vit p { color: #b79c8c; font-size: 1.02rem; }
.vit-link { display: inline-block; margin-top: 1rem; color: #d2ad55; text-decoration: none; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid rgba(210,173,85,.4); }
.vit-items { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: .9rem; }
.vi { position: relative; display: block; text-decoration: none; background: #f0e8d4; color: #2a1d16; padding: .9rem .8rem .8rem; text-align: center; transition: transform .2s; }
.vi:hover { transform: translateY(-3px); }
.vi::before { content: ""; position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #b3261e; box-shadow: 0 0 8px #b3261e; }
.vi span { display: block; font-size: 2.4rem; filter: sepia(.5); margin-bottom: .2rem; }
.vi b { display: block; font-family: var(--fd); font-weight: 400; font-size: 1rem; color: #171b24; }
.vi em { font-size: .8rem; color: #6a5a3c; }

/* ══════════════════════════════════
   CITATION + CHIFFRES
══════════════════════════════════ */
.an-quote { position: relative; background: #0e1620; padding: clamp(3rem,7vw,6rem) clamp(1.2rem,5vw,3rem); text-align: center; overflow: hidden; }
.an-quote::before { content:""; position:absolute; inset:0; background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.02) 0 2px, transparent 2px 9px); }
.an-quote blockquote { position: relative; max-width: 760px; margin: 0 auto; font-family: var(--fd); font-style: italic; font-size: clamp(1.5rem,3.4vw,2.3rem); line-height: 1.4; color: #eef2f5; }
.an-quote blockquote::before { content: "\201C"; display: block; font-size: 3.4rem; color: #9a7a2c; line-height: 0; margin-bottom: .6rem; }
.an-quote cite { position: relative; display: block; margin-top: 1.4rem; font-style: normal; font-size: .86rem; letter-spacing: .14em; text-transform: uppercase; color: #9a7a2c; }

.an-stats { background: #141f2b; border-top: 1px solid rgba(255,255,255,.08); padding: clamp(2.2rem,5vw,3.4rem) clamp(1rem,4vw,3rem); }
.an-stats-in { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: repeat(4,1fr); gap: 1.6rem; }
.an-stats-in div { text-align: center; padding: 0 .6rem; border-left: 1px solid rgba(255,255,255,.1); }
.an-stats-in div:first-child { border-left: 0; }
.an-stats-in strong { display: block; font-family: var(--fd); font-weight: 400; font-size: clamp(1.8rem,3.6vw,2.6rem); color: #d2ad55; }
.an-stats-in span { display: block; margin-top: .3rem; font-size: .82rem; letter-spacing: .06em; color: #93a6b8; }

/* ══════════════════════════════════
   OÙ LES OBSERVER — carte des milieux
══════════════════════════════════ */
.an-map { max-width: 1140px; margin: 4.5rem auto 0; padding: 0 clamp(1rem,4vw,3rem); }
.an-map h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.7rem,3.6vw,2.4rem); text-align: center; }
.an-map > p { text-align: center; color: var(--ink-muted); font-style: italic; margin: .5rem 0 2.4rem; }
.map-svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 18px rgba(0,0,0,.14)); }
.map-pin text { font-family: 'EB Garamond', serif; font-size: 11px; fill: #171b24; }
.map-pin .cnt { font-style: italic; fill: #666c78; }

/* ══════════════════════════════════
   CARNET DE TERRAIN
══════════════════════════════════ */
.an-field { max-width: 900px; margin: 4rem auto 0; padding: 0 clamp(1rem,4vw,2rem) 4.5rem; }
.an-field .paper { background: #f6f1de; border: 1px solid #cbb887; padding: clamp(1.6rem,4vw,2.6rem); box-shadow: 0 10px 26px rgba(0,0,0,.12); position: relative; }
.an-field .paper::before { content: ""; position: absolute; top: 0; bottom: 0; left: 52px; width: 1px; background: #d8b9a0; }
.an-field h2 { font-family: var(--fd); font-weight: 400; font-size: 1.5rem; margin-bottom: 1.2rem; }
.an-field ol { list-style: none; margin: 0; padding: 0; }
.an-field li { position: relative; padding: .5rem 0 .5rem 74px; font-size: 1rem; color: #3a2f22; line-height: 1.5; }
.an-field li b { position: absolute; left: 0; top: .5rem; width: 40px; text-align: right; font-family: var(--fd); color: #9a7a2c; }

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
footer { border-top: 1px solid var(--border); text-align: center; padding: 2.5rem 2rem; font-size: .85rem; color: var(--ink-muted); font-style: italic; background: var(--parch); }
footer strong { font-family: var(--fd); color: var(--ink-light); font-style: normal; }
footer ul { list-style: none; margin: .9rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; font-style: normal; }
footer a { color: var(--ink-light); text-decoration: none; }
footer a:hover { color: var(--accent); }
footer [aria-current] { color: var(--accent); border-bottom: 1px solid var(--accent); }
.footer-mentions { color: var(--ink-muted) !important; text-decoration: underline !important; font-style: italic; }
.footer-copy { display: inline-block; margin-top: .3rem; opacity: .7; font-size: .85em; }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 860px) {
  .an-hero { grid-template-columns: 1fr; }
  .wall { grid-template-columns: 1fr 1fr; }
  .p1, .p2, .p5, .vit { grid-column: 1/-1; }
  .p3, .p4, .p6 { grid-column: span 1; }
  .p1 { grid-row: auto; --e: 7rem; }
  .vit { grid-template-columns: 1fr; }
  .an-stats-in { grid-template-columns: 1fr 1fr; }
  .an-stats-in div:nth-child(3) { border-left: 0; }
}

@media (max-width: 768px) {
  nav { padding: 1rem 1.4rem; }
  .nav-logo { flex: 1; }
  .hamburger { display: flex !important; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; width: 100%;
    background: rgba(235,231,220,.98); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    padding: .5rem 0 1rem; max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-10px);
    transition: max-height .4s ease, opacity .35s ease, transform .35s ease; display: flex; z-index: 199;
  }
  .nav-links.open { max-height: 500px; opacity: 1; transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: .75rem 1.4rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .search-wrap { max-width: 100%; margin: 0 0 1.5rem; }
  .plant-grid .plant-card { min-width: 100%; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
