/* =========================================
   VGOTWEB GSAP ANIMATIONS 2.0
   ========================================= */

/* Avoid accidental horizontal overflow (clip, not hidden, so pinning works). */
html {
    overflow-x: clip;
}

/* -----------------------------------------
   Pre-hide animated elements.
   "vgw-js" is added in <head> before first paint, and removed again if the
   animation script fails, so content is never stuck invisible.
   ----------------------------------------- */
.vgw-js .vgw-scroll-reveal,
.vgw-js .vgw-text-reveal,
.vgw-js .vgw-grid-item,
.vgw-js .vgw-hero-logo,
.vgw-js .vgw-hero-title,
.vgw-js .vgw-hero-text,
.vgw-js .vgw-hero-image {
    opacity: 0;
    visibility: hidden;
}

/* -----------------------------------------
   Images and grid items
   ----------------------------------------- */
.vgw-grid-item img,
.vgw-hero-image img {
    display: block;
    max-width: 100%;
}

/* Gentle zoom on hover for image blocks (clipped inside the figure). */
.vgw-grid-item.wp-block-image {
    overflow: hidden;
}

.vgw-grid-item.wp-block-image img {
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.vgw-grid-item.wp-block-image:hover img {
    transform: scale(1.05);
}

/* Text mask lines (created by SplitText). */
.vgw-text-reveal .vgw-line,
.vgw-hero-title .vgw-line {
    will-change: transform;
}

/* -----------------------------------------
   Buttons
   The movement is done by GSAP (magnetic lift). CSS handles shadow only,
   plus a plain hover lift when JavaScript animations are not running.
   ----------------------------------------- */
.vgw-button,
.vgw-button a,
.vgw-button button,
a.vgw-button,
button.vgw-button {
    transition:
        box-shadow 0.45s ease,
        background-color 0.45s ease,
        color 0.45s ease;
}

.vgw-button:hover,
.vgw-button a:hover,
.vgw-button button:hover,
a.vgw-button:hover,
button.vgw-button:hover {
    box-shadow: 0 14px 28px -10px rgba(0, 0, 0, 0.28);
}

html:not(.vgw-js) .vgw-button:hover,
html:not(.vgw-js) .vgw-button a:hover,
html:not(.vgw-js) a.vgw-button:hover,
html:not(.vgw-js) button.vgw-button:hover {
    transform: translateY(-3px);
}

/* -----------------------------------------
   Navigation: sliding indicator
   ----------------------------------------- */
.vgw-menu-indicator {
    position: relative;
}

.vgw-menu-indicator .wp-block-navigation-item__content {
    position: relative;
}

.vgw-menu-indicator__bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 2px;
    width: 0;
    background: currentColor;
    pointer-events: none;
    opacity: 0;
}

/* Fallback underline when the sliding bar is not running. */
html:not(.vgw-js) .vgw-menu-indicator .wp-block-navigation-item__content::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s ease;
}

html:not(.vgw-js) .vgw-menu-indicator .wp-block-navigation-item__content:hover::after,
html:not(.vgw-js) .vgw-menu-indicator .current-menu-item > .wp-block-navigation-item__content::after {
    transform: scaleX(1);
}

/* -----------------------------------------
   Pinned, overlapping panels
   Parent: .vgw-pin-section
   Children: .vgw-pin-panel (each one needs a background colour)

   NOTE: once pinned, GSAP wraps each panel in a ".pin-spacer" element, so
   these rules must NOT rely on a direct-child (>) selector for the panel.
   ----------------------------------------- */
.vgw-pin-section {
    position: relative;
    width: 100%;
    gap: 0;
}

/* Remove WordPress block-gap margins that show up as white lines between
   panels (applies to the panel and to GSAP's pin-spacer wrapper). */
.vgw-pin-section > .vgw-pin-panel,
.vgw-pin-section > .pin-spacer {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    max-width: none !important;
}
/* Tabs: hidden until the load animation starts */
.vgw-js .vgw-tab,
.vgw-js .vgw-tabs a,
.vgw-js .vgw-tabs button {
    visibility: hidden;
}

/* Full-screen menu: our animation replaces WordPress's built-in fade */
.vgw-js .wp-block-navigation__responsive-container.is-menu-open {
    animation: none;
}

/* Every panel fills at least one screen, otherwise the panel underneath
   shows through below a short panel. */
.vgw-pin-section .vgw-pin-panel {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    box-sizing: border-box;
    /* No background here on purpose: the panel uses the colour you set in
       the block editor. If a panel has none, the script gives it the page
       colour so it still covers the panel underneath. */
}

.vgw-pin-section .vgw-pin-panel * {
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .vgw-pin-section .vgw-pin-panel {
        min-height: auto;
    }
}

/* -----------------------------------------
   Reduced motion
   ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .vgw-button,
    .vgw-button a,
    a.vgw-button,
    button.vgw-button,
    .vgw-grid-item.wp-block-image img,
    .vgw-menu-indicator .wp-block-navigation-item__content::after {
        transition: none !important;
    }
}
