/*
Theme Name: Plant Atlas
Theme URI: https://plantatlas.net/
Author: Plant Atlas
Author URI: https://plantatlas.net/
Description: Custom theme built from the approved combined sample (plant-atlas-mau-tong-hop): sticky header with a horizontal Polylang language switcher, mega-menu with the ten categories, hero, magazine, interactive map, live plant database with search, filters, A-Z, favourites and compare, Plant of the Day and a four-column footer. Every section is driven by real WordPress posts, categories and Polylang languages — no hardcoded sample content.
Version: 1.1.18
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: plant-atlas
Tags: plants, encyclopedia, multilingual, custom-menu, featured-images, threaded-comments
*/

/*
 * Visual base: the approved combined sample (plant-atlas-mau-tong-hop.html,
 * 2026-11-09). Palette, type, spacing and class names are kept from the sample
 * so the live site looks like the approved design; the additions at the end of
 * this file cover WordPress templates (single post, archives, search, compare)
 * that a one-page sample does not have.
 */
:root{
  --bg:#f5f3ea; --surface:#fffdf4; --surface2:#eef0e0; --ink:#22331d; --ink-soft:#5c6d54;
  --line:#ddd8c2; --green:#2e5f34; --green-deep:#16381f; --green-soft:#e3ecd4;
  --accent:#a96f14; --accent-soft:#f3e7cd; --danger:#9c3b2e; --danger-soft:#f6e3dc;
  --shadow:0 10px 30px rgba(28,46,20,.14); --radius:14px;
  --cat-trees:#3f7a3a; --cat-flowers:#b04a7d; --cat-herbs:#7a5fb0; --cat-vegetables:#c2571b;
  --cat-fruits:#a3820e; --cat-bamboo:#2e7d74;
  --cat-houseplants:#6a8f3c; --cat-ferns:#2f6b4f; --cat-aquatic:#2e7d8c; --cat-cacti:#b07d2a;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#10160e; --surface:#1b2416; --surface2:#232f1d; --ink:#e8edd9; --ink-soft:#a7b695;
    --line:#37452c; --green:#8fce8f; --green-deep:#0d2412; --green-soft:#26381f;
    --accent:#e0aa4e; --accent-soft:#3a2f16; --danger:#e08a7a; --danger-soft:#3d201a;
    --shadow:0 10px 30px rgba(0,0,0,.45);
    --cat-trees:#7cc474; --cat-flowers:#e58ab5; --cat-herbs:#bda6ec; --cat-vegetables:#eda06a;
    --cat-fruits:#e3cd6a; --cat-bamboo:#6fc7bc;
    --cat-houseplants:#a4c47a; --cat-ferns:#6fbf8f; --cat-aquatic:#6fc7d6; --cat-cacti:#d9b45e;
  }
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{overflow-x:clip}
body{margin:0;background:var(--bg);color:var(--ink);font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;line-height:1.55;font-size:17px}
h1,h2,h3{font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif}
img{display:block;max-width:100%;height:auto}
a{color:var(--green)}
button{font:inherit;cursor:pointer}
.wrap{max-width:1400px;margin:0 auto;padding:0 20px}
/* Anchor targets must not hide under the sticky header. */
#atlas-map,#database,#stories,#potd{scroll-margin-top:84px}
section{padding:44px 0 8px}
/* v1.0.6: .sec-head h2 and .sec-head .potd-date shared the same four
 * declarations — merged into one rule; only the font differs. */
.sec-head h2,.sec-head .potd-date{font-size:clamp(1.7rem,3.4vw,2.4rem);margin:0 0 6px;font-weight:800;letter-spacing:-.01em}
.sec-head .potd-date{font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif}
.sec-head p{margin:0;color:var(--ink-soft);max-width:760px}
.kicker{font-size:.78rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--accent);margin:0 0 8px}
.sci{font-style:italic}
.screen-reader-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- header ---------- */
/* BUG 4 (v1.0.0): Leaflet panes paint at z-index 400 and Leaflet controls
 * at z-index 1000, ABOVE this header's old z-index:60 — so the map (and
 * its zoom controls / tile edges) showed through the sticky header and a
 * line cut across the menu text while scrolling. The header must sit above
 * every Leaflet layer (max 1000); the drawer/backdrop/tray/toast are
 * raised above the header in turn so they still open on top of it. */
