/* Mobile first. Larger screens are progressive enhancement below. */

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

:root {
  --bg: #ffffff;
  --fg: #08090a;
  --fg-2: #3c4149;
  --muted: #6f7076;
  --faint: #9598a1;
  --line: #e9e9eb;
  --line-soft: #f2f2f4;
  --accent: #5e6ad2;
  --accent-soft: #f0f1fb;
  --done: #16a34a;
  --radius: 10px;
  --tap: 44px;              /* minimum comfortable tap target */
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
}

.brand {
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 15px;
  flex: none;
}

.brand-dot { color: var(--accent); }

/* horizontally scrollable nav on phones */
.nav {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-left: auto;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  white-space: nowrap;
  padding: 4px 0;
}

.nav a:active { color: var(--fg); }

/* ---------- hero ---------- */

.hero { padding: 40px 18px 32px; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

h1 {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.lede {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-2);
}

.countdown {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--muted);
}

.countdown strong { color: var(--fg); font-weight: 600; }

.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---------- sections ---------- */

.section { padding: 36px 18px; }

.section-head {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  width: 100%;
}

.sub-head {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.progress {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.progress.full { background: #e7f6ec; color: var(--done); }

/* ---------- icons ---------- */

.ico {
  width: 15px;
  height: 15px;
  flex: none;
  vertical-align: -2px;
}

h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.h-ico {
  display: inline-flex;
  color: var(--faint);
}

.h-ico .ico { width: 17px; height: 17px; }

.type-ico {
  display: inline-flex;
  flex: none;
}

.type-ico .ico { width: 15px; height: 15px; }

.place-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.place-group-head .ico { width: 13px; height: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn .ico { width: 14px; height: 14px; color: var(--faint); }

.card-kind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-kind .ico { width: 12px; height: 12px; }

.place-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.place-link .ico { width: 13px; height: 13px; }

.lg .ico { width: 13px; height: 13px; }

/* ---------- route line note ---------- */

.route-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 7px;
}

.route-dash {
  width: 26px;
  height: 0;
  flex: none;
  border-top: 2px dotted var(--accent);
  opacity: 0.7;
}

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  margin: 0 0 28px;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--line);
}

.tl-item { position: relative; padding: 0 0 24px 20px; }
.tl-item:last-child { padding-bottom: 0; }

/* icon sits on the rail instead of a plain dot */
.tl-ico {
  position: absolute;
  left: -31px; top: 1px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

.tl-ico .ico { width: 13px; height: 13px; }

.tl-item[data-kind="volo"] .tl-ico { color: var(--accent); border-color: #d7daf5; }
.tl-item[data-kind="alloggio"] .tl-ico { background: var(--fg); border-color: var(--fg); color: #fff; }

/* someone else's booking — lighter, so your own itinerary reads first */
.tl-item.is-other .tl-ico { border-style: dashed; }
.tl-item.is-other .tl-title { font-weight: 500; }

.card.is-other { background: #fcfcfd; }

.tl-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tl-date {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}

.tl-title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.tl-where { font-size: 13.5px; color: var(--muted); }

/* ---------- bookings ---------- */

.bookings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 28px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-kind {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 7px;
  border-radius: 5px;
  flex: none;
}

.card-title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.card-op { font-size: 12.5px; color: var(--muted); }

.card-when {
  font-size: 13px;
  color: var(--fg-2);
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
}

.card-where { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.dl { margin: 0 0 12px; font-size: 12.5px; }
.dl div { display: flex; gap: 10px; padding: 2px 0; }
.dl dt { color: var(--faint); min-width: 80px; flex: none; }
.dl dd { margin: 0; color: var(--fg-2); }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}

.btn {
  font-size: 13px;
  text-decoration: none;
  color: var(--fg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;      /* generous for thumbs */
  white-space: nowrap;
}

.btn:active { background: #f4f4f6; }

.btn-mail::before { content: "✉ "; color: var(--faint); }
.btn-app::before  { content: "↗ "; color: var(--faint); }
.btn-map::before  { content: "◎ "; color: var(--faint); }

.ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--faint);
}

/* ---------- regions: places ---------- */

.region-body { display: grid; gap: 20px; }

.place-group { margin-bottom: 18px; }

.place-group-head {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 7px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}

.place {
  display: flex;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
}

.place-body { flex: 1; min-width: 0; }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.place-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  line-height: 1.35;
}

.place-addr { font-size: 13px; color: var(--muted); margin-top: 1px; }
.place-note { font-size: 13px; color: var(--fg-2); margin-top: 4px; line-height: 1.5; }

.place-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.place-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 0;
}

/* rating + today's opening hours */
.place-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

.rating { color: #b45309; font-weight: 500; }
.rating-n { color: var(--faint); }

.hours {
  margin-top: 6px;
  font-size: 12.5px;
}

.hours summary {
  cursor: pointer;
  color: var(--muted);
  padding: 3px 0;
  list-style: none;
}

.hours summary::-webkit-details-marker { display: none; }
.hours summary::before { content: "▸ "; color: var(--faint); }
.hours[open] summary::before { content: "▾ "; }

.hours ul {
  margin: 4px 0 0;
  padding: 0 0 0 14px;
  list-style: none;
  color: var(--fg-2);
}

.hours li { padding: 1px 0; }

.tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--line-soft);
  color: var(--muted);
  white-space: nowrap;
}

.tag.hot { background: var(--fg); color: #fff; }
.tag.warn { background: #fff4e5; color: #b45309; }

.add-hint {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--faint);
}

.add-hint code {
  background: var(--line-soft);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* ---------- done toggle ---------- */

.tick {
  flex: none;
  width: 26px; height: 26px;
  min-width: 26px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  padding: 0;
  position: relative;
  /* expand the touch area without changing the visual size */
  box-shadow: 0 0 0 9px transparent;
}

.tick::after {
  content: "";
  position: absolute;
  left: 8px; top: 4px;
  width: 6px; height: 11px;
  border: solid transparent;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tick[aria-pressed="true"] {
  background: var(--done);
  border-color: var(--done);
}

.tick[aria-pressed="true"]::after { border-color: #fff; }

.is-done .place-name,
.is-done .food-name { text-decoration: line-through; color: var(--faint); }
.is-done .place-addr,
.is-done .place-note,
.is-done .food-note { color: var(--faint); }

/* ---------- foods ---------- */

.foods { display: grid; gap: 0; }

.food {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
}

.food-body { flex: 1; min-width: 0; }

.food-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  line-height: 1.35;
}

.food-note { font-size: 13px; color: var(--fg-2); margin-top: 3px; line-height: 1.5; }

/* ---------- filters ---------- */

.filters {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.filters::-webkit-scrollbar { display: none; }

.chip {
  font-size: 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex: none;
}

.chip[aria-pressed="true"] {
  background: var(--fg);
  border-color: var(--fg);
  color: #fff;
}

/* ---------- books ---------- */

.books {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 14px;
}

.book { min-width: 0; }

.book-media { position: relative; margin-bottom: 10px; }

.book-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #f6f6f8;
  border: 1px solid var(--line);
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.book-cover.is-blank {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 12px 14px;
  background: linear-gradient(160deg, #fbfbfc, #f1f1f4);
}

.blank-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.28;
  color: var(--fg-2);
}

.blank-author {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

.book-star {
  position: absolute;
  top: 7px; left: 7px;
  background: var(--fg);
  color: #fff;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
}

/* tick sits on the cover, thumb-sized */
.book-tick {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  padding: 0;
}

.book-tick::after {
  content: "";
  position: absolute;
  left: 11px; top: 7px;
  width: 7px; height: 13px;
  border: solid #c3c5cc;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.book-tick[aria-pressed="true"] { background: var(--done); border-color: var(--done); }
.book-tick[aria-pressed="true"]::after { border-color: #fff; }

.book.is-done .book-cover { opacity: 0.45; filter: grayscale(1); }
.book.is-done .book-title { text-decoration: line-through; color: var(--faint); }
.book.is-done .book-author,
.book.is-done .book-meta,
.book.is-done .book-note { color: var(--faint); }

.book-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.book-author { font-size: 13px; color: var(--muted); }
.book-meta { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.book-note { font-size: 12.5px; line-height: 1.5; color: var(--fg-2); margin-top: 5px; }

.book-links { display: flex; gap: 14px; font-size: 13px; margin-top: 6px; }
.book-links a { color: var(--accent); text-decoration: none; padding: 3px 0; }

/* ---------- bookshops ---------- */

.shops-block {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.shops-grid { display: grid; gap: 22px; }

.shop-city {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 7px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.shop { padding: 9px 0; }
.shop-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.shop-addr { font-size: 12.5px; color: var(--muted); }

/* ---------- maps ---------- */

.map-holder { min-width: 0; }

.map {
  width: 100%;
  height: 300px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f6f8;
}

.map-tall { height: 340px; }

.map-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.map-fallback { padding: 18px; font-size: 13px; color: var(--muted); line-height: 1.6; }

.iw { font-family: Inter, -apple-system, sans-serif; font-size: 13px; line-height: 1.5; max-width: 220px; }
.iw b { display: block; font-size: 14px; letter-spacing: -0.01em; margin-bottom: 2px; }
.iw span { color: #6f7076; }
.iw a { color: #5e6ad2; text-decoration: none; font-size: 12.5px; display: inline-block; margin-top: 6px; }

.overview { display: grid; gap: 20px; }

/* ---------- footer ---------- */

.footer {
  padding: 32px 18px 56px;
  border-top: 1px solid var(--line);
  margin-top: 32px;
}

.footer p { margin: 0; font-size: 12.5px; color: var(--faint); }
.footer code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }

/* ===================================================================
   Larger screens
   =================================================================== */

@media (min-width: 600px) {
  .wrap { padding: 0 28px; }
  .hero { padding: 72px 28px 52px; }
  h1 { font-size: 44px; }
  .lede { font-size: 17px; }
  .section { padding: 52px 28px; }
  .books { grid-template-columns: repeat(3, 1fr); gap: 26px 20px; }
  .bookings { grid-template-columns: repeat(2, 1fr); }
  .shops-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .map { height: 380px; }
  .map-tall { height: 440px; }
  .footer { padding: 44px 28px 64px; }
}

@media (min-width: 900px) {
  .topbar-inner { height: 56px; }
  .nav { gap: 24px; }
  h1 { font-size: 48px; }
  .books { grid-template-columns: repeat(4, 1fr); }
  .bookings { grid-template-columns: repeat(3, 1fr); }
  .shops-grid { grid-template-columns: repeat(4, 1fr); }

  /* list beside a sticky map */
  .region-body,
  .overview {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 34px;
    align-items: start;
  }

  .map-holder { position: sticky; top: 76px; }
  .map { height: 460px; }
  .map-tall { height: 520px; }
  .timeline { margin-bottom: 0; }
}

/* pointer devices get hover affordances; touch devices skip them */
@media (hover: hover) {
  .nav a:hover { color: var(--fg); }
  .card:hover { border-color: #d9d9dd; }
  .btn:hover { background: #fafafb; border-color: #d9d9dd; }
  .chip:hover { border-color: #d0d0d6; color: var(--fg); }
  .book-links a:hover, .place-link:hover { text-decoration: underline; }
  .tick:hover, .book-tick:hover { border-color: var(--muted); }
}
