/* =========================================================
   Portfolio Léo LUCAS — Thème Naturaliste
   Palette : crème · vert forêt · brun terre · or
   ========================================================= */

/* === VARIABLES === */
:root {
  --cream:        #F7F4EC;
  --cream-mid:    #EDE8DA;
  --cream-dark:   #D5CDBA;
  --green-forest: #2C5F2E;
  --green-mid:    #4A7C59;
  --green-light:  #7EAB8A;
  --brown-earth:  #7B4F2E;
  --brown-light:  #A67850;
  --gold:         #C4993A;
  --gold-light:   #D4B268;
  --text-dark:    #1C1B18;
  --text-mid:     #4A4540;
  --text-muted:   #8A7F72;
  --white:        #FFFFFF;

  --font-serif: 'EB Garamond', 'Georgia', serif;
  --font-sans:  system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;

  --max-width:   1200px;
  --radius:      3px;
  --radius-lg:   8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.07);
  --shadow:      0 2px 8px rgba(0,0,0,0.09);
  --shadow-lg:   0 6px 24px rgba(0,0,0,0.12);
  --transition:  0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a  { color: inherit; }
ul { list-style: none; }

/* === BASE === */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
}

/* === LAYOUT === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-main { flex: 1; }

/* =========================================================
   NAVIGATION
   ========================================================= */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--cream-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--green-forest);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nav-logo span {
  font-weight: 400;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-links > li { position: relative; }

.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.9rem;
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--text-mid);
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  color: var(--green-forest);
  background: var(--cream-mid);
}

.dropdown-arrow {
  font-size: 0.6rem;
  opacity: 0.55;
  transition: transform var(--transition);
}

.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  padding: 0.4rem 0;
  z-index: 200;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu { display: block; }

.dropdown-menu a {
  display: block;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--text-mid);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.dropdown-menu a:hover {
  color: var(--green-forest);
  background: var(--cream);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--text-mid);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  border-radius: 2px;
  transition: var(--transition);
}

/* =========================================================
   PAGE D'ACCUEIL
   ========================================================= */
.home-hero {
  padding: 5rem 0 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--cream-dark);
}

.home-hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-mid);
  font-family: var(--font-sans);
  margin-bottom: 1.2rem;
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--text-dark);
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.home-hero h1 em {
  color: var(--green-forest);
  font-style: normal;
}

.home-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem auto;
  max-width: 180px;
}

.home-divider::before,
.home-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cream-dark);
}

.home-divider span { color: var(--gold); font-size: 0.6rem; }

.home-hero-intro {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.home-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0 4.5rem;
}

.home-section-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem 2rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.home-section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-forest), var(--green-light));
}

.home-section-card--flore::before {
  background: linear-gradient(90deg, var(--green-mid), var(--gold));
}

.home-section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.home-section-icon { font-size: 2.4rem; line-height: 1; }

.home-section-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--text-dark);
}

.home-section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.home-section-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.home-section-subcat {
  font-size: 0.73rem;
  color: var(--text-muted);
  border: 1px solid var(--cream-dark);
  border-radius: 20px;
  padding: 0.12rem 0.55rem;
}

.home-section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  color: var(--green-forest);
  font-size: 0.875rem;
  font-weight: 500;
}

/* =========================================================
   PAGES DE SECTION / LISTE
   ========================================================= */
.page-header {
  padding: 2.5rem 0 1.75rem;
  border-bottom: 1px solid var(--cream-dark);
  margin-bottom: 1.75rem;
}

.page-header-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.page-header-eyebrow a {
  text-decoration: none;
  color: var(--text-muted);
  transition: color var(--transition);
}

.page-header-eyebrow a:hover { color: var(--green-forest); }

.page-header h1 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-dark);
}

.page-header-desc {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Sous-catégories */
.subcats-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.subcats-nav a {
  padding: 0.35rem 1rem;
  border: 1px solid var(--cream-dark);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-mid);
  text-decoration: none;
  background: var(--white);
  transition: all var(--transition);
}

.subcats-nav a:hover { border-color: var(--green-mid); color: var(--green-forest); }

.subcats-nav a.active {
  background: var(--green-forest);
  border-color: var(--green-forest);
  color: var(--white);
}

/* Grille espèces */
.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding-bottom: 4rem;
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem 0 4rem;
}

/* =========================================================
   CARTE ESPÈCE
   ========================================================= */
.species-card {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: transform var(--transition), box-shadow var(--transition);
}

.species-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.species-card-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream-mid);
}

.species-card-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.species-card:hover .species-card-photo-wrap img { transform: scale(1.05); }

.species-card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-mid);
  font-size: 3rem;
}

.species-card-body { padding: 1rem 1.1rem 1.25rem; }

.species-card-badge { margin-bottom: 0.55rem; }

