/* FarmCoraz V1 public site — shared styles
   Mobile-first, accessible, no external dependencies, no trackers. */

:root {
  --green: #1b7a3d;
  --green-dark: #135c2d;
  --green-soft: #e6f3ea;
  --ink: #16231a;
  --muted: #4a5a4f;
  --line: #d8e2db;
  --bg: #ffffff;
  --bg-alt: #f6faf7;
  --warn-bg: #fff6e5;
  --warn-line: #e0b454;
  --radius: 12px;
  --maxw: 880px;
}

* { box-sizing: border-box; }

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

/* No overflow-x:hidden guard: the layout must genuinely fit, not clip. Overflow
   is prevented by wrapping long content (below), not by hiding it. */
html, body { max-width: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  /* Long words, URLs, emails, and placeholder tokens wrap instead of forcing
     horizontal scroll. This wraps content; it does not clip or hide it. */
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Media never exceeds its container. */
img, svg { max-width: 100%; height: auto; }

/* Inline code (e.g. package id) wraps rather than overflowing. */
code { overflow-wrap: anywhere; word-break: break-word; }

a { color: var(--green-dark); }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green-dark);
  color: #fff;
  padding: 10px 16px;
  z-index: 10;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 64px;
  /* Allow the nav to wrap below the brand on very narrow screens instead of
     overflowing horizontally. */
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.15rem; flex: 0 0 auto; }
.brand .logo { width: 34px; height: 34px; flex: 0 0 auto; }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}
.nav a { text-decoration: none; font-weight: 600; white-space: nowrap; }

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--green-soft), var(--bg));
  padding: 56px 0 40px;
  text-align: center;
}
.hero h1 { font-size: 2rem; margin: 0 0 8px; line-height: 1.2; }
.tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--green-dark);
  margin: 0 auto 18px;
  max-width: 34ch;
}
.subhead { color: var(--muted); max-width: 56ch; margin: 0 auto 28px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  font-size: 1rem;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: #fff; color: var(--green-dark); border-color: var(--green); }

.btn-disabled {
  background: #eceeec;
  color: #6b766e;
  cursor: not-allowed;
  border-color: #d2d8d3;
}
.btn-note { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

/* Sections */
section { padding: 44px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: 1.5rem; margin: 0 0 6px; }
.section-intro { color: var(--muted); margin: 0 0 24px; max-width: 60ch; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.feature h3 { margin: 0 0 6px; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.97rem; }

.availability { display: flex; align-items: flex-start; gap: 14px; }
.availability .mark { font-size: 1.4rem; line-height: 1.2; }

ul.plain { padding-left: 1.2em; margin: 0; }
ul.plain li { margin-bottom: 8px; }

/* Callout for honesty notes / missing info */
.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-left: 5px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 18px 0;
}
.callout strong { color: #8a5a00; }

/* Placeholder token styling — must be replaced before publishing.
   Tokens can be long, so they must wrap rather than force horizontal scroll. */
.placeholder {
  background: #ffe8e8;
  border: 1px dashed #d05252;
  color: #a12020;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Support */
.support-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.support-card .email { font-size: 1.2rem; font-weight: 700; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center; }
.site-footer a { font-weight: 600; }

/* Simple content pages */
.doc { padding: 40px 0; }
.doc h1 { font-size: 1.8rem; }
.doc h2 { margin-top: 28px; }
.doc .meta { color: var(--muted); font-size: 0.9rem; }
/* Wrapper keeps a wide table scrollable within the page width WITHOUT clipping:
   content stays reachable via horizontal scroll on the wrapper only, and the
   page itself does not overflow. */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}
.doc table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  /* Fixed layout + wrapping cells so the 3-column table fits 360px without a
     single column blowing out the width. */
  table-layout: fixed;
}
.doc th, .doc td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.doc th { background: var(--bg-alt); }
/* Give the first (label) column a sensible minimum on larger screens. */
@media (min-width: 560px) {
  .doc table { table-layout: auto; }
}

/* Auth fallback page */
.callback {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--green-soft), var(--bg));
}
.callback .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 26px;
  max-width: 460px;
}
.callback .logo { width: 56px; height: 56px; margin-bottom: 8px; }

@media (min-width: 640px) {
  .hero h1 { font-size: 2.5rem; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.back-home { margin-top: 28px; }
.launch-intro { margin-bottom: 12px; }
.doc .support-card, .doc .support-card .btn-note { text-align: left; }
