/*
==========================================================================
 PARENT THEME: CORE LAYOUT & BLOCK ALIGNMENT
==========================================================================
*/

/* 1. Define layout widths as CSS variables for easy maintenance. */
:root {
    --content-max-width: 1280px; /* The maximum width for standard content. */
    --wide-max-width: 1280px;    /* Updated to match standard content width. */
}

/* 2. Prevent horizontal scrollbars caused by 'alignfull' blocks breaking out. */
body {
    overflow-x: hidden;
}

/* 3. Establish the default width for all top-level blocks.
 *
 * This selector targets every direct child (*) of your main content container.
 * Based on the HTML you provided, this container is 'main.site-main'.
 * Every block will be centered and constrained to your specified 1280px width.
*/
main.site-main > * {
    max-width: var(--content-max-width); /* 1280px */
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;  /* Maintains breathing room on smaller screens. */
    padding-right: 2rem;
    box-sizing: border-box; /* Ensure padding is included in width */
}

/* 4. Define the 'wide' alignment.
 *
 * This allows blocks with the .alignwide class to match the standard content width.
*/
main.site-main > .alignwide {
    max-width: var(--wide-max-width); /* 1280px */
}

/* 5. Define the 'full' alignment.
 *
 * Constrain full-width elements to the same max-width as standard content.
*/
main.site-main > .alignfull {
    max-width: var(--content-max-width); /* 1280px */
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
    box-sizing: border-box;
}

/* ========================================================================
   GLOBAL STYLES, FONTS, AND VARIABLES
   ======================================================================== */
:root {
    --font-stack-display: 'Cinzel', serif;
    --font-stack-primary: "Google Sans Flex", -apple-system, sans-serif;
    --font-body: 500 1rem/1.6 var(--font-stack-primary);
}

/* MODIFICATION: All page-level overflow rules are now consolidated here. */
html { 
    overflow-y: scroll;  /* Always show vertical scrollbar to prevent layout shift. */
    overflow-x: hidden;  /* Prevent horizontal scrollbars from off-canvas elements. */
}

body {
    font: var(--font-body);
    color: #333;
    background: #f4f7f6;
    /* REMOVED: The conflicting overflow-x: hidden; rule has been moved to the html element. */
}

/* This rule remains correct for locking the page when the mobile menu is open. */
body.menu-open { 
    overflow: hidden; 
}

a { 
    text-decoration: none; 
    color: inherit; 
}

h1, h2, h3 { 
    font-family: var(--font-stack-display); 
    font-weight: 500; 
    margin: 0 0 1rem; 
}

/* ========================================================================
   DESKTOP NAVIGATION SYSTEM
   ======================================================================== */
.wp-menu-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.wp-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.wp-logo {
    font-size: 2.2rem;
    font-family: Cinzel;
    white-space: nowrap;
}
.wp-nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}
.wp-nav-link {
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    padding: 0.5rem 0;
}
.wp-nav-link:hover { color: #667eea; }
.wp-nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}
.wp-nav-link:hover::after,
.current-menu-item > .wp-nav-link::after { width: 100%; }
.wp-submenu {
    position: absolute;
    top: 100%;
    left: -1rem;
    padding-top: 15px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0);
    transition: all 0.3s ease;
    z-index: 1001;
}
.wp-dropdown:hover .wp-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px);
}
.wp-submenu a {
    display: block;
    padding: 0.75rem 1.5rem;
    background: white;
}

/* ========================================================================
   MOBILE NAVIGATION (GSAP-READY)
   ======================================================================== */
.wp-mobile-toggle { display: none; z-index: 1002; }
.wp-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 768px) {
    .wp-mobile-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 0.5rem;
        gap: 5px;
        background: transparent;
        border: none;
    }
    .wp-mobile-toggle span {
        width: 25px;
        height: 3px;
        background: #333;
        border-radius: 3px;
        transition: all 0.3s ease-in-out;
        transform-origin: center;
    }
    .wp-mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .wp-mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .wp-mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .wp-nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        max-width: 80vw;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 6rem 2rem 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
        overflow-y: auto;
        gap: 0;
        transform: translateX(100%);
        visibility: hidden;
    }
    .wp-nav-link::after { display: none; }
    .wp-nav-link { padding: 1rem; border-bottom: 1px solid #f0f0f0; width: 100%; justify-content: space-between; }
    .wp-submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: #f8f9ff; min-width: 100%; padding: 0; max-height: 0; overflow: hidden; }
}
