/* Module Marées : style moderne, 3 thèmes (dark / light / auto) */

.mod-maree {
    --mm-bg: linear-gradient(150deg, #ffffff 0%, #eaf4fc 100%);
    --mm-fg: #0b2540;
    --mm-muted: #5b7089;
    --mm-card: rgba(11, 37, 64, .04);
    --mm-border: rgba(11, 37, 64, .10);
    --mm-accent: #0284c7;
    --mm-high: #0284c7;
    --mm-low: #ea580c;
    --mm-grid: rgba(11, 37, 64, .12);
    --mm-shadow: 0 14px 34px -16px rgba(11, 37, 64, .35);

    box-sizing: border-box;
    padding: 1.25rem;
    border-radius: 22px;
    border: 1px solid var(--mm-border);
    background: var(--mm-bg);
    color: var(--mm-fg);
    box-shadow: var(--mm-shadow);
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}

.mod-maree *,
.mod-maree *::before,
.mod-maree *::after { box-sizing: inherit; }

.mod-maree--dark {
    --mm-bg: linear-gradient(150deg, #0a1b33 0%, #0e2f52 55%, #12507c 100%);
    --mm-fg: #eaf4ff;
    --mm-muted: #9db6d0;
    --mm-card: rgba(255, 255, 255, .06);
    --mm-border: rgba(255, 255, 255, .12);
    --mm-accent: #38bdf8;
    --mm-high: #38bdf8;
    --mm-low: #fb923c;
    --mm-grid: rgba(255, 255, 255, .14);
    --mm-shadow: 0 20px 44px -20px rgba(0, 0, 0, .65);
}

@media (prefers-color-scheme: dark) {
    .mod-maree--auto {
        --mm-bg: linear-gradient(150deg, #0a1b33 0%, #0e2f52 55%, #12507c 100%);
        --mm-fg: #eaf4ff;
        --mm-muted: #9db6d0;
        --mm-card: rgba(255, 255, 255, .06);
        --mm-border: rgba(255, 255, 255, .12);
        --mm-accent: #38bdf8;
        --mm-high: #38bdf8;
        --mm-low: #fb923c;
        --mm-grid: rgba(255, 255, 255, .14);
        --mm-shadow: 0 20px 44px -20px rgba(0, 0, 0, .65);
    }
}

/* En-tête */
.mod-maree__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mod-maree__id { display: flex; align-items: center; gap: .75rem; }

.mod-maree__logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--mm-accent);
    background: var(--mm-card);
    border: 1px solid var(--mm-border);
}

.mod-maree__title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; color: inherit; }
.mod-maree__sub { margin: .1rem 0 0; font-size: .8rem; color: var(--mm-muted); }

.mod-maree__now { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.mod-maree__now-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mm-muted); }
.mod-maree__now-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.mod-maree__now-value small { font-size: .9rem; font-weight: 600; color: var(--mm-muted); }

.mod-maree__badge {
    align-self: center;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}
.mod-maree__badge--up { color: var(--mm-high); background: color-mix(in srgb, var(--mm-high) 16%, transparent); }
.mod-maree__badge--down { color: var(--mm-low); background: color-mix(in srgb, var(--mm-low) 16%, transparent); }

/* Prochaines marées */
.mod-maree__next { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }

.mod-maree__chip {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .55rem .85rem;
    border-radius: 14px;
    background: var(--mm-card);
    border: 1px solid var(--mm-border);
    border-left-width: 3px;
}
.mod-maree__chip--high { border-left-color: var(--mm-high); }
.mod-maree__chip--low { border-left-color: var(--mm-low); }
.mod-maree__chip-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--mm-muted); }
.mod-maree__chip-value { font-size: .95rem; font-weight: 700; }
.mod-maree__chip-value em { font-style: normal; font-weight: 500; color: var(--mm-muted); }

/* Jours */
.mod-maree__days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
}

.mod-maree__day {
    padding: .95rem;
    border-radius: 18px;
    background: var(--mm-card);
    border: 1px solid var(--mm-border);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform .2s ease, border-color .2s ease;
}
.mod-maree__day:hover { transform: translateY(-2px); border-color: var(--mm-accent); }
.mod-maree__day.is-today { border-color: color-mix(in srgb, var(--mm-accent) 55%, transparent); }

.mod-maree__day-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.mod-maree__day-title { margin: 0; font-size: 1rem; font-weight: 700; color: inherit; }
.mod-maree__day-date { font-size: .75rem; color: var(--mm-muted); }

/* Graphique */
.mod-maree__chart { display: block; width: 100%; height: auto; overflow: visible; }
.mod-maree__grid { stroke: var(--mm-grid); stroke-width: 1; stroke-dasharray: 3 4; }
.mod-maree__stop--a { stop-color: var(--mm-accent); stop-opacity: .45; }
.mod-maree__stop--b { stop-color: var(--mm-accent); stop-opacity: 0; }
.mod-maree__line {
    fill: none;
    stroke: var(--mm-accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: mod-maree-draw 1.2s ease-out forwards;
}
.mod-maree__dot { stroke-width: 2; stroke: var(--mm-fg); }
.mod-maree__dot--high { fill: var(--mm-high); }
.mod-maree__dot--low { fill: var(--mm-low); }
.mod-maree__now-line { stroke: var(--mm-fg); stroke-width: 1; stroke-dasharray: 2 3; opacity: .55; }
.mod-maree__now-dot { fill: var(--mm-fg); stroke: var(--mm-accent); stroke-width: 3; }

.mod-maree__axis {
    display: flex;
    justify-content: space-between;
    margin: .15rem 0 .6rem;
    font-size: .65rem;
    color: var(--mm-muted);
}

@keyframes mod-maree-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    .mod-maree__line { animation: none; stroke-dashoffset: 0; }
    .mod-maree__day { transition: none; }
    .mod-maree__day:hover { transform: none; }
}

/* Liste des marées */
.mod-maree__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }

.mod-maree__item {
    display: grid;
    grid-template-columns: 1.2rem 1fr auto auto;
    align-items: center;
    gap: .5rem;
    padding: .4rem .6rem;
    border-radius: 10px;
    background: color-mix(in srgb, var(--mm-fg) 4%, transparent);
    font-size: .88rem;
}
.mod-maree__icon { font-size: .7rem; }
.mod-maree__item--high .mod-maree__icon { color: var(--mm-high); }
.mod-maree__item--low .mod-maree__icon { color: var(--mm-low); }
.mod-maree__kind { color: var(--mm-muted); }
.mod-maree__time { font-weight: 700; }
.mod-maree__height { min-width: 4.2rem; text-align: right; font-weight: 600; }

.mod-maree__range { margin: .6rem 0 0; font-size: .75rem; color: var(--mm-muted); }
.mod-maree__range strong { color: var(--mm-fg); }

/* Pied */
.mod-maree__foot { margin-top: 1rem; font-size: .7rem; color: var(--mm-muted); }
.mod-maree__foot a { color: var(--mm-accent); text-decoration: none; }
.mod-maree__foot a:hover { text-decoration: underline; }

.mod-maree__empty { margin: 0; color: var(--mm-muted); }
