/* ===== CUSTOM PROPERTIES ===== */
:root {
  --navy:          #0f2942;
  --navy-dark:     #091d31;
  --navy-light:    #1a3a5c;
  --white:         #ffffff;
  --gray-50:       #f8fafc;
  --gray-100:      #f1f5f9;
  --gray-200:      #e2e8f0;
  --gray-400:      #94a3b8;
  --gray-500:      #64748b;
  --gray-700:      #334155;
  --gray-900:      #0f172a;
  --score-go:      #22c55e;
  --score-caution: #eab308;
  --score-no-go:   #ef4444;
  --radius:        12px;
  --shadow-sm:     0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md:     0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== BASE ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--navy);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 30px;
  width: auto;
}

.header-wordmark {
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

/* ===== PAGE HERO ===== */
.page-hero {
  padding: 32px 0 20px;
}

.page-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--gray-500);
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}

.select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--navy);
  pointer-events: none;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 36px 8px 14px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  min-width: 160px;
  font-family: inherit;
}

.filter-select:hover {
  border-color: var(--navy-light);
  color: var(--navy);
}

.filter-select:focus {
  outline: none;
  border-color: var(--navy);
  color: var(--navy);
}

.filter-select option {
  font-weight: 500;
}

/* ===== SITE GRID — mobile-first ===== */
.site-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 80px;
}

@media (min-width: 640px) {
  .site-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ===== SITE CARD ===== */
.site-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.site-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Card header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.card-title {
  min-width: 0;
}

.site-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-location {
  font-size: 0.78rem;
  color: var(--gray-500);
}

/* Score badge */
.score-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
}

.score-number {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.score-denom {
  font-size: 0.6rem;
  font-weight: 500;
  opacity: 0.85;
}

/* Card stats grid */
.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  font-weight: 700;
}

.stat-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* Card footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.divability-label {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.updated-time {
  font-size: 0.72rem;
  color: var(--gray-400);
}

/* ===== ERROR CARD ===== */
.site-card--error {
  background: var(--gray-100);
  opacity: 0.7;
}

.site-card--error .site-name {
  color: var(--gray-700);
}

.error-message {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-top: 8px;
}

/* ===== SKELETON CARDS ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.site-card--skeleton {
  pointer-events: none;
}

.skeleton-line {
  background: var(--gray-200);
  border-radius: 4px;
  animation: pulse 1.6s ease-in-out infinite;
}

.skeleton-name {
  height: 17px;
  width: 58%;
  margin-bottom: 7px;
}

.skeleton-location {
  height: 12px;
  width: 38%;
}

.skeleton-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gray-200);
  animation: pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

.skeleton-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 16px;
}

.skeleton-stat {
  height: 38px;
  background: var(--gray-200);
  border-radius: 4px;
  animation: pulse 1.6s ease-in-out infinite;
}

.skeleton-footer-label {
  height: 14px;
  width: 45%;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy-dark);
  color: var(--gray-400);
  padding: 18px 0;
  font-size: 0.8rem;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 -2px 12px rgb(0 0 0 / 0.35);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#last-updated {
  color: var(--white);
  font-weight: 600;
}

.footer-attribution {
  opacity: 0.8;
}

/* ===== SITE DETAIL — HEADER ADDITIONS ===== */
.header-back-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.header-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header-icons {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.header-icon-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== SITE DETAIL — PAGE HEADER ===== */
.site-page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.site-page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 12px;
}

.site-page-meta {
  min-width: 0;
  flex: 1;
}

.site-page-breadcrumb {
  font-size: 0.7rem;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.site-page-name {
  font-size: clamp(1.3rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 3px;
}

.site-page-location {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.site-page-score {
  flex-shrink: 0;
}

.site-page-score .score-badge {
  width: 56px;
  height: 56px;
}

.site-page-score .score-number {
  font-size: 1.3rem;
}

/* ===== SITE DETAIL — TABS ===== */
.site-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 6px;
  padding-bottom: 12px;
}

.site-tabs::-webkit-scrollbar {
  display: none;
}

.site-tab {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: inherit;
}

.site-tab:hover {
  color: var(--navy);
  border-color: var(--navy-light);
}

.site-tab.active {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

/* ===== SITE DETAIL — TAB CONTENT ===== */
.tab-content {
  padding: 28px 0 100px;
  min-height: 300px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* ===== SITE DETAIL — OVERVIEW TAB ===== */
.overview-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overview-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.overview-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.overview-card-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.overview-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
}

.overview-best-months-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.overview-ideal-conditions {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* Hazards */
.hazards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hazard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.hazard-bullet {
  color: var(--gray-400);
  flex-shrink: 0;
}

.hazard-name {
  flex: 1;
}

.hazard-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}

.hazard-badge--high {
  background: #fef2f2;
  color: #ef4444;
}

.hazard-badge--moderate {
  background: #fefce8;
  color: #ca8a04;
}

.hazard-badge--mild {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* Highlights */
.highlights-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.highlights-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 14px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.highlight-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px 16px;
}

.highlight-card-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 8px;
}

.highlight-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.highlight-card-desc {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ===== SITE DETAIL — MARINE LIFE TAB ===== */
.ml-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ml-filter-btn {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
}

.ml-filter-btn:hover {
  border-color: var(--navy-light);
  color: var(--navy);
}

.ml-filter-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Grid */
.ml-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .ml-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* Card */
.ml-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ml-card--hidden {
  display: none;
}

.ml-card-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}

.ml-card-summary:hover {
  background: var(--gray-50);
}

.ml-card-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.ml-card-summary-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ml-card-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* Frequency badges */
.ml-freq {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 100px;
  width: fit-content;
}

.ml-freq--common {
  background: #f0fdf4;
  color: #16a34a;
}

.ml-freq--notable {
  background: #eff6ff;
  color: #2563eb;
}

.ml-freq--rare {
  background: #faf5ff;
  color: #7c3aed;
}

/* Chevron expand indicator */
.ml-card-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gray-400);
  border-bottom: 2px solid var(--gray-400);
  transform: rotate(-45deg);
  flex-shrink: 0;
  transition: transform 0.25s ease;
  margin-right: 4px;
}

.ml-card.is-expanded .ml-card-chevron {
  transform: rotate(45deg);
}

/* Expand / collapse detail */
.ml-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.ml-card.is-expanded .ml-card-detail {
  max-height: 900px;
}

.ml-card-detail-inner {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Detail rows */
.ml-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
}

.ml-detail-icon {
  font-size: 0.9rem;
  line-height: 1.55;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.ml-detail-label {
  font-weight: 600;
  color: var(--gray-700);
}

.ml-detail-value {
  color: var(--gray-500);
}

.ml-detail-notes {
  font-size: 0.84rem;
  color: var(--gray-500);
  font-style: italic;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  border-left: 3px solid var(--gray-200);
  line-height: 1.5;
  margin: 2px 0;
}

/* Tips */
.ml-detail-tips {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 2px;
}

.ml-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 5px;
}

.ml-tips-list li {
  font-size: 0.84rem;
  color: var(--gray-500);
  padding-left: 14px;
  position: relative;
  line-height: 1.45;
}

.ml-tips-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--gray-400);
}

