/* Garde-fous responsive communs à l'ensemble du site */
html,
body {
    max-width: 100%;
}

body {
    overflow-x: clip;
}

body.nav-open {
    overflow: hidden;
    overscroll-behavior: none;
}

img,
video,
svg,
canvas {
    max-width: 100%;
}

button,
input,
select,
textarea {
    max-width: 100%;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.rewards-table-wrapper,
.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

@media (max-width: 1180px) and (min-width: 993px) {
    .navbar > .nav-container > .social-icons {
        display: none;
    }

    .nav-menu a {
        padding-right: 0.42rem;
        padding-left: 0.42rem;
        letter-spacing: 0.07em;
    }
}

@media (max-width: 992px) {
    html {
        --anchor-offset: 78px;
        scroll-padding-top: var(--anchor-offset);
    }

    .nav-container {
        width: 100%;
    }

    .nav-menu {
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .nav-menu .social-icons {
        display: flex;
        flex: 0 0 auto;
        gap: 0.65rem;
        align-items: center;
        justify-content: flex-start;
        margin: 1rem 0 0;
        padding: 1.15rem 0 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-menu .social-icons a {
        width: 42px;
        height: 42px;
        margin: 0;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.025);
    }

    .nav-menu a {
        min-height: 48px;
    }

    .footer .footer-content,
    .site-footer .footer-content {
        min-width: 0;
    }

    .program-details-section,
    .reglement-section::before,
    .histoire-section::before {
        background-attachment: scroll;
    }

    .hero-buttons,
    .intro-buttons {
        max-width: 100%;
    }

    .modern-features,
    .modern-features .tabs-content,
    .modern-features .tab-content,
    .feature-bento,
    .class-group,
    .class-card,
    .gallery-carousel {
        min-width: 0;
    }
}

@media (max-width: 700px) {
    .container {
        width: calc(100% - 2rem);
        padding-right: 0;
        padding-left: 0;
    }

    .section,
    .streamer-section {
        padding-top: 4.25rem;
        padding-bottom: 4.25rem;
    }

    .section-title {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .hero-buttons,
    .intro-buttons {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .hero-buttons .cta-button,
    .intro-buttons .cta-button {
        width: 100%;
        max-width: none;
        justify-content: center;
        text-align: center;
    }

    .modern-features .tabs-nav {
        margin-right: -1rem;
        padding-right: 1rem;
    }

    .modern-features .tab-button {
        min-height: 66px;
    }

    .feature-panel-heading h3,
    .intro-text h2,
    .community-copy h2 {
        overflow-wrap: anywhere;
    }

    .gallery-carousel .owl-stage-outer {
        overflow: hidden;
    }

    .site-footer .footer-play {
        width: 100%;
    }

    .back-to-top {
        right: 1rem;
        bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

@media (max-width: 520px) {
    .nav-menu {
        width: 100%;
        padding: 76px 1rem 1.25rem;
    }

    .nav-menu a {
        padding: 0.8rem 0.5rem;
        font-size: 0.72rem;
    }

    .nav-menu li {
        margin: 0;
    }

    .cta-button {
        white-space: normal;
    }

    .feature-visual-caption {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
    }

    .feature-visual-caption strong {
        font-size: 0.8rem;
    }

    .feature-bento-card {
        grid-template-columns: 32px minmax(0, 1fr);
        padding: 1rem;
    }

    .gallery-item {
        height: min(75vw, 300px);
    }

    .site-footer .footer-wordmark img {
        width: 138px;
    }
}

@media (max-width: 380px) {
    .container {
        width: calc(100% - 1.25rem);
    }

    .logo img,
    .navbar.scrolled .logo img {
        height: 30px;
    }

    .nav-container {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .footer-socials {
        flex-wrap: wrap;
    }
}

@media (max-width: 992px) and (max-height: 680px) {
    .nav-menu {
        padding-top: 68px;
    }

    .nav-menu a {
        min-height: 42px;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .nav-menu .social-icons {
        margin-top: 0.5rem;
        padding-top: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
