:root {
  --bg: #f6f5f2;
  --ink: #1d1b2e;
  --muted: #6b6878;
  --card: #fff;
  --accent: #c8553d;
  --radius: 14px;
  --tabbar-h: 64px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1 { font-size: 1.6rem; margin: 1rem 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
p { line-height: 1.5; margin: .25rem 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(.75rem + env(safe-area-inset-top)) 1rem .75rem;
  background: var(--ink); color: #fff;
}
.brand { font-weight: 700; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.pill { font-size: .75rem; padding: .2rem .6rem; border-radius: 99px; background: #ffffff22; }
.pill.offline { background: var(--accent); }

main {
  max-width: 720px; margin: 0 auto;
  padding: 0 1rem calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom));
}

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid #0001;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.3rem; opacity: .55;
}
.tabbar a span { font-size: .7rem; margin-top: .15rem; }
.tabbar a.active { opacity: 1; }

.hero { padding: .5rem 0; }
.btn {
  border: 0; border-radius: var(--radius); padding: .8rem 1.2rem;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600;
}

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.card {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem; border-radius: var(--radius); background: var(--card);
  text-decoration: none; font-size: 1.5rem; box-shadow: 0 1px 3px #0001;
}
.card strong { font-size: 1rem; }
.card span { font-size: .8rem; color: var(--muted); }

.service, .poi, .line, .booklet, details {
  background: var(--card); border-radius: var(--radius);
  padding: 1rem; margin-bottom: .75rem; box-shadow: 0 1px 3px #0001;
}
.service { display: flex; gap: .75rem; }
.service .icon { font-size: 1.8rem; }

.plan { border-radius: var(--radius); background: var(--card); margin: .5rem 0; }
.back { display: inline-block; margin-top: 1rem; text-decoration: none; color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .45rem .9rem; border-radius: 99px; background: var(--card);
  text-decoration: none; box-shadow: 0 1px 3px #0001;
}

/* Horaires */
.line header { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.badge {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; font-weight: 800;
}
.badge.sm {
  width: auto; min-width: 2.6rem; height: 1.4rem; padding: 0 .35rem; margin-right: .4rem;
  border-radius: 4px; font-size: .8rem; vertical-align: middle;
}
.more { display: block; margin: -.25rem 0 .5rem; text-align: right; color: var(--accent); text-decoration: none; font-size: .9rem; }
.line ul { list-style: none; margin: 0 0 .5rem; padding: 0; }
.line li {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: .4rem 0; border-top: 1px solid #0000000d;
}
.line .times { display: flex; gap: .6rem; white-space: nowrap; }

/* Galerie */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.thumb { padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.lightbox {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: #000e; color: #fff;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; text-align: center; }
.lightbox img { max-height: 80vh; margin: 0 auto; }
.lightbox figcaption { padding: .75rem; }
.lightbox button {
  position: absolute; border: 0; background: none; color: #fff;
  font-size: 2.5rem; padding: 1rem; cursor: pointer;
}
.lb-close { top: env(safe-area-inset-top); right: 0; font-size: 1.5rem !important; }
.lb-prev { left: 0; }
.lb-next { right: 0; }

details summary { font-weight: 600; cursor: pointer; }
details p { margin-top: .75rem; }
.booklet ul { margin: 0; padding-left: 1.2rem; line-height: 1.7; }