.ml-detail-label.ml-tips-label {
  font-size: 0.84rem;
}

.ml-empty {
  color: var(--gray-500);
  font-size: 0.9rem;
  padding: 24px 0;
}

/* ===== SITE DETAIL — FORECAST TAB ===== */
.forecast-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.forecast-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: 14px;
}

/* Chart */
.forecast-chart-wrapper {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
}

.forecast-chart-container {
  height: 300px;
  position: relative;
}

/* Cards section */
.forecast-cards-section {
  /* wrapper — title + scroll strip */
}

.forecast-cards-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.forecast-cards-scroll::-webkit-scrollbar {
  display: none;
}

/* Day card */
.forecast-day-card {
  min-width: 196px;
  flex-shrink: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.forecast-day-card--today {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(15, 41, 66, 0.18), var(--shadow-sm);
}

.forecast-day-header {
  padding: 12px 14px 11px;
  color: var(--white);
  position: relative;
}

.forecast-today-star {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.85rem;
  line-height: 1;
}

.forecast-day-date {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.88;
  margin-bottom: 4px;
}

.forecast-day-score {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.forecast-day-body {
  padding: 11px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.forecast-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.forecast-stat {
  font-size: 0.8rem;
  color: var(--gray-700);
  white-space: nowrap;
}

.forecast-sun-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.73rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-100);
  padding-top: 8px;
  margin-top: 2px;
}

.forecast-unavailable {
  color: var(--gray-500);
  font-size: 0.9rem;
  padding: 40px 0;
  text-align: center;
}

/* Desktop: switch to grid layout */
@media (min-width: 640px) {
  .forecast-cards-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    overflow-x: visible;
    padding-bottom: 0;
  }

  .forecast-day-card {
    min-width: 0;
  }
}

/* ===== SITE DETAIL — SEASONAL TAB ===== */
.seasonal-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.seasonal-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: 14px;
}

/* Heatmap card */
.seasonal-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.seasonal-heatmap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}

