@import url('https://fonts.googleapis.com/css2?family=Anta:wght@400&family=Raleway:wght@500&display=swap');

.ccm-block-hero-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Full-width breakout from container */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    /* Bleed upward to the very top of the viewport (for transparent navbars) */
    /* Adjust --lab-navbar-height in your theme to match your navbar */
    margin-top: calc(-1 * var(--lab-navbar-height, 0px));
}

.ccm-block-hero-image-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.ccm-block-hero-image-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.ccm-block-hero-image-section-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: rgba(8, 23, 40, 0.65);
    z-index: 2;
}

div.ccm-block-hero-image div.ccm-block-hero-image-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 3;
    text-align: left;
    color: white;
    /* Offset content below transparent navbar while keeping background flush */
    padding: calc(var(--lab-navbar-height, 0px) + 3rem) 4rem 3rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Constrain inner content and center it while keeping text left-aligned */
.ccm-block-hero-image .ccm-block-hero-image-text > * {
    max-width: 48rem; /* ~768px; adjust as needed */
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    div.ccm-block-hero-image div.ccm-block-hero-image-text {
        padding: calc(var(--lab-navbar-height, 0px) + 1.5rem) 2rem 1.5rem 2rem;
    }
    
    div.ccm-block-hero-image.has-section-divider div.ccm-block-hero-image-text {
        padding: calc(var(--lab-navbar-height, 0px) + 2rem) 2rem 2rem 2rem;
    }
}

@media (max-width: 576px) {
    div.ccm-block-hero-image div.ccm-block-hero-image-text {
        padding: calc(var(--lab-navbar-height, 0px) + 1.5rem) 1.5rem 1.5rem 1.5rem;
        width: 70%;
    }
    
    div.ccm-block-hero-image.has-section-divider div.ccm-block-hero-image-text {
        padding: calc(var(--lab-navbar-height, 0px) + 1.5rem) 1.5rem 1.5rem 1.5rem;
        width: 70%;
    }
    
    /* Expand section divider width on very small screens for better text fit */
    div.ccm-block-hero-image div.ccm-block-hero-image-section-divider {
        width: 70%;
    }
}

/* Ensure text is readable with proper contrast */
div.ccm-block-hero-image h1,
div.ccm-block-hero-image h2,
div.ccm-block-hero-image h3,
div.ccm-block-hero-image h4,
div.ccm-block-hero-image h5,
div.ccm-block-hero-image h6 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    font-family: 'Anta', sans-serif;
    font-weight: 400;
    /* Responsive scaling: comfortable on mobile, bold on desktop */
    font-size: clamp(28px, 6vw, 72px);
    line-height: 120%;
}

div.ccm-block-hero-image p {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 500;
    /* Scale paragraph text slightly with viewport */
    font-size: clamp(16px, 2.2vw, 20px);
    line-height: 150%;
}

/* Button styling adjustments for hero context */
div.ccm-block-hero-image .btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: none;
}

div.ccm-block-hero-image .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Removed local font overrides and typography sizing to revert behavior */

/* ------------------------------
   Staggered Fade-Up Animations
   ------------------------------ */
@keyframes labFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Title words animate one-by-one */
.ccm-block-hero-image .lab-hero-title-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    animation-name: labFadeUp;
    animation-timing-function: ease;
    animation-fill-mode: both;
}

/* Body and button animate after title */
.ccm-block-hero-image .lab-fade-up {
    opacity: 0;
    transform: translateY(10px);
    animation: labFadeUp 0.5s ease both;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .ccm-block-hero-image .lab-hero-title-word,
    .ccm-block-hero-image .lab-fade-up {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
