:root {
  /* Color Palette - Modern Creative */
  --primary: #2D5A27; /* Forest Green */
  --primary-light: #4A8B42;
  --accent: #F27D26; /* Sunset Orange */
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #666666;
  --border: #E5E7EB;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
            0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

[data-theme="dark"] {
  --bg: #121212;
  --surface: #1E1E1E;
  --text: #F8F9FA;
  --text-muted: #A0A0A0;
  --border: #333333;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Layout Components */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a:hover { color: var(--primary); }

.theme-toggle {
  padding: 0.5rem;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Nav */
.mobile-menu-btn { display: none; font-size: 1.5rem; }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
}

/* Image Placeholders */
.img-ph {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  position: relative;
  min-height: 200px; /* global default */
}

.img-ph::after {
  content: "📷";
  font-size: 2rem;
  opacity: 0.3;
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem 0;
  }
  .hero-img { order: -1; }
}

/* ✅ HERO IMAGE (responsive on ALL screen sizes) */
.hero-img{
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 420px;
}

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

.hero-content h1 { font-size: 3.5rem; margin-bottom: 1.5rem; }

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s, background-color 0.2s;
}

.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-light); transform: translateY(-2px); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
  border: 1px solid var(--border);
}

.card:hover { transform: translateY(-5px); }

/* ✅ CARD IMAGE (responsive + fits inside card) */
.card-img{
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
}

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

.card-content { padding: 1.5rem; }

/* Calculator Styles */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 1024px) {
  .calc-container { grid-template-columns: 1fr; }
}

.calc-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.results-panel {
  position: sticky;
  top: 100px;
  container-type: inline-size;
  overflow: hidden;
}

.result-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}

.result-item.total {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  border-bottom: none;
  margin-top: 1rem;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Footer */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.checklist-item.checked span {
  text-decoration: line-through;
  opacity: 0.5;
}

@media (max-width: 768px) {
  section[style*="max-width: 1000px"] > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }
  .checklist-sidebar { order: -1; }
}

/* Seasonal Chips */
.season-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.season-chip {
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.season-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  text-align: center;
}

/* Stat Cards (kept as-is from your latest working version) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
  min-width: 0;
}

.stat-card {
  min-width: 0;
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
}

.stat-card.highlighted {
  grid-column: 1 / -1;
  border: 2px solid #2D5A27;
  background: #ffffff;
  padding: 2rem;
  align-items: center;
  text-align: center;
  min-height: 220px;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
}

.stat-card.highlighted .stat-label { margin-bottom: 1rem; }

.stat-card.highlighted .stat-value {
  color: #2D5A27;
  font-size: 2.75rem;
  line-height: 1;
}

@container (min-width: 720px) {
  .stat-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.25rem;
  }

  .stat-card.highlighted {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    min-height: 280px;
  }
}

/* Spending List */
.spending-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.spending-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 1rem;
}

.spending-label {
  font-size: 0.9rem;
  color: #4b5563;
  font-weight: 500;
}

.spending-bar-bg {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
}

.spending-bar-fill {
  height: 100%;
  background: #2D5A27;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.spending-pct {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
  color: #111827;
}

/* ✅ Prevent placeholder min-height from breaking hero/card sizing */
.hero-img .img-ph,
.card-img .img-ph{
  min-height: 0;
  height: 100%;
  border-radius: 0;
}

/* =========================
   FIX IMAGES (Hero + Cards)
   Works with:
   - .hero-img img (old pages)
   - .hero-media img (autumn page)
   - .card-img > img (direct)
   - .card-img .media > img (your new structure)
========================= */

/* Global safety */
img, picture, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Alias: hero-media behaves like hero-img */
.hero-media,
.hero-img {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 420px;
}

.hero-media img,
.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Media wrapper used in cards (autumn page) */
.media {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: var(--border);
}

/* Thumbnail ratio for cards */
.media--thumb {
  aspect-ratio: 16 / 9; /* change to 16/10 if you prefer */
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Card image container: support BOTH direct img and .media wrapper */
.card-img {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* if the image is directly inside .card-img */
.card-img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* if you use: .card-img > .media > img */
.card-img > .media {
  height: 100%;
  border-radius: 0;
}

/* prevent .img-ph min-height from breaking layouts anywhere */
.hero-media .img-ph,
.hero-img .img-ph,
.card-img .img-ph,
.media .img-ph {
  min-height: 0;
  height: 100%;
  border-radius: 0;
}

/* Autocomplete dropdown (Destination) */
.autocomplete-field {
  position: relative;
}

.suggest-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow: auto;
  z-index: 999;
  display: none;
}

.suggest-item {
  padding: 10px 12px;
  cursor: pointer;
}

.suggest-item:hover {
  background: var(--bg);
}

.suggest-empty {
  padding: 10px 12px;
  color: var(--text-muted);
}