.heatmap-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: filter 0.15s, border-color 0.15s, transform 0.1s;
  font-family: inherit;
  gap: 4px;
  padding: 4px 2px;
}

.heatmap-cell:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.heatmap-cell.is-active {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.15);
}

.heatmap-cell--peak        { background: #dcfce7; }
.heatmap-cell--good        { background: #fef9c3; }
.heatmap-cell--challenging { background: #fee2e2; }

.heatmap-cell-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gray-700);
  line-height: 1;
}

/* Legend */
.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 0;
}

.heatmap-leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600, var(--gray-700));
}

.heatmap-leg::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.heatmap-leg--peak::before        { background: #22c55e; }
.heatmap-leg--good::before        { background: #eab308; }
.heatmap-leg--challenging::before { background: #ef4444; }

/* Month detail panel */
.heatmap-detail {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.heatmap-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.heatmap-detail-month {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gray-900);
}

.heatmap-detail-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 9px;
  border-radius: 100px;
}

.heatmap-detail-badge--peak        { background: #dcfce7; color: #16a34a; }
.heatmap-detail-badge--good        { background: #fef9c3; color: #ca8a04; }
.heatmap-detail-badge--challenging { background: #fee2e2; color: #dc2626; }

.heatmap-detail-pct {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.heatmap-detail-season {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.heatmap-detail-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.heatmap-detail-items li {
  font-size: 0.82rem;
  color: var(--gray-600, var(--gray-700));
}

.hdt-label {
  font-weight: 600;
  color: var(--gray-700);
}

/* Season breakdown cards */
.season-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

.season-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.season-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.season-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.season-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.season-card-months {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
}

.season-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.season-row {
  display: flex;
  gap: 6px;
  font-size: 0.82rem;
}

.season-row-label {
  font-weight: 700;
  color: var(--gray-700);
  white-space: nowrap;
  min-width: 68px;
}

.season-row-value {
  color: var(--gray-500);
}

/* Monsoon note */
.monsoon-note {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 4px solid #94a3b8;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.monsoon-note-icon {
  font-size: 1.25rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.monsoon-note-text {
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.6;
}

/* ===== HAMBURGER NAV ===== */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-right: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
}

.nav-backdrop.is-open {
  display: block;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background: var(--white);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
}

.nav-drawer.is-open {
  transform: translateX(0);
}

.nav-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--gray-500);
  padding: 16px 16px 8px;
  align-self: flex-end;
  line-height: 1;
  border-radius: 8px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.nav-close-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-list {
  list-style: none;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.nav-item:hover:not(.nav-item--disabled) {
  background: var(--gray-100);
  color: var(--navy);
}

.nav-item.is-active {
  background: var(--navy);
  color: var(--white);
}

.nav-item--disabled {
  color: var(--gray-400);
  cursor: default;
}

.nav-coming-soon {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--gray-100);
  color: var(--gray-400);
  margin-left: auto;
}

/* ===== MARINE LIFE PAGE ===== */
.marine-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}

.marine-filter-btn {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 100px;
  padding: 7px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
}

.marine-filter-btn:hover {
  border-color: var(--navy-light);
  color: var(--navy);
}

.marine-filter-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.marine-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 80px;
}

@media (min-width: 640px) {
  .marine-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.marine-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.marine-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.marine-card--hidden {
  display: none;
}

.marine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.marine-card-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.marine-card-emoji {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.marine-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marine-tier-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 100px;
  flex-shrink: 0;
}

.marine-tier-badge--common  { background: #f0fdf4; color: #16a34a; }
.marine-tier-badge--notable { background: #eff6ff; color: #2563eb; }
.marine-tier-badge--rare    { background: #faf5ff; color: #7c3aed; }

.marine-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 12px;
}

.marine-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.marine-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
}

.marine-stat-value {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gray-700);
}

.marine-card-habitat {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.marine-card-note {
  font-size: 0.82rem;
  color: var(--gray-600, var(--gray-500));
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.marine-card-found-at {
  border-top: 1px solid var(--gray-100);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.found-at-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}

.found-at-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--gray-100);
  color: var(--navy);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.site-chip:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ===== SITE DETAIL — DETAILS TAB ===== */
.details-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.details-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: 14px;
}

.details-empty {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Quick stats grid */
.detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 560px) {
  .detail-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.detail-stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.detail-stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-stat-icon {
  font-size: 1rem;
  line-height: 1;
}

.detail-stat-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
}

.detail-stat-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-stat-value {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Depth card */
.detail-depth-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.detail-depth-item {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.detail-depth-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-right: 2px;
}

.detail-depth-sep {
  color: var(--gray-300);
  font-weight: 300;
}

/* Difficulty card */
.detail-stars {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.detail-star {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gray-200);
  flex-shrink: 0;
}

.detail-star--filled {
  background: var(--navy);
}

.detail-diff-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-left: 2px;
}

.detail-note {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* Access card */
.detail-access-row {
  font-size: 0.875rem;
  color: var(--gray-700);
  font-weight: 500;
  line-height: 1.6;
}

/* Current card */
.detail-current-label {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
}

/* Pro tips */
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--navy-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.tip-item:last-child {
  border-bottom: none;
}

.tip-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  position: relative;
}

.tip-check::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg) translate(-1px, -1px);
}

.tip-text {
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.55;
}

/* Notable features */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.feature-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.feature-desc {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ===== MARINE LIFE DETAIL PAGE ===== */
.marine-hero {
  position: relative;
  height: 300px;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-light) 60%, #1a5276 100%);
  overflow: hidden;
}

.marine-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.25) 55%, rgba(0, 0, 0, 0.1) 100%);
}

