/**
 * @file
 * PGF Hero Component Styling
 */

.pgf-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--color-white);

    /* Fallback achtergrondkleur als er geen media is gepost */
    background-color: var(--color-bg-main);
}

/* --- 1. Media & Overlay --- */
.pgf-hero__background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Verberg ongewenste Drupal veldlabels in de achtergrond */
.pgf-hero__background .field__label {
    display: none;
}

/* Veranker foto/video/picture direct aan de achtergrond, ongeacht tussenliggende divs */
.pgf-hero__background picture,
.pgf-hero__background img,
.pgf-hero__background picture img,
.pgf-hero__background iframe,
.pgf-hero__background video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;

    /* Hardware acceleratie tegen subpixel-ruis */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;

    /* Subtiele slow-zoom bij het laden */
    animation: heroImageZoom 12s ease-out forwards;
}

/* Egale transparante overlay op basis van diepbruin met verloop-optie */
.pgf-hero__background::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
            180deg,
            rgba(68, 33, 0, 0.35) 0%,
            rgba(68, 33, 0, 0.65) 100%
    );
    transition: background var(--transition-speed) ease;
}

/* Koppeling met de overlay-utility intensiteiten uit PgfLayoutBehavior */
.pgf-overlay--0  .pgf-hero__background::after { display: none; }
.pgf-overlay--25 .pgf-hero__background::after { opacity: 0.4; }
.pgf-overlay--50 .pgf-hero__background::after { opacity: 0.7; }
.pgf-overlay--75 .pgf-hero__background::after { opacity: 0.9; }

/* --- 2. Content & Typografie --- */
.pgf-hero__content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding-block: var(--spacing-xl);

    /* Entree-animatie voor de tekstinhoud */
    animation: heroContentFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pgf-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, calc(1rem * var(--phi) * var(--phi) * var(--phi))); /* ~4.24rem */
    line-height: 1.1;
    color: var(--color-accent);
    margin-top: 0;
    margin-bottom: var(--spacing-m);

    /* Subtiele tekstschaduw voor gegarandeerde leesbaarheid over drukke foto's */
    text-shadow: 0 2px 10px rgba(68, 33, 0, 0.5);
}

.pgf-hero__intro {
    font-family: var(--font-quote); /* Cursief Libre Baskerville */
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, var(--spacing-l));
    line-height: var(--phi);
    color: var(--color-white);
    margin-bottom: var(--spacing-xl);
    max-width: var(--container-small);
    margin-inline: auto;
    text-shadow: 0 2px 8px rgba(68, 33, 0, 0.5);
}

.pgf-hero__actions {
    margin-top: var(--spacing-l);
}

/* Knop gedrag op mobiel vs desktop */
.pgf-hero__actions a {
    box-shadow: 0 4px 14px rgba(68, 33, 0, 0.3);
}

@media (max-width: 575px) {
    .pgf-hero__actions a {
        width: 100%; /* Full-width knop op kleine mobiele schermen */
    }
}

/* --- 3. Scroll Indicator --- */
.pgf-hero__scroll {
    display: none; /* Standaard verborgen */
    position: absolute;
    bottom: var(--spacing-l);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
}

/* Alleen tonen bij full-height heroes */
.pgf-min-h--100vh .pgf-hero__scroll,
.pgf-min-h--75vh .pgf-hero__scroll {
    display: block;
}

.pgf-hero__scroll-arrow {
    display: block;
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--color-white);
    border-bottom: 2px solid var(--color-white);
    transform: rotate(45deg);
    animation: heroScrollBounce 2s infinite;
    filter: drop-shadow(0 2px 4px rgba(68, 33, 0, 0.5));
}

/* --- 4. Animatie Keyframes & Toegankelijkheid --- */
@keyframes heroImageZoom {
    from { transform: scale(1.03); }
    to   { transform: scale(1.08); }
}

@keyframes heroContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroScrollBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
    40% { transform: translateY(-8px) rotate(45deg); }
    60% { transform: translateY(-4px) rotate(45deg); }
}

/* Respecteer bewegingsvoorkeuren van gebruikers (Accessibility) */
@media (prefers-reduced-motion: reduce) {
    .pgf-hero__background img,
    .pgf-hero__content,
    .pgf-hero__scroll-arrow {
        animation: none !important;
    }
}