/*
 * main.css — Gemeinsames Stylesheet
 * ═══════════════════════════════════════════════════════════════════
 * Top-Level:   <link rel="stylesheet" href="/main.css">
 * Unterordner: <link rel="stylesheet" href="../main.css">
 */

/* ── Reset & Design-Tokens ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Farben */
  --c-bg:      #f7f4ef;
  --c-bg2:     #eeebe3;
  --c-bg3:     #e4dfd4;
  --c-ink:     #0f1a0e;
  --c-ink2:    #2a3828;
  --c-ink3:    #4a5c47;
  --c-muted:   #7a8c76;
  --c-border:  #d8d2c6;
  --c-forest:  #1a3a1a;
  --c-green:   #2d6a2d;
  --c-green2:  #4a9e4a;
  --c-leaf:    #c8e6c0;

  /* Typografie */
  --f-serif: 'Playfair Display', Georgia, serif;
  --f-sans:  'DM Sans', system-ui, sans-serif;

  /* Abstände */
  --px:  clamp(16px, 5vw, 64px);
  --gap: clamp(10px, 2.5vw, 16px);

  /* Animation */
  --ease: cubic-bezier(.22, .87, .34, 1);
}

html { scroll-behavior: smooth; }
body  { font-family: var(--f-sans); background: var(--c-bg); color: var(--c-ink); line-height: 1.6; overflow-x: hidden; }
img   { display: block; max-width: 100%; }
a     { color: inherit; text-decoration: none; }
button { font-family: var(--f-sans); cursor: pointer; border: none; background: none; }


/* ══════════════════════════════════════════════════════════════════
   Navigation
══════════════════════════════════════════════════════════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(247,244,239,.93);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow .3s;
}
.site-nav.scrolled { box-shadow: 0 2px 24px rgba(15,26,14,.09); }

.nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--px); height: 58px; gap: 12px;
}
.nav-logo  { font-family: var(--f-serif); font-size: 1.1rem; color: var(--c-forest); white-space: nowrap; flex-shrink: 0; }
.nav-logo em { font-style: italic; color: var(--c-green); }

/* Desktop */
.nav-links { display: none; gap: 2px; align-items: center; }
@media (min-width: 860px) {
  .nav-links  { display: flex; }
  .nav-burger { display: none !important; }
}
.nav-link {
  font-size: .74rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
  color: var(--c-ink3); padding: 6px 10px; border-radius: 5px;
  transition: color .18s, background .18s; white-space: nowrap; position: relative;
}
.nav-link:hover, .nav-link.here { color: var(--c-forest); background: var(--c-leaf); }

/* Dropdown */
.nav-item { position: relative; }
.nav-link.has-drop { padding-right: 20px; }
.nav-link.has-drop::after {
  content: ''; position: absolute; right: 7px; top: 50%;
  transform: translateY(-60%);
  border: 4px solid transparent; border-top-color: currentColor; margin-top: 1px;
}
.nav-drop {
  position: absolute; top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 200px; background: #fff;
  border: 1px solid var(--c-border); border-radius: 10px;
  padding: 6px; box-shadow: 0 8px 28px rgba(15,26,14,.13);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  max-height: 75vh; overflow-y: auto;
}
.nav-item:hover .nav-drop { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0); }
.nav-drop a {
  display: block; font-size: .76rem; color: var(--c-ink2);
  padding: 6px 12px; border-radius: 6px; transition: background .13s;
}
.nav-drop a:hover { background: var(--c-leaf); color: var(--c-forest); }
.drop-hdr { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); padding: 8px 12px 3px; }

