/* ==========================================================================
   Iguanas.shop – společné styly pro všechny stránky
   ========================================================================== */

:root {
  --jungle-950: #0b1a13;
  --jungle-900: #10241a;
  --jungle-800: #173426;
  --jungle-700: #1f4a34;
  --leaf-500: #4f9d48;
  --leaf-400: #6dbb55;
  --lime-300: #c3e35a;
  --sand-50: #fbf8f1;
  --sand-100: #f4eee1;
  --sand-200: #e9dfc8;
  --clay-500: #c66a33;
  --ink: #1a2820;
  --ink-soft: #4a5a50;
  --line: rgba(26, 40, 32, .12);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 36, 26, .06), 0 8px 24px rgba(16, 36, 26, .08);
  --shadow-lg: 0 2px 4px rgba(16, 36, 26, .08), 0 18px 48px rgba(16, 36, 26, .16);
  --container: 1180px;
  --header-h: 72px;

  /* šupinový vzor (SVG) */
  --scales: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1.2'%3E%3Cpath d='M0 12a10 10 0 0 1 20 0M20 12a10 10 0 0 1 20 0M-10 24a10 10 0 0 1 20 0M10 24a10 10 0 0 1 20 0M30 24a10 10 0 0 1 20 0M-10 0a10 10 0 0 1 20 0M10 0a10 10 0 0 1 20 0M30 0a10 10 0 0 1 20 0'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- základ ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font: 400 1.0625rem/1.7 var(--font-sans);
  color: var(--ink);
  background: var(--sand-50);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--jungle-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--leaf-500); }
