/*
Theme Name: Metro 
Description: Minimal WordPress theme optimized for page builder usage (Brakdance/Breakdance compatible)
Author: Bloomdesigners
Author URI: https://bloomdesigners.com/
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: page-builder, minimal, clean, responsive
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

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

a {
    color: #0073aa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Reusable Breakdance text-link treatment */
.link-with-chevron {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.link-with-chevron::after {
    content: "";
    width: 7px;
    height: 7px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.link-with-chevron:hover {
    text-decoration: none;
}

.link-with-chevron:hover::after {
    transform: translateX(3px) rotate(45deg);
}

/* Reusable direction link treatment */
.direction-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.direction-link::before {
    content: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m8.176 8.45 2.023-2.024-2.023-2.051v1.45H5.25c-.164 0-.3.063-.41.19a.557.557 0 0 0-.164.41V8.75h1.148V7h2.352v1.45Zm4.484-1.86c.11.11.164.246.164.41 0 .164-.054.3-.164.41l-5.25 5.25a.557.557 0 0 1-.41.164.557.557 0 0 1-.41-.164L1.34 7.41A.557.557 0 0 1 1.176 7c0-.164.054-.3.164-.41l5.25-5.25A.557.557 0 0 1 7 1.176c.164 0 .3.054.41.164l5.25 5.25Z' fill='%2364758B'/%3E%3C/svg%3E");
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    margin-top: -5px;
}

.direction-link:hover {
    text-decoration: none;
}

/* Page Builder Theme Specific */
.page-builder-theme #primary {
    width: 100%;
}

/* Simple Header Styles (optional - can be hidden via customizer) */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Scroll-hide animation — toggled by .is-hidden class via JS */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.site-title a {
    color: #333;
    text-decoration: none;
}

.site-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.site-logo img {
    max-height: 60px;
    width: auto;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */

/* Scope flex only to the top-level menu so sub-menus remain vertical */
.main-navigation > div > ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
}

/* Each top-level <li> is the dropdown anchor point */
.main-navigation > div > ul > li {
    position: relative;
}

.main-navigation a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

/* .main-navigation a:hover {
    color: #0073aa;
    text-decoration: none;
} */

/* Top-level links: flex row so label + badge + chevron sit inline */
.main-navigation > div > ul > li > a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

/* Simple Footer Styles */
.site-footer {
    background: #f8f9fa;
    margin-top: auto;
    padding: 2rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-widgets {
    margin-bottom: 2rem;
}

.site-info {
    font-size: 0.9rem;
    color: #666;
}

/* WordPress Defaults */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
}

.alignleft {
    float: left;
    margin: 0 1rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 1rem;
}

.aligncenter {
    display: block;
    margin: 0 auto;
}

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

/* Responsive */
/* @media (max-width: 768px) {
    
    .main-navigation ul {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
} */

/* Page Builder Compatibility */
.page-builder-theme .site-main {
    padding: 0;
}

/* Hide header/footer when using blank page template */
.page-template-page-blank .site-header,
.page-template-page-blank .site-footer {
    display: none;
}

/* Ensure full width for page builders */
.page-builder-theme .site-main > .container,
.page-builder-theme .site-main > .wrapper {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* Remove theme default margins/padding that might interfere with page builders */
.page-builder-theme article,
.page-builder-theme .entry-content {
    margin: 0;
    padding: 0;
}


/* =============================================================================
   Navigation: dropdowns, mega menu, CTA button, chevrons
   ============================================================================= */

/* ── Sub-menu base (hidden state) ──────────────────────────────────────────── */
.main-navigation .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.375rem 0;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 200;

    /* Hidden by default — visibility keeps it out of tab order */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition:
        opacity   0.2s ease,
        transform 0.2s ease,
        visibility 0s linear 0.2s;
}

/* ── Sub-menu open state ───────────────────────────────────────────────────── */
.main-navigation .has-children.is-open  > .sub-menu,
.main-navigation .has-mega-menu.is-open > .sub-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition:
        opacity   0.2s ease,
        transform 0.2s ease,
        visibility 0s linear 0s;
}

