/* ===========================================
 * xFact Hero Block
 * =========================================== */

.xfact-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 70vh;
    overflow: hidden;
    background-color: var(--wp--preset--color--primary-dark);
}

@media (min-width: 640px) {
    .xfact-hero {
        min-height: 90vh;
    }
}

/* Background slides */
.xfact-hero__bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: opacity 1.5s ease-in-out;
    pointer-events: none;
}

/* Video overlay */
.xfact-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    opacity: 0.38;
    pointer-events: none;
}

/* Color overlays — light mode (default) */
.xfact-hero__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--wp--preset--color--primary-dark) 70%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--primary) 40%, transparent) 100%
    );
    transition: background 0.5s ease;
}

.xfact-hero__text-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--wp--preset--color--primary-dark) 85%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--primary-dark) 40%, transparent) 45%,
        transparent 100%
    );
}

/* Color overlays — dark mode */
html[data-theme="dark"] .xfact-hero__overlay {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--wp--preset--color--surface) 70%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--surface) 40%, transparent) 100%
    );
}

html[data-theme="dark"] .xfact-hero__text-gradient {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--wp--preset--color--surface) 85%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--surface) 40%, transparent) 45%,
        transparent 75%
    );
}

/* Content */
.xfact-hero__content {
    position: relative;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 640px) {
    .xfact-hero__content {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

@media (min-width: 768px) {
    .xfact-hero__content {
        padding-top: 8rem;
        padding-bottom: 8rem;
    }
}

.xfact-hero__layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.xfact-hero__text {
    max-width: 42rem;
}

.xfact-hero__title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--wp--preset--color--white);
    line-height: 1.1;
    margin: 0;
}

@media (min-width: 640px) {
    .xfact-hero__title {
        font-size: 2.25rem;
    }
}

@media (min-width: 768px) {
    .xfact-hero__title {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .xfact-hero__title {
        font-size: 3.75rem;
    }
}

.xfact-hero__accent {
    color: var(--wp--preset--color--primary);
}

.xfact-hero__subtitle {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.625;
    color: color-mix(in srgb, var(--wp--preset--color--white), transparent 25%);
}

@media (min-width: 640px) {
    .xfact-hero__subtitle {
        margin-top: 1.5rem;
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    .xfact-hero__subtitle {
        font-size: 1.25rem;
    }
}

.xfact-hero__cta {
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .xfact-hero__cta {
        margin-top: 2.5rem;
    }
}

/* Floating icon */
.xfact-hero__icon {
    display: none;
}

@media (min-width: 1024px) {
    .xfact-hero__icon {
        display: block;
    }

    .xfact-hero__icon svg,
    .xfact-hero__icon img {
        width: 14rem;
        height: 14rem;
    }

    .xfact-hero__icon svg {
        color: color-mix(in srgb, var(--wp--preset--color--white), transparent 90%);
    }

    .xfact-hero__icon img {
        opacity: 0.1;
        filter: brightness(0) invert(1);
    }
}

@media (min-width: 1280px) {
    .xfact-hero__icon svg,
    .xfact-hero__icon img {
        width: 18rem;
        height: 18rem;
    }
}

/* Scroll indicator */
.xfact-hero__scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: color-mix(in srgb, var(--wp--preset--color--white), transparent 60%);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

/* ── Floating Icon Animation ── */

@keyframes xfact-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* ── Ken Burns ── */

@keyframes xfact-ken-burns {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.08);
    }
}

/* ── Motion preferences ── */

@media (prefers-reduced-motion: no-preference) {
    .xfact-icon-float {
        animation: xfact-float 4s ease-in-out infinite;
        will-change: transform;
    }

    .xfact-ken-burns {
        animation: xfact-ken-burns 20s ease-out forwards;
        will-change: transform;
    }
}

/* ===========================================
 * Inner Page Hero Variant (.xfact-page-hero)
 * =========================================== */

.xfact-page-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--xfact-dark-section, #09172f);
    padding-top: 10rem;
    padding-bottom: var(--xfact-spacing-section);
    min-height: 30rem;
}

html[data-theme="dark"] .xfact-page-hero {
    background-color: var(--wp--preset--color--surface);
}

@media (min-width: 768px) {
    .xfact-page-hero {
        min-height: 34rem;
    }
}
@media (min-width: 1024px) {
    .xfact-page-hero {
        min-height: 38rem;
    }
}

.xfact-page-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    pointer-events: none;
}

.xfact-page-hero__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--wp--preset--color--primary-dark) 70%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--primary) 40%, transparent) 100%
    );
    transition: background 0.5s ease;
}

.xfact-page-hero__text-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--wp--preset--color--primary-dark) 85%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--primary-dark) 40%, transparent) 45%,
        transparent 75%
    );
}

/* Dark mode overlays */
html[data-theme="dark"] .xfact-page-hero__overlay {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--wp--preset--color--surface) 70%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--surface) 40%, transparent) 100%
    );
}

html[data-theme="dark"] .xfact-page-hero__text-gradient {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--wp--preset--color--surface) 85%, transparent) 0%,
        color-mix(in srgb, var(--wp--preset--color--surface) 40%, transparent) 45%,
        transparent 75%
    );
}

.xfact-page-hero__content {
    position: relative;
}

.xfact-page-hero__text {
    max-width: 48rem;
}

.xfact-page-hero__heading {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #ffffff;
    line-height: 1.1;
    margin: 0;
}

/* When heading follows a section label, add spacing */
.xfact-section-label + .xfact-page-hero__heading {
    margin-top: 1rem;
}

/* Section label inside dark hero */
.xfact-page-hero .xfact-section-label {
    color: var(--wp--preset--color--primary);
}

@media (min-width: 768px) {
    .xfact-page-hero__heading {
        font-size: 3rem;
    }
}
@media (min-width: 1024px) {
    .xfact-page-hero__heading {
        font-size: 3.75rem;
    }
}

.xfact-page-hero__subtitle {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    line-height: 1.625;
    color: rgba(255, 255, 255, 0.75);
}

@media (min-width: 768px) {
    .xfact-page-hero__subtitle {
        font-size: 1.25rem;
    }
}

.xfact-page-hero__body {
    margin-top: 1.5rem;
    max-width: 48rem;
    font-size: 1rem;
    line-height: 1.625;
    color: rgba(255, 255, 255, 0.75);
}

@media (min-width: 768px) {
    .xfact-page-hero__body {
        font-size: 1.125rem;
    }
}

/* Block-scoped Fade-in Pattern */

/* Breadcrumb Styling */
.xfact-breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.xfact-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.xfact-breadcrumb a {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.xfact-breadcrumb a:hover {
    color: var(--wp--preset--color--white);
}

.xfact-breadcrumb-separator {
    opacity: 0.6;
}

.xfact-breadcrumb li[aria-current="page"] {
    color: #ffffff;
}

.xfact-hero-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px !important;
    border: 1px solid rgba(92, 138, 230, 0.4);
    background-color: rgba(92, 138, 230, 0.1);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--wp--preset--color--primary);
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.xfact-dark-section .xfact-hero-badge,
html[data-theme="dark"] .xfact-hero-badge {
    background: var(--xfact-glass-bg);
    backdrop-filter: var(--xfact-glass-blur);
    -webkit-backdrop-filter: var(--xfact-glass-blur);
    border: 1px solid var(--xfact-glass-border);
    color: #ffffff;
}

/* Ensure proper spacing when following breadcrumb */
.xfact-breadcrumb + .xfact-hero-badge {
    margin-top: -0.25rem;
}
