/* Eco.Abode open garden. Colours and fonts come from the 2024 booklet.
   Built for phones held outdoors: large text, strong contrast, big tap targets.
   Sizes are in rem so the whole page grows with the visitor's text size setting. */

:root {
  --green: #3b5e2b;
  --green-dark: #2f4a22;
  --green-soft: #eef2e4;
  --sand: #faf6ee;
  --sand-deep: #ece4d3;
  --card: #ffffff;
  --ink: #2b2118;
  --ink-soft: #5c5245;
  --radius: 14px;
  --gutter: 16px;
  --heading: 'Poppins', system-ui, sans-serif;
  --body: 'Open Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* 1rem = 17px by default. */
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }

/* iPhones and iPads only pass their Text Size setting to web pages that opt in. */
@supports (font: -apple-system-body) {
  @media (hover: none) and (pointer: coarse) {
    html { font: -apple-system-body; }
  }
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

#app {
  max-width: 34rem;
  margin: 0 auto;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

a { color: var(--green); }
img { max-width: 100%; display: block; }
h1, h2 { font-family: var(--heading); font-weight: 600; line-height: 1.2; }

.loading { padding: 40px var(--gutter); text-align: center; color: var(--ink-soft); }

/* ---------- Home ---------- */

.hero {
  margin: 0 var(--gutter); padding: 4px 0 20px;
  background: var(--green); color: var(--sand);
  border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
}
.hero > * { margin-left: 18px; margin-right: 18px; }
.hero > .hero-photo { margin: -4px 0 0; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.eyebrow { font-size: .8rem; letter-spacing: .3px; margin-top: 16px; margin-bottom: 0; opacity: .9; }
.hero h1 { font-size: min(1.9rem, 14vw); margin-top: 4px; margin-bottom: 4px; }
.hero-text p { margin: 6px 0; font-size: .95rem; }

.map-wrap { padding: 16px var(--gutter) 0; }
.map { position: relative; border-radius: var(--radius); background: #9fb08f; overflow: hidden; }
.map img { width: 100%; }
/* Pins grow a little with text size, but are capped so they don't swallow the map. */
.pin {
  --size: clamp(30px, 1.9rem, 44px);
  position: absolute; transform: translate(-50%, -50%);
  width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--green-dark);
  border: 2px solid var(--green);
  font: 600 clamp(14px, .9rem, 20px)/1 var(--heading); text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.pin:active { background: var(--green); color: #fff; }
.gate {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--green-dark); color: #fff;
  font: 600 clamp(11px, .65rem, 15px)/1 var(--heading); padding: 4px 7px; border-radius: 8px;
}

.note {
  margin: 14px var(--gutter) 0; padding: 12px 14px;
  background: var(--green-soft); color: var(--green-dark);
  border-radius: var(--radius); font-size: .9rem;
}
.note p { margin: 4px 0; }
.note strong { font-weight: 600; }

.section-title { font-size: 1.1rem; margin: 24px var(--gutter) 10px; }

.stop-list, .links { list-style: none; margin: 0 var(--gutter); padding: 0; display: grid; gap: 8px; }
.stop-list a, .links a {
  display: flex; align-items: center; gap: 12px; height: 100%;
  min-height: 3.1rem; padding: 10px 14px;
  background: var(--card); border-radius: var(--radius);
  color: var(--green-dark); text-decoration: none; font-weight: 600;
}
.num {
  flex: none; width: 1.65rem; height: 1.65rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff; font: 600 .82rem/1 var(--heading);
}
.chev { margin-left: auto; font-size: 1.3rem; line-height: 1; }

.footer { text-align: center; color: var(--ink-soft); font-size: .82rem; margin: 28px var(--gutter) 0; }
.footer p { margin: 0 0 6px; }
.social { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--green-dark); }

/* ---------- Stop and other pages ---------- */

.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px;
  padding: 14px var(--gutter) 4px; font-size: .9rem; color: var(--green);
}
.topbar a { text-decoration: none; font-weight: 600; padding: 6px 0; }

.page-title { font-size: min(1.75rem, 11vw); margin: 4px var(--gutter) 12px; }
.intro { margin: 0 var(--gutter) 16px; color: var(--ink-soft); }
.intro p { margin: 0 0 10px; }
.prose { padding: 4px var(--gutter) 0; }
.prose img { border-radius: var(--radius); margin: 8px 0; }
.photo { width: calc(100% - 2 * var(--gutter)); margin: 0 var(--gutter); border-radius: var(--radius); }
.also { font-size: .9rem; color: var(--ink-soft); margin: 14px var(--gutter) 0; }
.also strong { color: var(--ink); }

/* Now / before slider: "now" is underneath, "before" is revealed from the left. */
.compare {
  position: relative; margin: 0 var(--gutter); border-radius: var(--radius);
  overflow: hidden; touch-action: pan-y; user-select: none; cursor: ew-resize;
  aspect-ratio: 4 / 3; background: var(--sand-deep);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 4px; margin-left: -2px; background: #fff;
}
.handle::after {
  content: '‹ ›'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--green-dark); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.handle:focus-visible::after { outline: 3px solid var(--green); }
.hint {
  position: absolute; top: 50%; left: calc(var(--pos) + 1.5rem);
  max-width: calc(100% - var(--pos) - 2.2rem);
  transform: translateY(-50%);
  background: #fff; color: var(--green-dark);
  font-size: .85rem; font-weight: 600; line-height: 1.3; padding: 7px 12px; border-radius: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: opacity .2s;
}
.compare.used .hint { opacity: 0; }
.tag {
  position: absolute; bottom: 10px;
  background: rgba(255, 255, 255, .9); color: var(--ink);
  font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 10px;
}
.tag-now { right: 10px; transition: opacity .2s; }
.compare.mostly-before .tag-now { opacity: 0; }
.tag-before { left: 10px; opacity: 0; transition: opacity .2s; }
.compare.used .tag-before { opacity: 1; }

.tile-placeholder {
  display: grid; place-items: center;
  background: #c9d6b3; color: var(--green-dark); font: 600 1.65rem/1 var(--heading);
}

/* Link from each Stop to the Plant Guide */
.plants-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 22px var(--gutter) 0; padding: 14px 18px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--green-soft);
  color: var(--green-dark); text-decoration: none; font: 600 1rem/1.3 var(--heading);
}
.plants-link small { display: block; font: 400 .78rem/1.4 var(--body); color: var(--ink-soft); }
.plants-link .chev { margin-left: 0; color: var(--green); }

