/* Termofold Figyelo — Child theme overrides for AgroVision FSE */

/*
 * Front page: single continuous background image behind header + hero.
 * The image is on <body>; header and hero are transparent so they float
 * over the same image — identical to the AgroVision demo look.
 */
body.home {
    background: url('../images/farmland_sunset.webp') 0px -1000px / cover no-repeat;
}

/* Header background on all non-home pages. Percentage position scales correctly
   across all viewport widths — pixel offsets shift the image off-screen on smaller displays. */
.site-main-header {
    background: url('../images/farmland_sunset.webp') center 85% / cover no-repeat !important;
    padding: 20px 0 !important;
}

/* On the front page, make the header transparent so the body image shows through */
body.home .site-main-header {
    background: transparent !important;
}

/* Hero cover block: transparent so body image shows through */
body.home .wp-block-cover.tf-hero {
    background: none !important;
}

/* Keep a dark tint overlay so white text stays readable */
body.home .wp-block-cover.tf-hero .wp-block-cover__background {
    background: rgba(3, 25, 10, 0.48) !important;
}

/* Footer links — white text, primary green on hover */
.site-footer a {
    color: #ffffff;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
}

/* Header nav — remove paragraph margins so links sit flush in the flex row */
.tf-header-nav p {
    margin: 0;
}

/* Header nav links — dark color, no underline, green on hover */
.tf-header-nav a {
    color: #282828 !important;
    text-decoration: none !important;
}

.tf-header-nav a:hover {
    color: var(--wp--preset--color--primary) !important;
}

/* Conditional nav: hide login/register when logged in; hide dashboard when logged out */
body.logged-in .tf-nav-guests-only {
    display: none !important;
}

body:not(.logged-in) .tf-nav-members-only {
    display: none !important;
}

/*
 * Constrain all plugin shortcode pages to a readable max-width and add
 * comfortable vertical breathing room between the header and content.
 */
.wp-block-column.fse-page-layout {
    padding: 32px 40px;
}

/* Footer: push Navigáció column to the right edge within the shared content box */
.tf-footer-inner>.wp-block-columns {
    justify-content: space-between;
}

/* =========================================================
   Mobile header fixes
   ========================================================= */

@media screen and (max-width: 767px) {

    /*
     * ── Spacing knobs ───────────────────────────────────────────────────────
     * Edit these six values to fine-tune mobile header whitespace.
     * A normal page refresh (no hard-refresh) picks up the change.
     */
    :root {
        /* Space above and below the entire header block */
        --tf-hdr-outer-pad-y: 0px;

        /* Green top bar — vertical / horizontal inner padding */
        --tf-hdr-topbar-pad-y: 8px;
        --tf-hdr-topbar-pad-x: 16px;

        /* White nav section — vertical / horizontal inner padding */
        --tf-hdr-nav-pad-y: 16px;
        --tf-hdr-nav-pad-x: 20px;

        /* Gap between site title and nav links when stacked (≤ 599px only) */
        --tf-hdr-logo-nav-gap: 12px;

        /* Hero section h1 font size (desktop: 60px inline) */
        --tf-hero-h1-size: 34px;
    }

    /*
     * Outer wrapper — needs both selectors so the home-page rule
     * (body.home .site-main-header) does not outrank the mobile override.
     */
    body.home .site-main-header,
    body:not(.home) .site-main-header {
        padding-top: var(--tf-hdr-outer-pad-y) !important;
        padding-bottom: var(--tf-hdr-outer-pad-y) !important;
    }

    /*
     * Green top bar — parent uses ".wp-block-group.headtop-Wrap" (0,2,0);
     * adding ".tf-site-header" ancestor gives us (0,3,0) so we always win.
     */
    .tf-site-header .wp-block-group.headtop-Wrap {
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding-top: var(--tf-hdr-topbar-pad-y) !important;
        padding-bottom: var(--tf-hdr-topbar-pad-y) !important;
        padding-left: var(--tf-hdr-topbar-pad-x) !important;
        padding-right: var(--tf-hdr-topbar-pad-x) !important;
    }

    /*
     * White nav section — parent uses ".wp-block-columns.header-logo-nav" (0,2,0);
     * adding ".tf-site-header" ancestor gives us (0,3,0) so we always win.
     */
    .tf-site-header .wp-block-columns.header-logo-nav {
        padding-top: var(--tf-hdr-nav-pad-y) !important;
        padding-bottom: var(--tf-hdr-nav-pad-y) !important;
        padding-left: var(--tf-hdr-nav-pad-x) !important;
        padding-right: var(--tf-hdr-nav-pad-x) !important;
        border-bottom: 2px solid #d8d8d8 !important;
    }

    /* Shrink description text so it fits on one line longer */
    .headtop-Wrap>p {
        font-size: 12px !important;
    }

    /* Hero h1 — desktop is 60px inline style, !important needed to override */
    .tf-hero h1.wp-block-heading {
        font-size: var(--tf-hero-h1-size) !important;
        line-height: 1.2 !important;
    }
}

@media screen and (max-width: 599px) {

    /* Gap between stacked site-title row and nav-links row */
    .wp-block-columns.header-logo-nav>.wp-block-column.header_right_menu {
        margin-top: var(--tf-hdr-logo-nav-gap, 2px) !important;
    }

    /*
     * Reset the parent theme's absolute positioning and 25px padding.
     * The parent selector is ".header_right_menu" (one class = specificity 0,1,0).
     * Using ".wp-block-column.header_right_menu" (two classes = 0,2,0) guarantees
     * we win regardless of stylesheet load order.
     */
    .wp-block-column.header_right_menu {
        position: static !important;
        padding: 0 !important;
    }

    /* Hide the empty 10% spacer column; it becomes a full-width blank gap when stacked */
    .wp-block-columns.header-logo-nav>.wp-block-column:not(.logo):not(.header_right_menu) {
        display: none !important;
    }

    /*
     * Logo column: strip the parent's "padding: 20px 0 20px 0px !important".
     * Parent selector is ".wp-block-column.logo" (0,2,0); we use a three-class
     * ancestor chain (0,3,0) to guarantee override.
     */
    .wp-block-columns.header-logo-nav>.wp-block-column.logo {
        padding: 0 !important;
    }

    /* Nav links: left-align (right-aligned on desktop) */
    .tf-header-nav.is-layout-flex,
    .tf-header-nav {
        justify-content: flex-start !important;
    }
}