/* Growers near you (spec 5.6 and 6.3). Page-only styles; shared parts live in people.css. */

.gn-page {
  --gn-forest: #1E3A2B;
  --gn-cream: #F6F3EA;
  --gn-card: #FFFDF8;
  --gn-lime: #A8D86A;
  --gn-leaf: #6FA83D;
  --gn-moss: #3E6B1F;
  --gn-ink: #4A524B;
  --gn-ink-soft: #6B736C;
  --gn-rule: #E2DED0;
  --gn-rule-strong: #CFC9B6;
  background: var(--gn-cream);
}

.gn-page :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--gn-leaf);
  outline-offset: 3px;
}

/* Region picker: text tabs on wide screens, a select on small ones */
.gn-pick { border-bottom: 1px solid var(--gn-rule); }
.gn-tabs { display: flex; flex-wrap: wrap; gap: 0 22px; }
.gn-tab {
  appearance: none;
  margin: 0 0 -1px;
  padding: 8px 0 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gn-ink-soft);
  cursor: pointer;
}
.gn-tab:hover { color: var(--gn-forest); }
.gn-tab[aria-pressed="true"] { color: var(--gn-forest); border-bottom-color: var(--gn-leaf); }

.gn-select {
  display: none;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gn-forest);
}
.gn-select select {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--gn-rule-strong);
  border-radius: 10px;
  background: var(--gn-card);
  font: inherit;
  font-weight: 600;
  color: var(--gn-forest);
}

html:not(.js) .gn-pick { display: none; }

/* Map left, panel right */
.gn-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px 44px;
  align-items: start;
  padding-top: 24px;
}
.gn-mapwrap { display: grid; gap: 12px; min-width: 0; }
.gn-svg { display: block; width: 100%; height: auto; }