:focus-visible { outline: 3px solid var(--lime-300); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--jungle-900); }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; padding: .6rem 1rem; background: var(--lime-300); color: var(--jungle-950); border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* ---------- tlačítka ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.5em; border-radius: 999px; font-weight: 600; text-decoration: none; transition: transform .15s, background-color .15s, color .15s; }
.btn-primary { background: var(--lime-300); color: var(--jungle-950); }
.btn-primary:hover { background: #d4ef75; color: var(--jungle-950); transform: translateY(-1px); }
.btn-primary[href^="#"]::after { content: "↓"; }

/* ---------- hlavička a navigace ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(16, 36, 26, .92);
  -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand img { width: 190px; height: auto; }

.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.site-nav a { color: var(--sand-100); text-decoration: none; }
.site-nav .menu > li > a { display: block; padding: .55rem 1rem; border-radius: 999px; font-weight: 600; font-size: .98rem; }
.site-nav .menu > li > a:hover,
.site-nav .menu > li.is-active > a { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav .menu > li > a[aria-current="page"] { color: var(--lime-300); }
.site-nav ul ul { list-style: none; margin: 0; padding: 0; }
.site-nav .sub-menu a[aria-current="page"] { color: var(--lime-300); }

.submenu-toggle { display: none; }

/* mega menu (desktop) */
@media (min-width: 961px) {
  .site-nav .menu > li { position: static; }
  .site-nav .menu > li.has-children > a::after { content: ""; display: inline-block; width: .45em; height: .45em; margin-left: .5em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.2em) rotate(45deg); opacity: .7; }
  .site-nav .sub-menu.level-1 {
    position: absolute; left: 50%; top: calc(100% - 6px); transform: translate(-50%, 8px);
    width: min(100vw - 2.5rem, var(--container));
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem 2rem;
    padding: 1.75rem 2rem 2rem;
    background: var(--jungle-900) var(--scales); border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s;
  }
  .site-nav .menu > li.has-children:hover > .sub-menu,
  .site-nav .menu > li.has-children:focus-within > .sub-menu,
  .site-nav .menu > li.has-children.is-open > .sub-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
  .site-nav .sub-menu.level-1 > li > a { display: block; font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; color: #fff; padding-bottom: .35rem; margin-bottom: .35rem; border-bottom: 1px solid rgba(255, 255, 255, .1); line-height: 1.3; }
  .site-nav .sub-menu.level-1 > li > a:hover { color: var(--lime-300); }
  .site-nav .sub-menu.level-2 a { display: block; padding: .2rem 0; font-size: .9rem; line-height: 1.4; color: rgba(244, 238, 225, .75); }
  .site-nav .sub-menu.level-2 a:hover { color: var(--lime-300); }
  .nav-toggle { display: none; }
}

/* mobilní menu */
@media (max-width: 960px) {
  /* backdrop-filter by z hlavičky udělal kontejner pro fixed menu, na mobilu ho vypínáme */
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--jungle-900); }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border-radius: 999px;
    background: rgba(255, 255, 255, .08); color: #fff; border: 0; font: 600 .95rem var(--font-sans); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; } .nav-toggle-bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; overflow-y: auto; overscroll-behavior: contain;
    background: var(--jungle-900); padding: 1rem 1.25rem 3rem; display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav .menu { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav .menu > li { position: relative; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .site-nav .menu > li > a { padding: 1rem .25rem; border-radius: 0; font-size: 1.1rem; background: none !important; }
  .submenu-toggle {
    display: grid; place-items: center; position: absolute; right: 0; top: .5rem; width: 44px; height: 44px;
    background: rgba(255, 255, 255, .06); border: 0; border-radius: 50%; color: #fff; cursor: pointer;
  }
  .submenu-toggle span { width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
  .submenu-toggle[aria-expanded="true"] span { transform: rotate(-135deg) translate(-2px, -2px); }
  .site-nav .sub-menu.level-1 { display: none; padding: 0 0 1rem .25rem; }
  .site-nav li.is-open > .sub-menu.level-1 { display: block; }
  .site-nav .sub-menu.level-1 > li > a { display: block; padding: .55rem 0; font-weight: 600; color: #fff; }
  .site-nav .sub-menu.level-2 { padding-left: 1rem; border-left: 2px solid rgba(195, 227, 90, .3); margin-bottom: .4rem; }
  .site-nav .sub-menu.level-2 a { display: block; padding: .35rem 0; font-size: .95rem; color: rgba(244, 238, 225, .75); }
  body.nav-open { overflow: hidden; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; color: var(--sand-100);
  background:
    radial-gradient(ellipse 60% 80% at 85% 20%, rgba(195, 227, 90, .22), transparent 60%),
    radial-gradient(ellipse 50% 70% at 10% 100%, rgba(79, 157, 72, .35), transparent 65%),
    var(--jungle-900);
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(4rem, 9vw, 7rem);
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scales); background-size: 56px 34px; mask-image: linear-gradient(100deg, transparent 35%, #000 85%); -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 85%); }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media .ph { display: none; }
.hero-media:has(img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 26, 19, .92) 0%, rgba(11, 26, 19, .7) 45%, rgba(11, 26, 19, .15) 100%); }
.hero-inner { max-width: var(--container); }
.hero h1 { color: #fff; max-width: 12ch; }
.hero-lead { max-width: 40rem; font-size: 1.15rem; color: rgba(244, 238, 225, .86); }
.eyebrow { display: inline-block; margin-bottom: 1.25rem; padding: .3rem .85rem; border: 1px solid rgba(195, 227, 90, .4); border-radius: 999px; color: var(--lime-300); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero-actions { margin: 2rem 0 0; }

/* ---------- sekce ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-head { max-width: 46rem; margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }

/* karty rodů */
.genus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.genus-card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.genus-card a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.genus-card figure { margin: 0; aspect-ratio: 560 / 373; overflow: hidden; background: var(--sand-200); }
.genus-card figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.genus-card a:hover figure img { transform: scale(1.05); }
.genus-card .genus-title { margin: 0; padding: 1rem 1.25rem 1.25rem; font-size: 1.15rem; line-height: 1.3; display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.genus-card .genus-title::after { content: "→"; color: var(--leaf-500); transition: transform .2s; }
.genus-card a:hover .genus-title::after { transform: translateX(4px); }

/* náhradní grafika za chybějící obrázky */
.ph {
  display: block; width: 100%; height: 100%; min-height: 160px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cpath fill='%23ffffff' fill-opacity='.22' d='M4 40c10-2 18-10 30-12 8-1 12 2 18 1l6-9 4 8 5-8 4 8 5-8 4 8 5-7 3 8c8 2 14 6 22 6l-4 5c-8 0-14-3-20-3-10 0-16 6-30 7-8 1-14-3-24-2-10 1-18 5-28 5z'/%3E%3C/svg%3E") center 58% / 62% no-repeat,
    var(--scales),
    linear-gradient(135deg, hsl(var(--hue, 120) 42% 34%), hsl(calc(var(--hue, 120) + 30) 48% 20%));
}

/* text o čeledi */
.section-prose { background: var(--sand-100); }
.prose-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.prose { max-width: 44rem; }
.prose .lead { font-family: var(--font-serif); font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.45; color: var(--jungle-900); }
.fact-card { position: relative; overflow: hidden; padding: 2rem; border-radius: var(--radius); background: var(--jungle-800); color: var(--sand-100); box-shadow: var(--shadow-lg); }
.fact-card::before { content: ""; position: absolute; inset: 0; background: var(--scales); opacity: .8; pointer-events: none; }
.fact-card > * { position: relative; }
.fact-number { font: 700 5rem/1 var(--font-serif); color: var(--lime-300); margin: 0 0 .5rem; }
.extinct-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .5rem; }
.extinct-list li { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; background: rgba(255, 255, 255, .06); border-radius: var(--radius-sm); font-style: italic; }
.extinct-list li::before { content: "†"; font-style: normal; color: var(--clay-500); font-weight: 700; }

/* tematické bloky */
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.topic { padding: 2rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--leaf-400); }
.topic h2 { font-size: 1.55rem; }
.topic p { color: var(--ink-soft); font-size: 1rem; }
.topic strong { color: var(--ink); }
.topic-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 1.25rem; border-radius: 14px; background: rgba(109, 187, 85, .14); }
.topic-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--jungle-700); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 960px) {
  .prose-layout, .topics { grid-template-columns: 1fr; }
}

/* ---------- obsah podstránek (článek) – rody a druhy ---------- */
.page-head {
  position: relative; isolation: isolate; color: var(--sand-100);
  background:
    radial-gradient(ellipse 60% 90% at 90% 0%, rgba(195, 227, 90, .18), transparent 60%),
    radial-gradient(ellipse 50% 80% at 0% 100%, rgba(79, 157, 72, .3), transparent 65%),
    var(--jungle-900);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 0;
}
.page-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scales); background-size: 56px 34px; mask-image: linear-gradient(100deg, transparent 30%, #000 90%); -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 90%); }
.page-head-inner { max-width: 46rem; }
.page-head h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 0; }
.page-head-media { max-width: 46rem; position: relative; margin-top: 2.5rem; margin-bottom: -3rem; }
.page-head-media img, .page-head-media .ph { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.page-head + .container { padding-top: calc(3rem + clamp(2rem, 5vw, 3rem)); }

.breadcrumbs { font-size: .9rem; color: rgba(244, 238, 225, .7); margin-bottom: 1.25rem; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .5rem; opacity: .6; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--lime-300); }
.breadcrumbs [aria-current] { color: var(--sand-100); }

