/* ==========================================================================
   Global
   ========================================================================== */

* {
    corner-shape: squircle;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.card-border {
    outline: 0.5px solid var(--color-border);
}

.section-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to right,
        rgba(58, 9, 104, 0.9)  0%,
        rgba(58, 9, 104, 0.82) 20%,
        rgba(58, 9, 104, 0.65) 45%,
        rgba(58, 9, 104, 0.42) 70%,
        rgba(58, 9, 104, 0.25) 100%
    );
}

.section-overlay--strong {
    background: linear-gradient(
        to right,
        rgba(58, 9, 104, 0.92) 0%,
        rgba(58, 9, 104, 0.84) 20%,
        rgba(58, 9, 104, 0.67) 45%,
        rgba(58, 9, 104, 0.44) 70%,
        rgba(58, 9, 104, 0.25) 100%
    );
}

/* Full-bleed CTA band photos (replaces background-image for sharper scaling / retina srcset) */
.cta-band-cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 0;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Shared hover lift for card-style surfaces */
.post-card,
.front-why-choose__box,
.front-services-overview__card,
.front-approach__bento-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover,
.front-why-choose__box:hover,
.front-services-overview__card:hover,
.front-approach__bento-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* ==========================================================================
   Top Bar
   ========================================================================== */

.top-bar {
    position: fixed;
    top: var(--wp-admin-bar-offset, 0);
    left: 0;
    right: 0;
    z-index: 201;
    height: var(--top-bar-height);
    background-color: transparent;
    color: #fff;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.top-bar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.top-bar__left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Icon (0.35rem) + label in one control */
.top-bar__link-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* External SVGs tint via currentColor: luminance → alpha mask, fill from `color` */
.top-bar__icon {
    display: block;
    width: 0.85em;
    height: 0.85em;
    flex-shrink: 0;
    line-height: 0;
    background-color: currentColor;
    -webkit-mask-image: var(--top-bar-ico);
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-image: var(--top-bar-ico);
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
}

.top-bar__link-label {
    white-space: nowrap;
}

.top-bar__email,
.top-bar__phone,
.top-bar__social-link,
.top-bar__lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.2;
    transition: color 0.3s ease;
    position: relative;
    background-image: none !important;
}

/* Flag height matches top bar SVG icons (~0.85em); width follows aspect ratio */
.top-bar__lang-switcher__flag {
    display: block;
    height: 0.85em;
    width: auto;
    max-width: 1.5em;
    object-fit: contain;
    flex-shrink: 0;
    pointer-events: none;
}

.top-bar__email::after,
.top-bar__phone::after,
.top-bar__social-link::after,
.top-bar__lang-switcher::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.25s ease;
}

.top-bar__email:hover::after,
.top-bar__phone:hover::after,
.top-bar__social-link:hover::after,
.top-bar__lang-switcher:hover::after {
    width: 100%;
}

.top-bar__email:hover,
.top-bar__phone:hover,
.top-bar__social-link:hover,
.top-bar__lang-switcher:hover {
    color: rgba(255, 255, 255, 0.75);
    background-image: none !important;
}

.top-bar__social {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}