/* Hamburger */
.nav-burger { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 10px; width: 40px; height: 40px; }
.nav-burger span { display: block; width: 20px; height: 1.5px; background: var(--c-ink); transition: transform .28s, opacity .28s, width .28s; transform-origin: center; }
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile Drawer */
.nav-drawer {
  position: fixed; inset: 58px 0 0 0; z-index: 190;
  background: #fff; overflow-y: auto;
  transform: translateX(100%); transition: transform .32s var(--ease);
  padding: 20px var(--px) 60px;
}
.nav-drawer.open { transform: none; }
.drw-section { margin-bottom: 24px; }
.drw-hdr { font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--c-border); }
.drw-link { font-family: var(--f-serif); font-size: 1.05rem; color: var(--c-ink2); display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.drw-link small { font-family: var(--f-sans); font-size: .68rem; color: var(--c-muted); }
.drw-sub { padding-left: 14px; }
.drw-sub .drw-link { font-family: var(--f-sans); font-size: .9rem; }


/* ══════════════════════════════════════════════════════════════════
   Page-Header (dunkler Block oben auf jeder Unterseite)
══════════════════════════════════════════════════════════════════ */
.page-hdr {
  background: var(--c-forest);
  padding: clamp(36px,6vw,68px) var(--px) clamp(28px,5vw,52px);
  position: relative; overflow: hidden;
}
.page-hdr::before {
  content: attr(data-emoji); position: absolute; right: -8px; top: 50%;
  transform: translateY(-50%); font-size: clamp(72px,16vw,148px);
  opacity: .07; pointer-events: none; user-select: none; line-height: 1;
}
.page-hdr-inner { max-width: 1400px; margin: 0 auto; position: relative; z-index: 1; }

.breadcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; font-size: .66rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.breadcrumb a { color: inherit; transition: color .18s; }
.breadcrumb a:hover { color: rgba(255,255,255,.7); }
.bc-sep { opacity: .3; }

.page-title { font-family: var(--f-serif); font-size: clamp(2rem,5vw,3.4rem); font-weight: 400; color: #fff; line-height: 1.1; }
.page-title em { font-style: italic; color: rgba(200,230,192,.8); }
.page-sub  { margin-top: 10px; font-size: .84rem; color: rgba(255,255,255,.42); max-width: 560px; line-height: 1.7; }

.page-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.page-badge { font-size: .65rem; font-weight: 600; letter-spacing: .07em; background: rgba(255,255,255,.1); color: rgba(255,255,255,.6); padding: 3px 11px; border-radius: 20px; border: 1px solid rgba(255,255,255,.12); }


/* ══════════════════════════════════════════════════════════════════
   Prev / Next Leiste
══════════════════════════════════════════════════════════════════ */
.pn-bar { background: var(--c-bg2); border-bottom: 1px solid var(--c-border); padding: 0 var(--px); }
.pn-bar-bottom { border-top: 1px solid var(--c-border); border-bottom: none; }
.pn-inner { max-width: 1400px; margin: 0 auto; height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pn-btn { display: flex; align-items: center; gap: 7px; font-size: .75rem; color: var(--c-ink3); padding: 5px 9px; border-radius: 6px; transition: all .18s; max-width: calc(50% - 60px); overflow: hidden; }
.pn-btn:hover { background: var(--c-leaf); color: var(--c-forest); }
.pn-btn.pn-next { flex-direction: row-reverse; text-align: right; }
.pn-btn svg { flex-shrink: 0; width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; opacity: .6; }
.pn-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-center { font-size: .68rem; color: var(--c-muted); white-space: nowrap; flex-shrink: 0; text-align: center; }


/* ══════════════════════════════════════════════════════════════════
   Kategorie-Übersicht
══════════════════════════════════════════════════════════════════ */
.cat-layout { max-width: 1400px; margin: 0 auto; padding: clamp(24px,4vw,48px) var(--px) 80px; display: grid; grid-template-columns: 1fr; gap: clamp(20px,3vw,36px); }
@media (min-width: 820px) { .cat-layout { grid-template-columns: 220px 1fr; } }

.sidebar { align-self: start; }
@media (min-width: 820px) { .sidebar { position: sticky; top: 70px; } }
.sidebar-title { font-size: .62rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 10px; }
.sidebar-list { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 820px) { .sidebar-list { flex-direction: column; gap: 3px; } }

.sb-btn { font-size: .76rem; color: var(--c-ink3); padding: 6px 12px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--c-border); transition: all .18s; white-space: nowrap; cursor: pointer; }
@media (min-width: 820px) { .sb-btn { border: none; border-radius: 7px; padding: 7px 10px; width: 100%; } }
.sb-btn:hover { background: var(--c-bg2); color: var(--c-ink); }
.sb-btn.active { background: var(--c-forest); color: #fff; border-color: var(--c-forest); }
.sb-btn small { font-size: .63rem; opacity: .5; font-weight: 500; flex-shrink: 0; }
.sb-sep { height: 1px; background: var(--c-border); margin: 6px 0; display: none; }
@media (min-width: 820px) { .sb-sep { display: block; } }

/* Eintrags-Grid */
.entries-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--gap); }
@media (min-width: 480px)  { .entries-grid { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 900px)  { .entries-grid { grid-template-columns: repeat(4,1fr); } }
@media (min-width: 1200px) { .entries-grid { grid-template-columns: repeat(5,1fr); } }

.ecard { display: block; position: relative; overflow: hidden; border-radius: 10px; background: var(--c-bg2); transition: transform .32s var(--ease), box-shadow .32s; }
.ecard:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(15,26,14,.13); }
.ecard-img { aspect-ratio: 4/3; overflow: hidden; background: var(--c-bg3); }
.ecard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), filter .4s; filter: brightness(.95) saturate(.88); }
.ecard:hover .ecard-img img { transform: scale(1.06); filter: brightness(1) saturate(1); }
.ecard-body { padding: 9px 11px 11px; }
.ecard-name  { font-family: var(--f-serif); font-size: .93rem; color: var(--c-ink); line-height: 1.2; margin-bottom: 2px; }
.ecard-latin { font-family: var(--f-serif); font-style: italic; font-size: .68rem; color: var(--c-muted); }
.ecard-grp   { font-size: .6rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--c-green); margin-top: 4px; }
.ecard-badge { position: absolute; top: 7px; left: 7px; background: rgba(10,18,10,.6); backdrop-filter: blur(4px); color: rgba(255,255,255,.75); font-size: .6rem; font-weight: 500; padding: 2px 7px; border-radius: 10px; }