.species-card-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.species-card-scientific {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.species-card-meta {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.badge-oiseaux    { color: var(--green-forest); }
.badge-insectes   { color: #8B6914; }
.badge-mammiferes { color: var(--brown-earth); }
.badge-reptiles   { color: var(--green-mid); }
.badge-plantes    { color: var(--green-forest); }
.badge-champignons{ color: var(--brown-earth); }
.badge-fleurs     { color: #b5446e; }
.badge-vegetaux   { color: var(--green-mid); }

/* =========================================================
   PAGE FICHE ESPÈCE
   ========================================================= */
.species-single {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.species-breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.species-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.species-breadcrumb a:hover { color: var(--green-forest); }

.species-breadcrumb span:not(:last-child) { opacity: 0.5; }

.species-layout {
  display: grid;
  grid-template-columns: 55% 1fr;
  gap: 4rem;
  align-items: start;
}

.species-photo { position: sticky; top: 80px; }

.species-photo img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.species-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cream-mid);
  border-radius: var(--radius-lg);
  border: 1px solid var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}

.species-info-badge { margin-bottom: 1rem; }

.species-name {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.species-scientific {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.species-divider {
  height: 1px;
  background: var(--cream-dark);
  margin: 1.5rem 0;
  position: relative;
}

.species-divider::after {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--cream);
  padding: 0 0.6rem;
  color: var(--gold);
  font-size: 0.45rem;
}

.species-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.species-meta-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9rem;
}

.species-meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 85px;
  flex-shrink: 0;
}

.species-meta-value { color: var(--text-mid); }

.species-description {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-mid);
}

.species-description p + p { margin-top: 1em; }

.species-section { }

.species-section-title {
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-forest);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.species-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cream-dark);
}

/* Badges IUCN */
.badge-iucn {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}

.badge-iucn--lc { background: #388e3c; }
.badge-iucn--nt { background: #689f38; }
.badge-iucn--vu { background: #f57c00; }
.badge-iucn--en { background: #d32f2f; }
.badge-iucn--cr { background: #b71c1c; }
.badge-iucn--ew { background: #4527a0; }
.badge-iucn--ex { background: #212121; }

/* =========================================================
   PAGE STANDARD (À PROPOS)
   ========================================================= */
.page-content {
  max-width: 680px;
  margin: 3rem auto;
  padding: 0 1.5rem 4rem;
}

.page-content h1 {
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--cream-dark);
}

.page-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.page-content h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
  color: var(--text-dark);
}

.page-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  color: var(--text-mid);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--cream-mid);
  border-top: 1px solid var(--cream-dark);
  padding: 1.75rem 0;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--green-forest);
}

.site-footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.site-footer-rights {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Copyright photo */
.photo-copyright {
  position: absolute;
  bottom: 0.5rem;
  right: 0.55rem;
  font-size: 0.62rem;
  font-family: var(--font-sans);
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* =========================================================
   PHOTO — DÉCLENCHEUR LIGHTBOX
   ========================================================= */
.lightbox-trigger {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: zoom-in;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.lightbox-trigger img { transition: filter 0.3s ease; }

.lightbox-trigger:hover img,
.lightbox-trigger:focus-visible img { filter: brightness(0.82); }

.lightbox-hint {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.lightbox-trigger:hover .lightbox-hint,
.lightbox-trigger:focus-visible .lightbox-hint {
  opacity: 1;
  transform: scale(1);
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: #000;
  cursor: zoom-out;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1;
  height: 2.25rem;
  padding: 0 0.9rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 18, 18, 0.82);
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
}

.lightbox-close-x {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.65;
}

.lightbox-figure {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

@keyframes lb-img-in {
  from { opacity: 0; transform: scale(0.93) translateY(14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.lightbox-img {
  display: block;
  max-width: 95vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
}

.lightbox.is-open .lightbox-img {
  animation: lb-img-in 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 0.015em;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .home-sections { grid-template-columns: 1fr; }

  .species-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .species-photo { position: static; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--cream-dark);
    padding: 0.75rem 1rem 1rem;
    gap: 0.1rem;
    box-shadow: var(--shadow);
  }

  .nav-links.is-open { display: flex; }

  .nav-links > li > a { padding: 0.6rem 0.75rem; }

  .nav-dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--cream-mid);
    border-radius: var(--radius);
    padding: 0.25rem 0 0.25rem 1rem;
    margin-top: 0.1rem;
    display: block;
  }

  .nav-toggle { display: block; }

  .species-name { font-size: 1.9rem; }
}

@media (max-width: 560px) {
  .home-hero { padding: 3rem 0 2.5rem; }

  .species-grid { grid-template-columns: 1fr; }

  .subcats-nav a { font-size: 0.78rem; }
}
