/**
 * Floating Header — style.css v1.0.1
 */

:root {
    --fh-float-y: 20px;
}

.fh-wrapper {
    position: relative;
    min-height: 400px;
    overflow: visible;
    width: 100%;
}

.fh-logo-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/**
 * --fh-x / --fh-y มาจาก PHP (shortcode.php)
 * translate(-50%,-50%) รวมอยู่ใน keyframes เพื่อไม่ให้ animation override centering
 */
.fh-logo {
    position: absolute;
    left: var(--fh-x, 50%);
    top: var(--fh-y, 50%);
}

.fh-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
}

@keyframes fh-float-up {
    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(calc(-1 * var(--fh-float-y)));
    }
}

@keyframes fh-float-down {
    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(var(--fh-float-y));
    }
}

.fh-float-up {
    animation: fh-float-up var(--fh-duration, 3s) ease-in-out var(--fh-delay, 0s) infinite;
}

.fh-float-down {
    animation: fh-float-down var(--fh-duration, 3s) ease-in-out var(--fh-delay, 0s) infinite;
}

@media (prefers-reduced-motion: reduce) {
    .fh-float-up,
    .fh-float-down {
        animation: none;
        transform: translate(-50%, -50%);
    }
}

.fh-title-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    width: 80%;
    pointer-events: none;
}

.fh-title {
    margin: 0 0 0.4em;
    line-height: 1.2;
}

.fh-subtitle {
    line-height: 1.6;
}

.fh-tier-3 .fh-logo:nth-child(even) {
    opacity: 0.75;
}

.fh-tier-4 .fh-logo:nth-child(n + 7) {
    opacity: 0.5;
}

@media (max-width: 768px) {
    :root {
        --fh-float-y: 12px;
    }

    .fh-wrapper {
        min-height: 280px;
    }

    .fh-logo img {
        max-width: 80px;
        max-height: 56px;
    }

    .fh-title-layer {
        width: 90%;
    }
}

@media (max-width: 480px) {
    :root {
        --fh-float-y: 8px;
    }

    .fh-wrapper {
        min-height: 220px;
    }

    .fh-logo img {
        max-width: 56px;
        max-height: 40px;
    }

    .fh-title-layer {
        width: 95%;
    }
}