/* Suche */
.search-wrap { position: relative; margin-bottom: clamp(10px,2vw,16px); }
.search-input { width: 100%; padding: 9px 36px 9px 14px; font-family: var(--f-sans); font-size: .84rem; background: var(--c-bg2); border: 1px solid var(--c-border); border-radius: 8px; color: var(--c-ink); outline: none; transition: border-color .18s; }
.search-input:focus { border-color: var(--c-green); background: #fff; }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.search-count { font-size: .72rem; color: var(--c-muted); margin-bottom: 12px; }

/* A–Z */
.az-bar { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: clamp(12px,2vw,18px); }
.az-btn { font-size: .72rem; font-weight: 600; width: 28px; height: 28px; border-radius: 5px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--c-border); color: var(--c-ink3); transition: all .15s; }
.az-btn:hover { background: var(--c-leaf); border-color: var(--c-green); color: var(--c-forest); }
.az-btn.inactive { opacity: .2; pointer-events: none; }
.no-results { grid-column: 1/-1; text-align: center; padding: 64px 20px; color: var(--c-muted); font-style: italic; }


/* ══════════════════════════════════════════════════════════════════
   Detail-Seite
══════════════════════════════════════════════════════════════════ */
.detail-wrap { max-width: 1400px; margin: 0 auto; padding: clamp(24px,4vw,52px) var(--px) 80px; display: grid; grid-template-columns: 1fr; gap: clamp(28px,4vw,52px); }
@media (min-width: 900px) { .detail-wrap { grid-template-columns: 1fr 360px; align-items: start; } }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 500; color: var(--c-green); transition: gap .18s; }
.back-link:hover { gap: 10px; }
.back-link svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Galerie */
.gallery-col { min-width: 0; }
.main-img-wrap { position: relative; border-radius: 12px; overflow: hidden; background: var(--c-bg3); cursor: zoom-in; }
.main-img-wrap img { width: 100%; height: auto; display: block; max-height: 72vh; object-fit: contain; background: var(--c-ink); }

.img-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(10,18,10,.55); backdrop-filter: blur(4px); color: #fff; font-size: 1.1rem; display: grid; place-items: center; transition: background .18s; z-index: 2; border: 1px solid rgba(255,255,255,.1); }
.img-nav-btn:hover { background: rgba(10,18,10,.85); }
.img-nav-btn.img-prev { left: 10px; }
.img-nav-btn.img-next { right: 10px; }
.img-nav-btn:disabled { opacity: .2; pointer-events: none; }

