/**
 * Inner page layout spacing + page hero.
 * Loaded site-wide from layout (after page CSS) so navbar-to-content gap is consistent.
 */

:root {
    /* Must match home.css fixed navbar (--navbar-height) + breathing room */
    --navbar-height: 76px;
    --page-below-navbar-gap: 24px;
    --page-content-padding-top: calc(var(--navbar-height) + var(--page-below-navbar-gap));
}

@media (max-width: 1200px) {
    :root {
        --navbar-height: 68px;
    }
}

@media (max-width: 1024px) {
    :root {
        --navbar-height: 64px;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
        --page-below-navbar-gap: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --navbar-height: 56px;
        --page-below-navbar-gap: 16px;
    }
}

html {
    scroll-padding-top: var(--navbar-height);
}

.fh-page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 50px auto 26px;
    width: 90%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 28px 64px -12px rgba(15, 23, 42, 0.35),
        0 0 0 1px rgba(51, 122, 183, 0.15);
    background: linear-gradient(155deg, #030910 0%, #0c2138 42%, #143d6b 78%, #07121f 100%);
}

/* Hero with custom background image */
.fh-page-hero--has-image {
    background: var(--hero-bg-image, linear-gradient(155deg, #030910 0%, #0c2138 42%, #143d6b 78%, #07121f 100%));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.fh-page-hero--has-image::before {
    /* Dark overlay for better text readability over images */
    background: linear-gradient(
        105deg,
        rgba(3, 9, 16, 0.85) 0%,
        rgba(12, 33, 56, 0.75) 22%,
        rgba(20, 61, 107, 0.65) 45%,
        rgba(12, 33, 56, 0.75) 68%,
        rgba(7, 18, 31, 0.85) 100%
    );
    background-size: 280% 280%;
}

/* Slow shifting color band — smooth horizontal drift */
.fh-page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: linear-gradient(
        105deg,
        rgb(8 32 62 / 0.15) 0%,
        rgb(51 122 183 / 0.5) 22%,
        rgb(25 95 160 / 0.35) 45%,
        rgb(51 122 183 / 0.45) 68%,
        rgb(10 40 78 / 0.2) 100%
    );
    background-size: 280% 280%;
    background-position: 0% 50%;
    animation: fh-page-hero-gradient-sweep 22s ease-in-out infinite;
    pointer-events: none;
}

/* Soft “light pool” that drifts for depth */
.fh-page-hero::after {
    content: "";
    position: absolute;
    width: min(85vw, 560px);
    height: min(85vw, 560px);
    top: 42%;
    left: 50%;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle closest-side,
        rgb(80 160 230 / 0.28) 0%,
        rgb(51 122 183 / 0.12) 42%,
        transparent 72%
    );
    transform: translate(-50%, -50%);
    animation: fh-page-hero-glow-drift 18s ease-in-out infinite;
    pointer-events: none;
}

@keyframes fh-page-hero-gradient-sweep {
    0%,
    100% {
        background-position: 0% 45%;
    }

    33% {
        background-position: 100% 55%;
    }

    66% {
        background-position: 85% 35%;
    }
}

@keyframes fh-page-hero-glow-drift {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.95;
    }

    33% {
        transform: translate(-44%, -56%) scale(1.08);
        opacity: 1;
    }

    66% {
        transform: translate(-58%, -44%) scale(0.92);
        opacity: 0.88;
    }
}

.fh-page-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    /* Subtle mesh + vignette (modern editorial) */
    background:
        repeating-linear-gradient(
            105deg,
            transparent 0,
            transparent 46px,
            rgb(255 255 255 / 0.045) 46px,
            rgb(255 255 255 / 0.045) 47px
        ),
        repeating-linear-gradient(
            -8deg,
            transparent 0,
            transparent 46px,
            rgb(255 255 255 / 0.03) 46px,
            rgb(255 255 255 / 0.03) 47px
        ),
        radial-gradient(ellipse 100% 85% at 50% 0%, rgb(51 122 183 / 0.18) 0%, transparent 52%),
        radial-gradient(ellipse 95% 70% at 50% 115%, rgb(0 0 0 / 0.45) 0%, transparent 50%),
        linear-gradient(
            180deg,
            rgb(4 12 28 / 0.2) 0%,
            rgb(4 12 28 / 0.02) 48%,
            rgb(2 8 18 / 0.38) 100%
        );
    pointer-events: none;
}

.fh-page-hero__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: min(1180px, 100%);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 52px) clamp(20px, 4vw, 40px);
    text-align: center;
}

/* Title stack */
.fh-page-hero__title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    max-width: min(100%, 46rem);
}

.fh-page-hero__kicker {
    margin: 0;
    max-width: 100%;
    text-align: center;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgb(180 210 245 / 0.95);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* Title: modern display + accent rule */
.fh-page-hero__title {
    margin: 0;
    max-width: 100%;
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.045em;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    text-wrap: balance;
    color: #fbfdff;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.12),
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 0 80px rgba(80, 160, 230, 0.15);
}

.fh-page-hero__title::after {
    content: "";
    display: block;
    width: min(5rem, 32vw);
    height: 4px;
    margin: 1.15rem auto 0;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgb(126 186 240 / 0.3) 18%,
        #5eb0f8 50%,
        rgb(51 122 183 / 0.95) 82%,
        transparent 100%
    );
    box-shadow: 0 0 24px rgba(94, 176, 248, 0.35);
}

/* When no kicker, keep accent tight under title */
.fh-page-hero__title-block:not(:has(.fh-page-hero__kicker)) .fh-page-hero__title::after {
    margin-top: 1rem;
}

/* Breadcrumb: center stack (overrides home .page-breadcrumb--hero align-self + align-start) */
.fh-page-hero .page-breadcrumb.page-breadcrumb--hero {
    align-self: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 0.35rem;
    column-gap: 0.35rem;
    margin: 0;
    padding: 11px 22px;
    border-radius: 12px;
    background: rgb(8 14 28 / 0.5);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.fh-page-hero .page-breadcrumb--hero .page-breadcrumb__link {
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.2s ease;
}

.fh-page-hero .page-breadcrumb--hero .page-breadcrumb__link:hover {
    color: rgba(255, 255, 255, 0.95);
}

.fh-page-hero .page-breadcrumb--hero .page-breadcrumb__current {
    color: #ffffff;
}

/* Template detail slot (type / category line) */
.fh-page-hero .template-detail__meta {
    margin: 0.35rem 0 0;
    max-width: 42rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    text-wrap: balance;
}

@media (prefers-reduced-motion: no-preference) {
    .fh-page-hero__inner {
        animation: fh-page-hero-fade 0.55s ease-out both;
    }
}

@keyframes fh-page-hero-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 720px) {
    .fh-page-hero {
        min-height: 420px;
    }

    .fh-page-hero__inner {
        gap: 1.65rem;
    }

    .fh-page-hero__title {
        font-size: clamp(2.25rem, 3.8vw, 3.65rem);
    }
}

@media (max-width: 1024px) {
    .fh-page-hero {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .fh-page-hero {
        min-height: 370px;
    }

    .fh-page-hero__inner {
        padding: 28px 18px;
        gap: 1.1rem;
    }

    .fh-page-hero__title {
        max-width: 100%;
    }

    .fh-page-hero .page-breadcrumb.page-breadcrumb--hero {
        padding: 8px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .fh-page-hero {
        min-height: 260px;
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fh-page-hero::before,
    .fh-page-hero::after {
        animation: none;
    }

    .fh-page-hero__inner {
        animation: none;
    }
}
