/* Ancient Grove — shared layout and components */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
html { font-synthesis: none; }
body {
  margin: 0; min-height: 100vh; background: var(--night); color: var(--parchment);
  font: 400 1rem/1.7 var(--body); overflow-x: hidden;
}
/* film grain over everything, never intercepting clicks */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--gold); color: var(--night); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: var(--s4); top: -60px; z-index: 200; background: var(--gold); color: var(--night); padding: var(--s2) var(--s4); border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.skip:focus { top: var(--s4); }
.back-top { position: fixed; z-index: 42; inset-inline-end: max(18px, var(--gutter)); bottom: 22px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(var(--glass-rgb), .88); backdrop-filter: blur(12px); color: var(--gold-soft); cursor: pointer; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .25s, visibility 0s .25s, background .25s, color .25s; }
.back-top.shown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.back-top:hover { border-color: var(--gold); background: var(--gold); color: var(--night); }
.back-top svg { width: 18px; height: 22px; transition: transform .3s var(--ease); }
.back-top:hover svg { transform: translateY(-3px); }

/* type */
h1, h2, h3, .display { font-family: var(--display); font-weight: 300; line-height: 1.12; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .display { line-height: 1.4; letter-spacing: 0; font-weight: 400; }
h1 { font-size: clamp(2.8rem, 7.5vw, 6.5rem); font-weight: 200; }
h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
em, .italic { font-style: italic; color: var(--gold-soft); }
html[lang="ar"] em { font-style: normal; }
p { margin: 0 0 var(--s4); color: var(--parchment-soft); max-width: 66ch; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--parchment); }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s3); font: 600 .72rem/1 var(--body); letter-spacing: .28em; text-transform: uppercase; color: var(--gold);
}
html[lang="ar"] .eyebrow { letter-spacing: 0; font-size: .9rem; }
.eyebrow::before { content: ""; width: 2.2rem; height: 1px; background: currentColor; opacity: .7; }
.num { font-family: var(--display); font-variant-numeric: lining-nums tabular-nums; }

/* header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; transition: background .4s var(--ease), border-color .4s, backdrop-filter .4s;
  /* frosted glass even at the top of the page, so the header reads over the painting */
  border-bottom: 1px solid rgba(233, 222, 196, .08);
  background: linear-gradient(180deg, rgba(var(--shade-rgb), .2), rgba(var(--glass-rgb), .06)); backdrop-filter: blur(5px) saturate(1.1); -webkit-backdrop-filter: blur(5px) saturate(1.1);
}
.site-header.solid { background: rgba(var(--glass-rgb), .55); backdrop-filter: blur(14px) saturate(1.2); border-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s5); height: 76px; }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; margin-inline-end: auto; }
.brand-mark { width: 38px; height: 38px; color: var(--gold); flex: none; }
.brand-name { font: 500 1.35rem/1 var(--display); letter-spacing: .01em; }
html[lang="ar"] .brand-name { font-weight: 700; font-size: 1.45rem; }
.brand-name small { display: block; font: 600 .58rem/1.6 var(--body); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
html[lang="ar"] .brand-name small { letter-spacing: 0; font-size: .7rem; }
.nav { display: flex; gap: var(--s1); }
.nav a {
  position: relative; padding: var(--s2) var(--s3); text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--parchment-soft); transition: color .25s;
}
.nav a::after { content: ""; position: absolute; inset-inline: var(--s3); bottom: 2px; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform .35s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--parchment); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.lang-btn {
  border: 1px solid var(--line-strong); background: transparent; border-radius: 99px; padding: .4rem .95rem; cursor: pointer; font-size: .82rem; font-weight: 600;
  transition: border-color .25s, background .25s;
}
/* theme switch: a round button showing the sun in dark mode and the moon in light mode */
.theme-btn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--parchment); cursor: pointer; transition: border-color .25s, color .25s, background .25s; }
.theme-btn:hover { border-color: var(--gold); color: var(--gold); }
.theme-btn svg { width: 19px; height: 19px; grid-area: 1 / 1; transition: transform .45s var(--ease), opacity .3s; }
.theme-btn .moon, html[data-theme="light"] .theme-btn .sun { opacity: 0; transform: rotate(-60deg) scale(.6); }
html[data-theme="light"] .theme-btn .moon { opacity: 1; transform: none; }
.lang-btn:hover { border-color: var(--gold); background: rgba(210, 174, 99, .08); }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; }
.menu-btn span { display: block; height: 1.5px; background: currentColor; margin: 6px 0; transition: transform .3s; }
@media (max-width: 860px) {
  .nav { position: fixed; inset: 76px 0 auto; flex-direction: column; background: rgba(var(--glass-rgb), .97); border-bottom: 1px solid var(--line); padding: var(--s4) var(--gutter) var(--s6);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .3s var(--ease); }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a { font: 500 1.6rem/1.2 var(--display); padding: var(--s3) 0; }
  .nav a::after { inset-inline: 0; }
  .menu-btn { display: block; }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--s3); padding: .95rem 1.6rem; border-radius: 99px; border: 1px solid var(--gold);
  background: var(--gold); color: var(--night); font-weight: 700; font-size: .88rem; letter-spacing: .04em; text-decoration: none; cursor: pointer;
  transition: transform .3s var(--ease), background .3s, box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); background: var(--gold-soft); box-shadow: 0 14px 30px -12px rgba(210, 174, 99, .55); }
