/* L'Écluse d'Épisy — feuille de style « nature cocon »
   Mise en page : une seule colonne calme sur téléphone, grilles légères sur grand écran.
   Tons lin, mousse et bois. Formes douces, peu d'éléments, beaucoup d'air. */

/* Polices hébergées avec le site (licence SIL OFL, voir fonts/) */
@font-face { font-family: "Lora"; src: url("../fonts/lora.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }

:root {
  --linen: #f3eee4;      /* fond lin */
  --card: #fbf8f2;
  --ink: #33372e;        /* texte, brun-vert doux */
  --muted: #6e7265;
  --moss: #5f7353;       /* vert mousse */
  --moss-soft: #e2e7d8;
  --wood: #9c6f4b;       /* bois chaud */
  --wood-soft: #f0e4d6;
  --line: #e3dbcc;
  --alert: #9a5232;
  --alert-soft: #f5e3d7;
  --shadow: 0 10px 30px -18px rgba(70, 60, 40, .35);
  --f-display: "Lora", "Iowan Old Style", Georgia, serif;
  --f-body: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --r: 22px;
  --tabbar-h: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --linen: #181b16; --card: #1f231d; --ink: #ebe5d8; --muted: #a8ab9d;
    --moss: #a9bf98; --moss-soft: #283124; --wood: #d3a77f; --wood-soft: #33291f;
    --line: #2f352b; --alert: #e5a17f; --alert-soft: #3a271e;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --linen: #181b16; --card: #1f231d; --ink: #ebe5d8; --muted: #a8ab9d;
  --moss: #a9bf98; --moss-soft: #283124; --wood: #d3a77f; --wood-soft: #33291f;
  --line: #2f352b; --alert: #e5a17f; --alert-soft: #3a271e;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--linen); color: var(--ink);
  font: 400 17px/1.65 var(--f-body);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--linen); }
img { max-width: 100%; display: block; }
a { color: var(--moss); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--wood); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; text-wrap: balance; margin: 0; }
h1 em, h2 em { font-style: italic; color: var(--moss); }
h1 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 4.4vw, 2.1rem); line-height: 1.18; }
h3 { font-size: 1.18rem; line-height: 1.3; }
p { margin: 0; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: .82rem; font-weight: 700; color: var(--wood); }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 58ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.ico { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--linen) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand b { font-family: var(--f-display); font-weight: 500; font-style: italic; font-size: 1.2rem; }
.brand-leaf { color: var(--moss); width: 22px; height: 22px; }
.topnav { display: none; gap: 4px; }
.topnav a { text-decoration: none; color: var(--muted); padding: 8px 14px; border-radius: 999px; font-size: .95rem; font-weight: 600; }
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--moss-soft); color: var(--ink); }
.favcount { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); padding: 0 14px; border-radius: 999px; background: var(--card); font-size: .9rem; font-weight: 600; min-height: 40px; }
.favcount .ico { color: var(--wood); }

/* ---------- Barre d'onglets mobile ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); box-shadow: 0 -1px 0 var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar-h); text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tabbar a .ico { width: 24px; height: 24px; padding: 2px; }
.tabbar a[aria-current="page"] { color: var(--moss); }
.tabbar a[aria-current="page"] .ico { background: var(--moss-soft); border-radius: 999px; width: 44px; height: 26px; padding: 3px 12px; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- Vues ---------- */
.view { animation: fade .45s ease both; }
.view[hidden] { display: none !important; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } html { scroll-behavior: auto; } }
.section { padding-block: 34px; display: grid; gap: 20px; }
.section-head { display: grid; gap: 8px; }

