/* ============================================================================
   HOMEPAGE POLISH — visual & responsive enhancements (no markup changes)
   Loaded after all other CSS to ensure proper cascade override.
   ========================================================================= */

/* ----------------------------------------------------------------------------
   1. FLUID TYPOGRAPHY — headings scale smoothly on all screens (no jump)
   ------------------------------------------------------------------------- */
.hero .hero-content h1,
.hero h1 {
    font-size: clamp(1.7rem, 5.5vw, 2.8rem) !important;
    line-height: 1.15 !important;
}

.hero .hero-tagline,
.hero .animated-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem) !important;
    letter-spacing: 0.5px;
}

/* Section H2 titles (many use inline font-size: 3rem or 2.8rem) */
section h2,
section h2[style*="font-size: 3rem"],
section h2[style*="font-size: 2.8rem"],
section h2[style*="font-size: 2.6rem"],
section h2[style*="font-size: 2.5rem"] {
    font-size: clamp(1.6rem, 4.5vw, 2.6rem) !important;
    line-height: 1.2 !important;
    word-wrap: break-word;
}

section h3,
section h3[style*="font-size: 1.8rem"],
section h3[style*="font-size: 1.7rem"] {
    font-size: clamp(1.15rem, 3vw, 1.5rem) !important;
    line-height: 1.3 !important;
}

/* Trust bar counter numbers */
.trust-bar-section .count-number {
    font-size: clamp(1.8rem, 6vw, 2.6rem) !important;
}
.trust-bar-section .count-number span {
    font-size: clamp(0.9rem, 3vw, 1.3rem) !important;
}

/* ----------------------------------------------------------------------------
   2. RESPONSIVE SECTION PADDING — avoid giant blocks on mobile
   ------------------------------------------------------------------------- */
section[style*="padding: 80px 0"],
section[style*="padding: 80px 20px"],
section[style*="padding: 70px 0"],
section[style*="padding: 60px 0"] {
    padding-top: clamp(40px, 7vw, 80px) !important;
    padding-bottom: clamp(40px, 7vw, 80px) !important;
}

/* ----------------------------------------------------------------------------
   3. CONTAINER PADDING — breathing room on small phones
   ------------------------------------------------------------------------- */
.container {
    padding-left: clamp(16px, 4vw, 20px);
    padding-right: clamp(16px, 4vw, 20px);
}

/* ----------------------------------------------------------------------------
   4. SMOOTH SCROLL & SCROLL PADDING for anchor links (#faq, #contact)
   ------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ----------------------------------------------------------------------------
   5. TRUST BAR — ameliorations subtiles
   ------------------------------------------------------------------------- */
.trust-bar-section .trust-card {
    position: relative;
    isolation: isolate;
}
.trust-bar-section .trust-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(245,179,1,0.35), rgba(255,255,255,0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}
.trust-bar-section .trust-card:hover::before {
    opacity: 1;
}

/* ----------------------------------------------------------------------------
   6. FAQ DETAILS — hover + open states polish
   ------------------------------------------------------------------------- */
#faq details {
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
#faq details:hover {
    box-shadow: 0 8px 30px rgba(44,85,48,0.12) !important;
    transform: translateY(-2px);
    border-left-color: #f5b301 !important;
}
#faq details[open] {
    border-left-color: #f5b301 !important;
    background: linear-gradient(to right, #fffef5 0%, #ffffff 15%) !important;
}
#faq summary::after {
    content: '+';
    position: absolute;
    right: 28px;
    top: 22px;
    font-size: 1.6rem;
    font-weight: 300;
    color: #6a8d73;
    transition: transform 0.3s ease;
}
#faq details[open] summary::after {
    content: '−';
    color: #f5b301;
}
/* Hide the chevron icon since we have + / - */
#faq summary i.fas.fa-chevron-down {
    display: none;
}
#faq summary {
    position: relative;
    padding-right: 56px !important;
}

/* ----------------------------------------------------------------------------
   7. BUTTON STANDARDIZATION — consistent CTAs
   ------------------------------------------------------------------------- */
