/* =========================================================================
   base.css — styles communs, navigation et responsive global.
   ========================================================================= */

:root {
    --color-primary: #3498db;
    --color-primary-hover: #2980b9;
    --color-success: #27ae60;
    --color-warning: #e67e22;
    --color-danger: #e74c3c;
    --color-danger-hover: #c0392b;

    --color-text: #eee;
    --color-text-muted: #aaa;
    --color-nav: #000;
    --color-page: #222;

    --radius-card: 12px;
    --radius-control: 7px;
    --font-stack: Arial, Helvetica, sans-serif;

    /* Largeur pensée pour les écrans d'ordinateur modernes. */
    --max-width-content: 1440px;
    --page-gutter: clamp(12px, 2.2vw, 36px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0 0 30px;
    overflow-x: hidden;
    background: var(--color-page);
    color: var(--color-text);
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.5;
}

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

button,
select,
input,
textarea {
    font: inherit;
}

/* -------------------------------------------------------------------------
   Navigation principale
   ------------------------------------------------------------------------- */

.nav-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    padding: 12px max(var(--page-gutter), calc((100vw - 1600px) / 2));
    background: var(--color-nav);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    padding: 10px 18px;
    border-radius: var(--radius-card);
    color: #fff;
    font-size: clamp(0.92rem, 1.1vw, 1.05rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.nav-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.nav-btn--home {
    background: var(--color-primary);
}

.nav-btn--meteo {
    background: var(--color-success);
}

.nav-btn--webcams {
    background: var(--color-warning);
}

/* -------------------------------------------------------------------------
   Utilitaires
   ------------------------------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    white-space: nowrap;
    clip: rect(0, 0, 0, 0);
}

/* -------------------------------------------------------------------------
   Tablette
   ------------------------------------------------------------------------- */

@media (max-width: 900px) {
    :root {
        --page-gutter: 14px;
    }

    .nav-bar {
        gap: 9px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-btn {
        min-height: 46px;
        padding: 9px 10px;
        font-size: 0.95rem;
    }
}

/* -------------------------------------------------------------------------
   Téléphone
   Les trois boutons restent sur une ligne afin de ne pas prendre
   inutilement toute la hauteur de l'écran.
   ------------------------------------------------------------------------- */

@media (max-width: 560px) {
    body {
        padding-bottom: 20px;
        font-size: 15px;
    }

    .nav-bar {
        gap: 6px;
        padding: 8px;
    }

    .nav-btn {
        min-height: 42px;
        padding: 8px 4px;
        border-radius: 8px;
        font-size: 0.82rem;
    }
}

@media (max-width: 380px) {
    .nav-btn {
        font-size: 0.76rem;
    }
}

/* Respect du réglage système « réduire les animations ». */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
