/*
 * BerryFields design tokens: the single source of colour, type, shape and depth.
 *
 * WHY THIS FILE EXISTS
 * BerryFields is one of the Country Corn Australia brands, alongside
 * Harvestime, Frozberries and CWFD. Those sites now share one design
 * language: an editorial serif for headings, Inter for reading text, warm
 * off-white pages, three corner radii and soft tinted shadows. This file
 * gives BerryFields the same system in its own colour (berry red), so the
 * four sites read as one family. The structure and names mirror Harvestime's
 * tokens.css (--hv-*), so a change made there can be carried across 1:1.
 *
 * Never put raw hex colours in a page stylesheet; add a token here.
 * Loaded on every front-end page, before every other theme stylesheet.
 */
:root {
    /* Brand berry reds */
    --bf-berry: #a3132f;          /* primary: buttons, links, accents (7.4:1 on white) */
    --bf-berry-deep: #7d0e24;     /* hover / pressed, dark panels */
    --bf-berry-bright: #d8344c;   /* highlights, dots. NOT for text on white */
    --bf-blush: #fbe9ec;          /* tinted chips and panels */
    --bf-rose: #f6d6dc;           /* borders on tinted panels */

    /* Family accent: Harvestime forest, used sparingly (trade, organic cues) */
    --bf-leaf: #0c4437;
    --bf-leaf-text: #0e6b49;
    --bf-gold: #e8a33b;           /* corn / mango warmth, on dark only */

    /* Neutrals: warm, faintly berry-tinted */
    --bf-ink: #2a171c;            /* headings */
    --bf-body: #4a3a3e;           /* paragraph text (9.9:1) */
    --bf-muted: #75666a;          /* secondary text (5.3:1) */
    --bf-line: #ecdfe1;           /* borders */
    --bf-line-soft: #f3eaeb;
    --bf-wash: #faf5f3;           /* section backgrounds */
    --bf-cream: #fdfbf8;          /* page background */
    --bf-white: #ffffff;
    --bf-night: #1f1115;          /* footer */

    /* Type: same pairing as Harvestime (Fraunces + Inter) */
    --bf-font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --bf-font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

    /* Shape: three radii only (same as Harvestime) */
    --bf-radius-sm: 12px;         /* buttons, inputs, chips */
    --bf-radius: 20px;            /* cards */
    --bf-radius-lg: 28px;         /* large panels and heroes */

    /* Depth */
    --bf-shadow-sm: 0 1px 2px rgba(42, 23, 28, 0.05), 0 6px 16px rgba(42, 23, 28, 0.06);
    --bf-shadow: 0 1px 2px rgba(42, 23, 28, 0.04), 0 16px 38px rgba(42, 23, 28, 0.08);
    --bf-shadow-lg: 0 2px 4px rgba(42, 23, 28, 0.05), 0 28px 60px rgba(42, 23, 28, 0.13);
    --bf-shadow-berry: 0 8px 20px rgba(163, 19, 47, 0.22);   /* under primary buttons */
    --bf-focus: 0 0 0 3px rgba(216, 52, 76, 0.4);
    --bf-scrim: rgba(31, 17, 21, 0.45);                     /* behind the mobile drawer */
    --bf-glass: rgba(253, 251, 248, 0.92);                  /* sticky header */

    /* Type scale: identical to Harvestime so headings match across sites */
    --bf-fs-h1: clamp(38px, 4.4vw, 64px);
    --bf-fs-h2: clamp(28px, 3vw, 44px);
    --bf-fs-h3: clamp(19px, 1.5vw, 22px);
    --bf-fs-lead: clamp(17px, 1.3vw, 19px);
    --bf-fs-body: 16px;
    --bf-fs-sm: 15px;
    --bf-fs-xs: 13px;             /* the floor for readable text */
    --bf-fs-eyebrow: 12px;        /* uppercase labels, tracked out */
    --bf-lh-heading: 1.06;
    --bf-lh-body: 1.65;

    --bf-container: 1240px;
    --bf-gutter: clamp(16px, 4vw, 32px);
    --bf-section: clamp(64px, 8vw, 112px);

    /*
     * Legacy names. Older templates and Pagelayer content still reference
     * these, so they point at the new tokens instead of their old values.
     */
    --berry-primary: var(--bf-berry);
    --berry-primary-dark: var(--bf-berry-deep);
    --berry-secondary: var(--bf-leaf);
    --berry-accent: var(--bf-gold);
    --berry-success: var(--bf-leaf-text);
    --color-white: var(--bf-white);
    --color-off-white: var(--bf-wash);
    --color-light-gray: var(--bf-line);
    --color-gray: var(--bf-muted);
    --color-dark-gray: var(--bf-body);
    --color-black: var(--bf-ink);
    --gradient-berry: var(--bf-berry);
    --gradient-fresh: var(--bf-leaf);
    --gradient-organic: var(--bf-leaf-text);
    --font-primary: var(--bf-font-body);
    --font-heading: var(--bf-font-display);
    --radius-sm: var(--bf-radius-sm);
    --radius-md: var(--bf-radius-sm);
    --radius-lg: var(--bf-radius);
    --radius-xl: var(--bf-radius-lg);
    --shadow-sm: var(--bf-shadow-sm);
    --shadow-md: var(--bf-shadow);
    --shadow-lg: var(--bf-shadow-lg);
}

::selection {
    background: var(--bf-rose);
    color: var(--bf-ink);
}

/* One visible, consistent keyboard focus style everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: none;
    box-shadow: var(--bf-focus);
    border-radius: 6px;
}

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