/* =====================================================
   Marées — tides.css (version fluide / mobile-first)
   Objectif: même logique que les autres pages
   - width: min(calc(100% - 2*gutter), max)
   - tailles avec clamp()
   - pas de dépendance iPhone/iPad
===================================================== */

:root {
    /* cohérent avec tes autres cartes */
    --card-max: 500px;
    --card-gutter: clamp(0.75rem, 3vw, 1.15rem);
}

/* =====================================================
   1) TITRE PRINCIPAL
===================================================== */
.maree-title {
    /* typographie fluide */
    font-size: clamp(1.22rem, 3.2vw, 1.55rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.3px;

    /* largeur fluide + centrée comme tes cartes */
    width: min(calc(100% - (2 * var(--card-gutter))), 26ch);
    margin: clamp(0.55rem, 2.2vw, 0.9rem) auto clamp(0.65rem, 2.4vw, 0.95rem);
    padding: 0 0 clamp(0.18rem, 1vw, 0.28rem);

    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

/* =====================================================
   2) CARTES PAR JOUR
===================================================== */
.maree-day-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1em;
    box-shadow: 0 3px 10px rgba(60, 110, 170, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);

    /* mobile-first + fluide */
    box-sizing: border-box;
    width: min(calc(100% - (2 * var(--card-gutter))), var(--card-max));
    margin: 0 auto clamp(0.55rem, 2vw, 0.8rem);

    /* padding fluide */
    padding: clamp(0.7rem, 2.2vw, 0.95rem) clamp(0.85rem, 2.8vw, 1.15rem);
}

.maree-day-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   3) EN-TÊTE DE JOUR (DATE)
===================================================== */
.maree-header {
    text-align: left;
    font-weight: 700;
    font-size: clamp(1.02rem, 2.2vw, 1.12rem);
    color: rgba(255, 255, 255, 0.98);

    margin: 0 0 clamp(0.35rem, 1.3vw, 0.5rem);
    padding: 0 0 clamp(0.35rem, 1.2vw, 0.45rem);

    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

/* Variante utilisée ailleurs (garde pour compatibilité) */
.previsions-list.marees .maree-header {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.7em 1em;
    border-radius: 1em 1em 0 0;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-align: center;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

/* =====================================================
   4) LIGNES DES MARÉES (UNE MARÉE PAR LIGNE)
   -> grille stable (heure | type | niveau)
===================================================== */
.maree-entry {
    display: grid;
    grid-template-columns: 5ch 1fr 7ch; /* heure | type | niveau */
    align-items: center;
    column-gap: clamp(0.55rem, 2vw, 0.9rem);

    padding: clamp(0.22rem, 1vw, 0.32rem) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);

    font-size: clamp(0.98rem, 2.2vw, 1.08rem);
}

.maree-entry:first-child {
    border-top: none;
}

/* =====================================================
   5) COLONNES (HEURE / TYPE / NIVEAU)
===================================================== */
.maree-heure {
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
}

.maree-type {
    text-align: center;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.maree-niveau {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
}

/* =====================================================
   6) TEXTE EXPLICATIF (sous les marées)
===================================================== */
.marees-explanation {
    font-size: clamp(0.95rem, 2.2vw, 1.02rem);
    line-height: 1.55;
    color: #f3f7ff;

    background: rgba(30, 45, 90, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.8em;

    box-sizing: border-box;
    width: min(calc(100% - (2 * var(--card-gutter))), 420px);
    margin: clamp(0.45rem, 1.8vw, 0.6rem) auto;
    padding: clamp(0.6rem, 2.4vw, 0.8rem) clamp(0.9rem, 3vw, 1.15rem);

    text-align: center;
}

.marees-explanation a {
    text-decoration: underline dotted;
    transition: color 0.16s;
}

.marees-explanation a:hover,
.marees-explanation a:focus {
    color: #fffbe8;
}

/* =====================================================
   7) VOIR PLUS / VOIR MOINS
   -> remplace les anciens styles inline de tides.html
===================================================== */

/* Conteneur <details> (centré + même largeur que les cartes) */
.maree-more {
    box-sizing: border-box;
    width: min(calc(100% - (2 * var(--card-gutter))), 420px);
    margin: 0.25rem auto 1rem;
    padding: 0.25rem 0.5rem;
}

/* <summary> cliquable, sans puce, centré */
.maree-more-summary {
    list-style: none;
    cursor: pointer;
    text-align: center;

    /* typographie + espacement doux */
    font-size: clamp(0.92rem, 2.2vw, 0.98rem);
    margin: 0.25rem auto 0.5rem;
    padding: 0;

    /* petit contraste, sans casser ton thème */
    color: rgba(255, 255, 255, 0.92);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

/* Retire le marqueur dans Safari/Chrome */
.maree-more-summary::-webkit-details-marker {
    display: none;
}

/* Contenu interne des jours supplémentaires */
.maree-more-content {
    margin-top: 0.5rem;
}

.voir-plus-lien .label-moins {
    display: none;
}

details[open] .voir-plus-lien .label-plus {
    display: none;
}

details[open] .voir-plus-lien .label-moins {
    display: inline;
}

/* =====================================================
   8) SOURCE (BAS DE PAGE)
===================================================== */
.source-reference {
    font-size: clamp(0.88rem, 2.1vw, 0.92rem);
    color: #e8f1ff;
    margin: clamp(0.35rem, 1.4vw, 0.5rem) 0 clamp(0.55rem, 2vw, 0.7rem);
    text-align: center;
    opacity: 0.92;
}

.source-reference a {
    color: #dce9ff;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    transition: 0.2s ease;
}

.source-reference a:hover {
    color: #ffffff;
    text-decoration-thickness: 2px;
}

.source-multi {
    display: inline-block;
    text-align: center;
    width: 100%;
    line-height: 1.25em;
}

/* Accessibilité / confort */
@media (prefers-reduced-motion: reduce) {
    .maree-day-card {
        transition: none;
    }
}
