/*
Theme Name: BerryFields
Theme URI: https://berryfields.com.au
Author: Country Corn Australia Pty Ltd
Author URI: https://countrycorn.com.au
Description: BerryFields brand site for Country Corn Australia. Shares the family design system with Harvestime, CWFD and Frozberries: Fraunces headings, Inter text, real packshots and one token file (css/tokens.css).
Version: 2.6.9
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: berryfields
Tags: frozen-berries, frozen-corn, organic, australian, wholesale
*/

/*
 * Colours, type, radii and shadows come from css/tokens.css (--bf-*).
 * Do not add raw hex values here; add a token instead.
 */

/* ==========================================================================
   Base
   ========================================================================== */

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

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    font-family: var(--bf-font-body);
    font-size: var(--bf-fs-body);
    line-height: var(--bf-lh-body);
    color: var(--bf-body);
    background: var(--bf-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--bf-berry);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--bf-berry-deep);
}

ul[class], ol[class] {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--bf-font-display);
    font-weight: 600;
    line-height: var(--bf-lh-heading);
    color: var(--bf-ink);
    letter-spacing: -0.015em;
    font-optical-sizing: auto;
}

h1 { font-size: var(--bf-fs-h1); letter-spacing: -0.025em; }
h2 { font-size: var(--bf-fs-h2); letter-spacing: -0.02em; }
h3 { font-size: var(--bf-fs-h3); line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.25; }

p {
    margin-bottom: 1em;
}

p:last-child {
    margin-bottom: 0;
}

sup {
    font-size: 0.55em;
    line-height: 0;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.skip-link:focus {
    clip: auto;
    width: auto;
    height: auto;
    top: 12px;
    left: 12px;
    z-index: 10000;
    padding: 12px 18px;
    background: var(--bf-white);
    color: var(--bf-ink);
    border-radius: var(--bf-radius-sm);
    box-shadow: var(--bf-shadow);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container,
.container-wide {
    width: 100%;
    max-width: var(--bf-container);
    margin: 0 auto;
    padding: 0 var(--bf-gutter);
}

.section,
.bf-section {
    padding: var(--bf-section) 0;
}

.text-center { text-align: center; }

.bf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-family: var(--bf-font-body);
    font-size: var(--bf-fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bf-berry);
}

.bf-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--bf-berry-bright);
}

/* ==========================================================================
   Buttons: 12px-cornered rectangles, same as Harvestime
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    font-family: var(--bf-font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: 1.5px solid transparent;
    border-radius: var(--bf-radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--bf-berry);
    color: var(--bf-white);
    box-shadow: var(--bf-shadow-berry);
}

.btn-primary:hover {
    background: var(--bf-berry-deep);
    color: var(--bf-white);
}

.btn-ghost,
.btn-outline,
.btn-secondary {
    background: var(--bf-white);
    border-color: var(--bf-line);
    color: var(--bf-ink);
}

.btn-ghost:hover,
.btn-outline:hover,
.btn-secondary:hover {
    border-color: var(--bf-berry);
    color: var(--bf-berry);
}

.btn-light {
    background: var(--bf-white);
    color: var(--bf-leaf);
}

.btn-light:hover {
    background: var(--bf-cream);
    color: var(--bf-leaf);
}

.btn-large {
    min-height: 54px;
    padding: 14px 26px;
    font-size: 16px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn .bf-arrow {
    transition: transform 0.2s ease;
}

.btn:hover .bf-arrow,
.bf-link:hover .bf-arrow {
    transform: translate(2px, -2px);
}

.bf-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: var(--bf-fs-sm);
    color: var(--bf-berry);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.admin-bar .site-header {
    top: 32px;
}

.bf-topbar {
    background: var(--bf-berry-deep);
    color: rgba(255, 255, 255, 0.88);
    font-size: var(--bf-fs-xs);
}

.bf-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
}

.bf-topbar p {
    margin: 0;
}

.bf-topbar__inner > .bf-topbar__brand {
    margin-right: auto;
    margin-left: -8px;
}

.bf-topbar__brand::before {
    content: "\00B7";
    margin-right: 8px;
}

.bf-topbar__buy {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bf-topbar__buy span {
    color: rgba(255, 255, 255, 0.7);
}

.bf-topbar__buy a {
    color: var(--bf-white);
    font-weight: 600;
}

.bf-topbar__buy small {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
}

.bf-topbar__buy a:hover,
.bf-topbar__buy a:hover small {
    color: var(--bf-rose);
}

.main-header {
    background: var(--bf-glass);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--bf-line);
    transition: box-shadow 0.2s ease;
}

.site-header.scrolled .main-header {
    box-shadow: var(--bf-shadow-sm);
}

.bf-header {
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 78px;
}

.site-branding img,
.site-branding .custom-logo {
    width: auto;
    max-height: 52px;
}

.main-navigation {
    margin-left: auto;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.primary-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--bf-radius-sm);
    font-size: var(--bf-fs-sm);
    font-weight: 500;
    color: var(--bf-body);
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    color: var(--bf-berry);
    background: var(--bf-blush);
}

.header-cta {
    display: flex;
    gap: 10px;
}

.btn-header {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 14px;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    background: var(--bf-white);
    border: 1px solid var(--bf-line);
    border-radius: var(--bf-radius-sm);
    cursor: pointer;
}

.hamburger {
    display: grid;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--bf-ink);
}

/* Mobile drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    width: min(380px, 88vw);
    display: flex;
    flex-direction: column;
    background: var(--bf-cream);
    box-shadow: var(--bf-shadow-lg);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
}

.mobile-nav-drawer.active {
    transform: translateX(0);
    visibility: visible;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bf-line);
}

.mobile-nav-header img {
    height: 40px;
    width: auto;
}

.mobile-nav-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bf-white);
    border: 1px solid var(--bf-line);
    border-radius: var(--bf-radius-sm);
    color: var(--bf-ink);
    cursor: pointer;
}

.mobile-nav-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 28px;
}

.mobile-menu a {
    display: block;
    padding: 14px 4px;
    border-bottom: 1px solid var(--bf-line-soft);
    font-family: var(--bf-font-display);
    font-size: 21px;
    font-weight: 500;
    color: var(--bf-ink);
}

.mobile-brands-label {
    margin: 24px 0 10px;
    font-size: var(--bf-fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bf-muted);
}

.mobile-brands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    padding: 8px;
    background: var(--bf-white);
    border: 1px solid var(--bf-line);
    border-radius: var(--bf-radius-sm);
}

.mobile-brand img {
    max-height: 40px;
    width: auto;
}

.mobile-cta-buttons {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: var(--bf-scrim);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--bf-night);
    color: rgba(255, 255, 255, 0.72);
    font-size: var(--bf-fs-sm);
    padding: clamp(56px, 7vw, 88px) 0 28px;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.88);
}

.site-footer a:hover {
    color: var(--bf-white);
}

.bf-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr 1.1fr;
    gap: 40px;
}

.bf-footer__logo {
    display: inline-flex;
    padding: 10px 14px;
    margin-bottom: 18px;
    background: var(--bf-white);
    border-radius: var(--bf-radius-sm);
}

.bf-footer__logo img {
    height: 40px;
    width: auto;
}

.bf-footer__about p {
    max-width: 34ch;
}

.bf-footer__social {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.bf-footer__social a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--bf-radius-sm);
}

.bf-footer__title {
    margin-bottom: 16px;
    font-family: var(--bf-font-body);
    font-size: var(--bf-fs-eyebrow);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bf-white);
}

.bf-footer__list {
    display: grid;
    gap: 12px;
}

.bf-footer__list small {
    display: block;
    font-size: var(--bf-fs-xs);
    color: rgba(255, 255, 255, 0.55);
}

.bf-footer__contact a {
    overflow-wrap: anywhere;
}

.bf-footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: clamp(40px, 6vw, 64px);
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: var(--bf-fs-xs);
    color: rgba(255, 255, 255, 0.55);
}

.bf-footer__bottom p {
    margin: 0;
}

.bf-footer__legal {
    display: flex;
    gap: 18px;
    white-space: nowrap;
}

/* ==========================================================================
   Inner pages and posts
   ========================================================================== */

