/* GoVermont - Custom Styles */

/* ===== Seasonal CSS Variables ===== */
:root {
  /* Default: Winter */
  --hero-from: #1a365d;
  --hero-via: #2d6a2d;
  --hero-to: #153815;
  --season-accent: #90cdf4;
}

.season-winter {
  --hero-from: #1a365d;
  --hero-via: #2b4c7e;
  --hero-to: #1e3a5f;
  --season-accent: #90cdf4;
}

.season-spring {
  --hero-from: #7d3312;
  --hero-via: #c4570d;
  --hero-to: #2d6a2d;
  --season-accent: #f4b56b;
}

.season-summer {
  --hero-from: #153815;
  --hero-via: #2d6a2d;
  --hero-to: #1a365d;
  --season-accent: #6db56d;
}

.season-fall {
  --hero-from: #7d3312;
  --hero-via: #c4570d;
  --hero-to: #672c12;
  --season-accent: #ef8e2e;
}

/* ===== Navbar ===== */
#navbar {
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

#navbar.scrolled {
  background: rgba(13, 37, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

#navbar.scrolled .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

#navbar.scrolled .nav-link:hover {
  color: white;
}

/* ===== Hero Gradient ===== */
.hero-gradient {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-via), var(--hero-to));
  transition: background 1s ease;
}

/* ===== Typography ===== */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ===== Season Cards ===== */
.season-card {
  background: white;
  border: 2px solid transparent;
}

.season-card.active {
  border-color: var(--season-accent);
  background: linear-gradient(135deg, rgba(45, 106, 45, 0.05), rgba(244, 181, 107, 0.05));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ===== Region Cards ===== */
.region-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.region-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.region-card.highlight {
  border-color: var(--season-accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 45, 0.15);
}

/* ===== Region Dot ===== */
.region-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Chamber Links ===== */
.chamber-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #2d6a2d;
  background: #f0f7f0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.chamber-link:hover {
  background: #d4e8d4;
  color: #153815;
  transform: translateX(2px);
}

.chamber-link::before {
  content: '\2192';
  margin-right: 8px;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ===== Fact Cards ===== */
.fact-card {
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

/* ===== Map ===== */
#map {
  z-index: 1;
}

.leaflet-container {
  background: #e8f0e8;
  font-family: 'Inter', sans-serif;
}

.county-tooltip {
  background: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  max-width: 300px;
}

.leaflet-tooltip.county-tooltip-wrapper {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: none;
}

.county-tooltip .county-name {
  font-weight: 600;
  font-size: 14px;
  color: #153815;
  margin-bottom: 2px;
}

.county-tooltip .county-region {
  color: #6c757d;
  font-size: 12px;
  margin-bottom: 4px;
}

.county-tooltip .county-highlight {
  color: #495057;
  font-size: 12px;
}

.county-tooltip::before {
  border: none;
}

/* Leaflet tooltip arrow override */
.leaflet-tooltip-top::before,
.leaflet-tooltip-bottom::before,
.leaflet-tooltip-left::before,
.leaflet-tooltip-right::before {
  border-top-color: white;
}

/* ===== Map Info Bar ===== */
#map-info {
  transition: opacity 0.3s ease;
}

/* ===== Smooth Scroll ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Mobile Menu ===== */
#mobile-menu {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

#mobile-menu.open {
  display: block;
  max-height: 300px;
  opacity: 1;
}

.mobile-nav-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Responsive ===== */

/* Tablets (iPad portrait & landscape) */
@media (min-width: 768px) and (max-width: 1024px) {
  #map {
    height: 480px !important;
  }

  .region-card .md\:w-72 {
    width: 14rem;
  }
}

/* Phones landscape & small tablets */
@media (max-width: 768px) {
  #hero .relative.z-10 {
    padding-top: 5rem;
    padding-bottom: 3rem;
  }

  #map {
    height: 400px !important;
  }

  .region-card {
    padding: 1.25rem;
  }

  .chamber-link {
    font-size: 0.85rem;
    padding: 10px 12px;
    min-height: 44px;
  }

  /* Stack region cards fully on mobile */
  .region-card .flex.flex-col.md\:flex-row {
    flex-direction: column;
  }

  .region-card .md\:w-72 {
    width: 100%;
  }

  /* Fact cards: ensure text fits */
  .fact-card .text-2xl {
    font-size: 1.1rem;
  }
}