.top-bar.is-scrolled {
    background-color: var(--color-topbar-scrolled, #3a0968);
    color: rgba(255, 255, 255, 0.85);
}

.top-bar.is-scrolled .top-bar__email,
.top-bar.is-scrolled .top-bar__phone,
.top-bar.is-scrolled .top-bar__social-link,
.top-bar.is-scrolled .top-bar__lang-switcher {
    color: rgba(255, 255, 255, 0.85);
}

.top-bar.is-scrolled .top-bar__email:hover,
.top-bar.is-scrolled .top-bar__phone:hover,
.top-bar.is-scrolled .top-bar__social-link:hover,
.top-bar.is-scrolled .top-bar__lang-switcher:hover {
    color: #fff;
}

/* Top bar text goes dark when mobile nav is open (non-scrolled state) */
.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__email,
.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__phone,
.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__social-link,
.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__lang-switcher {
    color: var(--color-charcoal);
}

.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__email:hover,
.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__phone:hover,
.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__social-link:hover,
.site:has(#mobile-nav.is-open) .top-bar:not(.is-scrolled) .top-bar__lang-switcher:hover {
    color: rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Site Header & Branding
   ========================================================================== */

.site-header {
    background-color: transparent;
    border-bottom: none;
    position: fixed; /* Switch to fixed for hero underlap */
    left: 0;
    right: 0;
    top: calc(var(--wp-admin-bar-offset, 0) + var(--top-bar-height));
    z-index: 200;
    transition: padding 0.15s ease, background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
    padding: 1rem;
}

.site-header.is-scrolled {
    padding-top: 0;
    padding-bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

/* WP Admin Bar Handling */
:root {
    --wp-admin-bar-offset: 0px;
    --header-height: 72px; /* Set a default height that includes previous padding */
    --top-bar-height: 36px;
}

.admin-bar {
    --wp-admin-bar-offset: 32px;
}

@media (max-width: 1024px) {
    /* Hide full social group (text + icons). Avoid orphan icons when space is tight. */
    .top-bar__social {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-bar__link-with-icon,
    .top-bar__left,
    .top-bar__lang-switcher {
        font-size: 0.7rem;
    }

    /* Hide full email (text + icon), not label-only — matches old top-bar__email { display: none; } */
    .top-bar__email {
        display: none;
    }
}

@media (max-width: 782px) {
    .admin-bar {
        --wp-admin-bar-offset: 46px;
    }

    .site-header.is-scrolled {
        --wp-admin-bar-offset: 0px; /* Mobile admin bar scrolls up */
    }

    .top-bar.is-scrolled {
        --wp-admin-bar-offset: 0px; /* Mobile admin bar scrolls up */
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    transition: height 0.15s ease;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}

.site-header.is-scrolled .header-inner {
    --header-height: 60px; /* Slightly smaller header height on scroll */
}

.site-branding a {
    font-weight: 700;
    color: var(--color-purple);
    text-decoration: none;
    display: block;
}

.site-branding img {
    height: 50px;
    width: auto;
    display: block;
    transition: height 0.15s ease, filter 0.3s ease;
    /* White mark on hero: works for WebP/PNG/SVG (not SVG-only) */
    filter: brightness(0) invert(1);
}

.site-header.is-scrolled .site-branding img {
    height: 40px;
    filter: none; /* Scrolled state: Original color */
}

.site-header:not(.is-scrolled):has(.mobile-nav-toggle.is-active) .site-branding img {
    filter: none; /* Menu open: Original color, no size change */
}

/* ==========================================================================
   Primary Navigation
   ========================================================================== */

.primary-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    font-weight: 500;
    color: #fff; /* Initial state: White */
    text-decoration: none;
}

.site-header.is-scrolled .nav-menu a {
    color: var(--color-charcoal); /* Scrolled state: Charcoal */
}

/* Mobile menu toggle — hidden on desktop */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff; /* Initial state: White */
    transition: color 0.2s ease;
}

.site-header.is-scrolled .mobile-nav-toggle {
    color: var(--color-charcoal); /* Scrolled state: Charcoal */
}

.mobile-nav-toggle__line {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Hamburger → X when active */
.mobile-nav-toggle.is-active .mobile-nav-toggle__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.is-active .mobile-nav-toggle__line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-nav-toggle.is-active .mobile-nav-toggle__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Full-screen overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: calc(var(--header-height) + var(--top-bar-height) + 1.75rem) 2rem 2rem;
    color: var(--color-charcoal);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    align-items: center;
    justify-content: center;
}

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

.mobile-nav__content {
    text-align: right;
    width: 100%;
}

.mobile-nav__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.mobile-nav__links li {
    width: 100%;
}

.mobile-nav__links a {
    display: block;
    padding: 0.55rem 0;
    font-size: 2rem;
    font-weight: 500;
    color: var(--color-charcoal);
    text-decoration: none;
    text-align: right;
    transition: color 0.2s ease;
    background-image: none;
    background-size: auto;
}

.mobile-nav__links a:hover,
.mobile-nav__links a:focus,
.mobile-nav__links a:focus-visible,
.mobile-nav__links .current-menu-item > a {
    color: var(--color-purple);
    background-image: none;
    background-size: auto;
}

/* Match global a:active scale without drifting: full-width right-aligned links need origin on the right */
.mobile-nav__links a:active {
    transform-origin: right center;
}

