/* ==========================================================================
   Gratitude Farms — shared site stylesheet
   Loaded from every page's <helmet>. Inline styles in the .dc.html templates
   carry the desktop design; the rules here add the things inline styles
   cannot express: media queries, pseudo-classes and shared components.

   Overrides use !important on purpose — an !important author rule is the only
   thing that beats an element's inline style, and the desktop look is stored
   inline. Every !important below is scoped inside a media query or a state.
   ========================================================================== */

:root {
  /* Measured, not guessed: 52px logo + 2x14px padding + 1px border. The mobile
     value below matches the 40px logo. Keep these in step with the logoSize
     values in SiteNav.dc.html — the spacer depends on it. */
  --gf-nav-h: 81px;

  --gf-green: #1A3C34;
  --gf-green-deep: #01261F;
  --gf-gold: #C5A059;
  --gf-gold-light: #e9c176;
  --gf-emerald: #2D5A27;
  --gf-olive: #3C4A3E;
  --gf-canvas: #FCF9F4;
  --gf-stone: #FAFAF9;
  --gf-beige: #F5F2ED;
  --gf-line: #e5e2dd;
  --gf-ink: #1c1c19;
  --gf-ink-soft: #414846;
  --gf-ink-mute: #717976;
}

html { scroll-behavior: smooth; }

/* `clip`, not `hidden`. The dc runtime sets `html,body{height:100%}`, and
   `overflow-x:hidden` on top of that makes body a 844px scroll container —
   the document stops scrolling, window.scrollY freezes at 0, and everything
   built on it (the reading-progress bar, the nav shadow, anchor links) dies.
   `clip` suppresses sideways overflow without creating a scroll container. */
body {
  overflow-x: clip;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Anchor targets must clear the fixed navigation bar. */
[id] { scroll-margin-top: calc(var(--gf-nav-h) + 16px); }

img, video, iframe { max-width: 100%; }

/* Keyboard focus needs to stay visible — several controls sit on dark panels. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gf-gold);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Navigation
   The nav is fixed, so a spacer of exactly the same height follows it.
   Both are driven by --gf-nav-h so they can never drift apart.
   ========================================================================== */

.gf-nav-spacer { height: var(--gf-nav-h); }

.gf-sticky-under-nav { top: var(--gf-nav-h) !important; }

.gf-nav-scrolled { box-shadow: 0 6px 24px rgba(26, 60, 52, 0.08); }

/* Dropdown panels can exceed the viewport on short screens. */
.gf-nav-panel { max-height: calc(100vh - var(--gf-nav-h) - 24px); overflow-y: auto; }

.gf-mobile-panel { max-height: calc(100vh - var(--gf-nav-h)); overflow-y: auto; }

@media (max-width: 980px) {
  :root { --gf-nav-h: 69px; }
}

/* ==========================================================================
   Layout — column stacking
   Grids whose track list is fixed (1fr 1fr, 5fr 6fr, …) cannot collapse on
   their own. Anything carrying .gf-2col becomes a single column on narrow
   screens; .gf-4col steps 4 → 2 → 1.
   ========================================================================== */

@media (max-width: 900px) {
  .gf-2col { grid-template-columns: 1fr !important; }
  .gf-2col > * { order: 0 !important; }
  .gf-gap-sm { gap: 28px !important; }
}

@media (max-width: 900px) {
  .gf-4col { grid-template-columns: 1fr 1fr !important; }
}

/* Pairs that hold up at tablet width and only need to break on phones. */
@media (max-width: 620px) {
  .gf-2col-sm { grid-template-columns: 1fr !important; }
}

@media (max-width: 620px) {
  .gf-4col { grid-template-columns: 1fr !important; }
}

/* Footer sitemap: 5 → 3 → 2 → 1 columns. */
@media (max-width: 1180px) {
  .gf-foot-grid { grid-template-columns: 1fr 1fr 1fr !important; }
}

@media (max-width: 760px) {
  .gf-foot-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
}

@media (max-width: 480px) {
  .gf-foot-grid { grid-template-columns: 1fr !important; }
}

/* Media that should lead on mobile even when the desktop order puts it second. */
@media (max-width: 900px) {
  .gf-media-first { order: -1 !important; }
}

/* Anything too wide to shrink scrolls inside its own box rather than the page. */
.gf-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Typography rhythm on small screens
   ========================================================================== */

@media (max-width: 620px) {
  .gf-hero-tall { height: auto !important; min-height: 72vh !important; }
  .gf-stat-lg { font-size: 34px !important; }
}

/* On a phone the carousel arrows sit on top of the headline, and the slide is
   swipeable / auto-advancing anyway. The dots stay as the visible control. */
@media (max-width: 720px) {
  .gf-carousel-arrow { display: none !important; }
}

/* ==========================================================================
   Forms
   ========================================================================== */

.gf-field {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-bottom: 1px solid #c1c8c4;
  padding: 11px 2px;
  font-size: 15px;
  font-family: 'Hanken Grotesk', sans-serif;
  color: var(--gf-ink);
  transition: border-color 0.2s ease;
}

.gf-field:focus { outline: none; border-bottom-color: var(--gf-gold); }

.gf-field-box {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid #c1c8c4;
  border-radius: 8px;
  padding: 12px;
  font-size: 14.5px;
  font-family: 'Hanken Grotesk', sans-serif;
  color: var(--gf-ink);
  resize: vertical;
  transition: border-color 0.2s ease;
}

.gf-field-box:focus { outline: none; border-color: var(--gf-gold); }

.gf-field-invalid,
.gf-field-box.gf-field-invalid { border-color: #ba1a1a !important; }

.gf-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gf-green);
  display: block;
  margin-bottom: 8px;
}