.img-counter { position: absolute; bottom: 10px; right: 12px; z-index: 2; font-size: .65rem; font-weight: 600; background: rgba(10,18,10,.6); backdrop-filter: blur(4px); color: rgba(255,255,255,.7); padding: 3px 9px; border-radius: 12px; }
.img-legend  { font-size: .78rem; color: var(--c-muted); padding: 8px 2px; min-height: 1.6em; font-style: italic; }

/* Thumbnails */
.thumb-strip { display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 4px; margin-top: 10px; scrollbar-width: thin; scrollbar-color: var(--c-border) transparent; }
.thumb-strip::-webkit-scrollbar { height: 4px; }
.thumb-strip::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }
.thumb { flex-shrink: 0; width: 72px; height: 54px; border-radius: 6px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color .18s, opacity .18s; opacity: .55; }
.thumb.active { border-color: var(--c-green); opacity: 1; }
.thumb:hover  { opacity: .85; }
.thumb img    { width: 100%; height: 100%; object-fit: cover; }

/* Info-Spalte */
.info-col { align-self: start; }
@media (min-width: 900px) { .info-col { position: sticky; top: 70px; } }

.species-name  { font-family: var(--f-serif); font-size: clamp(1.8rem,4vw,2.6rem); font-weight: 400; color: var(--c-forest); line-height: 1.1; margin-bottom: 6px; }
.species-latin { font-family: var(--f-serif); font-style: italic; font-size: clamp(.95rem,2vw,1.15rem); color: var(--c-muted); margin-bottom: 20px; }

.info-desc { font-size: .87rem; color: var(--c-ink2); line-height: 1.85; margin-bottom: 24px; }
.info-desc p + p { margin-top: .8em; }

/* Taxonomie */
.tax-card { background: var(--c-bg2); border: 1px solid var(--c-border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.tax-head { padding: 10px 14px; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); border-bottom: 1px solid var(--c-border); background: var(--c-bg3); }
.tax-row { display: flex; padding: 8px 14px; border-bottom: 1px solid var(--c-border); font-size: .79rem; gap: 8px; align-items: baseline; }
.tax-row:last-child { border: none; }
.tax-lbl { color: var(--c-muted); font-size: .72rem; min-width: 90px; flex-shrink: 0; }
.tax-val { color: var(--c-ink2); flex: 1; }
.tax-val em { font-style: italic; }

/* Tags */
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.tag { font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 11px; border-radius: 20px; background: var(--c-leaf); color: var(--c-forest); border: 1px solid rgba(45,106,45,.2); }
.tag.secondary { background: var(--c-bg2); color: var(--c-ink3); border-color: var(--c-border); }

/* Lightbox */
#lb { position: fixed; inset: 0; z-index: 600; background: rgba(10,18,10,.97); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
#lb.open { opacity: 1; pointer-events: all; }
.lb-img { max-width: 96vw; max-height: 96svh; object-fit: contain; border-radius: 4px; }
.lb-close { position: fixed; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1); color: rgba(255,255,255,.65); font-size: 1rem; display: grid; place-items: center; z-index: 1; transition: background .18s; }
.lb-close:hover { background: rgba(255,255,255,.2); }


/* ══════════════════════════════════════════════════════════════════
   Footer
══════════════════════════════════════════════════════════════════ */
.site-footer { background: var(--c-ink); padding: clamp(28px,5vw,48px) var(--px); }
.foot-inner { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.foot-logo { font-family: var(--f-serif); font-size: 1rem; color: rgba(255,255,255,.4); }
.foot-logo em { font-style: italic; color: var(--c-green2); }
.foot-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-nav a { font-size: .7rem; color: rgba(255,255,255,.25); transition: color .18s; }
.foot-nav a:hover { color: rgba(255,255,255,.6); }


/* ══════════════════════════════════════════════════════════════════
   Scroll-Reveal
══════════════════════════════════════════════════════════════════ */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
[data-reveal].visible { opacity: 1; transform: none; }

/* Touch: keine Hover-Effekte */
@media (hover: none) {
  .ecard:hover { transform: none; box-shadow: none; }
  .ecard-img img { transform: none !important; filter: none !important; }
}