/* ---------- Accueil ---------- */
.hero { margin-top: 6px; border-radius: 28px 28px 28px 110px; overflow: hidden; background: var(--moss-soft); }
.hero img { width: 100%; height: clamp(300px, 56vh, 520px); object-fit: cover; }
.hero-text { padding-block: 26px 22px; }
.essentials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .essentials { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: grid; gap: 4px; padding: 16px; background: var(--card); border-radius: 18px; text-decoration: none; color: var(--ink); align-content: start; min-width: 0; transition: transform .25s, box-shadow .25s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .ico { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--moss-soft); color: var(--moss); margin-bottom: 6px; }
.tile b { font-size: .98rem; font-weight: 700; }
.tile span { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
#season-notice:not(:empty) { margin-top: 22px; }
.welcome { justify-items: center; text-align: center; padding-block: 40px 30px; gap: 6px; }
.welcome-text { font-family: var(--f-display); font-style: italic; font-size: 1.5rem; color: var(--moss); }
.signature { color: var(--muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .95rem; border: 0; cursor: pointer; transition: background .25s, transform .2s; }
.btn:active { transform: scale(.98); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--moss); color: var(--card); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--moss-soft); }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: .88rem; }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 70%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .gallery { grid-auto-columns: 32%; } }
.gallery figure { margin: 0; scroll-snap-align: start; display: grid; gap: 8px; }
.gallery img { aspect-ratio: 4 / 5; width: 100%; height: auto; object-fit: cover; border-radius: 20px; background: var(--moss-soft); }
.gallery figcaption { font-size: .85rem; color: var(--muted); padding-left: 4px; }

.feature { display: grid; margin-top: 34px; background: var(--moss-soft); border-radius: var(--r); overflow: hidden; }
@media (min-width: 760px) { .feature { grid-template-columns: 1fr 1fr; } }
.feature img { width: 100%; height: 100%; min-height: 230px; max-height: 400px; object-fit: cover; }
.feature-body { padding: 26px 22px 28px; display: grid; gap: 12px; align-content: center; }
.feature-body p { color: var(--muted); }
.feature .btn { justify-self: start; }

.notice { display: flex; gap: 12px; padding: 16px 18px; border-radius: 18px; background: var(--wood-soft); color: var(--ink); }
.notice .ico { color: var(--wood); margin-top: 3px; }
.notice.alert { background: var(--alert-soft); }
.notice.alert .ico { color: var(--alert); }
.notice > div { display: grid; gap: 6px; min-width: 0; }
.notice ul { margin: 0; padding-left: 18px; font-size: .95rem; }

/* ---------- Champs à compléter ---------- */
.todo { display: inline-flex; align-items: center; font-family: var(--f-body); font-style: normal; font-size: .78rem; font-weight: 700; color: var(--alert); background: var(--alert-soft); padding: 2px 10px; border-radius: 999px; }

