/*
 * Public site styles. Self-contained (no admin.css).
 *
 * The garden's look comes from custom properties that admin/theme.php
 * defines after this file: --web-bg (primary), --web-accent (secondary),
 * --web-fg (text on the primary colour), --web-hero, --web-pattern.
 * The defaults below are only fallbacks.
 *
 * Two page kinds:
 *   body.landing  the presentation page; rules copied from the garden's
 *                 original static page so it looks the same.
 *   body.inner    calendar and plants: green header and footer, light content.
 */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/montserrat-latin-italic.woff2") format("woff2");
}

:root {
  --web-bg: #69b291;
  --web-accent: #2d6a4f;
  --web-fg: #ffffff;
  --web-link-opacity: .65;
  --web-link-decoration: none;
  --ground: #f6f7f2;
  --paper: #ffffff;
  --ink: #1f2a1f;
  --muted: #5b675b;
  --line: #d9ded3;
  --radius: 6px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

/* ---- Landing (same rules as the original static page) ------------------------ */

body.landing {
  background: var(--web-bg);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.landing h1 { font-size: 1.6rem; margin-block-end: 0em; }
body.landing h2 {
  font-size: 1.2rem; font-style: italic; font-weight: normal;
  margin-block-start: 0em; margin-block-end: 1.5em; line-height: 1em;
}

.top-section {
  position: relative; flex: 1; overflow: hidden;
  display: flex; justify-content: center; align-items: center;
  /* On a short screen (a phone with its browser bars) the information below takes most of the
     height; without a floor the photo shrinks to a strip. The page then scrolls a little. The
     body keeps a definite height, so the logo's percentage limits still resolve as before. */
  min-height: 14rem;
}
.top-section::before {
  content: ""; position: absolute; inset: 0;
  background: var(--web-hero, none) no-repeat center bottom;
  background-size: cover;
}
.top-logo, .top-logo-overlay { max-width: 50%; max-height: 50%; object-fit: contain; }
.top-logo { position: relative; opacity: var(--web-logo-opacity, 0.7); z-index: 1; }
.top-logo-overlay {
  position: absolute; z-index: 2;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}

.bottom-section {
  flex: 1; background: var(--web-bg); color: var(--web-fg);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 10px; box-sizing: border-box; text-align: center; line-height: 1.6; position: relative;
}
.bottom-section::before, .site-foot::before {
  content: ""; position: absolute; inset: 0;
  background: var(--web-pattern, none) repeat center center;
  background-size: 700px; opacity: 0.1; pointer-events: none;
}
.bottom-section-pattern { position: relative; z-index: 1; }
.contact-info { font-size: 18px; }
.address { font-size: medium; font-style: italic; }
.maps { font-style: normal; }
.contact-info a.mail { opacity: 1; }

.landing a, .site-head a, .site-foot a { color: var(--web-fg); opacity: var(--web-link-opacity); text-decoration: var(--web-link-decoration); text-underline-offset: .15em; }
.landing a:hover, .site-head a:hover, .site-foot a:hover { opacity: 1; }

.seedling {
  color: var(--web-bg); font-size: 0.7rem;
  display: inline-block; vertical-align: middle;
  background: var(--web-fg); padding: 4px 6px 4px 5px; border-radius: 20px;
}
.pill-row + .pill-row { margin-top: .5rem; }
/* When a row has to wrap (phones), the space between its lines equals the space between rows:
   a flex row keeps each button's own line box, and row-gap adds the same .5rem the rows are apart. */
.pill-row { display: flex; flex-wrap: wrap; justify-content: center; row-gap: .5rem; }
.pill-row a + a { margin-left: .4rem; }
.author { font-size: x-small; font-style: italic; font-weight: 300; opacity: 0.6; }
.footer-logo img.logo { width: 150px; height: auto; }

/* ---- Inner pages: green header and footer, light content -------------------------- */

body.inner {
  background: var(--ground); color: var(--ink);
  line-height: 1.55; min-height: 100vh;
  display: flex; flex-direction: column;
}
body.inner h1 { font-size: 1.6rem; margin: 0 0 1rem; line-height: 1.2; }
body.inner h2 { font-size: 1.2rem; margin: 1.75rem 0 .75rem; line-height: 1.2; }
body.inner h3 { font-size: 1.05rem; margin: 0 0 .25rem; line-height: 1.25; }

.site-head {
  background: var(--web-bg); color: var(--web-fg);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem;
  padding: .75rem max(1rem, 4vw);
  padding-top: max(.75rem, env(safe-area-inset-top));
}
.brand, .site-head a.brand { display: flex; align-items: center; gap: .75rem; font-size: 1.25rem; font-weight: 700; opacity: 1; text-decoration: none; }
.brand .logo { max-height: 3rem; width: auto; }
.site-head nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-head nav a { padding: .5rem 0; border-bottom: 3px solid transparent; text-decoration: none; }
.site-head nav a[aria-current="page"] { border-bottom-color: var(--web-fg); opacity: 1; }

body.inner main { flex: 1; width: 100%; max-width: 56rem; margin: 0 auto; padding: 2rem max(1rem, 4vw) 3rem; }
body.inner main a { color: var(--web-accent); opacity: 1; text-decoration: underline; text-underline-offset: .15em; }
body.inner main a:hover { filter: brightness(.8); }
.muted { color: var(--muted); }
.page-intro { margin: 0 0 1.5rem; max-width: 42rem; }

.site-foot {
  position: relative; background: var(--web-bg); color: var(--web-fg);
  padding: 2rem max(1rem, 4vw) calc(2rem + env(safe-area-inset-bottom));
  text-align: center; line-height: 1.6;
}

:focus-visible { outline: 3px solid var(--web-accent); outline-offset: 2px; }
.landing :focus-visible, .site-head :focus-visible, .site-foot :focus-visible { outline-color: var(--web-fg); }

.events { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.event, .plants li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.event { border-left: 4px solid var(--web-accent); padding: .75rem 1rem; }
.event .when, .event .where { margin: 0; color: var(--muted); font-size: .9rem; }
.is-cancelled { border-left-color: var(--line); }
.event.is-cancelled h3 a, .event-page.is-cancelled h1 { text-decoration: line-through; opacity: .7; }
.tag { display: inline-block; font-size: .7rem; padding: 0 .45rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper); font-weight: 400; vertical-align: middle; white-space: nowrap; }
.tag-cancelled { color: #6e1628; background: #f7e1e5; border-color: transparent; }

.event-page .card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.event-body { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.event-body > div { flex: 1 1 18rem; }
.flyer { max-width: 100%; height: auto; border-radius: var(--radius); background: var(--paper); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.5rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Request form */
.request-form { display: grid; gap: 1rem; max-width: 40rem; }
.request-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0; }
.request-form legend { font-weight: 700; padding: 0 .4rem; }
.request-form .field { display: grid; gap: .25rem; }
.request-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; }
.request-form input:not([type="checkbox"]):not([type="radio"]), .request-form select, .request-form textarea {
  font: inherit; width: 100%; box-sizing: border-box; padding: .5rem .6rem; border: 1px solid #8a8f86; border-radius: var(--radius); background: #fff; color: var(--ink);
}
.request-form fieldset .field + .field { margin-top: 1rem; }
.request-form .privacy p { margin: 0 0 .75rem; }
.request-form .check { display: flex; gap: .5rem; align-items: baseline; }
.request-form .hint, .request-form .privacy { color: var(--muted); font-size: .9rem; margin: 0; }
.request-form .privacy { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }
.request-form .privacy .check { color: var(--ink); font-size: 1rem; }
.field-error, .flash-error { color: #6e1628; font-weight: 700; margin: 0; }
.flash-error { background: #f7e1e5; border-radius: var(--radius); padding: .6rem 1rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.button { font: inherit; font-weight: 700; padding: .6rem 1.4rem; border: 0; border-radius: var(--radius); background: var(--web-accent); color: #fff; cursor: pointer; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0 0 1.25rem; }
.filters a, body.inner main .filters a { text-decoration: none; padding: .25rem 0; border-bottom: 3px solid transparent; color: var(--muted); }
.filters a[aria-current="true"], body.inner main .filters a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--web-accent); font-weight: 700; }
.plants { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.plants li { overflow: hidden; padding-bottom: .75rem; }
.plants li > :not(a) { margin-left: 1rem; margin-right: 1rem; }
.plants li > h3:first-child { margin-top: .75rem; }
.plants img { display: block; width: 100%; height: 12rem; object-fit: cover; background: #eee; margin-bottom: .6rem; }
.plants p { margin-top: .2rem; margin-bottom: 0; }

@media (max-width: 40rem) {
  .brand { font-size: 1.05rem; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: .6rem; }
  .site-head nav a { padding: .6rem 0; }
}

/* Unlisted inventory: the bar above the results and the list view. */
.inv-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .75rem 0; }
.inv-bar .filters { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.toolbar input, .toolbar select, .toolbar button { font: inherit; padding: .45rem .6rem; border: 1px solid #8a8f86; border-radius: var(--radius); background: #fff; color: var(--ink); }
.toolbar input[type="search"] { flex: 1 1 12rem; min-width: 0; }
.toolbar button { cursor: pointer; background: var(--ink); color: #fff; border-color: var(--ink); }
.inv-table { width: 100%; border-collapse: collapse; background: var(--paper); }
.inv-table th, .inv-table td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.inv-table .thumb-cell { width: 3.5rem; padding-right: 0; }
.inv-table img { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius); background: #eee; }
.inv-table .tag { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.inv-bar .export-link { text-decoration: underline; }
.tag-ok { color: #1f5d33; background: #e3f1e7; border-color: transparent; }
.tag-warn { color: #7a4b00; background: #fbefd3; border-color: transparent; }
.inv-table td.num { white-space: nowrap; text-align: right; }
