/**
 * Helikopterpiloten.se - Global Animations
 * Loaded on ALL pages. Handles fixed header, scroll reveal,
 * interactive hover effects, and reduced-motion preferences.
 */

/* ==========================================================================
   Fixed Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header--scrolled {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Space for fixed header on all pages */
body {
    padding-top: 80px;
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */

[data-animate] {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--animate-delay, 0ms);
}

[data-animate="fade-up"] {
    transform: translateY(30px);
}

[data-animate="fade-left"] {
    transform: translateX(-30px);
}

[data-animate="fade-right"] {
    transform: translateX(30px);
}

[data-animate="scale-up"] {
    transform: scale(0.9);
}

[data-animate="fade-in"] {
    transform: none;
}

[data-animate].is-visible {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Global Link & Button Transitions
   ========================================================================== */

a {
    transition: color 0.2s ease;
}

.pillar-card,
.featured-card,
.article-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pillar-card:hover,
.featured-card:hover,
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .hero-helicopter,
    .cloud-layer,
    .stat-number,
    .scroll-indicator {
        animation: none !important;
        transition: none !important;
    }

    .pillar-card,
    .featured-card,
    .article-card {
        transition: none !important;
    }

    .site-header {
        transition: none !important;
    }
}

/* Footer link touch targets — minimum 24×24 px per WCAG 2.5.5 */
.footer-links li a {
    display: inline-block;
    padding: 4px 0;
}

/* Gutenberg query-loop excerpt "Läs mer" link — ensure WCAG AA contrast on white */
.wp-block-post-excerpt__more-link {
    color: #2C5F8A;
}

/* ==========================================================================
   Contact Form 7 — theme-matched styles
   ========================================================================== */

.wpcf7 {
    margin-top: 1.5rem;
}

.wpcf7 p {
    margin-bottom: 1.25rem;
}

.wpcf7 label,
.wpcf7 p > br + * {
    display: block;
    margin-top: 0.35rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #CBD5E1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    color: #1B3A5C;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
    outline: none;
    border-color: #2C5F8A;
    box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.15);
}

.wpcf7 textarea {
    resize: vertical;
    min-height: 160px;
}

.wpcf7 input[type="submit"] {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #2C5F8A;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus {
    background: #1B3A5C;
    transform: translateY(-1px);
    outline: none;
}

.wpcf7 input[type="submit"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.4);
}

/* Validation errors */
.wpcf7 .wpcf7-not-valid {
    border-color: #C0392B !important;
}

.wpcf7 .wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.875rem;
    color: #C0392B;
}

/* Response messages */
.wpcf7 .wpcf7-response-output {
    margin-top: 1.25rem;
    padding: 0.875rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    border: none;
}

.wpcf7 .wpcf7-mail-sent-ok {
    background: #EAF4EC;
    color: #1A6B2F;
}

.wpcf7 .wpcf7-mail-sent-ng,
.wpcf7 .wpcf7-aborted,
.wpcf7 .wpcf7-spam-blocked,
.wpcf7 .wpcf7-validation-errors,
.wpcf7 .wpcf7-acceptance-missing {
    background: #FDECEA;
    color: #A93226;
}

/* Spinner */
.wpcf7 .wpcf7-spinner {
    margin-left: 0.75rem;
    vertical-align: middle;
}