/* ── Sub-menu item links ───────────────────────────────────────────────────── */
.main-navigation .sub-menu li {
    position: relative;
}

.main-navigation .sub-menu li > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    color: #333;
    font-weight: 400;
    white-space: nowrap;
    border-radius: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.main-navigation .sub-menu li > a .menu-item-label {
    flex: 1;
}

.main-navigation .sub-menu li > a .menu-item-chevron--right {
    margin-left: auto;
    opacity: 0.45;
    flex-shrink: 0;
}

.main-navigation .sub-menu li > a:hover {
    background-color: #f5f7fa;
    color: #0073aa;
    text-decoration: none;
}

.main-navigation .sub-menu li > a:hover .menu-item-chevron--right {
    opacity: 1;
}

/* ── Badge pill ────────────────────────────────────────────────────────────── */
.menu-item-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.22em 0.6em;
    border-radius: 20px;
    background: #eef2f7;
    color: #5a6a7e;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Mega menu panel ───────────────────────────────────────────────────────── */

/*
 * Breakdance HTML for items with has-mega-menu:
 *   <li class="... has-mega-menu">
 *     <div class="breakdance-dropdown-toggle">...</div>
 *     <div class="breakdance-dropdown-floater">       ← direct child of <li>
 *       <div class="breakdance-dropdown-body">
 *         <div class="breakdance-dropdown-section">
 *           <ul class="breakdance-dropdown-links">...</ul>
 *
 * Remove .has-mega-menu <li> as CSS containing block so the panel
 * positions relative to the sticky header instead of the narrow <li>.
 */
.has-mega-menu {
    position: static !important;
}

/* Widen the Breakdance dropdown floater to a mega-menu panel */
/*
 * position: fixed  → containing block is the viewport, so left/width are
 *                    relative to the full viewport regardless of Breakdance's
 *                    nav hierarchy.
 * Breakdance's JS sets --dropdown-offset-y via getBoundingClientRect() which
 * returns viewport-relative px, so top: var(--dropdown-offset-y) stays correct.
 * Only left + width are overridden to center the 1152 px panel.
 */
.has-mega-menu > .breakdance-dropdown-floater {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 1152px !important;
    width: 100%;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14) !important;
    min-width: auto;
}

/* Our own walker sub-menu (used inside header.php) */
.main-navigation > div > ul > li.has-mega-menu {
    position: static;
}

.main-navigation .sub-menu.mega-menu-panel {
    left: 0;
    right: 0;
    top: 100%;
    width: 100%;
    max-width: 100%;
    transform: translateY(6px);
    padding: 1.5rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    border-radius: 0 0 12px 12px;
    list-style: none;
}

/* Open state */
.main-navigation .has-mega-menu.is-open > .sub-menu.mega-menu-panel {
    transform: translateY(0);
}

/* Mega menu items: let them flow as flex columns */
.main-navigation .sub-menu.mega-menu-panel > li {
    flex: 1 1 180px;
}

.main-navigation .sub-menu.mega-menu-panel > li > a {
    white-space: normal;
}

/* ── CTA button — secondary / outlined style ───────────────────────────────── */
/*
 * Breakdance HTML: <li class="menu-item-cta"><a class="breakdance-menu-link">...</a></li>
 * The <a> is a direct child of <li class="menu-item-cta"> so the > combinator works.
 * Use !important on visual properties to override Breakdance's own link styles.
 */
li.menu-item-cta > a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    padding: 0.45rem 1.25rem !important;
    border: 2px solid #0073aa !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #0073aa !important;
    background: transparent !important;
    transition:
        background-color 0.2s ease,
        color            0.2s ease,
        border-color     0.2s ease !important;
}

li.menu-item-cta > a:hover {
    background-color: #0073aa !important;
    border-color: #0073aa !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* ── Chevron SVG transitions ───────────────────────────────────────────────── */
.menu-item-chevron svg {
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Rotate chevron-down when parent is open */
.has-children.is-open  > a .menu-item-chevron--down svg,
.has-mega-menu.is-open > a .menu-item-chevron--down svg {
    transform: rotate(180deg);
}
