/*
Theme Name: EduSeedTech
Theme URI: https://www.eduseedtech.com/
Author: EduSeedTech
Author URI: https://www.eduseedtech.com/
Description: Custom block theme for EduSeedTech — overseas education advisory firm. White-dominant, navy footer, gold accents. Fraunces + Plus Jakarta Sans typography. Built for the 2026 brochure refresh.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: eduseedtech
Tags: block-theme, education, business
*/

/*
 * theme.json drives the bulk of styling.
 * This file holds only the rules that theme.json cannot express:
 *  - Italic spans inside headings rendered in gold
 *  - Visible focus outline on interactive elements
 *  - Smooth scroll for in-page anchors
 */

html {
    scroll-behavior: smooth;
}

h1 em, h2 em, h3 em, h4 em, h5 em, h6 em,
.wp-block-heading em {
    color: var(--wp--preset--color--gold-text);
    font-style: italic;
    font-weight: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.wp-block-button__link:focus-visible,
.wp-block-navigation a:focus-visible {
    outline: 2px solid var(--wp--preset--color--gold-deep);
    outline-offset: 3px;
}

.wp-block-navigation .current-menu-item > a {
    color: var(--wp--preset--color--gold-text);
}

/*
 * Force white text on navy-background sections.
 * theme.json sets element.h1-h6.color.text = navy globally; that rule wins
 * over inline style on dark sections in some block-supports cascades.
 * Scoping by parent background class keeps the override predictable.
 */
.has-navy-background-color,
.has-navy-background-color h1,
.has-navy-background-color h2,
.has-navy-background-color h3,
.has-navy-background-color h4,
.has-navy-background-color h5,
.has-navy-background-color h6,
.has-navy-background-color p,
.has-navy-background-color li,
.has-navy-background-color a:not(.wp-element-button) {
    color: #ffffff !important;
}

.has-navy-background-color h1 em,
.has-navy-background-color h2 em,
.has-navy-background-color h3 em,
.has-navy-background-color h4 em,
.has-navy-background-color h5 em,
.has-navy-background-color h6 em {
    color: var(--wp--preset--color--gold) !important;
}

.has-navy-background-color .has-gold-color,
.has-navy-background-color .has-gold-text-color,
.has-navy-background-color .has-gold-deep-color {
    color: var(--wp--preset--color--gold);
}

.has-navy-background-color .has-text-mute-color {
    color: rgba(255, 255, 255, 0.78);
}

/* Buttons: ensure filled buttons keep white text */
.wp-element-button.has-white-color,
a.wp-element-button.has-white-color,
.wp-block-button__link.has-white-color {
    color: #ffffff !important;
}

/* Site logo: lock to a clean square in the header */
.wp-block-site-logo img {
    border-radius: 0;
}
.wp-block-site-logo {
    line-height: 0;
}

/*
 * Mobile breakpoint (≤781px — WP block columns auto-collapse here).
 * Inline grid templates and flex-basis on column blocks don't collapse
 * automatically, so we override them. Fixed paddings get tightened so
 * content has room to breathe on a 390px viewport.
 */
@media (max-width: 781px) {

    /* Prevent stray alignwide/alignfull elements from causing horizontal
       scroll, which makes long headings appear clipped. */
    html, body {
        overflow-x: hidden;
    }

    /* Tighten root left/right padding (theme.json sets 2rem on body). The
       vars cascade — overriding on body propagates into .has-global-padding
       and the .alignfull negative-margin calc. */
    body {
        --wp--style--root--padding-left: 1.25rem !important;
        --wp--style--root--padding-right: 1.25rem !important;
    }

    /* Header utility strip: wrap, center, smaller. */
    header > .wp-block-group:first-child {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.25rem 0.75rem !important;
        font-size: 0.7rem !important;
        text-align: center;
    }

    /* Header main row: keep logo left + hamburger right, no overflow. */
    header > .wp-block-group:nth-child(2) {
        gap: 0.5rem !important;
    }
    .wp-block-site-title a {
        font-size: 1.25rem !important;
    }

    /* Hero & page-header: smaller padding, allow long words to break. */
    .wp-block-group[style*="padding-top:5rem"],
    .wp-block-group[style*="padding-top: 5rem"] {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    .wp-block-group[style*="padding-top:6rem"] {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }
    .wp-block-heading {
        word-break: break-word;
        hyphens: auto;
    }

    /* Hero h1 hard cap on mobile (the clamp's vw min was still too big
       when the viewport is exactly 390px and the headline is long). */
    h1.wp-block-heading {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
        line-height: 1.1 !important;
    }
    h2.wp-block-heading {
        font-size: clamp(1.625rem, 6vw, 2rem) !important;
        line-height: 1.2 !important;
    }

    /* Columns: any inline flex-basis percentage / fixed width → full width. */
    .wp-block-columns {
        flex-direction: column !important;
        gap: 2rem !important;
    }
    .wp-block-column {
        flex-basis: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    /* Inline 3-col grid (admissions-table, locations-grid, services-pillars
       use this exact pattern) → single column. */
    .wp-block-group[style*="grid-template-columns:repeat(3,1fr)"],
    .wp-block-group[style*="grid-template-columns: repeat(3,1fr)"],
    .wp-block-group[style*="grid-template-columns:repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* 4-col approach-steps & stats-band → 2x2 grid. */
    .wp-block-group[style*="grid-template-columns:repeat(4,1fr)"],
    .wp-block-group[style*="grid-template-columns:repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Service hero banners — shorter on mobile. */
    figure.wp-block-image.alignwide img[style*="height:440px"] {
        height: 220px !important;
    }

    /* Founder photo column should not retain a fixed flex-basis. */
    .eduseedtech-founder-photo img {
        max-width: 100%;
    }

    /* Buttons: smaller padding, allow stacking. The hero pattern sets
       flex-wrap:nowrap inline on the wrapper, which overflows on mobile. */
    .wp-block-buttons,
    .wp-block-buttons.is-content-justification-left,
    .wp-block-buttons[style*="flex-wrap"] {
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
    }
    .wp-block-button {
        flex-shrink: 0;
    }
    .wp-block-button .wp-block-button__link {
        padding: 0.85rem 1.25rem !important;
        font-size: 0.78rem !important;
    }

    /* Footer: stack columns, tighten padding. */
    footer.wp-block-group {
        padding-top: 3rem !important;
        padding-bottom: 1.5rem !important;
    }
    footer .wp-block-columns,
    footer .wp-block-group[style*="space-between"] {
        flex-direction: column !important;
        gap: 2rem !important;
        align-items: flex-start !important;
    }

    /* Tables in /photo-credits/ — tighten and allow horizontal scroll. */
    .wp-block-table {
        overflow-x: auto;
    }
    .wp-block-table table {
        font-size: 0.78rem !important;
    }

    /* Two-col content patterns (content-two-col) — left col with fixed
       360px width was overflowing. */
    .wp-block-column[style*="flex-basis:360px"] {
        flex-basis: 100% !important;
    }

}

@media (max-width: 480px) {
    /* Phones: still readable padding (1.25rem each side keeps text off the
       hard edge) and slightly smaller hero. */
    body {
        --wp--style--root--padding-left: 1.25rem !important;
        --wp--style--root--padding-right: 1.25rem !important;
    }
    h1.wp-block-heading {
        font-size: clamp(1.625rem, 8vw, 2rem) !important;
    }
    h2.wp-block-heading {
        font-size: clamp(1.4rem, 6vw, 1.75rem) !important;
    }
    .wp-block-group[style*="padding-top:5rem"],
    .wp-block-group[style*="padding-top: 5rem"] {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    figure.wp-block-image.alignwide img[style*="height:440px"] {
        height: 180px !important;
    }
    /* CTA band heading often runs long ("Plan your next chapter with us"). */
    .has-navy-background-color h2.wp-block-heading {
        font-size: clamp(1.5rem, 6.5vw, 1.875rem) !important;
    }
}
