:root {
  --navy: #232b4d;
  --deep: #1a2040;
  --slate: #3f4864;
  --slate-hi: #55618a;
  --orange: #f58220;
  --green: #2ecc71;
  --yellow: #f1c40f;
  --white: #fff;
  --r: 20px;
}
* {
  box-sizing: border-box;
  margin: 0;
}

body, main, .map-card, .side, .list, .steps {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  min-height: 100dvh;
  height: 100%;
}
body {
  background: radial-gradient(circle at 15% 0%, #2f3862 0%, var(--navy) 55%);
  color: var(--white);
  font-family: "Archivo", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.5rem 1rem;
}

/* Header */
.top {
  text-align: center;
  flex-shrink: 0;
  position: relative;
}
h1 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.95;
  color: var(--orange);
  letter-spacing: 0.02em;
}
.top p {
  font-weight: 600;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  margin-top: 0.2rem;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.25rem;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
}

/* Map */
.map-card {
  position: relative;
  background: var(--deep);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r);
  overflow: hidden;
  height: 100%;
  min-height: 420px;
}
#map {
  width: 100%;
  height: 100%;
  display: block;
}
.st {
  fill: var(--slate);
  stroke: var(--deep);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.st.va {
  fill: var(--slate-hi);
}
.route {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2.5;
  stroke-dasharray: 7 8;
  stroke-linecap: round;
  opacity: 0.75;
}
.hint {
  position: absolute;
  left: 1rem;
  bottom: 0.8rem;
  font-size: 0.75rem;
  opacity: 0.55;
}

.pin {
  cursor: pointer;
  outline: none;
}
.pin .body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scale(0.6);
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.pin .shape {
  fill: var(--white);
  transition: fill 0.2s;
}
.pin .dot {
  fill: var(--navy);
}
.pin .tag rect {
  fill: var(--orange);
}
.pin .tag text {
  fill: var(--white);
  font:
    800 15px "Archivo",
    sans-serif;
  text-anchor: middle;
}
.pin:hover .body,
.pin:focus-visible .body,
.pin.active .body {
  transform: scale(0.8);
}
.pin:hover .shape,
.pin:focus-visible .shape,
.pin.active .shape {
  fill: var(--orange);
}

/* Floating info card */
.tip {
  position: absolute;
  width: 260px;
  background: var(--white);
  color: var(--navy);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  animation: pop 0.18s ease-out;
  z-index: 10;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}
.tip .date {
  font-weight: 800;
  font-size: 1.2rem;
}
.tip .place {
  font-weight: 600;
  margin: 0.1rem 0 0.4rem;
  line-height: 1.25;
}
.tip .meta {
  font-size: 0.8rem;
  line-height: 1.35;
  opacity: 0.8;
}
.badge-group {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: var(--orange);
  color: var(--white);
}
.badge.free {
  background: var(--green);
  color: var(--navy);
}
.badge.paid {
  background: var(--yellow);
  color: var(--navy);
}

/* Side panel */
.side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 0;
}
.intro {
  font-size: 0.95rem;
  line-height: 1.4;
}
.intro strong {
  color: var(--orange);
}

.list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font: inherit;
  text-align: left;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.list .d {
  flex: none;
  min-width: 4.6rem;
  font-weight: 800;
  color: var(--orange);
}
.list .p {
  font-size: 0.9rem;
  font-weight: 600;
}
.list button:hover,
.list button:focus-visible,
.list button.active {
  background: rgba(245, 130, 32, 0.18);
  border-color: var(--orange);
  outline: none;
}

.steps {
  display: flex;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15); /* Dashed border separates it from solid city cards */
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.steps li span {
  font-weight: 800;
  color: var(--deep); /* Or your accent orange color */
  background: var(--accent, #f97316);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  width: max-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn {
  text-align: center;
  text-decoration: none;
  background: var(--orange);
  color: var(--white);
  font-weight: 800;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  transition:
    transform 0.15s,
    background 0.15s,
    color 0.15s;
}
.btn:hover,
.btn:focus-visible {
  background: var(--white);
  color: var(--orange);
  transform: translateY(-2px);
  outline: none;
}

footer {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.75;
  flex-shrink: 0;
  padding-bottom: 0.2rem;
}
footer a {
  color: var(--orange);
  font-weight: 600;
}

/* Tablet */
@media (min-width: 861px) and (max-width: 1100px) {
  main {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

/* Phones and small tablets */
@media (max-width: 860px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }
  body {
    padding: max(0.4rem, env(safe-area-inset-top))
      max(0.6rem, env(safe-area-inset-right))
      max(0.6rem, env(safe-area-inset-bottom))
      max(0.6rem, env(safe-area-inset-left));
    gap: 0.4rem;
    justify-content: space-between;
  }
  h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }
  .top p {
    font-size: 0.85rem;
    margin-top: 0.1rem;
  }
  main {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  /* Make the map card taller vertically */
  .map-card {
    height: 70vh;
    flex-shrink: 0;
    border-radius: 14px;
    min-height: 340px;
  }

  .intro {
    display: none;
  }
  .side {
    justify-content: space-between;
    gap: 0.4rem;
    flex: 1;
    min-height: 0;
  }

  /* Horizontal scrolling row for mobile list */
  .list {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    margin-inline: 0;
    padding-bottom: 0.1rem;
    flex-shrink: 0;
  }
  .list::-webkit-scrollbar {
    display: none;
  }
  .list li {
    flex: none;
    scroll-snap-align: start;
  }
  .list button {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 9.5rem;
    height: 100%;
    min-height: 54px;
    padding: 0.5rem 0.65rem;
  }
  .list .d {
    min-width: 0;
    font-size: 0.85rem;
  }
  .list .p {
    font-size: 0.75rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .steps {
    gap: 0.3rem;
  }
  .steps li {
    padding: 0.35rem 0.45rem;
    font-size: 0.62rem;
  }
  .steps li span {
    display: inline;
    margin-right: 0.3rem;
  }
  .btn {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  footer {
    font-size: 0.75rem;
  }

  /* Dock the tip cleanly at the bottom of the map card */
  .tip {
    position: absolute;
    left: 0.5rem !important;
    right: 0.5rem !important;
    bottom: 0.5rem !important;
    top: auto !important;
    width: auto !important;
    z-index: 20;
    padding: 0.7rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