.btn.ghost { background: transparent; color: var(--parchment); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--gold); background: rgba(210, 174, 99, .08); box-shadow: none; }
.btn svg { width: 1.1em; height: 1.1em; }
.btn-sm { padding: .7rem 1.2rem; font-size: .82rem; }
html[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
.link-arrow { display: inline-flex; align-items: center; gap: var(--s2); padding: .7rem 1.25rem; border-radius: 99px; border: 1px solid var(--gold-deep); background: rgba(210, 174, 99, .08); color: var(--gold-soft); text-decoration: none; font-weight: 600; font-size: .85rem; letter-spacing: .02em; transition: background .3s, border-color .3s, color .3s, transform .3s var(--ease); }
.link-arrow:hover { background: var(--gold); border-color: var(--gold); color: var(--night); transform: translateY(-2px); }
.link-arrow svg { width: 1em; transition: transform .3s var(--ease); }

/* One expressive arrow language across CTAs, text links and card actions. */
:is(.btn, .link-arrow):has(.arrow) { padding-block: .58rem; padding-inline-start: 1.25rem; padding-inline-end: .55rem; gap: .75rem; }
.btn-sm:has(.arrow) { padding-block: .45rem; padding-inline-start: 1rem; padding-inline-end: .42rem; }
:is(.btn, .link-arrow) .arrow {
  box-sizing: border-box; flex: none; width: 32px; height: 32px; padding: 7px; border: 1px solid currentColor; border-radius: 50%;
  background: rgba(24, 34, 29, .1); transition: transform .34s var(--ease), background .3s, color .3s, border-color .3s;
}
.link-arrow .arrow { background: rgba(210, 174, 99, .09); }
:is(.btn, .link-arrow):hover .arrow { transform: translateX(4px); background: var(--night); border-color: var(--night); color: var(--gold-soft); }
html[dir="rtl"] :is(.btn, .link-arrow) .arrow { transform: scaleX(-1); }
html[dir="rtl"] :is(.btn, .link-arrow):hover .arrow { transform: scaleX(-1) translateX(4px); }
.icon-btn.dir svg { width: 20px; transition: transform .3s var(--ease); }
.icon-btn.dir:hover svg { transform: translateX(3px); }
html[dir="rtl"] .icon-btn.dir svg { transform: scaleX(-1); }
html[dir="rtl"] .icon-btn.dir:hover svg { transform: scaleX(-1) translateX(3px); }

/* sections */
.section { padding-block: clamp(4.5rem, 10vw, 8rem); position: relative; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s7); }
.section-head > div { max-width: 720px; }
.section-head h2 { margin-top: var(--s4); }
.page-top { padding-top: calc(76px + clamp(3rem, 7vw, 6rem)); padding-bottom: var(--s7); position: relative; overflow: hidden; }
.page-top h1 { font-size: clamp(2.8rem, 7vw, 6rem); margin-block: var(--s4); }
.rings-bg { position: absolute; inset-inline-end: -12vw; top: -10vw; width: min(70vw, 900px); aspect-ratio: 1; color: var(--gold); opacity: .09; pointer-events: none; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* hero */
.hero { position: relative; min-height: min(100svh, 1000px); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); animation: drift 26s var(--ease) infinite alternate; }
@keyframes drift { to { transform: scale(1.18) translate(-1.5%, -1%); } }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 80% at 70% 20%, transparent 0 30%, rgba(var(--glass-rgb), .55) 70%), linear-gradient(180deg, rgba(var(--glass-rgb), .55) 0%, rgba(var(--glass-rgb), .1) 35%, rgba(var(--glass-rgb), .75) 75%, var(--night) 100%); }
.hero .wrap { padding-bottom: clamp(3rem, 9vh, 6rem); padding-top: 120px; }
.hero h1 { margin-block: var(--s5) var(--s5); max-width: 11ch; }
.hero h1 em { display: block; }
.hero .lead { max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.scroll-cue { position: absolute; left: 50%; bottom: 18px; width: 1px; height: 56px; background: linear-gradient(var(--gold), transparent); animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0%, 100% { opacity: .2; transform: scaleY(.6); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.stat { padding: var(--s6) var(--s5); position: relative; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat .num { display: block; font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1; color: var(--parchment); font-weight: 400; }
.stat .num sup { font-size: .4em; color: var(--gold); margin-inline-start: .15em; vertical-align: top; position: relative; top: .4em; font-style: italic; }
.stat .label { display: block; margin-top: var(--s3); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
html[lang="ar"] .stat .label { letter-spacing: 0; font-size: .9rem; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-inline-start: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* intro split */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 5; background: var(--canopy); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame-tag { position: absolute; inset-inline-start: var(--s4); bottom: var(--s4); background: rgba(var(--glass-rgb), .78); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 99px; padding: .45rem 1rem; font-size: .78rem; }
.quote { font: italic 400 clamp(1.6rem, 3vw, 2.4rem)/1.25 var(--display); color: var(--parchment); border-inline-start: 2px solid var(--gold); padding-inline-start: var(--s5); margin: var(--s6) 0; max-width: 30ch; }
html[lang="ar"] .quote { font-style: normal; line-height: 1.6; }

/* tree cards */
.grid { display: grid; gap: clamp(1rem, 2vw, 1.75rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.tree-card {
  --card-radius: 14px;
  position: relative; display: block; text-decoration: none; border-radius: var(--card-radius); overflow: hidden; overflow: clip; background: var(--canopy); aspect-ratio: 3 / 4;
  isolation: isolate; contain: paint; box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .8); transition: transform .6s var(--ease), box-shadow .6s;
}
.tree-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; z-index: -2; transition: transform 1.2s var(--ease), filter .6s; filter: saturate(.9); }
.tree-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: linear-gradient(180deg, rgba(var(--glass-rgb), 0) 35%, rgba(var(--glass-rgb), .92) 100%); }
.tree-card:hover { transform: translateY(-6px); box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .9); }
.tree-card:hover img { transform: scale(1.07); filter: saturate(1.05); }
.tree-card .body { position: absolute; inset: auto 0 0; padding: 1.15rem 1.25rem 1.25rem; }
.tree-card .age { position: absolute; top: var(--s4); inset-inline-end: var(--s4); display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
  background: rgba(var(--glass-rgb), .6); backdrop-filter: blur(8px); border: 1px solid rgba(210, 174, 99, .45); text-align: center; line-height: 1; }
.tree-card .age b { font: 500 1.5rem/1 var(--display); color: var(--gold-soft); display: block; }
.tree-card .age small { font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--parchment-soft); }
html[lang="ar"] .tree-card .age small { letter-spacing: 0; font-size: .7rem; }
.tree-card h3 { font-size: clamp(1.25rem, 1.55vw, 1.5rem); line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; color: var(--parchment); }
.tree-card .sci { font: italic 400 1rem/1.4 var(--display); color: var(--gold-soft); margin-top: var(--s1); }
.tree-card .meta { display: flex; gap: var(--s4); margin-top: var(--s3); font-size: .78rem; color: var(--parchment-soft); }
.tree-card .meta span { display: inline-flex; gap: .35em; align-items: baseline; }
.tree-card .meta b { color: var(--parchment); font-weight: 600; }
.tree-card.no-image { background: radial-gradient(circle at 50% 35%, var(--moss), var(--forest)); }
.tree-card .placeholder { position: absolute; inset: 14% 18% 40%; color: var(--gold); opacity: .3; z-index: -1; }

/* horizontal rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 340px); gap: clamp(1rem, 2vw, 1.5rem); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  padding-bottom: var(--s5); padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); scrollbar-width: thin; scrollbar-color: var(--moss) transparent; }
.rail > * { scroll-snap-align: start; }
.rail-wrap { width: 100%; }
.rail-controls { display: flex; gap: var(--s2); }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; display: grid; place-items: center; cursor: pointer; transition: border-color .25s, background .25s; }
.icon-btn:hover { border-color: var(--gold); background: rgba(210, 174, 99, .08); }
.icon-btn svg { width: 18px; }
html[dir="rtl"] .icon-btn.dir svg { transform: scaleX(-1); }

/* species */
.species-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.species-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: var(--s5); align-items: center; padding: var(--s5) 0; border-bottom: 1px solid var(--line); text-decoration: none; position: relative;
}
.species-row .thumb { width: 120px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--canopy); border: 1px solid var(--line-strong); }
.species-row .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.species-row:hover .thumb img { transform: scale(1.1); }
.species-row h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); transition: color .3s; }
.species-row:hover h3 { color: var(--gold-soft); }
.species-row p { margin: var(--s2) 0 0; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.species-row .count { text-align: end; }
.species-row .count b { display: block; font: 400 2.6rem/1 var(--display); color: var(--gold); }
.species-row .count small { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
@media (max-width: 640px) { .species-row { grid-template-columns: 72px 1fr; } .species-row .thumb { width: 72px; } .species-row .count { grid-column: 2; text-align: start; } .species-row .count b { display: inline; font-size: 1.4rem; margin-inline-end: .4em; } }

/* species detail blocks */
.species-block { padding-block: var(--s8); border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.species-block header { display: grid; grid-template-columns: 220px 1fr; gap: var(--s6); align-items: center; margin-bottom: var(--s6); }
.species-block .medallion { width: 220px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 1px solid var(--gold-deep); box-shadow: 0 0 0 10px rgba(210, 174, 99, .05), 0 0 0 22px rgba(210, 174, 99, .03); background: var(--canopy); }
.species-block .medallion img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) { .species-block header { grid-template-columns: 1fr; } .species-block .medallion { width: 160px; } }

/* filters */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s6); }
.search { flex: 1 1 260px; position: relative; }
.search input { width: 100%; background: var(--forest); border: 1px solid var(--line-strong); border-radius: 99px; padding: .85rem 1.2rem .85rem 2.9rem; color: var(--parchment); font: inherit; font-size: .95rem; }
html[dir="rtl"] .search input { padding: .85rem 2.9rem .85rem 1.2rem; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--gold); }
.search svg { position: absolute; inset-inline-start: 1.1rem; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }
.search .search-clear { position: absolute; inset-inline: auto .55rem; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
html[dir="rtl"] .search .search-clear { inset-inline: .55rem auto; }
.search .search-clear:hover { background: var(--canopy); color: var(--parchment); }
.search .search-clear svg { position: static; transform: none; width: 17px; }
.search .search-clear[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { border: 1px solid var(--line-strong); background: transparent; border-radius: 99px; padding: .55rem 1rem; font-size: .85rem; cursor: pointer; transition: .25s; color: var(--parchment-soft); }
.chip:hover { border-color: var(--gold); color: var(--parchment); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; }
.select { background: var(--forest); border: 1px solid var(--line-strong); border-radius: 99px; padding: .8rem 1.1rem; color: var(--parchment); font: inherit; font-size: .9rem; cursor: pointer; }
.result-count { color: var(--muted); font-size: .88rem; margin-bottom: var(--s4); }
.filter-summary { display: flex; align-items: center; gap: var(--s3); margin: calc(-1 * var(--s3)) 0 var(--s4); }
.filter-toggle, .reset-filters { border: 1px solid var(--line-strong); background: var(--forest); color: var(--parchment-soft); border-radius: 99px; padding: .58rem 1rem; font: 600 .82rem var(--body); cursor: pointer; }
.filter-toggle { display: none; }
.reset-filters { margin-inline-start: auto; color: var(--gold-soft); }
.filter-toggle:hover, .reset-filters:hover { border-color: var(--gold); color: var(--parchment); }
.filter-count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; margin-inline-start: .45rem; border-radius: 50%; background: var(--gold); color: var(--night); font-size: .7rem; }
@media (max-width: 700px) {
  .filter-toggle { display: inline-flex; align-items: center; }
  .filters-panel { display: none; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--forest); }
  .filters-panel.open { display: flex; }
  .filters-panel .chip { flex: 1 1 auto; }
}
.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty h3 { color: var(--parchment); margin-bottom: var(--s2); }

