/* Bonsai designboard stylesheet.
   Externalized in v17.0; cleaned in v17.1. */

/* Index page */
:root {
  --page-bg: #efe8d8;
  --page-bg-light: #f4eddd;
  --panel-bg: rgba(255, 252, 242, 0.88);
  --ink: #1d2419;
  --muted: #5e6258;
  --rule: #b8ad98;
  --green: #17391e;
  --accent: #2c6e68;
  --shadow: 0 14px 34px rgba(41, 30, 13, 0.10);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--page-bg-light), var(--page-bg));
  line-height: 1.38;
}

.sheet {
  max-width: 1460px;
  margin: 0 auto;
  padding: 22px 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-140%);
  background: var(--green);
  color: #fffaf0;
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}


header {
  border-bottom: 2px solid var(--rule);
  padding-bottom: 10px;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 4vw, 3.65rem);
  line-height: 1;
  letter-spacing: 0.035em;
  color: var(--green);
  text-transform: uppercase;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

.collection-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 18px;
}

.collection-button {
  appearance: none;
  border: 1px solid rgba(184, 173, 152, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.collection-button:hover,
.collection-button.active {
  background: rgba(44, 110, 104, 0.92);
  border-color: rgba(44, 110, 104, 0.92);
  color: #fff;
}

.subject-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.subject-button {
  appearance: none;
  border: 1px solid rgba(184, 173, 152, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  min-width: 34px;
  padding: 5px 9px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.subject-button:hover,
.subject-button.active {
  background: rgba(23, 57, 30, 0.92);
  border-color: rgba(23, 57, 30, 0.92);
  color: #fff;
}

.subject-panel[hidden] {
  display: none;
}

body.subject-miniatures {
  --page-bg: #070405;
  --page-bg-light: #18070a;
  --panel-bg: rgba(20, 12, 13, 0.94);
  --ink: #f2e7dc;
  --muted: #b89794;
  --rule: #64191d;
  --green: #f0443e;
  --accent: #ff6a4e;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

body.subject-miniatures header {
  border-bottom-color: rgba(143, 28, 34, 0.9);
}

body.subject-miniatures .subject-button-miniatures.active,
body.subject-miniatures .subject-button:hover {
  background: rgba(143, 28, 34, 0.96);
  border-color: rgba(255, 91, 73, 0.7);
  color: #fff0e8;
}

/* DESIGN: Miniatures use their own gallery system instead of Bonsai cards.
   Bonsai cards need fixed catalog crops; painted miniatures need natural image ratios,
   masonry flow, and direct lightbox interaction. */
.index-miniatures {
  margin-top: 2px;
}

.miniature-masonry {
  column-width: 320px;
  column-gap: 18px;
}

.miniature-tile {
  appearance: none;
  display: block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 18px;
  padding: 0;
  border: 1px solid rgba(143, 28, 34, 0.72);
  border-radius: 10px;
  overflow: hidden;
  background: #12090a;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  cursor: zoom-in;
  text-align: inherit;
}

.miniature-tile:hover {
  border-color: rgba(255, 91, 73, 0.82);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

.miniature-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.miniature-tile img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  background: #12090a;
}

.miniature-empty {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  break-inside: avoid;
  margin: 0 0 18px;
  border: 1px dashed rgba(143, 28, 34, 0.62);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 760px) {
  .miniature-masonry {
    column-width: 240px;
    column-gap: 14px;
  }

  .miniature-tile,
  .miniature-empty {
    margin-bottom: 14px;
  }
}

/* DESIGN: auto-fill keeps index cards at a stable catalog-card width on wide screens.
   Empty right-side columns are intentional; new trees fill left-to-right, then wrap. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid rgba(184, 173, 152, 0.65);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(41, 30, 13, 0.16);
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: #ddd7c8;
}

.card-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(184, 173, 152, 0.65);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 14px;
}

.card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.card-id {
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.card-title-separator {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--accent);
}

.card-name {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--accent);
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-species {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--green);
}

.card-style,
.card-session {
  font-size: 0.82rem;
  color: var(--muted);
}

.card.placeholder {
  border: 2px dashed var(--rule);
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  cursor: default;
}

.card.placeholder:hover {
  transform: none;
  box-shadow: none;
}

.placeholder-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 20px;
}

.placeholder-label span {
  display: block;
  font-size: 2rem;
  margin-bottom: 6px;
  opacity: 0.4;
}


/* Tree detail pages */
header {
  border-bottom: 2px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

h1.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.28em;
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 4vw, 3.65rem);
  line-height: 0.95;
  letter-spacing: 0.035em;
  color: var(--green);
  text-transform: uppercase;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.page-title-id,
.page-title-separator,
.page-title-species,
.page-title-full {
  display: inline-block;
  font-size: 1em;
  line-height: 0.95;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.95rem;
}

.metadata span::after {
  content: "•";
  margin-left: 14px;
  color: var(--muted);
}

.metadata span:last-child::after {
  content: "";
  margin-left: 0;
}

.metadata-design-direction {
  margin-top: 4px;
}

.session-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.session-button {
  appearance: none;
  border: 1px solid rgba(184, 173, 152, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.session-button:hover:not(:disabled),
.session-button.active {
  background: rgba(44, 110, 104, 0.92);
  border-color: rgba(44, 110, 104, 0.92);
  color: #fff;
}

.session-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.session-message {
  min-height: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.session-message:empty {
  display: none;
}

.session-kind {
  text-transform: capitalize;
}


h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h3 {
  margin: 12px 0 7px;
  font-size: 0.95rem;
  color: var(--green);
}

p { margin: 0 0 9px; }

ul {
  margin: 0;
  padding-left: 1.1rem;
}

li + li { margin-top: 3px; }

/* Back toward the earlier design-board feeling:
   current photos left, compact status in the middle, target design right. */
.top-grid {
  display: grid;
  grid-template-columns: minmax(430px, 1.22fr) minmax(280px, 0.62fr) minmax(380px, 0.98fr);
  gap: 18px;
  align-items: stretch;
}

.top-grid.public-top-grid {
  grid-template-columns: minmax(430px, 1.18fr) minmax(380px, 0.82fr);
}

.panel {
  background: var(--panel-bg);
  border: 1px solid rgba(184, 173, 152, 0.65);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.top-grid > .panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.views-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}

figure { margin: 0; }

.tree-view figcaption {
  min-height: 2.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  line-height: 1.05;
}

.badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  transform: translateY(-1px);
}

figure img,
.target-image {
  width: 100%;
  display: block;
  background: #ddd7c8;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  object-position: center center;
}

.views-grid img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center center;
}

/* Keep the hero row compact at 100% zoom. */
@media (min-width: 1251px) {
  .views-grid img { max-height: 28vh; }
  .detail-grid img { max-height: 35vh; }
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  align-items: start;
}

.detail-grid figcaption {
  min-height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
}


.missing-image {
  width: 100%;
  border: 2px dashed var(--rule);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 12px;
}

.views-grid .missing-image {
  aspect-ratio: 4 / 5;
}

@media (min-width: 1251px) {
  .views-grid .missing-image { max-height: 28vh; }
}

.top-placeholder {
  aspect-ratio: 1 / 1;
  background: var(--page-bg-light);
}

.base-placeholder {
  aspect-ratio: 16 / 9;
}

.target-placeholder {
  height: 100%;
  min-height: 360px;
  font-size: 0.95rem;
}

.image-frame {
  display: block;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: var(--page-bg-light);
}

.image-frame img {
  border: none;
  background: transparent;
}

.top-view img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center center;
}

.nebari-view img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center center;
}

.target-gallery {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 360px;
}

.target-track {
  flex: 1;
  min-width: 0;
}

.target-link {
  height: 100%;
  display: none;
  overflow: hidden;
  border-radius: 6px;
  min-height: 360px;
}

.target-link.active {
  display: block;
}

.target-image {
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center center;
}

.target-nav {
  appearance: none;
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 68px;
  border: 1px solid rgba(184, 173, 152, 0.72);
  border-radius: 999px;
  background: rgba(255, 252, 242, 0.72);
  box-shadow: 0 8px 20px rgba(41, 30, 13, 0.08);
  color: var(--green);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  line-height: 1;
  opacity: 0.38;
  transform: translateY(-50%);
  transition: opacity 0.18s ease, color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.target-nav:hover,
.target-nav:focus-visible {
  background: rgba(255, 252, 242, 0.90);
  color: var(--accent);
  opacity: 0.96;
  outline: none;
  transform: translateY(-50%) scale(1.025);
}

.target-nav-prev { left: 10px; }
.target-nav-next { right: 10px; }

.target-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  border: 1px solid rgba(184, 173, 152, 0.75);
  border-radius: 999px;
  background: rgba(255, 252, 242, 0.80);
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(41, 30, 13, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 4px 8px;
}

.target-nav[hidden],
.target-counter[hidden],
.target-slide[hidden] {
  display: none !important;
}

.caption-box {
  margin-top: 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 8px 12px;
  text-align: center;
  background: rgba(255,255,255,0.45);
  font-size: 0.9rem;
}

.status-card {
  font-size: 0.94rem;
}

.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.status-list li {
  border-top: 1px dotted rgba(184, 173, 152, 0.9);
  padding: 9px 0;
  margin: 0;
}

.status-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.status-label {
  display: block;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.76rem;
  margin-bottom: 2px;
}

/* DESIGN: collapsed details panels should stay compact. Panel-like padding belongs
   inside the open body, not on the closed <details> wrapper. */
details {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
}


details > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  user-select: none;
}

details > summary::-webkit-details-marker { display: none; }

details > summary::after {
  content: "open";
  float: right;
  color: var(--accent);
  text-transform: none;
  font-weight: 700;
  font-size: 0.85rem;
}

details[open] > summary {
  border-bottom: 1px solid rgba(184, 173, 152, 0.7);
}

details[open] > summary::after { content: "close"; }

/* DESIGN: <details class="panel"> uses panel border/background but keeps the
   same compact closed height as other details accordions. The open content
   keeps its spacing through .details-body. */
details.panel {
  padding: 0;
}

.notes-collapsible {
  margin-top: 18px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: rgba(244, 245, 223, 0.62);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.notes-body {
  padding: 4px 16px 14px;
  font-size: 0.9rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
}


.details-body {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

/* DESIGN: open More information panels should behave like contained
   workbench boxes. Long botanical/detail content scrolls inside the
   panel instead of stretching the whole page. */
details.panel[open] > .details-body {
  max-height: 760px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.info-subsection {
  margin-top: 0;
  border: 1px solid rgba(184, 173, 152, 0.75);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

details.panel.archive-details {
  padding: 0;
}

.info-subsection + .info-subsection {
  margin-top: 0;
}

.info-subsection > summary {
  padding: 13px 14px;
  font-size: 0.9rem;
}

.info-subsection-body {
  padding: 14px;
  display: grid;
  gap: 18px;
  align-items: start;
}

.archive-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 14px 0;
}

/* DESIGN: public archive keeps the same pill styling, but compare is an action,
   not a season filter. Snap it to the right without introducing a new toolbar box. */
details.panel.archive-details > .archive-filter #compare-toggle {
  margin-left: auto;
}

/* DESIGN: the archive opens as a preview of the latest two visible session rows.
   Older sessions stay available by scrolling inside this contained window. */
.archive-scroll-window {
  padding: 14px;
  max-height: 760px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.progression-list {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.archive-session {
  border: 1px solid rgba(184, 173, 152, 0.75);
  border-radius: 8px;
  background: rgba(255,255,255,0.32);
  padding: 12px;
}

.archive-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  border-bottom: 1px dotted rgba(184, 173, 152, 0.9);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.archive-header h4 {
  margin: 0;
  color: var(--green);
  font-size: 1rem;
}

.archive-header span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(80px, 1fr));
  gap: 10px;
}

.archive-thumb img,
.archive-thumb .missing-image {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center center;
  width: 100%;
}

.archive-thumb figcaption {
  margin-top: 4px;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.archive-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.archive-meta p {
  margin: 4px 0 0;
}

@media (max-width: 900px) {
  .archive-grid { grid-template-columns: repeat(3, minmax(80px, 1fr)); }
}

@media (max-width: 520px) {
  .archive-grid { grid-template-columns: repeat(2, minmax(80px, 1fr)); }
}

.info-subsection code,
.block-code {
  display: block;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(184, 173, 152, 0.75);
  border-radius: 6px;
  padding: 10px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.35;
}


.missing-list {
  margin-bottom: 12px;
}

.missing-ok {
  color: var(--green);
  font-weight: 700;
}


.tree-side-nav {
  position: fixed;
  top: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 48px;
  min-height: 78px;
  color: var(--green);
  text-decoration: none;
  opacity: 0.34;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tree-side-nav-prev {
  left: max(18px, calc((100vw - 1460px) / 2 - 156px));
  justify-content: flex-start;
  transform: translateY(-50%);
}

.tree-side-nav-next {
  right: max(18px, calc((100vw - 1460px) / 2 - 156px));
  justify-content: flex-end;
  transform: translateY(-50%);
}

.tree-side-nav:hover,
.tree-side-nav:focus-visible {
  color: var(--accent);
  opacity: 0.96;
  outline: none;
  transform: translateY(-50%) scale(1.025);
}

.tree-side-nav-symbol {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 4.6vw, 4rem);
  line-height: 1;
  font-weight: 400;
}

.tree-side-nav-label {
  border: 1px solid rgba(184, 173, 152, 0.75);
  border-radius: 999px;
  background: rgba(255, 252, 242, 0.78);
  box-shadow: 0 8px 20px rgba(41, 30, 13, 0.08);
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  opacity: 0;
  padding: 5px 8px;
  text-transform: uppercase;
  transform: translateX(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.tree-side-nav-prev .tree-side-nav-label {
  transform: translateX(-5px);
}

.tree-side-nav-next .tree-side-nav-label {
  transform: translateX(5px);
}

.tree-side-nav:hover .tree-side-nav-label,
.tree-side-nav:focus-visible .tree-side-nav-label {
  opacity: 1;
  transform: translateX(0);
}

.tree-inline-nav {
  display: none;
  gap: 10px;
  justify-content: space-between;
  margin-top: 16px;
}

.tree-inline-nav a {
  border: 1px solid rgba(184, 173, 152, 0.75);
  border-radius: 999px;
  background: rgba(255, 252, 242, 0.58);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 6px 10px;
  text-decoration: none;
}

.tree-inline-nav a:hover,
.tree-inline-nav a:focus-visible {
  background: rgba(44, 110, 104, 0.12);
  outline: none;
}

.back-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}


@media (max-width: 1639px) {
  .tree-side-nav { display: none; }
  .tree-inline-nav { display: flex; }
}

@media (max-width: 520px) {
  .tree-inline-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .tree-inline-nav a {
    text-align: center;
  }
}

@media (max-width: 1250px) {
  .top-grid,
  .details-body {
    grid-template-columns: 1fr;
  }


  .target-gallery,
  .target-link,
  .target-image {
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  .sheet { padding: 14px; }

  .views-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .tree-view figcaption { min-height: 1.6rem; }
}

/* Lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 8, 4, 0.88);
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-nav,
.lightbox-close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(8, 8, 8, 0.44);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border-radius: 999px;
  font-size: 2.3rem;
  line-height: 1;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.lightbox-nav:hover,
.lightbox-close:hover,
.lightbox-nav:focus-visible,
.lightbox-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
}

.lightbox-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
}

/* Seasonal color theming — leafless shifts to cooler tones */
body { transition: background 0.6s ease; }

body.season-leafless {
  --page-bg: #e4e1db;
  --page-bg-light: #eae8e3;
  --green: #2c3a34;
  --accent: #4a6e6e;
  --rule: #b5b0a8;
  background: linear-gradient(135deg, var(--page-bg-light), var(--page-bg));
}

/* Compare mode — archive thumbnail selection */
.archive-thumb {
  position: relative;
}

.compare-mode .archive-thumb a {
  cursor: crosshair;
}

.archive-thumb.compare-selected::after {
  content: attr(data-compare-label);
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.compare-hint {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: italic;
  padding: 0 14px 4px;
  display: none;
}

.compare-mode .compare-hint {
  display: block;
}

/* Comparison slider overlay */
.compare-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 8, 4, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
}

.compare-overlay.open {
  display: flex;
}

.compare-container {
  position: relative;
  user-select: none;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(10, 8, 4, 0.55);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  cursor: ew-resize;
  touch-action: none;
}

.compare-after-layer,
.compare-before-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.compare-after-layer {
  z-index: 1;
}

.compare-before-layer {
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  z-index: 2;
}

.compare-after-layer img,
.compare-before-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.compare-img {
  transform: translate(var(--compare-x, 0px), var(--compare-y, 0px)) rotate(var(--compare-tilt, 0deg)) scale(var(--compare-zoom, 1)) scaleX(var(--compare-flip, 1));
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  will-change: transform;
}

.compare-guide {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 76%;
  z-index: 4;
  border-top: 1px dashed rgba(255, 252, 242, 0.68);
  box-shadow: 0 0 0 1px rgba(44, 110, 104, 0.24);
  pointer-events: none;
}

.compare-container.show-guide .compare-guide {
  display: block;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 5;
}

.compare-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.compare-grip::before {
  content: "\25C0  \25B6";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #555;
  letter-spacing: 1px;
}

.compare-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 88vw;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.compare-align-controls {
  width: min(88vw, 780px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: rgba(255, 252, 242, 0.72);
}

.compare-align-card {
  border: 1px solid rgba(184, 173, 152, 0.48);
  border-radius: 8px;
  background: rgba(255, 252, 242, 0.08);
  padding: 8px;
}

.compare-align-title {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 252, 242, 0.7);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.compare-nudge-row,
.compare-zoom-row,
.compare-align-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.compare-zoom-row {
  margin-top: 6px;
}

.compare-zoom-readout {
  min-width: 46px;
  color: rgba(255, 252, 242, 0.7);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.03em;
}

.compare-align-button {
  min-width: 30px;
  min-height: 28px;
  border: 1px solid rgba(184, 173, 152, 0.62);
  border-radius: 999px;
  background: rgba(255, 252, 242, 0.16);
  color: rgba(255, 252, 242, 0.86);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  padding: 5px 9px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.compare-align-button:hover,
.compare-align-button:focus-visible,
.compare-align-button.active {
  background: rgba(44, 110, 104, 0.45);
  border-color: rgba(255, 252, 242, 0.78);
  outline: none;
  transform: translateY(-1px);
}

.compare-align-button-wide {
  min-width: 58px;
}

.compare-align-actions {
  justify-content: center;
  width: min(88vw, 780px);
}

@media (max-width: 720px) {
  .compare-overlay {
    padding: 14px;
  }

  .compare-align-controls {
    grid-template-columns: 1fr;
  }
}

.botanical-more-information {
  margin-top: 18px;
}

.botanical-details .botanical-scroll-window {
  padding: 14px;
  max-height: 620px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.botanical-figure {
  max-width: min(100%, 560px);
}

.botanical-link,
.botanical-image {
  display: block;
}

.botanical-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  background: #ddd7c8;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.botanical-figure figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}


/* 404 page */
.not-found-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.not-found-card {
  width: min(940px, calc(100vw - 32px));
  text-align: center;
  padding: clamp(28px, 5vw, 58px);
}

.not-found-card h1 {
  margin: 0 0 8px;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
}

.not-found-graphic {
  display: block;
  width: min(720px, 100%);
  margin: 0 auto 16px;
}

.not-found-card p {
  margin: 0 auto 22px;
  max-width: 38rem;
  color: var(--muted);
  font-weight: 700;
}

.not-found-card .back-link {
  display: inline-flex;
  margin-top: 0;
}