.marine-hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}

.marine-hero-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.species-site-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.species-site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.species-site-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.species-site-location {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.species-site-tier {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 100px;
  flex-shrink: 0;
}

.species-site-tier--common  { background: #f0fdf4; color: #16a34a; }
.species-site-tier--notable { background: #eff6ff; color: #2563eb; }
.species-site-tier--rare    { background: #faf5ff; color: #7c3aed; }

.species-site-footer {
  border-top: 1px solid var(--gray-100);
  padding-top: 12px;
}

.species-site-link {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}

.species-site-link:hover {
  text-decoration: underline;
}

/* ===== SITE DETAIL — LOCATION CARD ===== */
.location-map {
  width: 100%;
  height: 180px;
  border: none;
  display: block;
  border-radius: 8px;
  margin-bottom: 10px;
}

.location-actions {
  display: flex;
  gap: 10px;
}

.location-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s;
  font-family: inherit;
}

.location-btn:hover {
  opacity: 0.85;
}

.location-btn--maps {
  background: var(--navy);
  color: var(--white);
}

.location-btn--photos {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ===== HEADER NAV ===== */
.header-nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
  align-items: center;
}

.header-nav-link {
  color: var(--white);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.72;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.header-nav-link:hover {
  opacity: 1;
}

.header-nav-link--active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 479px) {
  .header-nav {
    display: none;
  }
}

/* ===== CALENDAR PAGE ===== */
.month-strip-wrapper {
  padding-bottom: 4px;
}

.month-strip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.month-strip::-webkit-scrollbar {
  display: none;
}

.month-pill-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.month-pill {
  padding: 7px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: inherit;
  line-height: 1;
}

.month-pill:hover {
  color: var(--navy);
  border-color: var(--navy-light);
}

.month-pill--active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.month-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.month-strip-divider {
  width: 1px;
  height: 32px;
  background: var(--gray-200);
  flex-shrink: 0;
  margin: 0 2px;
}

/* Calendar legend */
.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0 28px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-dot--peak    { background: #22c55e; }
.legend-dot--caution { background: #eab308; }
.legend-dot--avoid   { background: #ef4444; }

/* Override the 80px footer-clearance padding that .site-grid adds on the dashboard.
   Calendar has multiple sections; only #cal-grid needs the clearance. */
.cal-region .site-grid {
  padding-bottom: 16px;
}

#cal-grid {
  padding-bottom: 80px;
}

/* Calendar region section */
.cal-region {
  margin-bottom: 40px;
}

.cal-region-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-200);
}

/* Calendar card */
.cal-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.cal-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cal-card-stripe {
  height: 5px;
}

.cal-card-body {
  padding: 16px 20px;
}

.cal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.cal-card-title {
  min-width: 0;
}

.cal-site-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-site-location {
  font-size: 0.78rem;
  color: var(--gray-500);
}

.cal-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 100px;
  flex-shrink: 0;
}

.cal-card-footer {
  display: flex;
  align-items: center;
}

.cal-region-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 3px 9px;
  border-radius: 100px;
}

/* ===== ACTIVITY FILTER BAR ===== */
.activity-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}

.activity-tab {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
}

.activity-tab:hover {
  border-color: var(--navy-light);
  color: var(--navy);
}

.activity-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ===== ACTIVITY TAG PILLS ===== */
.activity-tags { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.activity-tag { font-size: 0.7rem; font-weight: 600; padding: 3px 8px;
  border-radius: 100px; border: 1px solid; }
.activity-tag--scuba      { color: #1e40af; border-color: #bfdbfe; background: #eff6ff; }
.activity-tag--freediving { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.activity-tag--snorkeling { color: #92400e; border-color: #fde68a; background: #fffbeb; }
