/* ==========================================================================
   Agro Acres — base
   Tokens from the Agro Acres Brand Guideline (2022):
   Salem #1C8459, Tangerine Yellow #FDD103, plus the orange, brown and
   peach used in the logo and brand elements. Typeface: Avenir, with
   Nunito Sans as the web fallback.
   ========================================================================== */

:root {
    --green: #1c8459;
    --green-dark: #146544;
    --green-tint: #eaf4ef;
    --green-tint-2: #d2e6dd;

    --yellow: #fdd103;
    --yellow-dark: #e9bf00;
    --yellow-tint: #fff8d6;

    --orange: #e85118;
    --orange-dark: #b93d0e;
    --peach: #f29673;
    --peach-tint: #fdefe8;

    --brown: #432a17;
    --ink: #2b1d12;
    --ink-soft: #5b4838;
    --muted: #8a7a6c;

    --paper: #faf8f3;
    --paper-2: #f2eee5;
    --line: #e8e2d7;
    --line-strong: #cfc5b5;
    --white: #ffffff;

    --font: "Avenir Next", Avenir, "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --radius: 3px;
    --section: clamp(64px, 9vw, 112px);

    color-scheme: light;
}

/* Reset ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

/* Author display rules (grid, flex) must not override the hidden attribute */
[hidden] { display: none !important; }
img { height: auto; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

::selection { background: var(--yellow); color: var(--brown); }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    background: var(--ink); color: var(--white);
    padding: 10px 14px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--white); }

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Type ------------------------------------------------------------------- */

h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.display {
    font-size: clamp(2.5rem, 5.2vw, 4.5rem);
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--green);
    text-wrap: balance;
}

.h2 {
    font-size: clamp(1.9rem, 3.4vw, 2.85rem);
    letter-spacing: -0.03em;
    color: var(--green);
    text-wrap: balance;
}

.h3 {
    font-size: 1.3rem;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.lead {
    font-size: clamp(1.1rem, 1.6vw, 1.25rem);
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 38em;
}

.eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-bottom: 18px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.eyebrow > span:not(.eyebrow-rule) { flex: none; }
.eyebrow-rule {
    width: 72px;
    height: 1px;
    background: var(--yellow-dark);
}

.prose p + p { margin-top: 1em; }
.prose { color: var(--ink-soft); max-width: 40em; }

.optional {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: 4px;
}

/* Buttons & links -------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 24px;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    font-size: 0.975rem;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn .icon { width: 18px; height: 18px; transition: transform .15s ease; }
.btn:hover .icon { transform: translateX(3px); }

.btn-sm { min-height: 42px; padding: 0 18px; font-size: 0.9rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); color: var(--white); }

.btn-yellow { background: var(--yellow); color: var(--brown); }
.btn-yellow:hover { background: var(--yellow-dark); color: var(--brown); }

.btn-outline { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }

.btn-danger { background: var(--white); color: var(--orange-dark); border-color: #f1b9a3; }
.btn-danger:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: var(--white); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 3px;
    border-bottom: 2px solid var(--yellow);
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s ease;
}
.link-arrow::after {
    content: "";
    width: 14px; height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.link-arrow:hover { color: var(--ink); border-color: var(--green); }

/* Forms ------------------------------------------------------------------ */

.form { display: grid; gap: 22px; }

.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field label, .field-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field-half { max-width: calc(50% - 11px); }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="search"], input[type="url"], select, textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 1rem;
    line-height: 1.4;
    color: var(--ink);
    transition: border-color .15s ease;
}
input::placeholder, textarea::placeholder { color: #a99b8d; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--green);
    outline-offset: -1px;
    border-color: var(--green);
}
textarea { min-height: 120px; resize: vertical; }

select {
    appearance: none;
    padding-right: 42px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b4838' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
    cursor: pointer;
}

[aria-invalid="true"] { border-color: var(--orange) !important; }
.field-error { font-size: 0.85rem; font-weight: 600; color: var(--orange-dark); }

.input-group { display: grid; grid-template-columns: 1fr auto; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group select {
    width: auto;
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: var(--paper);
}

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-soft);
    transition: border-color .15s ease, background-color .15s ease;
}
.choice:hover span { border-color: var(--muted); }
.choice input:checked + span {
    border-color: var(--green);
    background: var(--green-tint);
    color: var(--green-dark);
    box-shadow: inset 0 0 0 1px var(--green);
}
.choice input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--green); }

/* Alerts ----------------------------------------------------------------- */

.alert {
    padding: 14px 18px;
    border-left: 3px solid;
    font-size: 0.95rem;
    line-height: 1.5;
}
.alert-success { background: var(--green-tint); border-color: var(--green); color: var(--green-dark); }
.alert-error { background: var(--peach-tint); border-color: var(--orange); color: var(--orange-dark); }
.alert-notice { background: var(--yellow-tint); border-color: var(--yellow-dark); color: var(--brown); }

/* Status labels ---------------------------------------------------------- */

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--ink-soft);
}
.status::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--muted);
}
.status-available::before { background: var(--green); }
.status-seasonal::before { background: var(--yellow-dark); }
.status-on_request::before { background: var(--peach); }
.status-unavailable { color: var(--muted); }
.status-unavailable::before { background: transparent; border: 1.5px solid var(--muted); }

.icon { width: 20px; height: 20px; flex: none; }

@media (max-width: 640px) {
    .field-row { grid-template-columns: 1fr; }
    .field-half { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
