/* Minimal custom styles for Home Page Hero Block */
/* Most styles are handled by Tailwind CSS */

/* Break out of container to make full-width */
.home-page-hero-block {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    box-sizing: border-box;
}

/* Ensure parent containers don't clip */
/* Removed overflow-x: visible to prevent horizontal scrollbar */

/* Override Elementor container max-width when block is inside */
.e-con-inner:has(.home-page-hero-block),
.elementor-container:has(.home-page-hero-block),
main:has(.home-page-hero-block) {
    max-width: none !important;
    overflow-x: visible !important;
}

/* Fallback for browsers without :has() support - target parent */
/* Styles are handled by block itself and :has() selector above */

/* Override any parent container constraints */
.home-page-hero-block * {
    max-width: none !important;
}

/* Hero viewport height - bottom of window slightly below logo showcase, slightly above testimonial video h2 */
.home-page-hero-block {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
}

.home-page-hero-block section:first-of-type {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Logo showcase height and pill styling */
.home-page-hero-block section:nth-of-type(2) {
    /* min-height: 80px;
    max-height: 100px; */
    height: auto;
    border-radius: 1.5rem !important;
}

/* Logo showcase - grid-based system (Sana Labs inspired) */
[data-logo-container] {
    display: grid !important;
    column-gap: 2rem;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    align-items: center;
}

/* Mobile: 3 columns */
@media (max-width: 767px) {
    [data-logo-container] {
        grid-template-columns: repeat(3, 1fr) !important;
        column-gap: 0.5rem !important;
    }
    .partner-logo:nth-child(n + 4) {
        display: none !important;
    }
    
    /* Hide icon on mobile */
    .logo-showcase-text > div:first-child {
        display: none !important;
    }
    
    /* Reduce padding on mobile */
    .home-page-hero-block section.bg-white {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Tablet: 5 columns (below 1280px) */
@media (min-width: 768px) and (max-width: 1279px) {
    [data-logo-container] {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    .partner-logo:nth-child(n + 6) {
        display: none !important;
    }
}

/* Desktop: 6 columns (1280px and above) */
@media (min-width: 1280px) {
    [data-logo-container] {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* Partner logo container - flex inside grid cell */
.partner-logo {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 30px;
    transition: opacity 1s ease;
    opacity: 1;
}

.partner-logo.hidden {
    opacity: 0;
}

.partner-logo img.logo-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Hide logo pool */
[data-logo-pool] {
    display: none !important;
}

/* Logo showcase section - ensure full width below 1024px */
@media (max-width: 1023px) {
    .home-page-hero-block section.bg-gray-200 [data-logo-container] {
        width: 100% !important;
    }
}

/* Override Bootstrap !important on mb-4 for logo showcase text */
.logo-showcase-text {
    margin-bottom: 1rem !important;
}

@media (min-width: 1024px) {
    .logo-showcase-text {
        margin-bottom: 0 !important;
    }
}

/* Testimonial video section - responsive margin-top (padding-top handled by Tailwind classes) */
.testimonial-video-section {
    margin-top: -120px;
}

/* Testimonial section h2 - match resources-headline responsiveness */
.testimonial-video-section__headline {
    font-size: 20px !important;
}

@media (min-width: 768px) {
    .testimonial-video-section__headline {
        font-size: 24px !important;
    }
}

@media (min-width: 1024px) {
    .testimonial-video-section__headline {
        font-size: 30px !important;
    }
}

@media (min-width: 1024px) {
    .testimonial-video-section {
        margin-top: -80px;
    }
}

@media (max-width: 575px) {
    .testimonial-video-section {
        margin-left: -10px;
        margin-right: -10px;
    }
}

/* Video container - ensure full height is visible on larger screens and stays centered */
@media (min-width: 1280px) {
    .testimonial-video-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .home-testimonial-video__player {
        max-width: 100%;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Ensure video maintains aspect ratio and doesn't get cut off vertically */
    .home-testimonial-video__player #home-hero-video {
        object-fit: contain;
    }
}

/* On very large screens, constrain width to ensure height fits in viewport */
@media (min-width: 1400px) {
    .home-testimonial-video__player {
        max-width: min(90vw, 1600px);
        margin-left: auto;
        margin-right: auto;
    }
}

/* Hero H1 and rotating text - 80px between 1024px and 1400px (reduced from 96px) */
@media (min-width: 1024px) and (max-width: 1399px) {
    .home-page-hero-block section:first-of-type h1,
    .home-page-hero-block section:first-of-type .rotating-text-item {
        font-size: 80px !important;
    }
}

/* Rotating text - prevent horizontal scrollbar and allow long words */
.home-hero-section__headline-rotating-wrapper {
    overflow: hidden !important;
    width: auto;
    min-width: 0;
    display: inline-block;
    height: 1.3em;
    line-height: 1.3em;
    vertical-align: bottom;
}

.home-hero-section__headline-rotating {
    overflow: hidden !important;
    width: 100%;
    position: relative;
    height: 100%;
}

.rotating-text-item {
    overflow: visible !important;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
    line-height: 1.3em;
    height: 1.3em;
}

/* Rotating text animation states (GSAP handles the actual animation) */
.rotating-text-item {
    will-change: transform, opacity;
}

/* Logo showcase animation states */
.home-logo-showcase__logo {
    will-change: transform, opacity;
}

/* Video gradient overlays - explicit CSS so they render in all browsers/incognito (no Tailwind dependency) */
.home-testimonial-video__player .video-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none;
}

/* Top/bottom: dark at edges (blend into background), transparent in center */
.home-testimonial-video__player .video-gradient-overlay--t {
    background-image: linear-gradient(to top,
        #000000 0%,
        rgba(0,0,0,0.85) 10%,
        rgba(0,0,0,0.45) 28%,
        transparent 48%,
        transparent 52%,
        rgba(0,0,0,0.45) 72%,
        rgba(0,0,0,0.85) 90%,
        #000000 100%);
}

/* Left/right: dark at edges, fade to transparent toward center */
.home-testimonial-video__player .video-gradient-overlay--l {
    background-image: linear-gradient(to left,
        #000000 0%,
        rgba(0,0,0,0.8) 12%,
        transparent 45%,
        transparent 100%);
}

.home-testimonial-video__player .video-gradient-overlay--r {
    background-image: linear-gradient(to right,
        #000000 0%,
        rgba(0,0,0,0.8) 12%,
        transparent 45%,
        transparent 100%);
}

/* Keep video layer below overlays so fades are visible everywhere */
.home-testimonial-video__player #home-hero-video {
    z-index: 0;
}

/* Video play button and controls */
#home-hero-video-play {
    transition: opacity 0.2s ease;
}

#home-hero-video-play:hover svg {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Show video controls on hover or when play button is clicked */
.home-testimonial-video__player:hover #home-hero-video,
.home-testimonial-video__player.controls-visible #home-hero-video {
    pointer-events: auto;
}

#home-hero-video.controls-visible {
    pointer-events: auto;
}

/* CTA buttons - remove underline */
.home-hero-cta,
.home-hero-section__cta,
.home-testimonial-video__cta {
    text-decoration: none !important;
}

.home-hero-cta:hover,
.home-hero-cta:focus,
.home-hero-cta:active {
    text-decoration: none !important;
}

/* Override Bootstrap !important rules for CTA buttons */
/* First CTA (bg-white) - remove !important from bg-white, change hover to bg-transparent */
.home-hero-cta.bg-white {
    background-color: #ffffff !important;
    border: 1px solid transparent !important;
}

.home-hero-cta.bg-white:hover {
    background-color: transparent !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}

/* Second CTA (hero) and video CTA (bg-transparent) - remove !important from bg-transparent and text-white */
.home-hero-cta.bg-transparent {
    background-color: transparent !important;
    color: #ffffff !important;
}

.home-hero-cta.bg-transparent:hover {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* Variant blocks - add spacing and labels */
.home-page-hero-variant {
    margin-top: 4rem;
    position: relative;
}

.hero-variant-label {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.hero-variant-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 700;
    min-width: 3rem;
    text-align: center;
}

.hero-variant-name {
    font-weight: 500;
    letter-spacing: 0.025em;
}

@media (max-width: 767px) {
    .hero-variant-label {
        top: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .hero-variant-number {
        min-width: auto;
    }
}

/* 3D transform support for book flip animation */
.home-page-hero-block [data-rotating-text] {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.rotating-text-item {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* Respect reduced motion for all animations */
@media (prefers-reduced-motion: reduce) {
    .rotating-text-item,
    .home-page-hero-variant * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
