:root {
  color-scheme: light;
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #221f1d;
  --text-muted: #6f6862;
  --border: #e9e4df;
  --accent: #e4572e;
  --accent-dark: #c1461f;
  --danger: #b3392a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(40, 30, 20, 0.05), 0 20px 48px rgba(40, 30, 20, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 60vh;
  max-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("/hero.jpg");
  background-size: cover;
  background-position: center 65%;
  padding: 6rem 1.5rem 9rem;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 13, 10, 0.5) 0%,
    rgba(18, 13, 10, 0.18) 42%,
    rgba(18, 13, 10, 0.7) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  text-align: center;
  color: #fff;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(1.9rem, 1.1rem + 3vw, 3.15rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 0.85rem + 0.6vw, 1.2rem);
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
}

/* ---------- Layout ---------- */

main {
  max-width: 920px;
  margin: -72px auto 0;
  padding: 0 1.5rem 5rem;
  position: relative;
  z-index: 2;
}

/* ---------- Search form ---------- */

.search-form {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

input {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}

input:focus {
  outline: 2px solid var(--text);
  outline-offset: 1px;
  background: var(--surface);
}

#origin {
  text-transform: uppercase;
}

/* The single, unmistakable call to action on the page. */
button {
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1.05rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(228, 87, 46, 0.28);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: 0.5rem;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(228, 87, 46, 0.34);
}

button:disabled {
  background: #d8d2cb;
  color: #8a837c;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ---------- Status ---------- */

.status {
  margin-top: 2rem;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
}

.status[hidden] {
  display: none;
}

.status.error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}

.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Results ---------- */

.results {
  margin-top: 3.5rem;
}

.results h2 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.map-wrapper {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-wrapper[hidden] {
  display: none;
}

.results-map {
  height: 380px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  color: #fff;
  flex-shrink: 0;
}

.legend-accommodation {
  background: #2a81cb;
}

.legend-experience {
  background: #0d9488;
}

/* Leaflet default marker for accommodation; this custom divIcon marks
   experiences instead, so the two pin types read as visually distinct
   without needing to click either one. */
.experience-marker-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0d9488;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.popup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 200px;
  height: 90px;
  background: #0d9488;
  color: #fff;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .field-row {
    flex-direction: row;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.package-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;

  /* Subtle scroll-reveal: fades/slides in as each card enters the
     viewport (see app.js). Disabled entirely under reduced motion. */
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.package-card.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .package-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.package-card.cheapest::before {
  content: "Cheapest";
  position: absolute;
  top: -0.65rem;
  right: 1.1rem;
  background: var(--text);
  color: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.package-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.trip-length {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.package-dates {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.price-lines {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.price-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.25rem;
}

.addon-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.addon-toggle input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--text);
}

.extras {
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.extras h4 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.extras-subtotal {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.extras-subtotal[hidden] {
  display: none;
}

.package-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.package-links a {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.package-links a:hover {
  border-color: var(--text);
  background: var(--bg);
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 1rem;
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 3rem 1.5rem 2.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}