.gn-s {
  stroke: var(--gn-cream);
  stroke-width: 1;
  stroke-linejoin: round;
  outline: none;
  transition: opacity 0.18s ease;
}
.gn-s[data-region] { cursor: pointer; }
.gn-s[data-lv="0"] { fill: #E6E1D3; }
.gn-s[data-lv="1"] { fill: #C7E0A6; }
.gn-s[data-lv="2"] { fill: #9CC967; }
.gn-s[data-lv="3"] { fill: #457A2A; }
.gn-s[data-lv="4"] { fill: #1E3A2B; }

.gn-svg.has-selection .gn-s:not(.is-in) { opacity: 0.5; }
.gn-svg.has-selection .gn-s.is-hover:not(.is-in) { opacity: 0.85; }

.gn-lake { fill: var(--gn-cream); pointer-events: none; }
.gn-outline {
  display: none;
  fill: none;
  stroke: var(--gn-forest);
  stroke-linejoin: round;
  pointer-events: none;
}
.gn-outline.is-hover { display: inline; stroke-width: 1.6; }
.gn-outline.is-on { display: inline; stroke-width: 2.4; }

/* Density key: five swatches, no numbers */
.gn-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--gn-ink);
}
.gn-swatches { display: inline-flex; }
.gn-swatch { width: 18px; height: 14px; }
.gn-swatch:first-child { border-radius: 3px 0 0 3px; }
.gn-swatch:last-child { border-radius: 0 3px 3px 0; }
.gn-swatch[data-lv="0"] { background: #E6E1D3; }
.gn-swatch[data-lv="1"] { background: #C7E0A6; }
.gn-swatch[data-lv="2"] { background: #9CC967; }
.gn-swatch[data-lv="3"] { background: #457A2A; }
.gn-swatch[data-lv="4"] { background: #1E3A2B; }

/* Panels */
.gn-panels { display: grid; gap: 32px; min-width: 0; }
.js .gn-panels { gap: 0; }
.js .gn-panel { grid-area: 1 / 1; }
.js .gn-panel[hidden] { display: grid; visibility: hidden; pointer-events: none; }
.gn-panel { display: grid; gap: 16px; align-content: start; min-width: 0; }

.gn-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gn-rule);
}
.gn-panel-head h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--gn-forest);
  text-wrap: balance;
}

.gn-ask {
  margin: 0;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--gn-ink);
  text-wrap: balance;
}

.gn-btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--gn-forest);
  color: var(--gn-cream);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.gn-btn:hover { background: #0F2218; color: var(--gn-cream); }

.gn-hold {
  margin: 0;
  padding: 18px 20px;
  border: 1.5px dashed var(--gn-rule-strong);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--gn-ink);
  text-wrap: balance;
}

.gn-note {
  margin: 14px 0 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gn-ink-soft);
  text-wrap: pretty;
}
.gn-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gn-grower {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--gn-rule);
  border-radius: 14px;
  background: var(--gn-card);
}
.gn-monogram {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gn-monogram--0 { background: #1E3A2B; color: #A8D86A; }
.gn-monogram--1 { background: #A8D86A; color: #1E3A2B; }
.gn-monogram--2 { background: #CFE3BE; color: #1E3A2B; }
.gn-monogram--3 { background: #457A2A; color: #F6F3EA; }
.gn-name {
  min-width: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--gn-forest);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

@media (max-width: 1000px) and (min-width: 901px), (max-width: 480px) {
  .gn-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .gn-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 699.98px) {
  .gn-tabs { display: none; }
  .gn-select { display: flex; }
  .gn-pick { border-bottom: 0; }
  .gn-body { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .gn-s { transition: none; }
}

/* Static (no-scroll) mode: the map scales to the window height so the whole
   map scene always fits on one screen. */
.scene-deck-on .gn-scene { padding-top: clamp(96px, 13vh, 160px); }
.scene-deck-on .gn-scene .scene-panel { padding-block: clamp(16px, 2.6vh, 32px); }
.scene-deck-on .gn-svg { width: auto; max-width: 100%; max-height: calc(100vh - 330px); max-height: calc(100svh - 330px); margin-inline: auto; }

.gn-grower--logo {
  padding: 0;
  overflow: hidden;
}
.gn-logo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 148px;
  padding: 14px 16px;
  box-sizing: border-box;
  background: #ffffff;
}
.gn-logo--dark { background: var(--gn-forest); }
.gn-logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

@media (min-width: 2200px) and (min-height: 1100px) {
  .gn-scene .scene__inner { max-width: 1792px; }
  .gn-scene .scene-panel.gn { zoom: 1.4; }
  .scene-deck-on .gn-scene .gn-svg { max-height: calc((100vh - 400px) / 1.4); max-height: calc((100svh - 400px) / 1.4); }
}

@media (min-width: 3200px) and (min-height: 1800px) {
  .gn-scene .scene__inner { max-width: 2432px; }
  .gn-scene .scene-panel.gn { zoom: 1.9; }
  .scene-deck-on .gn-scene .gn-svg { max-height: calc((100vh - 480px) / 1.9); max-height: calc((100svh - 480px) / 1.9); }
}

@media (max-width: 900px) {
  .js .gn-panel[hidden] { display: none; }
}

@media (max-width: 699.98px) {
  .gn-body { gap: 14px; }
  .gn-mapwrap { gap: 8px; }
  .gn-key { justify-content: center; gap: 6px 8px; font-size: 12px; }
  .gn-swatch { width: 16px; height: 10px; }
  .gn-panel { gap: 12px; }
  .gn-panel[data-panel="all"] .gn-panel-head { display: none; }
  .gn-panel[data-panel="all"] .gn-ask { margin: 0 auto; font-size: 14px; text-align: center; text-wrap: balance; }
  .gn-panel-head { flex-wrap: nowrap; padding-bottom: 10px; }
  .gn-panel-head h2 { font-size: 22px; }
  .gn-btn { padding: 8px 14px; font-size: 13px; }
  .gn-hold { padding: 14px 16px; font-size: 14px; }
  .gn-note { margin-top: 10px; font-size: 13px; }
  .gn-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gn-logo { height: 96px; padding: 10px 12px; }
  .gn-logo img { max-height: 72px; }
}

/* Phones: pin the card to the top so the region picker and map stay put
   when a region with more growers makes the card taller. */
@media (max-width: 760px) {
  .gn-scene { align-items: flex-start; justify-content: flex-start; }
  html.scene-swipe-on .gn-scene .scene__inner,
  .gn-scene .scene__inner { margin-top: 0; margin-bottom: auto; }
}