.bf-page-hero {
    padding: clamp(56px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
    background: var(--bf-wash);
    border-bottom: 1px solid var(--bf-line);
}

.bf-page-hero h1 {
    max-width: 18ch;
}

.bf-page-hero .bf-page-hero__meta,
.bf-page-hero .bf-page-hero__lead {
    margin-top: 16px;
    font-size: var(--bf-fs-lead);
    color: var(--bf-muted);
    max-width: 60ch;
}

.entry-content {
    max-width: 760px;
    font-size: 17px;
    line-height: 1.75;
}

.entry-content > * + * {
    margin-top: 1.1em;
}

.entry-content h2 { font-size: clamp(26px, 2.4vw, 34px); margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.6em; }

.entry-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.3em;
}

.entry-content li + li {
    margin-top: 0.4em;
}

.entry-content img {
    border-radius: var(--bf-radius);
}

.entry-content blockquote {
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--bf-berry-bright);
    font-family: var(--bf-font-display);
    font-size: 21px;
    color: var(--bf-ink);
}

.entry-featured-image img {
    width: 100%;
    border-radius: var(--bf-radius-lg);
}

.entry-footer {
    max-width: 760px;
    margin: 48px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--bf-line);
    font-size: var(--bf-fs-sm);
}

/* Archive / blog index */
.bf-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
    .bf-topbar__brand {
        display: none;
    }

    .main-navigation,
    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .bf-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 0;
    }
}

@media (max-width: 680px) {
    .bf-topbar__lead,
    .bf-topbar__buy small {
        display: none;
    }

    .bf-topbar__inner {
        justify-content: center;
        min-height: 34px;
    }

    .bf-header {
        min-height: 66px;
    }

    .site-branding img,
    .site-branding .custom-logo {
        max-height: 42px;
    }

    .bf-footer__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .bf-footer__bottom {
        flex-direction: column;
    }
}

.bf-post {
    overflow: hidden;
    background: var(--bf-white);
    border: 1px solid var(--bf-line);
    border-radius: var(--bf-radius);
}

.bf-post__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.bf-post__body {
    padding: 22px;
}

.bf-post__body time {
    font-size: var(--bf-fs-xs);
    color: var(--bf-muted);
}

.bf-post__body h2 {
    margin: 6px 0 10px;
    font-size: var(--bf-fs-h3);
    line-height: 1.2;
}

.bf-post__body h2 a {
    color: var(--bf-ink);
}

.bf-post__body p {
    font-size: var(--bf-fs-sm);
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.nav-links .page-numbers {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: var(--bf-white);
    border: 1px solid var(--bf-line);
    border-radius: var(--bf-radius-sm);
    color: var(--bf-ink);
}

.nav-links .page-numbers.current {
    background: var(--bf-berry);
    border-color: var(--bf-berry);
    color: var(--bf-white);
}