/* ---------- Séjour ---------- */
.info-grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel { background: var(--card); border-radius: var(--r); padding: 22px 20px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; }
.panel-head .badge-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--moss-soft); color: var(--moss); flex: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: baseline; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.list li { display: flex; gap: 10px; align-items: flex-start; }
.list li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--moss); opacity: .6; margin-top: .65em; flex: none; }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
ol.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
ol.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--moss-soft); color: var(--moss); font-weight: 800; font-size: .85rem; flex: none; }
.copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy code { font: 700 1rem/1.3 var(--f-body); background: var(--linen); padding: 8px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.emergency { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.emergency div { display: grid; gap: 2px; padding: 14px; border-radius: 18px; background: var(--card); }
.emergency b { font-family: var(--f-display); font-size: 1.7rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; color: var(--wood); }
.emergency span { font-size: .82rem; color: var(--muted); }
details.faq { background: var(--card); border-radius: 18px; }
details.faq + details.faq { margin-top: 8px; }
details.faq summary { list-style: none; cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 700; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--moss); transition: transform .25s; }
details.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details.faq > div { padding: 0 18px 18px; color: var(--muted); }

/* ---------- Spa ---------- */
.spa-hero { border-radius: var(--r); overflow: hidden; }
.spa-hero img { width: 100%; height: clamp(240px, 48vh, 440px); object-fit: cover; }
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.chip { padding: 16px; border-radius: 18px; background: var(--card); display: grid; gap: 4px; align-content: start; min-width: 0; }
.chip .ico { color: var(--moss); width: 24px; height: 24px; margin-bottom: 4px; }
.chip small { color: var(--muted); font-size: .82rem; }
.chip b { font-size: .98rem; overflow-wrap: anywhere; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.rule { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 16px; border-radius: 18px; background: var(--card); align-content: start; }
.rule .ico { grid-row: span 2; width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: var(--moss-soft); color: var(--moss); }
.rule b { font-size: .98rem; }
.rule p { font-size: .9rem; color: var(--muted); }

/* ---------- Autour du gîte ---------- */
.toolbar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 60px); z-index: 10; background: var(--linen); padding-block: 8px 12px; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--card); cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--moss); color: var(--card); }
.filter .n { font-size: .78rem; opacity: .7; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: var(--card); border-radius: 999px; padding: 4px; justify-self: start; }
.seg button { border: 0; background: transparent; min-height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-size: .88rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--moss-soft); color: var(--ink); }
.cards { display: grid; gap: 14px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--card); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; transition: transform .25s, box-shadow .25s; }
@media (hover: hover) { .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); } }
.card-art { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 0; }
.card-art .where { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: .84rem; font-weight: 700; color: var(--moss); }
.card-art .where .ico { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--moss-soft); }
.cat-patrimoine .card-art .where, .cat-restaurants .card-art .where { color: var(--wood); }
.cat-patrimoine .card-art .where .ico, .cat-restaurants .card-art .where .ico { background: var(--wood-soft); }
.card-art .dist { flex: none; white-space: nowrap; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-body { padding: 12px 20px 16px; display: grid; gap: 10px; flex: 1; align-content: start; }
.card-title { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.card-name { display: grid; gap: 2px; min-width: 0; }
.card-name .commune { font-size: .85rem; color: var(--muted); }
.card-body > p { color: var(--ink); font-size: .97rem; }
.fav { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--linen); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.fav[aria-pressed="true"] { color: var(--wood); background: var(--wood-soft); }
.fav[aria-pressed="true"] .ico { fill: currentColor; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.b { font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--linen); color: var(--muted); }
.b-free { background: var(--moss-soft); color: var(--moss); }
.b-hotes { background: var(--wood-soft); color: var(--wood); }
.b-closed { background: var(--alert-soft); color: var(--alert); }
.b-check { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
details.more { border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { cursor: pointer; list-style: none; font-size: .88rem; font-weight: 700; color: var(--moss); padding: 8px 0; display: flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-size: 1.15rem; font-weight: 400; transition: transform .25s; }
details.more[open] summary::after { transform: rotate(45deg); }
.facts { margin: 4px 0 0; display: grid; gap: 8px; font-size: .9rem; }
.facts div { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.facts .ico { width: 16px; height: 16px; color: var(--moss); margin-top: 4px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.facts dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.card-alert { font-size: .88rem; padding: 12px 14px; border-radius: 14px; background: var(--alert-soft); }
.card-alert a { color: var(--alert); font-weight: 700; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 20px; margin-top: auto; }
.source { font-size: .78rem; color: var(--muted); padding-top: 10px; }
.empty { padding: 34px 20px; text-align: center; border-radius: var(--r); background: var(--card); color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty .ico { width: 28px; height: 28px; color: var(--wood); }

#map { height: min(68vh, 560px); border-radius: var(--r); background: var(--moss-soft); z-index: 1; }
.map-pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fbf8f2; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.map-pin.home { background: #33372e; width: 34px; height: 34px; }
.pin-nature { background: #6f8a66; } .pin-patrimoine { background: #8a6e4b; } .pin-activites { background: #4f7480; } .pin-restaurants { background: #b8792e; } .pin-commerces { background: #8d877b; }
.leaflet-popup-content { font: 14px/1.45 var(--f-body); margin: 12px 14px; }
.leaflet-popup-content b { font: 600 15px/1.25 var(--f-display); display: block; margin-bottom: 4px; }
.leaflet-popup-content a { color: #5f7353; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Idées de journées ---------- */
.days { display: grid; gap: 14px; }
@media (min-width: 860px) { .days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.day { background: var(--card); border-radius: var(--r); padding: 22px 20px; display: grid; gap: 14px; align-content: start; }
.day h2 { font-size: clamp(1.35rem, 4vw, 1.7rem); }
.day-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline .h { font-weight: 800; color: var(--wood); font-size: .88rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.timeline a { font-size: .86rem; }

/* ---------- Divers ---------- */
.to-top { position: fixed; right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px)); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 24; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--card); color: var(--moss); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; transform: translateY(8px); }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
@media (min-width: 900px) { .to-top { bottom: max(24px, env(safe-area-inset-bottom, 0px)); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px); transform: translate(-50%, 20px); background: var(--ink); color: var(--linen); padding: 10px 18px; border-radius: 999px; font-size: .92rem; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 40; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer.foot { padding-block: 26px 40px; margin-top: 20px; font-size: .84rem; color: var(--muted); display: grid; gap: 6px; justify-items: center; text-align: center; }
footer.foot #foot-name { font-family: var(--f-display); font-style: italic; font-size: 1.1rem; color: var(--ink); }
.img-fallback { background: var(--moss-soft); }