/* tree detail */
.tree-hero { position: relative; min-height: min(88svh, 900px); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.tree-hero .hero-media img { animation: none; transform: scale(1.03); }
.tree-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(var(--glass-rgb), .6), rgba(var(--glass-rgb), .05) 30%, rgba(var(--glass-rgb), .7) 72%, var(--night)); }
.tree-hero .wrap { padding-bottom: var(--s7); padding-top: 140px; }
.tree-hero h1 { font-size: clamp(3rem, 8vw, 7rem); margin-block: var(--s4) var(--s2); }
.tree-hero .sci { font: italic 400 clamp(1.3rem, 2.4vw, 2rem)/1.3 var(--display); color: var(--gold-soft); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: .8rem; }
.crumbs a { text-decoration: none; color: var(--parchment); padding: .35rem .9rem; border-radius: 99px; border: 1px solid var(--line-strong); background: rgba(var(--glass-rgb), .45); backdrop-filter: blur(6px); transition: border-color .25s, background .25s; }
.crumbs a:hover { border-color: var(--gold); background: rgba(210, 174, 99, .15); }
.crumbs span[aria-hidden] { opacity: .5; }

.measure { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.measure > div { background: var(--forest); padding: var(--s5); }
.measure .num { font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; display: block; color: var(--parchment); }
.measure .num small { font: 500 .9rem var(--body); color: var(--gold); margin-inline-start: .3em; }
.measure .label { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: block; margin-top: var(--s2); }
html[lang="ar"] .measure .label { letter-spacing: 0; font-size: .85rem; }
.measure .bar { height: 3px; background: var(--moss); border-radius: 3px; margin-top: var(--s4); overflow: hidden; }
.measure .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); transition: width 1.6s var(--ease); }
@media (max-width: 760px) { .measure { grid-template-columns: repeat(2, 1fr); } }
.reading-progress { position: fixed; z-index: 70; inset: 76px 0 auto; height: 2px; pointer-events: none; background: linear-gradient(90deg, var(--gold) var(--progress, 0%), transparent 0); }
.tree-actions { position: sticky; top: 86px; z-index: 38; display: flex; gap: var(--s2); overflow-x: auto; width: max-content; max-width: calc(100% - 2 * var(--gutter)); padding: .42rem; margin-top: var(--s4); border: 1px solid var(--line); border-radius: 99px; background: rgba(var(--glass-rgb), .56); backdrop-filter: blur(14px) saturate(1.12); box-shadow: 0 18px 38px -28px rgba(0, 0, 0, .5); scrollbar-width: none; }
.tree-actions::-webkit-scrollbar { display: none; }
.tree-actions a { flex: none; padding: .55rem 1rem; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--parchment-soft); text-decoration: none; font-size: .82rem; font-weight: 600; transition: .2s; }
.tree-actions a:hover, .tree-actions a[aria-current] { border-color: var(--gold); color: var(--parchment); background: rgba(210, 174, 99, .1); }
.intro-band, .place-band, .dossier-section, #gallery, #tours, #witness { scroll-margin-top: 142px; }
@media (max-width: 760px) {
  .tree-actions { top: 82px; width: calc(100% - 2 * var(--gutter)); max-width: none; border-radius: 18px; }
  .tree-hero { min-height: min(78svh, 720px); }
}