.gf-error {
  color: #ba1a1a;
  font-size: 12.5px;
  margin: 6px 0 0;
  display: block;
}

/* Off-screen honeypot — real people never see it, bots fill it in. */
.gf-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.gf-btn-primary {
  background: var(--gf-green);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 28px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Hanken Grotesk', sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.gf-btn-primary:hover:not(:disabled) {
  background: var(--gf-gold);
  color: var(--gf-green);
  transform: translateY(-2px);
}

.gf-btn-primary:disabled { opacity: 0.6; cursor: progress; }

/* ==========================================================================
   Floating contact dock — phone + WhatsApp, present on every page
   ========================================================================== */

.gf-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gf-dock a {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 8px 24px rgba(26, 60, 52, 0.28);
  transition: transform 0.2s ease;
}

.gf-dock a:hover { transform: scale(1.08); color: #fff; }

.gf-dock-wa { background: #25D366; }
.gf-dock-call { background: var(--gf-green); }

@media (max-width: 620px) {
  .gf-dock { right: 14px; bottom: 14px; gap: 10px; }
  .gf-dock a { width: 46px; height: 46px; }
}

@media print {
  .gf-dock, .gf-nav-spacer { display: none; }
}

/* ==========================================================================
   Cards & tiles used by the catalogue and cross-link strips
   ========================================================================== */

.gf-card-lift { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }

.gf-card-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 44px rgba(26, 60, 52, 0.13);
  border-color: var(--gf-gold);
}

.gf-chip {
  border: 1px solid var(--gf-line);
  background: var(--gf-beige);
  color: var(--gf-olive);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Hanken Grotesk', sans-serif;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gf-chip:hover { border-color: var(--gf-gold); color: var(--gf-green); }

.gf-chip[aria-pressed="true"] {
  background: var(--gf-green);
  border-color: var(--gf-green);
  color: var(--gf-stone);
}

/* ==========================================================================
   Admin console
   The console is a desktop tool, but it still has to be usable on a phone:
   the sidebar becomes a horizontal strip and wide tables scroll in place.
   ========================================================================== */

.adm-row { min-width: 720px; }

.adm-row-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
  .adm-shell { flex-direction: column !important; }

  .adm-aside {
    width: 100% !important;
    height: auto !important;
    position: static !important;
    padding: 16px !important;
  }

  .adm-aside nav {
    flex-direction: row !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 4px;
  }

  .adm-aside nav button { white-space: nowrap; flex-shrink: 0; }

  .adm-header {
    padding: 16px 20px !important;
    flex-wrap: wrap !important;
    position: static !important;
  }

  .adm-body { padding: 24px 20px !important; }
}

/* ==========================================================================
   Toast
   ========================================================================== */

.gf-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: var(--gf-green);
  color: var(--gf-stone);
  padding: 15px 26px;
  border-radius: 12px;
  font-size: 14.5px;
  font-family: 'Hanken Grotesk', sans-serif;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  z-index: 200;
  max-width: calc(100vw - 32px);
  text-align: center;
}