header.site{position:sticky;top:0;z-index:1100;background:var(--surface);border-bottom:1px solid var(--line);box-shadow:0 2px 14px rgba(20,35,15,.06)}
.hbar{display:flex;align-items:center;gap:14px;padding-top:10px;padding-bottom:10px;flex-wrap:wrap}
.logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink)}
.logo svg{flex:none}
.logo .lname{font-family:"Newsreader",Georgia,serif;font-weight:800;font-size:1.45rem;line-height:1}
.logo .ltag{font-size:.72rem;color:var(--ink-soft);letter-spacing:.04em}
.langbar{display:flex;align-items:center;gap:2px;background:var(--surface2);border:1px solid var(--line);border-radius:999px;padding:3px}
.langbar button{background:none;border:0;border-radius:999px;padding:6px 11px;font-weight:800;font-size:.84rem;color:var(--ink-soft);letter-spacing:.02em}
.langbar button:hover{color:var(--ink)}
.langbar button[aria-pressed="true"]{background:var(--green);color:#fff}
.langbar ul{list-style:none;display:flex;gap:2px;margin:0;padding:0}
.langbar nav{display:flex}
.langbar li{list-style:none;margin:0}
.langbar li::marker{content:""}
.langbar a{display:block;text-decoration:none;border-radius:999px;padding:6px 11px;font-weight:800;font-size:.84rem;color:var(--ink-soft);letter-spacing:.02em;text-transform:uppercase}
.langbar a:hover{color:var(--ink)}
.langbar li.current-lang a,.langbar a[aria-current="true"]{background:var(--green);color:#fff}
.langbar span.lang-current{display:block;border-radius:999px;padding:6px 11px;font-weight:800;font-size:.84rem;background:var(--green);color:#fff}
nav.main{display:flex;align-items:center;gap:4px;margin-left:4px}
nav.main>a,nav.main .navbtn{background:none;border:0;color:var(--ink);text-decoration:none;font-weight:700;font-size:.95rem;padding:9px 12px;border-radius:9px}
nav.main>a:hover,nav.main .navbtn:hover{background:var(--green-soft)}
nav.main ul{list-style:none;display:flex;align-items:center;gap:4px;margin:0;padding:0}
nav.main ul li{margin:0}
nav.main ul a{display:block;color:var(--ink);text-decoration:none;font-weight:700;font-size:.95rem;padding:9px 12px;border-radius:9px}
nav.main ul a:hover{background:var(--green-soft)}
.has-menu{position:relative}
.mega{position:absolute;top:calc(100% + 8px);right:-10px;width:min(700px,94vw);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;display:none;z-index:70}
.has-menu.open .mega{display:block}
.mega .mega-title{margin:0 0 4px;font-size:1.05rem;font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-weight:700}
.mega p{margin:0 0 10px;font-size:.85rem;color:var(--ink-soft)}
.mega-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px 18px}
.mega a{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:8px 10px;border-radius:8px;text-decoration:none;color:var(--ink)}
.mega a:hover{background:var(--green-soft)}
.mega a>span:first-child{min-width:0}
.mega a .cnt{font-size:.76rem;color:var(--ink-soft);white-space:nowrap;text-align:right}
.mega a .cnt.done{color:var(--green);font-weight:700}
.hsearch{margin-left:auto;display:flex;align-items:center;background:var(--surface2);border:1px solid var(--line);border-radius:999px;padding:3px 3px 3px 14px;min-width:min(320px,100%)}
.hsearch input{border:0;background:none;color:var(--ink);font:inherit;font-size:.92rem;width:100%;outline:none;flex:1;min-width:0}
.hsearch button{background:var(--green);color:#fff;border:0;border-radius:999px;padding:7px 14px;font-weight:700;font-size:.88rem;white-space:nowrap;flex:none}
.potd-link{background:var(--accent-soft);color:var(--ink);text-decoration:none;font-weight:700;font-size:.9rem;padding:9px 14px;border-radius:999px;border:1px solid var(--line);white-space:nowrap}
.menu-btn{display:none;background:none;border:1px solid var(--line);border-radius:9px;padding:8px 12px;font-weight:700;color:var(--ink)}

/* ---------- hero ---------- */
/* v1.0.5 (VQA-35 / VQA-31): these rules are scoped to div.hero — the
 * front-page hero only. Batch-1 articles use <figure class="hero"> for
 * their lead figure, and the unscoped .hero::after gradient darkened the
 * left half of every such in-body figure (maize) with no text on it. */
div.hero{position:relative;border-radius:0 0 22px 22px;overflow:hidden;background:#12260f}
div.hero img.bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
div.hero::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,rgba(8,22,8,.9) 30%,rgba(8,22,8,.6) 65%,rgba(8,22,8,.3))}
.hero-in h1{text-shadow:0 2px 16px rgba(0,0,0,.5)}
.hero-in p.lede{text-shadow:0 1px 10px rgba(0,0,0,.45)}
.hero-in{position:relative;z-index:1;padding-top:64px;padding-bottom:54px;max-width:720px;color:#f2f7e9}
.hero-in .kicker{color:#f0c979}
.hero-in h1{font-size:clamp(2.2rem,5.4vw,3.6rem);line-height:1.05;margin:0 0 14px;font-weight:800}
.hero-in p.lede{font-size:1.06rem;color:#e6efdb;max-width:600px}
.hero-search{display:flex;background:#fffdf4;border-radius:999px;padding:4px;max-width:600px;margin-top:22px;box-shadow:var(--shadow)}
.hero-search input{flex:1;border:0;background:none;padding:10px 16px;font:inherit;font-size:1rem;color:#22331d;outline:none;min-width:0}
.hero-search button{background:#2e5f34;color:#fff;border:0;border-radius:999px;padding:11px 22px;font-weight:800;white-space:nowrap;flex:none}
.stats{background:var(--surface);border-bottom:1px solid var(--line)}
.stats-in{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding-top:18px;padding-bottom:18px}
.stat{text-align:center;padding:6px 4px}
.stat .num{font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:2rem;font-weight:800;color:var(--green);line-height:1}
.stat .lab{font-size:.85rem;font-weight:700;margin-top:4px}

/* ---------- magazine ---------- */
.feature{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:28px;margin-top:22px;background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow)}
.feature figure{margin:0;position:relative;background:var(--green-soft);min-height:340px}
.feature figure img{width:100%;height:100%;object-fit:cover;min-height:340px}
.cover-badge{position:absolute;top:14px;left:14px;background:var(--accent);color:#fff;font-weight:800;font-size:.78rem;padding:6px 12px;border-radius:999px;letter-spacing:.03em}
.feature figure figcaption{position:absolute;left:0;right:0;bottom:0;padding:26px 16px 12px;background:linear-gradient(transparent,rgba(8,20,8,.78));color:#eef4e2;font-size:.85rem}
.feature .txt{padding:26px 26px 26px 0}
.feature h2{font-size:clamp(1.6rem,3vw,2.15rem);margin:0 0 10px;line-height:1.15;font-weight:800}
.feature h2 a{color:var(--ink);text-decoration:none}
.feature h2 a:hover{color:var(--green)}
.byline{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:.85rem;color:var(--ink-soft);border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:8px 0;margin:0 0 14px}
.standfirst{font-size:1.05rem}
.factbox{background:var(--green-soft);border-radius:12px;padding:14px 18px;margin:16px 0}
/* v1.0.8: the DE sidebar ("Wichtige Fakten", 320px column) overflowed — the
 * label track was `auto` and labels were nowrap, so "Wissenschaftlicher
 * Name" (~175px) squeezed the value track to ~90px while German compounds
 * ("Mittelmeerraum,") need ~110px. Cap the label track at 9rem so the
 * value track keeps >= 122px, let labels wrap, and let long words break
 * (hyphens via lang="de") instead of overflowing. The same shared rule
 * covers the in-content .factbox, whose labels also fit in 9rem. */
.factbox dl,.dlist{display:grid;grid-template-columns:minmax(0,9rem) minmax(0,1fr);gap:5px 16px;margin:0;font-size:.93rem}
.factbox dt,.dlist dt{font-weight:700;min-width:0;overflow-wrap:break-word}
.factbox dd,.dlist dd{margin:0;min-width:0;overflow-wrap:break-word;hyphens:auto}
.btn{display:inline-block;background:var(--green);color:#fff;text-decoration:none;border:0;border-radius:999px;padding:11px 20px;font-weight:800;font-size:.95rem}
.btn.ghost{background:none;color:var(--green);border:2px solid var(--green)}
.tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:20px 0 6px}
.chips{display:flex;flex-wrap:wrap;gap:7px}
.chip{background:var(--surface);border:1px solid var(--line);color:var(--ink);border-radius:999px;padding:7px 14px;font-weight:600;font-size:.88rem}
.chip[aria-pressed="true"]{background:var(--green);color:#fff;border-color:var(--green)}
.tools input[type="search"]{flex:1;min-width:200px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:999px;padding:10px 16px;font:inherit}
.count-note{font-size:.88rem;color:var(--ink-soft)}
.story-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(258px,1fr));gap:16px;margin-top:14px}
.story{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;text-align:left;padding:0;width:100%}
.story h3 a{color:inherit;text-decoration:none}
.story h3 a:hover{text-decoration:underline}
.story:hover{box-shadow:var(--shadow)}
.story .ph{position:relative;background:var(--green-soft);min-height:168px;display:block}
.story .ph img{width:100%;height:168px;object-fit:cover}
.story .tag{position:absolute;top:10px;left:10px;background:rgba(14,30,12,.82);color:#eef4e2;font-size:.74rem;font-weight:700;padding:4px 10px;border-radius:999px}
.story .bd{padding:14px 16px 16px;display:flex;flex-direction:column;gap:6px;flex:1}
.story h2,.story h3{margin:0;font-size:1.22rem}
.story h2 .loc,.story h3 .loc{display:block;font-family:"Roboto",sans-serif;font-size:.86rem;font-weight:600;color:var(--ink-soft)}
.story .sci-line{font-size:.85rem;color:var(--ink-soft)}
.story p{margin:0;font-size:.9rem;color:var(--ink-soft)}
.story .grow{padding-top:8px;border-top:1px dashed var(--line);font-size:.84rem}
.story .grow b{color:var(--green)}
.safety-note{background:var(--danger-soft);border-radius:9px;padding:8px 11px;font-size:.8rem;color:var(--ink)}
/* v1.1.2: story cards collapse the excerpt + growing + safety note behind
 * a "More +" accordion so the grid stays short (user order 2026-11-14).
 * The toggle is white with a big green "+" and the word More beside it. */
.story-more{display:flex;flex-direction:column;gap:6px}
.story-more[hidden]{display:none}
.story-toggle{margin-top:auto;align-self:flex-start;display:inline-flex;align-items:center;gap:8px;background:#fff;border:1px solid #c9d4bd;border-radius:999px;padding:5px 14px 5px 10px;font-weight:700;font-size:.92rem;color:#2e7d32}
.story-toggle:hover{border-color:#2e7d32}
.story-toggle:focus-visible{outline:2px solid #2e7d32;outline-offset:2px}
.story-toggle .story-plus{font-size:1.4rem;line-height:1;font-weight:800;color:#2e7d32}
.empty-note{display:none;background:var(--surface);border:1px dashed var(--line);border-radius:var(--radius);padding:18px;margin-top:14px}
.empty-note.show{display:block}

/* ---------- map ---------- */
.mapgrid{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:18px;margin-top:18px;align-items:start}
.mapbox{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);position:relative;z-index:1}
#map{height:520px;width:100%;position:relative;z-index:0;background:var(--surface2)}
#map .leaflet-container{font:inherit}
.map-fallback{display:none;padding:20px}
.map-fallback.show{display:block}
.pin{width:30px;height:30px;border-radius:50% 50% 50% 4px;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center;transform:rotate(-45deg);border:2px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.35);font-weight:800;font-size:.8rem}
.pin span{transform:rotate(45deg)}
.pinlist{display:flex;flex-direction:column;gap:9px;max-height:560px;overflow:auto;padding-right:4px}
.pincard{display:flex;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:9px;text-align:left;width:100%;color:var(--ink);text-decoration:none}
.pincard:hover,.pincard.sel{border-color:var(--green);box-shadow:var(--shadow)}
.pincard img{width:64px;height:64px;object-fit:cover;border-radius:9px;flex:none}
/* v1.0.5 (VQA-25): consistent placeholder for pin-list items whose plant
 * has no published post / thumbnail yet (Ginkgo, Giant sequoia, Oak…),
 * instead of a missing image. Same role as .pcard .band. */
.pinband{width:64px;height:64px;border-radius:9px;flex:none;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center;font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:1.7rem;font-weight:800}
.pincard .n{font-weight:800;font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:1.05rem;line-height:1.2}
.pincard .n .loc{display:block;font-family:"Roboto",sans-serif;font-size:.8rem;font-weight:600;color:var(--ink-soft)}
.pincard .r{font-size:.8rem;color:var(--ink-soft)}
.pincard .num{background:var(--green);color:#fff;border-radius:50%;width:22px;height:22px;display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:800;flex:none}
.leaflet-popup-content{font-family:"Roboto",system-ui,sans-serif;font-size:.92rem;line-height:1.45}
.leaflet-popup-content b{font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:1.05rem}
.leaflet-popup-content a{font-weight:700}

/* ---------- database ---------- */
.db{background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:20px;margin-top:18px}
.db-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}
.db-tools label{font-size:.8rem;font-weight:700;display:block}
/* v1.0.5 (VQA-32): the database search input spans two grid columns so
 * its placeholder ("Name, scientific name, family…") is not cut off. */
.db-tools label:first-child{grid-column:span 2}
.db-tools input,.db-tools select{width:100%;margin-top:4px;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:10px;padding:10px 12px;font:inherit;font-size:.93rem}
.db-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:14px}
.seg{display:flex;border:1px solid var(--line);border-radius:999px;overflow:hidden}
.seg button{background:var(--surface);border:0;padding:8px 16px;font-weight:700;color:var(--ink)}
.seg button.active{background:var(--green);color:#fff}
.tgl{background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:8px 14px;font-weight:700;color:var(--ink)}
.tgl[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent)}
.clearbtn{background:none;border:0;color:var(--green);font-weight:700;text-decoration:underline}
.az{display:flex;flex-wrap:wrap;gap:3px;margin-top:16px;align-items:center}
.az span{font-weight:700;font-size:.85rem;margin-right:8px}
.az button{background:none;border:1px solid transparent;border-radius:7px;padding:4px 8px;font-weight:700;color:var(--ink)}
.az button:hover{border-color:var(--line)}
.az button.active{background:var(--green);color:#fff}
.meta{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:12px;font-size:.9rem;color:var(--ink-soft)}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:14px;margin-top:14px}
.pcard{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column}
a.pcard{text-decoration:none;color:var(--ink)}
a.pcard:hover{box-shadow:var(--shadow)}
.pcard .ph img{width:100%;height:140px;object-fit:cover}
.pcard .band{height:140px;display:flex;align-items:center;padding:0 16px;color:#fff;font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:1.9rem;font-weight:800}
.pcard .bd{padding:12px 14px 14px;display:flex;flex-direction:column;gap:5px;flex:1}
.pcard h2,.pcard h3{margin:0;font-size:1.12rem;line-height:1.25}
.pcard h2 .loc,.pcard h3 .loc{display:block;font-family:"Roboto",sans-serif;font-size:.84rem;font-weight:600;color:var(--ink-soft)}
.pcard .sci-line{font-size:.85rem;color:var(--ink-soft)}
.catline{font-size:.78rem;font-weight:700}
.catline i{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px}
.pcard p{margin:0;font-size:.86rem;color:var(--ink-soft)}
.pcard .acts{margin-top:auto;padding-top:10px;display:flex;gap:6px;flex-wrap:wrap}
.abtn{background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:6px 11px;font-size:.8rem;font-weight:700;color:var(--ink)}
.abtn[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent)}
.abtn.go{background:var(--green);color:#fff;border-color:var(--green)}
table.dbtable{width:100%;border-collapse:collapse;margin-top:14px;font-size:.9rem}
table.dbtable th{text-align:left;padding:9px 10px;border-bottom:2px solid var(--line);font-size:.8rem;letter-spacing:.03em}
table.dbtable td{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:top}
table.dbtable tr:hover td{background:var(--surface2)}
table.dbtable .loc{display:block;font-size:.8rem;color:var(--ink-soft);font-weight:400}
.more{text-align:center;margin-top:18px}
.safe-badge{display:inline-block;background:var(--danger-soft);color:var(--danger);font-size:.72rem;font-weight:800;padding:2px 8px;border-radius:999px}
.db-loading{opacity:.55;pointer-events:none}

/* drawer / tray / toast */
.backdrop{position:fixed;inset:0;background:rgba(10,18,8,.5);opacity:0;pointer-events:none;transition:opacity .2s;z-index:1120}
.backdrop.show{opacity:1;pointer-events:auto}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(480px,94vw);background:var(--surface);z-index:1140;transform:translateX(105%);transition:transform .25s;overflow:auto;box-shadow:var(--shadow);padding:0 0 30px}
.drawer.show{transform:none}
.drawer .heroimg{width:100%;height:230px;object-fit:cover}
.drawer .inner{padding:20px 24px}
.drawer .drawer-title{margin:0 0 2px;font-size:1.7rem;font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-weight:700}
.drawer .drawer-title .loc{display:block;font-family:"Roboto",sans-serif;font-size:1rem;font-weight:600;color:var(--ink-soft)}
.drawer-close{position:absolute;top:12px;right:12px;background:var(--surface);border:1px solid var(--line);border-radius:50%;width:38px;height:38px;font-size:1rem;color:var(--ink);z-index:2}
.drawer .about{font-size:.95rem;color:var(--ink-soft)}
/* v1.0.6: the compare modal was removed in v1.0.5 (compare moved to its
 * own page, table.cmp-page); the .modal/.modal-card/table.cmp rules below
 * were dead — no template, script or article uses them. Removed. */
.tray{position:fixed;left:50%;transform:translate(-50%,140%);bottom:16px;z-index:1130;background:var(--green-deep);color:#f0f5e6;border:1px solid rgba(255,255,255,.35);border-radius:999px;padding:10px 12px 10px 20px;display:flex;gap:12px;align-items:center;box-shadow:var(--shadow);transition:transform .25s;max-width:94vw;flex-wrap:wrap;justify-content:center}
/* v1.0.5 (VQA-36): reserve space at the page bottom while the tray is
 * visible, so it never covers footer content; the border above keeps it
 * visible against the dark footer. */
body.has-tray{padding-bottom:96px}
.tray.show{transform:translate(-50%,0)}
.tray .go{background:#fff;color:#16381f;border:0;border-radius:999px;padding:8px 16px;font-weight:800}
.tray button.clear2{background:none;border:1px solid rgba(255,255,255,.5);color:#fff;border-radius:999px;padding:7px 12px}
.toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,180%);background:var(--ink);color:var(--bg);padding:11px 20px;border-radius:999px;z-index:1160;font-size:.9rem;transition:transform .25s;max-width:92vw;text-align:center}
.toast.show{transform:translate(-50%,0)}

/* ---------- potd ---------- */
.potd{display:grid;grid-template-columns:400px minmax(0,1fr);background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow);margin-top:20px}
.potd img{width:100%;height:100%;object-fit:cover;min-height:320px;background:var(--green-soft)}
.potd .txt{padding:26px 28px}
.potd h2{font-size:clamp(1.55rem,3vw,2.1rem);margin:0 0 10px;font-weight:800;line-height:1.15}
.potd h2 a{color:var(--ink);text-decoration:none}
.potd h2 a:hover{color:var(--green)}
.potd p{color:var(--ink-soft)}
.potd .btns{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}

/* ---------- footer ---------- */
footer.site{margin-top:56px;background:var(--green-deep);color:#dfe9d2}
footer.site a{color:#f0c979;text-decoration:none}
footer.site a:hover{text-decoration:underline}
.foot-grid{display:grid;grid-template-columns:1.3fr 1fr 1fr 1.2fr;gap:28px;padding:40px 0 10px}
footer.site h2,footer.site h3{color:#fff;font-size:1.12rem;margin:0 0 10px}
footer.site p,footer.site li{font-size:.9rem;color:#c9d8b6}
footer.site ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.foot-notes{border-top:1px solid rgba(255,255,255,.18);padding:18px 0 30px;display:flex;flex-direction:column;gap:9px}
.foot-notes p{margin:0;font-size:.84rem;color:#b9cba6}
.news-p{margin:0 0 12px}

@media (max-width:1020px){
  .mapgrid{grid-template-columns:1fr}
  .pinlist{max-height:340px}
  #map{height:420px}
  .potd{grid-template-columns:1fr}
  .potd img{min-height:240px;max-height:300px}
  .foot-grid{grid-template-columns:1fr 1fr}
  .single-grid{grid-template-columns:1fr !important}
  .single-side{position:static !important}
}
@media (max-width:760px){
  .menu-btn{display:block}
  nav.main{display:none;width:100%;flex-direction:column;align-items:stretch;background:var(--surface);padding:6px 0}
  nav.main.open{display:flex}
  nav.main>a,nav.main .navbtn{text-align:left}
  nav.main ul{flex-direction:column;align-items:stretch;width:100%}
  nav.main ul a{text-align:left}
  .has-menu{position:static}
  .mega{position:static;transform:none;width:100%;box-shadow:none;margin-top:4px}
  .mega-grid{grid-template-columns:1fr}
  .hsearch{order:6;width:100%;margin-left:0}
  /* v1.1.3 (user 14/11, phone screenshot): compact the Plant of the Day
   * pill on mobile — smaller text + padding — so it shares one slim row
   * with the language bar instead of owning a tall row of its own. The
   * language bar is slimmed a touch too so the two fit side by side at
   * 390px. Desktop rules are untouched. */
  .hbar{gap:8px;padding-top:8px;padding-bottom:8px}
  .potd-link{margin-left:auto;font-size:.78rem;padding:5px 10px}
  .langbar{order:5;margin-left:auto;padding:2px}
  .langbar a,.langbar span.lang-current{font-size:.78rem;padding:5px 8px}
  .stats-in{grid-template-columns:repeat(2,1fr)}
  .feature{grid-template-columns:1fr}
  .feature .txt{padding:0 20px 22px}
  .feature figure img{min-height:230px;max-height:280px}
  #map{height:340px}
  .db{padding:14px}
  table.dbtable th:nth-child(4),table.dbtable td:nth-child(4){display:none}
  .foot-grid{grid-template-columns:1fr}
  section{padding-top:34px}
}
/* ---------- v1.1.15 (mobile readability, user 19:32 23/11) ----------
 * Phone reading was cramped: 17px body, 1.55 line-height, 1em gaps
 * between paragraphs, dense 6-7 sentence blocks. Mobile only
 * (<=768px); desktop rules untouched. Values per the user order;
 * line-height 1.8 + justify with hyphens:auto matches the War
 * precedent (.wa-single p: line-height 1.75, justify, hyphens:auto).
 * hyphens:auto relies on the <html lang> attribute (Polylang emits
 * the post language); JA ignores it (no hyphenation in CJK).
 *
 * Overflow (found from the 320px before-screenshots, DE artichoke):
 * body text and the Key Facts table were cut mid-word at the right
 * edge. Root cause is grid blowout, not the paragraphs: the
 * 2-column tables inside .post-content (facts + "Common products",
 * longest German words ~26 chars, e.g. Artischockenblattextrakt)
 * have a min-content width of ~365px, wider than a 320px viewport
 * (280px content width). The single-column .single-grid is
 * 1fr = minmax(auto,1fr), so the article's min-content forced the
 * whole page wider than the viewport and html,body{overflow-x:clip}
 * cut everything at the edge. Fix: min-width:0 on the grid children
 * (article + aside), overflow-wrap inherited everywhere inside them,
 * table-layout:fixed so tables wrap inside the frame, and a narrower
 * Key Facts label column so values get room at 320px. */
@media (max-width:768px){
  .post-content{font-size:18px;line-height:1.8}
  .post-content p{margin:0 0 1.4em;text-align:justify;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word}
  .single-grid>article,.single-side{min-width:0}
  .post-content,.quick-profile{overflow-wrap:break-word}
  .post-content table{table-layout:fixed;width:100%}
  .post-content th,.post-content td{overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}
  .quick-profile .dlist{grid-template-columns:minmax(0,7rem) minmax(0,1fr)}
}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  *{transition:none !important}
}

/* ================= WordPress templates (no equivalent in the one-page sample) ================= */

/* archive / search / page headers */
.archive-head{padding:34px 0 6px}
.archive-head h1{font-size:clamp(1.8rem,3.6vw,2.5rem);margin:0 0 6px;font-weight:800}
.archive-head p{color:var(--ink-soft);margin:0;max-width:760px}
.archive-head .subcats{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.archive-head .subcats a{background:var(--surface);border:1px solid var(--line);color:var(--ink);border-radius:999px;padding:7px 14px;font-weight:600;font-size:.88rem;text-decoration:none}
.archive-head .subcats a:hover{border-color:var(--green)}

/* single post */
.single-wrap{padding-top:28px}
.single-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:28px;align-items:start}
/* v1.1.8 (user 17/11, screenshot Stenochlaena): the sticky aside holds Key
 * facts + "In this category" + Categories — taller than the viewport, so
 * with plain sticky the bottom blocks stayed below the fold and could never
 * be scrolled into view. Cap its height and let it scroll internally. */
.single-side{position:sticky;top:86px;max-height:calc(100vh - 98px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.single-hero{border-radius:18px;overflow:hidden;margin-bottom:20px}
/* v1.0.5 (VQA-43): no max-height crop — the Coffee Köhler plate's labels
 * were sliced at the bottom edge by the 480px cap. */
.single-hero img{width:100%;height:auto;object-fit:cover}
.single-hero figcaption{font-size:.82rem;color:var(--ink-soft);padding:8px 4px 0}
.single-title{font-size:clamp(1.9rem,4vw,2.7rem);line-height:1.12;margin:0 0 8px;font-weight:800}
.single-title .loc{display:block;font-family:"Roboto",sans-serif;font-size:1.05rem;font-weight:600;color:var(--ink-soft)}
/* v1.1.12 (QA 19/11): was inline style="font-size:1.05rem" on the single
 * .sci-line (single.php) — moved into CSS. Direct-child selector keeps it
 * clear of the .pcard/.story .sci-line rules (0.85rem). */
.single-grid>article>.sci-line{font-size:1.05rem}
.post-content{font-size:1.06rem}
.post-content h2{font-size:1.55rem;margin:1.6em 0 .5em;line-height:1.25}
.post-content h3{font-size:1.25rem;margin:1.4em 0 .4em}
/* TOC anchor jumps (Easy TOC) must not hide headings under the sticky header
   on direct #anchor loads; the 90px offset matches the TOC smooth-scroll offset. */
.post-content h2[id],.post-content h3[id]{scroll-margin-top:90px}
.post-content p{margin:0 0 1em;text-align:justify}
.post-content ul,.post-content ol{margin:0 0 1em;padding-left:1.4em}
.post-content li{margin-bottom:.35em}
.post-content figure{margin:1.4em 0}
.post-content figure img{border-radius:12px}
.post-content figcaption{font-size:.85rem;color:var(--ink-soft);margin-top:6px}
.post-content blockquote{margin:1.4em 0;padding:.6em 1.1em;border-left:4px solid var(--accent);font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:1.2rem;font-style:italic}
.post-content table{width:100%;border-collapse:collapse;margin:1.2em 0;font-size:.93rem}
.post-content th,.post-content td{border:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:top}
.post-content th{background:var(--surface2)}
.post-content a{overflow-wrap:break-word}
.post-meta{font-size:.88rem;color:var(--ink-soft);margin:0 0 18px}
.post-meta a{color:var(--ink-soft)}
.quick-profile{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow)}
.quick-profile .qp-title{font-size:1.15rem;margin:0 0 10px;font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-weight:700}
.quick-profile .dlist{font-size:.9rem}
.quick-profile .safety-note{margin-top:12px}
.related{margin-top:36px}
.related h2{font-size:1.4rem;margin:0 0 4px}

/* page content */
.page-content{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:26px 28px;margin-top:20px;box-shadow:var(--shadow)}
.page-content h2{font-size:1.5rem}
.page-content img{border-radius:12px}

/* pagination */
.pagination{display:flex;gap:8px;justify-content:center;margin:26px 0 8px;flex-wrap:wrap}
.pagination .page-numbers{display:inline-block;background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:8px 13px;font-weight:700;color:var(--ink);text-decoration:none}
.pagination .page-numbers.current{background:var(--green);border-color:var(--green);color:#fff}
.pagination .page-numbers:hover{border-color:var(--green)}

/* search results */
.search-list{display:flex;flex-direction:column;gap:14px;margin-top:18px}
.search-hit{display:flex;gap:14px;align-items:flex-start;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px}
.search-hit img{width:96px;height:96px;object-fit:cover;border-radius:10px;flex:none}
.search-hit h2{margin:0 0 4px;font-size:1.3rem}
.search-hit h2 a{color:var(--ink);text-decoration:none}
.search-hit h2 a:hover{color:var(--green)}
.search-hit p{margin:0;color:var(--ink-soft);font-size:.93rem}

/* compare page */
.compare-wrap{overflow-x:auto;margin-top:18px}
table.cmp-page{width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);font-size:.93rem}
table.cmp-page th,table.cmp-page td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
table.cmp-page th:first-child{width:150px;color:var(--ink-soft);font-size:.82rem}
table.cmp-page thead th{font-family:"Roboto",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:1.15rem}
table.cmp-page img{border-radius:10px;margin-bottom:8px}

/* ---------- v1.0.5 additions ---------- */

/* breadcrumbs (single posts + category archives) */
.crumbs{font-size:.88rem;color:var(--ink-soft);margin:0 0 14px}
.crumbs a{color:var(--green);text-decoration:none;font-weight:700}
.crumbs a:hover{text-decoration:underline}
.crumbs .sep{margin:0 6px;color:var(--ink-soft)}
.crumbs [aria-current="page"]{font-weight:700;color:var(--ink)}

/* compare page picker */
.cmp-picker{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-top:18px}
.cmp-picker label{font-size:.82rem;font-weight:700;display:block}
.cmp-picker select{margin-top:4px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:10px;padding:10px 12px;font:inherit;font-size:.93rem;min-width:220px}

/* ---------- print (VQA-36 / VQA-53 / VQA-54 / VQA-57) ---------- */
/* Fixed UI (compare tray, toast, drawer, backdrop) must never print
 * — the tray pill repeated on every printed page, covering body text,
 * headings, photos and footer text. The sticky header goes static in
 * print (it printed mid-page over figures/FAQ text), figures and headings
 * are kept whole, and paragraphs keep 3 orphans/widows. */
@media print{
  .tray,.toast,.drawer,.backdrop{display:none !important}
  header.site{position:static;box-shadow:none}
  .post-content figure,.potd,.feature,.pcard{break-inside:avoid}
  .post-content h2,.post-content h3,.sec-head h2,.related h2{break-after:avoid}
  p{orphans:3;widows:3}
  body.has-tray{padding-bottom:0}
}

/* ---------- single-post sidebar: same-category + categories (v1.1.6) ---------- */
/* WarAtlas-style right column, Plant-prefixed classes. Blocks sit inside
 * <aside class="single-side"> under Key facts; at <=1020px the aside is
 * already static below the article (rule above), so these stack with it. */
.pa-side-block{margin-top:22px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow);overflow-wrap:break-word}
.pa-side-block h2{font-size:1.15rem;margin:0 0 10px;font-weight:700}
.pa-side-list,.pa-side-cats,.pa-side-subcats{list-style:none;margin:0;padding:0}
.pa-side-list li{padding:.35rem 0;border-bottom:1px solid var(--line)}
.pa-side-list li:last-child,.pa-side-cat:last-child{border-bottom:0}
.pa-side-list a{color:var(--ink);text-decoration:none}
.pa-side-list a:hover{color:var(--green);text-decoration:underline}
.pa-side-cat{padding:.35rem 0;border-bottom:1px solid var(--line)}
.pa-side-cat-row{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px}
.pa-side-cat-row>a{color:var(--ink);text-decoration:none;min-width:0;overflow-wrap:break-word;flex:1 1 auto}
.pa-side-cat-row>a:hover{color:var(--green);text-decoration:underline}
.pa-side-cat.pa-side-current>.pa-side-cat-row>a{font-weight:700;color:var(--green)}
.pa-side-count{color:var(--ink-soft);font-size:.85rem;white-space:nowrap}
.pa-side-toggle{margin-left:auto;background:none;border:0;padding:.1rem .35rem;cursor:pointer;color:var(--ink-soft);font-size:.95rem;line-height:1}
.pa-side-toggle:hover{color:var(--green)}
.pa-side-chev{display:inline-block;transition:transform .15s ease}
.pa-side-cat.pa-sub-open .pa-side-chev{transform:rotate(90deg)}
.pa-side-subcats{display:none;margin:.1rem 0 0;padding-left:16px}
.pa-side-cat.pa-sub-open>.pa-side-subcats{display:block}
.pa-side-subcats li{padding:.28rem 0;font-size:.9rem}
.pa-side-subcats a{color:var(--ink);text-decoration:none}
.pa-side-subcats a:hover{color:var(--green);text-decoration:underline}
