/* ==========================================
   Camino de Santiago 2026 — Shared Styles
   ========================================== */

:root {
  --gold:        #C8920A;
  --gold-light:  #F0C94A;
  --green:       #1A5276;
  --green-light: #5DADE2;
  --terra:       #C0533A;
  --bg:          #F0F4F8;
  --bg-card:     #FFFFFF;
  --text:        #2C2C2C;
  --text-muted:  #6B6B6B;
  --border:      #E0DAD0;
  --shadow:      0 2px 8px rgba(0,0,0,0.08);
  --radius:      10px;
  --nav-h:       56px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--green);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.nav-brand {
  font-weight: 700;
  color: var(--gold-light);
  font-size: 1.05rem;
  margin-right: auto;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav-brand span { font-size: 1.2em; }
.nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover,
.nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ---- Hero (used on index) ---- */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, #143d5e 60%, #0c2a45 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
}
.hero-badge {
  display: inline-block;
  background: var(--gold-light);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.8;
  margin-bottom: 2rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.stat {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  min-width: 90px;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-light);
  display: block;
}
.stat-label {
  font-size: 0.75rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Page layout ---- */
.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* ---- Destination cards (index) ---- */
.dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.dest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.dest-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.dest-card .dest-emoji { font-size: 2rem; display: block; margin-bottom: 0.4rem; }
.dest-card .dest-name { font-weight: 700; font-size: 0.95rem; }
.dest-card .dest-dates { font-size: 0.8rem; color: var(--text-muted); }
.dest-card.type-camino { border-left: 3px solid var(--green-light); }
.dest-card.type-destination { border-left: 3px solid var(--gold); }
.dest-card.type-city { border-left: 3px solid var(--terra); }

/* ---- Type badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-flight    { background: #EBF4FD; color: #1A6BAF; }
.badge-walk      { background: #EDF7EF; color: #1E7A38; }
.badge-chill     { background: #FDF5E6; color: #A0660A; }
.badge-tbd       { background: #F3F3F3; color: #888; border: 1px dashed #ccc; }

/* ---- Filter tabs ---- */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  color: var(--text-muted);
}
.filter-btn:hover { border-color: var(--green); color: var(--green); }
.filter-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ---- Day cards (itinerary) ---- */
.day-list { display: flex; flex-direction: column; gap: 0.75rem; }
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0 1rem;
  align-items: start;
}
.day-card.type-tbd {
  opacity: 0.65;
  border-style: dashed;
}
.day-card.type-walk { border-left: 3px solid var(--green-light); }
.day-card.type-flight { border-left: 3px solid #1A6BAF; }
.day-card.type-chill { border-left: 3px solid var(--gold); }
.day-card.type-tbd { border-left: 3px solid #ccc; }

.day-num {
  text-align: center;
  border-right: 1px solid var(--border);
  padding-right: 1rem;
}
.day-num .num { font-size: 1.4rem; font-weight: 800; color: var(--green); line-height: 1; }
.day-num .weekday { font-size: 0.68rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }
.day-num .date { font-size: 0.75rem; color: var(--text-muted); }

.day-body {}
.day-route { font-weight: 700; font-size: 1rem; margin-bottom: 0.3rem; }
.day-notes { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.day-accommodation { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ---- Activities table (3-column: activity / effort / notes) ---- */
.activities-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.82rem;
}
.activities-table thead th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.6rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.activities-table tbody td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}
.activities-table tbody tr:last-child td { border-bottom: none; }
.act-activity { font-weight: 600; color: var(--text) !important; width: 40%; }
.act-effort   { white-space: nowrap; width: 18%; }
.act-notes    { width: 42%; }
.map-btn {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green);
  background: var(--bg);
  border: 1px solid var(--green-light);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.map-btn:hover { background: var(--green); color: #fff; text-decoration: none; }
.day-accommodation::before { content: "🏠 "; }

.day-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.day-distance { font-size: 0.9rem; font-weight: 700; color: var(--green); }

/* ---- Budget table ---- */
.budget-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.budget-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.budget-stat .value { font-size: 1.4rem; font-weight: 800; color: var(--green); }
.budget-stat .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.budget-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.budget-table th {
  background: var(--green);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.7rem 1rem;
  text-align: left;
}
.budget-table th:not(:first-child) { text-align: right; }
.budget-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: top;
}
.budget-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.budget-table tr:last-child td { border-bottom: none; }
.budget-table .total-row td {
  font-weight: 800;
  background: #F5F2EC;
  font-size: 0.95rem;
}
.budget-table .cat-icon { margin-right: 0.4rem; }
.budget-table .cat-notes { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

.progress-bar-wrap { margin-top: 0.4rem; background: #EEE; border-radius: 4px; height: 5px; width: 120px; margin-left: auto; }
.progress-bar-fill { height: 100%; border-radius: 4px; background: var(--green-light); }
.progress-bar-fill.over { background: var(--terra); }

/* ---- Map page ---- */
.map-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  height: calc(100vh - var(--nav-h));
}
#map { flex: 1; min-height: 400px; }
.map-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem;
}
.map-sidebar h2 { font-size: 1rem; font-weight: 700; color: var(--green); margin-bottom: 1rem; }
.stop-list { list-style: none; }
.stop-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 6px;
  padding-left: 0.4rem;
}
.stop-item:hover { background: var(--bg); }
.stop-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.stop-dot.type-city { background: var(--terra); }
.stop-dot.type-camino { background: var(--green-light); }
.stop-dot.type-destination { background: var(--gold); }
.stop-dot.type-transit { background: #AAA; }
.stop-info .stop-name { font-weight: 600; font-size: 0.88rem; }
.stop-info .stop-dates { font-size: 0.75rem; color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .nav-brand { font-size: 0.9rem; }
  .nav a { padding: 0.3rem 0.5rem; font-size: 0.82rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .day-card { grid-template-columns: 48px 1fr; }
  .day-meta { display: none; }
  .map-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .map-sidebar { max-height: 200px; }
  .budget-table th:nth-child(3),
  .budget-table td:nth-child(3) { display: none; }
}