a.btn,
a.animated-button,
a[href="/reservation"][style*="border-radius: 50px"] {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
a.btn:hover,
a.animated-button:hover,
a[href="/reservation"][style*="border-radius: 50px"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(44,85,48,0.25) !important;
}

/* ----------------------------------------------------------------------------
   8. SECTION SEPARATORS — subtle visual rhythm
   ------------------------------------------------------------------------- */
section + section {
    position: relative;
}

/* ----------------------------------------------------------------------------
   9. IMAGES — responsive & prevent layout shift
   ------------------------------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
}
/* Services card images keep aspect ratio */
.service-card img,
.service-image {
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* ----------------------------------------------------------------------------
   10. MOBILE — specific tweaks ≤768px
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Hero content compact */
    .hero .hero-content {
        padding: 0 16px !important;
    }
    .hero .hero-content p[style*="font-size: 1.2rem"] {
        font-size: 1rem !important;
        margin-bottom: 1.2rem !important;
    }
    .hero .hero-content .btn,
    .hero .hero-content .animated-button {
        padding: 12px 20px !important;
        font-size: 0.95rem !important;
        margin: 4px 4px !important;
    }

    /* Trust bar cards: smaller padding */
    .trust-bar-section .trust-card {
        padding: 22px 14px !important;
    }
    .trust-bar-section .trust-card > div:first-child {
        width: 42px !important;
        height: 42px !important;
        margin-bottom: 10px !important;
    }
    .trust-bar-section .trust-card i {
        font-size: 1.1rem !important;
    }

    /* Section intro badges: smaller */
    section [style*="border-radius: 50px"][style*="padding: 8px 20px"] {
        padding: 6px 14px !important;
    }
    section [style*="border-radius: 50px"][style*="padding: 8px 20px"] span {
        font-size: 0.75rem !important;
        letter-spacing: 0.5px !important;
    }

    /* Mission section: reduce founder card padding */
    #about [style*="padding: 50px 35px"] {
        padding: 35px 22px !important;
    }
    #about [style*="padding: 35px 28px"] {
        padding: 28px 20px !important;
    }

    /* FAQ: compact */
    #faq details summary {
        padding: 18px 52px 18px 22px !important;
        font-size: 1rem !important;
    }
    #faq details > div {
        padding: 0 22px 18px 22px !important;
        font-size: 0.95rem !important;
    }
    #faq summary::after {
        right: 22px;
        top: 18px;
    }

    /* Contact section compact */
    #contact .section-header h2 {
        font-size: 1.8rem !important;
    }

    /* Force single column on tight spaces */
    [style*="grid-template-columns: repeat(auto-fit, minmax(260px"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(200px"] {
        gap: 16px !important;
    }

    /* Testimonials: full-width cards */
    .testimonials .testimonial-slider {
        padding: 0 10px !important;
    }
}

/* Very small phones */
@media (max-width: 420px) {
    .trust-bar-section {
        padding: 40px 12px !important;
    }
    .trust-bar-section .count-number {
        font-size: 1.7rem !important;
    }
    .trust-bar-section [style*="display: grid"] {
        gap: 12px !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .trust-bar-section .trust-card:last-child {
        grid-column: 1 / -1;
    }

    /* Hero logo smaller */
    .hero .hero-content h1 {
        font-size: 1.5rem !important;
    }
}

/* ----------------------------------------------------------------------------
   11. SELECTION COLOR — branded text selection
   ------------------------------------------------------------------------- */
::selection {
    background: rgba(245, 179, 1, 0.3);
    color: #2c5530;
}

/* ----------------------------------------------------------------------------
   12. FOCUS STATES — accessibility (visible focus rings)
   ------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
    outline: 3px solid #f5b301;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ----------------------------------------------------------------------------
   13. DYNAMIC SCROLL ANIMATIONS — fade-up, fade-in, slide, zoom, stagger
   ------------------------------------------------------------------------- */
.anim-fade-up,
.anim-fade-in,
.anim-slide-left,
.anim-slide-right,
.anim-zoom-in {
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.anim-fade-up { transform: translateY(40px); }
.anim-fade-in { transform: none; }
.anim-slide-left { transform: translateX(-60px); }
.anim-slide-right { transform: translateX(60px); }
.anim-zoom-in { transform: scale(0.85); }

.anim-fade-up.visible,
.anim-fade-in.visible,
.anim-slide-left.visible,
.anim-slide-right.visible,
.anim-zoom-in.visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Stagger delays for children */
.anim-stagger > * {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.anim-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.anim-stagger.visible > *:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.anim-stagger.visible > *:nth-child(3) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.anim-stagger.visible > *:nth-child(4) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.anim-stagger.visible > *:nth-child(5) { transition-delay: 0.45s; opacity: 1; transform: translateY(0); }
.anim-stagger.visible > *:nth-child(n+6) { transition-delay: 0.55s; opacity: 1; transform: translateY(0); }

/* Subtle section reveal for H2 headers */
section > .container > div:has(> h2),
section > div.container > div:first-child {
    animation: none;
}

/* Smooth fade-in for iframes (video) once loaded */
iframe {
    transition: opacity 0.5s ease;
}

/* Animated gradient border on hover for FAQ + service cards */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Pulse on play button */
@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(106, 141, 115, 0.6); }
    70% { box-shadow: 0 0 0 25px rgba(106, 141, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(106, 141, 115, 0); }
}
.play-button-animated {
    animation: pulseRing 2s infinite !important;
}

/* Floating arrow animation for "scroll" hints */
@keyframes floatArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Reduced motion override — respect accessibility */
@media (prefers-reduced-motion: reduce) {
    .anim-fade-up, .anim-fade-in, .anim-slide-left, .anim-slide-right, .anim-zoom-in,
    .anim-stagger > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .play-button-animated {
        animation: none !important;
    }
}

/* ----------------------------------------------------------------------------
   14. HERO ENHANCEMENTS — parallax feel + gradient animation
   ------------------------------------------------------------------------- */
.hero .hero-content {
    animation: heroIntro 1s ease-out both;
}
@keyframes heroIntro {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Subtle parallax on scroll — background moves slower */
.hero {
    background-attachment: fixed;
}
@media (max-width: 768px) {
    .hero { background-attachment: scroll; } /* mobile = no parallax (perf) */
}

/* ----------------------------------------------------------------------------
   15. PRINT STYLES — clean paper output
   ------------------------------------------------------------------------- */
@media print {
    .hero video,
    .hero-image-container,
    #chatbot-toggle,
    .chatbot-container,
    section[aria-label="Chiffres cles ETERNELIS"],
    #faq,
    .reveal-on-scroll {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
    }
}