.next {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 26px var(--gutter) 0; padding: 16px 18px; border-radius: var(--radius);
  background: var(--green); color: var(--sand); text-decoration: none;
  font: 600 1.06rem/1.3 var(--heading);
}
.next small { display: block; font: 400 .78rem/1.4 var(--body); opacity: .9; }
.next span:last-child { font-size: 1.4rem; }

/* Plant Guide: a tappable row per plant (photo and name) that opens in place to show the details. */
.plant-card { margin: 0 var(--gutter) 10px; background: var(--card); border-radius: var(--radius); scroll-margin-top: 12px; overflow: hidden; }
.plant-card summary {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  list-style: none; cursor: pointer; min-height: 3.1rem;
}
.plant-card summary::-webkit-details-marker { display: none; }
.plant-card summary:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; border-radius: var(--radius); }
.plant-photo { flex: none; width: min(4.5rem, 22vw); aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.plant-photo.tile-placeholder { font-size: 1.4rem; }
.plant-card h3 { font-family: var(--heading); font-weight: 600; font-size: 1.05rem; line-height: 1.25; margin: 0; color: var(--green-dark); }
.plant-card .chev { color: var(--green); transition: transform .2s; }
.plant-card[open] .chev { transform: rotate(90deg); }
.plant-text { padding: 0 16px 14px; }
.plant-photo-large { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.plant-text p { margin: 6px 0; }
.plant-text .also { margin: 8px 0 0; }
.where-list { margin: 4px 0 0; padding-left: 1.2em; }
.where-list li { margin: 2px 0; }
/* A–Z / By garden bed switch, bed picker and letter headings */
.plant-filter {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 var(--gutter) 12px;
  padding: 4px; background: var(--sand-deep); border-radius: var(--radius);
}
.plant-filter button {
  min-height: 2.75rem; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: 600 .95rem/1.2 var(--body); color: var(--green-dark);
}
.plant-filter button[aria-pressed="true"] { background: var(--green); color: #fff; }
.bed-picker { display: block; margin: 0 var(--gutter) 12px; }
.bed-picker[hidden] { display: none; }
.bed-picker span { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.bed-picker select {
  width: 100%; min-height: 2.9rem; padding: 0 12px; font: 600 1rem var(--body); color: var(--ink);
  background: var(--card); border: 2px solid var(--green); border-radius: 10px;
}
.plant-count { margin: 0 var(--gutter) 10px; font-size: .85rem; color: var(--ink-soft); }
.plant-letter { font-size: 1.1rem; color: var(--green); margin: 18px var(--gutter) 8px; }
.plant-letter:first-child { margin-top: 0; }
.tag-exotic { display: inline-block; font-size: .78rem; font-weight: 600; color: #7a4a12; background: #f6e7cf; padding: 2px 9px; border-radius: 10px; }

/* Wildlife page */
.jump-to { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 var(--gutter) 6px; }
.jump-to button {
  min-height: 2.5rem; padding: 0 14px; border: 2px solid var(--green-soft); border-radius: 20px;
  background: var(--card); color: var(--green-dark); font: 600 .9rem/1 var(--body); cursor: pointer;
}
.wildlife-group { scroll-margin-top: 12px; }
.wildlife-group span { font: 400 .85rem var(--body); color: var(--ink-soft); }
.tag-threatened { display: inline-block; font-size: .78rem; font-weight: 600; color: #8a1f1f; background: #f8dede; padding: 2px 9px; border-radius: 10px; }
.credit { font-size: .75rem; color: var(--ink-soft); }
/* Show the whole wildlife photo when opened, so nothing gets cropped off. */
.plant-photo-large.whole { aspect-ratio: auto; height: auto; max-height: 75vh; object-fit: contain; background: var(--sand-deep); }
.credit a { color: inherit; }

.botanical { font-style: italic; color: var(--ink-soft); font-size: .82rem; margin: 2px 0 0; }

/* ---------- Tablets ---------- */

@media (min-width: 700px) {
  :root { --gutter: 32px; }
  #app { max-width: 52rem; }
  .hero { padding-bottom: 28px; }
  .hero > * { margin-left: 28px; margin-right: 28px; }
  .hero > .hero-photo { aspect-ratio: 16 / 9; object-position: 50% 60%; }
  .hero h1 { font-size: min(2.4rem, 12vw); }
  .hero-text { max-width: 36rem; }
  .map-wrap { padding-top: 24px; }
  .stop-list, .links { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: min(2.1rem, 9vw); margin-top: 12px; }
  .prose, .intro { max-width: 40rem; }
  .compare { aspect-ratio: 3 / 2; }
  .plant-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 var(--gutter); align-items: start; }
  .plant-guide .plant-card { margin: 0; }
  .plant-guide .plant-letter { grid-column: 1 / -1; margin: 12px 0 0; }
  .plant-filter, .bed-picker { max-width: 34rem; }
}