.article { max-width: 46rem; margin-inline: auto; padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.article > p:first-child { font-family: var(--font-serif); font-size: clamp(1.2rem, 2vw, 1.4rem); line-height: 1.5; color: var(--jungle-900); }
.article h2 { margin-top: 2em; }
.article h3 { margin-top: 1.6em; }
.article h4 { margin-top: 1.4em; font-size: 1.1rem; }
.article ul, .article ol { padding-left: 1.3rem; margin: 0 0 1.25em; }
.article li { margin-bottom: .35em; }
.article li::marker { color: var(--leaf-500); }
.article figure { margin: 2rem 0; }
.article figure img, .article figure .ph { width: 100%; border-radius: var(--radius); }
.article figure .ph { aspect-ratio: 3 / 2; height: auto; }
.article figcaption { margin-top: .6rem; font-size: .9rem; color: var(--ink-soft); }

.toc { margin: 2rem 0; padding: 1.5rem 1.75rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-left: 4px solid var(--leaf-400); }
.toc-title { font: 700 .8rem var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--jungle-700); margin-bottom: .75rem; }
.toc ol { margin: 0; padding-left: 1.4rem; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; font-size: .98rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.species-grid { margin: 2rem 0; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.article .species-grid figure { margin: 0; }
.article .species-grid figure img, .article .species-grid figure .ph { border-radius: 0; height: 100%; aspect-ratio: auto; }
.species-grid .genus-title { margin-top: 0; }
.genus-card .card { display: flex; flex-direction: column; height: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.genus-card.is-static .genus-title::after { content: none; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 2rem 0; }
.article .gallery figure { margin: 0; }
.article .gallery img, .article .gallery .ph { aspect-ratio: 3 / 2; object-fit: cover; height: auto; }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- patička ---------- */
.site-footer { position: relative; background: var(--jungle-950); color: rgba(244, 238, 225, .72); font-size: .95rem; }
.footer-scales { height: 14px; background: var(--leaf-500) var(--scales); background-size: 28px 17px; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 2fr 1fr; gap: 2.5rem; padding: 3.5rem 0 2.5rem; }
.footer-brand img { width: 190px; }
.footer-title { font: 700 .8rem var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--lime-300); margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-genera ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.site-footer a { color: rgba(244, 238, 225, .8); text-decoration: none; }
.site-footer a:hover, .site-footer a[aria-current="page"] { color: var(--lime-300); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 0 1.75rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .875rem; }
.footer-bottom p { margin: 0; }
.back-to-top { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .08); font-size: 1.1rem; }
@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
  .footer-genera ul { grid-template-columns: 1fr; }
}