.detail { display: grid; grid-template-columns: 1fr 380px; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 980px) { .detail { grid-template-columns: 1fr; } }
.detail aside { position: sticky; top: 100px; display: grid; gap: var(--s5); }
.panel { background: var(--forest); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); }
.panel h3 { font-size: 1.4rem; margin-bottom: var(--s4); }
.mini-map { height: 260px; border-radius: 12px; overflow: hidden; background: var(--canopy); }
.coords { font-size: .8rem; color: var(--muted); margin-top: var(--s3); font-variant-numeric: tabular-nums; }
.prose p { font-size: 1.08rem; line-height: 1.85; color: var(--parchment-soft); }
.prose p:first-of-type::first-letter { float: inline-start; font: 400 4.6rem/.85 var(--display); color: var(--gold); margin-top: -.045em; padding-inline-end: .1em; padding-top: 0; }
html[lang="ar"] .prose p:first-of-type::first-letter { float: none; font: inherit; color: inherit; padding: 0; }
.facts { display: grid; gap: 0; margin-top: var(--s6); border-top: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: var(--s5); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.fact dt { font: italic 500 1.2rem/1.4 var(--display); color: var(--gold-soft); }
html[lang="ar"] .fact dt { font-style: normal; }
.fact dd { margin: 0; color: var(--parchment-soft); white-space: pre-line; }
@media (max-width: 560px) { .fact { grid-template-columns: 1fr; gap: var(--s1); } }

/* ring visual of age */
.age-rings { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.age-rings svg { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold); }
.age-rings svg path { fill: none; stroke: currentColor; }
.age-rings .center { text-align: center; position: relative; }
.age-rings .center b { display: block; font: 400 3.4rem/1 var(--display); color: var(--parchment); }
.age-rings .center small { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
html[lang="ar"] .age-rings .center small { letter-spacing: 0; font-size: .85rem; }

.ext-links { display: grid; gap: var(--s2); }
.ext-links a { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line-strong); border-radius: 12px; text-decoration: none; transition: .25s; }
.ext-links a:hover { border-color: var(--gold); background: rgba(210, 174, 99, .06); }
.ext-links small { display: block; color: var(--muted); font-size: .78rem; }

/* gallery masonry + lightbox */
.masonry { columns: 3 280px; column-gap: var(--s4); }
.masonry figure { break-inside: avoid; margin: 0 0 var(--s4); border-radius: 12px; overflow: hidden; position: relative; cursor: zoom-in; background: var(--canopy); }
.masonry figure img { width: 100%; height: auto; transition: transform 1s var(--ease); }
.masonry figure:hover img { transform: scale(1.04); }
.masonry figcaption { position: absolute; inset: auto 0 0; padding: var(--s5) var(--s4) var(--s3); background: linear-gradient(transparent, rgba(var(--glass-rgb), .9)); font-size: .85rem; opacity: 0; transition: opacity .4s; }
.masonry figure:hover figcaption, .masonry figure:focus-visible figcaption { opacity: 1; }
.masonry figcaption b { display: block; font: 500 1.1rem/1.3 var(--display); color: var(--parchment); }
/* gallery viewer: title bar, quality switch, contained photo, side arrows, thumbnail strip */
html.locked { overflow: hidden; }
html.locked body { padding-inline-end: var(--sbw, 0); }
.lightbox { position: fixed; inset: 0; z-index: 150; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(5, 9, 7, .9); backdrop-filter: blur(18px) saturate(1.1); opacity: 0; transition: opacity .25s var(--ease); overscroll-behavior: contain; }
.lightbox.open { opacity: 1; }
.lb-bar { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); }
.lb-title { flex: 1; min-width: 0; display: grid; }
.lb-title b { font-weight: 500; font-size: 1.05rem; color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-cap { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-quality { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 99px; }
.lb-quality button { border: 0; background: none; color: var(--parchment-soft); font-size: .78rem; font-weight: 600; padding: .35rem .8rem; border-radius: 99px; cursor: pointer; }
.lb-quality button[aria-pressed="true"] { background: var(--gold); color: var(--night); }
.lb-res { direction: ltr; unicode-bidi: isolate; font-size: .7rem; color: var(--muted); padding-inline: .5rem .6rem; }
.lb-zoom { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 99px; padding: 3px; }
.lb-zoom button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--parchment); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.lb-zoom button:hover { background: var(--canopy); color: var(--gold); }
.z-level { min-width: 3.4rem; text-align: center; font-size: .75rem; color: var(--parchment-soft); cursor: pointer; }
.lb-frame { touch-action: none; }
.lb-frame img { cursor: zoom-in; transform-origin: center; will-change: transform; }
.lb-frame.zoomed img { cursor: grab; box-shadow: none; }
.lb-frame.dragging img { cursor: grabbing; }
.lb-frame.zoomed { overflow: hidden; }
.lb-count { font-size: .85rem; color: var(--gold-soft); padding: .3rem .8rem; border: 1px solid var(--line-strong); border-radius: 99px; }
.lb-stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); min-height: 0; height: 100%; overflow: hidden; }
/* the photo is pinned inside its frame and centred, so it can never run under the bar or the strip */
.lb-frame { position: relative; margin: 0; height: 100%; min-height: 0; }
.lb-frame img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.lb-frame.loading img { opacity: .25; transform: scale(.985); }
.lb-spin { position: absolute; left: 50%; top: 50%; margin: -19px 0 0 -19px; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--gold); opacity: 0; animation: spin .9s linear infinite; transition: opacity .2s; }
.lb-frame.loading .lb-spin { opacity: 1; }
.lb-stage .icon-btn { background: rgba(var(--glass-rgb), .6); }
.lb-strip { display: flex; gap: 8px; overflow-x: auto; padding: var(--s3) var(--s5) var(--s4); border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--moss) transparent; }
.lb-strip button { flex: none; width: 84px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--canopy); cursor: pointer; opacity: .55; transition: opacity .2s, border-color .2s; }
.lb-strip button:hover { opacity: .9; }
.lb-strip button[aria-current] { opacity: 1; border-color: var(--gold); }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) { .lb-stage { grid-template-columns: minmax(0, 1fr); padding: var(--s3); } .lb-stage .icon-btn { display: none; } .lb-strip button { width: 64px; height: 46px; } .lb-bar { padding: var(--s3); flex-wrap: wrap; } .lb-res { display: none; } }
.lightbox .lb-close { top: var(--s4); inset-inline-end: var(--s4); }
.lightbox .lb-prev { inset-inline-start: var(--s4); top: 50%; }
.lightbox .lb-next { inset-inline-end: var(--s4); top: 50%; }