/* Small phones (iPhone SE, etc.) */
@media (max-width: 480px) {
  #hero h1 {
    font-size: 2.5rem;
  }

  #hero .text-lg {
    font-size: 0.9rem;
  }

  #map {
    height: 300px !important;
    border-radius: 12px !important;
  }

  .season-card {
    padding: 0.75rem;
  }

  .season-card .text-3xl {
    font-size: 1.5rem;
  }

  .season-card .text-xs {
    font-size: 0.65rem;
  }

  /* Eat Vermont food icons smaller on tiny screens */
  #eat-vermont .grid .text-2xl {
    font-size: 1.5rem;
  }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
  #navbar {
    padding-top: env(safe-area-inset-top);
  }
}

/* Prevent horizontal overflow on any screen */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.region-card {
  animation: fadeInUp 0.4s ease forwards;
}

.region-card:nth-child(2) { animation-delay: 0.05s; }
.region-card:nth-child(3) { animation-delay: 0.1s; }
.region-card:nth-child(4) { animation-delay: 0.15s; }
.region-card:nth-child(5) { animation-delay: 0.2s; }
.region-card:nth-child(6) { animation-delay: 0.25s; }
.region-card:nth-child(7) { animation-delay: 0.3s; }

/* ===== Back to Top Button ===== */
#back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  transform: translateY(-2px);
}

/* ===== Map Legend ===== */
.map-legend span.flex {
  font-size: 0.85rem;
}

/* ===== Southern Toggle ===== */
#southern-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ===== Events Page ===== */

/* Filter Bar */
.events-filter-bar {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.events-search-input,
.events-select {
  min-height: 44px;
  font-size: 16px; /* prevents iOS zoom on focus */
}

.events-select {
  min-width: 150px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Event Cards */
.event-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.event-date-badge {
  width: 64px;
  min-width: 64px;
  text-align: center;
  padding: 8px 4px;
  background: #f0f7f0;
  border-radius: 10px;
  flex-shrink: 0;
}

.event-date-badge .month {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2d6a2d;
}

.event-date-badge .day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #153815;
}

.event-date-badge .weekday {
  font-size: 0.65rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.event-card.past {
  opacity: 0.6;
}

.event-card.past .event-date-badge {
  background: #f8f9fa;
}

.event-card.past .event-date-badge .month,
.event-card.past .event-date-badge .day {
  color: #6c757d;
}

/* Category Badges */
.category-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.category-badge.music     { background: #fef3c7; color: #92400e; }
.category-badge.food      { background: #fdecd5; color: #9e3f0d; }
.category-badge.outdoors  { background: #d4e8d4; color: #1e4d1e; }
.category-badge.arts      { background: #ede9fe; color: #5b21b6; }
.category-badge.markets   { background: #dbeafe; color: #1e40af; }
.category-badge.festivals { background: #fce7f3; color: #9d174d; }
.category-badge.holiday   { background: #fee2e2; color: #991b1b; }
.category-badge.other     { background: #f3f4f6; color: #374151; }

/* Event Link */
.event-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2d6a2d;
  text-decoration: none;
  transition: color 0.2s ease;
}

.event-link:hover {
  color: #153815;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.event-skeleton .bg-slate-100 {
  background: linear-gradient(90deg, #f1f5f9 25%, #e8ecf0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

/* ===== Events Responsive ===== */
@media (max-width: 768px) {
  .event-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .event-date-badge {
    width: 52px;
    min-width: 52px;
    padding: 6px 2px;
  }

  .event-date-badge .day {
    font-size: 1.25rem;
  }

  .events-filter-bar .flex-col {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .event-date-badge {
    width: 48px;
    min-width: 48px;
  }

  .event-date-badge .day {
    font-size: 1.1rem;
  }
}