/* tour cards */
.tour-card { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 10; text-decoration: none; isolation: isolate; background: var(--canopy); }
.tour-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.4s var(--ease); }
.tour-card:hover img { transform: scale(1.1) translateX(-3%); }
.tour-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgba(var(--glass-rgb), .9)); }
.tour-card .body { position: absolute; inset: auto 0 0; padding: var(--s5); }
.tour-card h3 { font-size: 1.5rem; }
.badge-360 { position: absolute; top: var(--s4); inset-inline-start: var(--s4); display: inline-flex; align-items: center; gap: .4em; padding: .4rem .8rem; border-radius: 99px; background: rgba(var(--glass-rgb), .65); backdrop-filter: blur(8px); border: 1px solid rgba(210, 174, 99, .5); color: var(--gold-soft); font-size: .75rem; font-weight: 700; letter-spacing: .08em; }
.badge-360 svg { width: 16px; }

/* map page */
.map-page { position: fixed; inset: 76px 0 0; display: grid; grid-template-columns: 380px 1fr; }
.map-side { background: var(--forest); border-inline-end: 1px solid var(--line); display: grid; grid-template-rows: auto auto 1fr; min-height: 0; }
/* threat filter: the IUCN scale as a row of coloured segments; pressing one shows only that level (several can be combined) */
.threat-filter { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.tf-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
html[lang="ar"] .tf-head { letter-spacing: 0; font-size: .85rem; }
.tf-all { border: 1px solid var(--line-strong); background: none; color: var(--parchment-soft); border-radius: 99px; padding: .25rem .8rem; font: 600 .72rem var(--body); letter-spacing: 0; text-transform: none; cursor: pointer; }
.tf-all:hover { border-color: var(--gold); color: var(--parchment); }
/* the IUCN scale: a green-to-red gauge over one tile per level; "not assessed" stands apart, off the scale */
.tf-row { display: flex; gap: var(--s2); align-items: stretch; direction: ltr; }
.tf-scale { position: relative; flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding-top: 10px; }
.tf-scale::before { content: ""; position: absolute; inset: 0 2px auto; height: 3px; border-radius: 3px; opacity: .85;
  background: linear-gradient(90deg, #88c459, #c9e68c 25%, #f8b85b 50%, #ff7f7f 75%, #e0303a); }
.tf-apart { display: grid; padding-top: 10px; padding-inline-start: var(--s2); border-inline-start: 1px dashed var(--line-strong); }
.tf-seg { --c: #88c459; position: relative; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: .55rem .25rem .5rem; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025); color: var(--parchment-soft); transition: border-color .2s, background .2s, color .2s, transform .2s, box-shadow .2s; }
/* a tick from each tile up to its place on the gauge */
.tf-scale .tf-seg::before { content: ""; position: absolute; top: -8px; left: 50%; width: 1px; height: 7px; background: var(--c); opacity: .6; }
.tf-seg[data-level="NA"] { --c: #8d8a7d; min-width: 46px; }
.tf-seg i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent), 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); }
.tf-seg b { font: 700 .8rem/1 var(--body); letter-spacing: .05em; color: var(--parchment); }
.tf-seg small { font-size: .68rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.tf-seg:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); transform: translateY(-1px); }
.tf-seg:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tf-seg[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--forest)); box-shadow: 0 6px 18px -8px var(--c), inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.tf-seg[aria-pressed="true"] small { color: var(--parchment); }
.filtering .tf-seg:not([aria-pressed="true"]) { opacity: .5; }
.filtering .tf-seg:not([aria-pressed="true"]) i { box-shadow: none; }
.tf-ends { display: flex; justify-content: space-between; margin-top: var(--s2); padding-inline-end: 64px; font-size: .68rem; color: var(--muted); direction: ltr; }
html[dir="rtl"] .tf-ends { padding-inline-end: 0; padding-right: 64px; }
.tf-note { margin: var(--s2) 0 0; font-size: .78rem; color: var(--parchment-soft); min-height: 1.2em; }
.tf-note:empty { display: none; }
.map-side header { padding: var(--s5); border-bottom: 1px solid var(--line); }
.map-title-row { display: flex; align-items: center; gap: var(--s3); }
.map-sheet-toggle { display: none; margin-inline-start: auto; width: 44px; height: 34px; border: 1px solid var(--line-strong); border-radius: 99px; background: transparent; cursor: pointer; }
.map-sheet-toggle span { display: block; width: 18px; height: 2px; margin: auto; border-radius: 2px; background: var(--gold); }
.map-search { position: relative; display: block; margin-top: var(--s4); }
.map-search input { width: 100%; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--night); color: var(--parchment); padding: .65rem 5.5rem .65rem 2.6rem; font: .85rem var(--body); }
html[dir="rtl"] .map-search input { padding: .65rem 2.6rem .65rem 5.5rem; }
.map-search > svg { position: absolute; inset-inline-start: .9rem; top: .72rem; width: 17px; color: var(--muted); }
.map-search small { position: absolute; inset-inline-end: .9rem; top: .7rem; color: var(--muted); font-size: .68rem; pointer-events: none; }
.map-side h1 { font-size: 2.4rem; margin-bottom: var(--s3); }
.map-list { overflow-y: auto; padding: var(--s2); scrollbar-width: thin; scrollbar-color: var(--moss) transparent; }
.map-item { display: grid; grid-template-columns: 64px 1fr; gap: var(--s3); align-items: center; width: 100%; padding: var(--s2); border: 0; border-radius: 12px; background: none; text-align: start; cursor: pointer; transition: background .2s; }
.map-item:hover, .map-item.active { background: var(--canopy); }
.map-item img, .map-item .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--moss); }
.map-item b { display: block; font: 500 1.15rem/1.2 var(--display); }
.map-item small { color: var(--muted); font-size: .78rem; }
/* the threat status is a tag pinned over the bottom edge of the photo, as on the tree cards */
.map-item .thumb { position: relative; display: block; padding-bottom: 8px; }
.map-item .iucn-badge { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); padding: .2rem .5rem .2rem .4rem; font-size: .6rem; background: rgba(var(--glass-rgb), .92); backdrop-filter: none; }
#map { width: 100%; height: 100%; background: var(--forest); }
@media (max-width: 860px) {
  .map-page { grid-template-columns: 1fr; grid-template-rows: 1fr 42%; }
  .map-page.sheet-collapsed { grid-template-rows: 1fr 76px; }
  .map-side { order: 2; border-inline-end: 0; border-top: 1px solid var(--line); }
  .map-sheet-toggle { display: block; }
  .map-side header { padding: var(--s3) var(--s4); }
  .map-side h1 { font-size: 1.6rem; margin: 0; }
  .map-side header p { display: none; }
  .map-search { margin-top: var(--s2); }
  .map-page.sheet-collapsed .map-search, .map-page.sheet-collapsed .threat-filter, .map-page.sheet-collapsed .map-list { display: none; }
}
/* leaflet in the grove palette */
.leaflet-container { font-family: var(--body); background: var(--forest); }
.grove-popup .leaflet-popup-content-wrapper { background: var(--forest); color: var(--parchment); border: 1px solid var(--line-strong); border-radius: 18px; padding: 0; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); }
/* no pointer: the tree's ring seal sits over the card's bottom edge, where the marker is */
.grove-popup { margin-bottom: 0; }
.grove-popup .leaflet-popup-tip-container { position: relative; left: 0; width: 0; height: 0; margin: 0 auto; overflow: visible; pointer-events: none; }
.grove-popup .pop-seal { position: absolute; left: 0; transform: scale(1.18); animation: seal-in .35s var(--ease) both; }
.grove-popup .pop-seal svg.seal { opacity: 1; }
@keyframes seal-in { from { transform: scale(.6); opacity: 0; } }
.leaflet-marker-icon.open { visibility: hidden; }
.grove-popup .leaflet-popup-content { margin: 0; width: 280px !important; font: inherit; line-height: 1.5; }
.grove-popup a.leaflet-popup-close-button { top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(var(--glass-rgb), .7); backdrop-filter: blur(6px); color: var(--parchment); font: 400 20px/28px var(--body); z-index: 3; }
html[dir="rtl"] .grove-popup a.leaflet-popup-close-button { right: auto; left: 10px; }
.grove-popup a.leaflet-popup-close-button:hover { color: var(--gold); background: rgba(var(--glass-rgb), .9); }
.pop-photo { position: relative; height: 164px; background: var(--canopy); }
.pop-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pop-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--forest)); }
.pop-photo .iucn-badge { position: absolute; z-index: 2; top: 12px; inset-inline-start: 12px; }
.pop-age { position: absolute; z-index: 2; inset-inline-end: 14px; bottom: -26px; display: grid; place-content: center; width: 76px; height: 76px; padding: 10px; border-radius: 50%; background: var(--night); border: 1px solid var(--gold); box-shadow: 0 0 0 4px rgba(var(--glass-rgb), .85), inset 0 0 0 5px rgba(210, 174, 99, .12); font-size: .58rem; text-transform: uppercase; letter-spacing: .14em; color: var(--parchment-soft); line-height: 1.15; text-align: center; }
.pop-age b { display: block; font-size: 1.05rem; font-weight: 400; color: var(--gold-soft); letter-spacing: 0; margin-bottom: 2px; }
.pop-body { padding: var(--s4) var(--s5) var(--s5); }
.pop-body h3 { font-size: 1.3rem; font-weight: 400; color: var(--parchment); margin: 0 5.2rem 0 0; line-height: 1.3; }
html[dir="rtl"] .pop-body h3 { margin: 0 0 0 5.2rem; }
.pop-body .sci { margin: var(--s1) 0 0; font-size: .85rem; color: var(--gold-soft); }
.pop-stats { list-style: none; display: flex; gap: var(--s2); padding: 0; margin: var(--s4) 0; }
.pop-stats li { flex: 1; white-space: nowrap; background: var(--canopy); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .5rem; font-size: .7rem; color: var(--parchment-soft); text-align: center; }
.pop-stats b { font-size: .95rem; font-weight: 500; color: var(--parchment); }
.pop-stats small { display: block; font-size: .62rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-body .btn { width: 100%; justify-content: center; color: var(--night); }
.leaflet-bar a { background: var(--forest); color: var(--parchment); border-color: var(--line) !important; }
.leaflet-bar a:hover, .leaflet-bar a:focus, .leaflet-bar a:active { background: var(--canopy); color: var(--gold); }
/* Leaflet whitens a focused button; keep the dark theme and show keyboard focus as a gold ring */
.leaflet-bar a:focus { outline: none; }
.leaflet-bar a:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.leaflet-bar a.leaflet-disabled { background: var(--forest); color: var(--muted); }
.leaflet-control-attribution { background: rgba(var(--glass-rgb), .7) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--parchment-soft) !important; }
.tree-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--gold); border: 2px solid var(--night); box-shadow: 0 6px 16px rgba(0, 0, 0, .5); display: grid; place-items: center; transition: transform .2s; }
.tree-pin svg { width: 16px; transform: rotate(45deg); color: var(--night); }
.tree-pin.active { background: var(--copper); transform: rotate(-45deg) scale(1.25); }
/* clusters: a dark seal with a gold rim and number, so they stand out on the pale desert imagery */
.marker-cluster div { background: radial-gradient(circle at 50% 40%, #2e3d33, var(--night)); color: var(--gold-soft); font: 700 .9rem/32px var(--body); border: 2px solid var(--gold); border-radius: 50%; width: 36px; height: 36px; margin: 2px; text-align: center; box-sizing: border-box; }
.marker-cluster { background: rgba(var(--glass-rgb), .45); border-radius: 50%; box-shadow: 0 0 0 2px rgba(210, 174, 99, .55), 0 6px 16px rgba(0, 0, 0, .6); }
.marker-cluster:hover div { background: var(--canopy); }

/* panorama page */
.tour-page { position: fixed; inset: 76px 0 0; background: #000; overflow: hidden; }
/* the viewer keeps very large internal layers; clip them so the page never scrolls */
#viewer, .tour-page .psv-container { overflow: hidden; contain: strict; }
body[data-page="tour"] { overflow: hidden; }
#viewer { position: absolute; inset: 0; }
.tour-bar { position: absolute; z-index: 20; inset: var(--s4) var(--s4) auto; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; pointer-events: none; }
.tour-bar > * { pointer-events: auto; }
.tour-title { background: rgba(var(--glass-rgb), .72); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; padding: var(--s3) var(--s4); margin-inline-end: auto; }
.tour-title b { display: block; font: 500 1.35rem/1.2 var(--display); }
.tour-title small { color: var(--parchment-soft); }
.tour-hint { position: absolute; z-index: 19; left: 50%; top: 52%; transform: translate(-50%, -50%); padding: .75rem 1.2rem; border: 1px solid rgba(210, 174, 99, .45); border-radius: 99px; background: rgba(24, 34, 29, .78); backdrop-filter: blur(10px); color: var(--parchment); font-size: .85rem; font-weight: 600; pointer-events: none; transition: opacity .45s, transform .45s; }
.tour-hint.dismissed { opacity: 0; transform: translate(-50%, -35%); }
.tour-strip { position: absolute; z-index: 20; inset: auto 0 64px; display: flex; gap: var(--s2); justify-content: center; padding: 0 var(--s4); overflow: hidden; }
.tour-strip a { position: relative; flex: 0 1 110px; min-width: 0; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .75; transition: .25s; }
.tour-strip a[aria-current="true"], .tour-strip a:hover { border-color: var(--gold); opacity: 1; }
.tour-strip img { width: 100%; height: 100%; object-fit: cover; }
.tour-strip span { position: absolute; inset: auto 5px 5px auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(24, 34, 29, .85); color: var(--gold-soft); font-size: .68rem; font-weight: 700; }
@media (max-width: 700px) {
  .tour-strip { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .tour-strip a { flex: 0 0 82px; }
  .tour-title { max-width: calc(100vw - 32px); }
  .tour-title b { font-size: 1.05rem; }
}
.psv-marker .pin-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); border: 3px solid rgba(var(--glass-rgb), .8); box-shadow: 0 0 0 0 rgba(210, 174, 99, .7); animation: pulse 2s infinite; cursor: pointer; }
@keyframes pulse { 70% { box-shadow: 0 0 0 16px rgba(210, 174, 99, 0); } 100% { box-shadow: 0 0 0 0 rgba(210, 174, 99, 0); } }
.psv-tooltip { background: rgba(var(--glass-rgb), .92) !important; border: 1px solid var(--line-strong); border-radius: 12px !important; font-family: var(--body) !important; max-width: 280px; }
.psv-tooltip-content b { display: block; font: 500 1.15rem var(--display); color: var(--gold-soft); margin-bottom: 4px; }
.psv-tooltip-content img { border-radius: 8px; margin-top: 8px; width: 100%; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s8) var(--s6); margin-top: var(--s8); position: relative; overflow: hidden; }
.site-footer .big { font: italic 300 clamp(3rem, 11vw, 9.5rem)/.9 var(--display); color: transparent; -webkit-text-stroke: 1px rgba(210, 174, 99, .35); white-space: nowrap; margin-bottom: var(--s7); }
html[lang="ar"] .site-footer .big { font-style: normal; font-weight: 700; line-height: 1.3; }
.foot-grid { display: flex; flex-wrap: wrap; gap: var(--s6); justify-content: space-between; align-items: end; }
.foot-grid nav { display: flex; flex-wrap: wrap; gap: var(--s5); }
.foot-grid nav { gap: var(--s2) !important; }
.foot-grid nav a { text-decoration: none; color: var(--parchment-soft); font-size: .85rem; padding: .55rem 1.1rem; border-radius: 99px; border: 1px solid var(--line-strong); transition: border-color .25s, color .25s, background .25s; }
.foot-grid nav a:hover { color: var(--night); background: var(--gold); border-color: var(--gold); }
.site-footer small { color: var(--muted); font-size: .8rem; }

/* cta band */
.cta { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 5vw, 5rem); background: radial-gradient(90% 120% at 100% 0%, var(--moss), var(--forest) 60%); border: 1px solid var(--line); isolation: isolate; }
.cta .rings-bg { opacity: .14; inset-inline-end: -18%; top: -40%; width: 70%; }
.cta h2 { max-width: 16ch; margin-block: var(--s4) var(--s5); }

/* loading */
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.loading .spin { width: 64px; height: 64px; color: var(--gold); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
html[lang="ar"] .sci, html[lang="ar"] .italic, html[lang="ar"] [style*="italic"], html[lang="ar"] .tree-card .sci, html[lang="ar"] .ring-readout .sci, html[lang="ar"] .hero-caption strong { font-style: normal; }

/* sort: a segmented control in the site's style instead of the browser's dropdown */
.sort { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--forest); }
.sort button { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; color: var(--parchment-soft); font-size: .86rem; font-weight: 600; padding: .6rem 1rem; border-radius: 99px; cursor: pointer; transition: background .25s, color .25s; }
.sort button svg { width: 16px; height: 16px; opacity: .8; }
.sort button:hover { color: var(--parchment); background: var(--canopy); }
.sort button[aria-checked="true"] { background: var(--gold); color: var(--night); }
.sort button[aria-checked="true"] svg { opacity: 1; }
@media (max-width: 560px) { .sort { width: 100%; } .sort button { flex: 1; justify-content: center; padding: .6rem .5rem; } }
/* the page content holds at least a screen's height while it loads, so the footer never jumps down */
#main { min-height: 100svh; }
