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

/* === Theme Variables === */
:root,
[data-theme="light"] {
  --color-bg: #faf9f7;
  --color-bg-secondary: #f0eeea;
  --color-surface: #ffffff;
  --color-surface-hover: #f5f3ef;
  --color-text: #2c2c2c;
  --color-text-secondary: #5a5a5a;
  --color-text-muted: #8a8a8a;
  --color-accent: #5e6f57;
  --color-accent-hover: #4d5c48;
  --color-accent-light: #e8ede6;
  --color-border: #e0ddd8;
  --color-border-light: #eceae6;
  --color-emergency: #c44;
  --color-emergency-bg: #fdf0f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --color-bg: #1a1d21;
  --color-bg-secondary: #22262b;
  --color-surface: #2a2e34;
  --color-surface-hover: #32373e;
  --color-text: #e4e2de;
  --color-text-secondary: #b0ada6;
  --color-text-muted: #7a7772;
  --color-accent: #8fa888;
  --color-accent-hover: #a3b99d;
  --color-accent-light: #2d3530;
  --color-border: #3a3e44;
  --color-border-light: #32363c;
  --color-emergency: #e77;
  --color-emergency-bg: #3a2222;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* === Typography === */
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition:
    background-color 0.3s,
    color 0.3s;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.35rem;
}
h3 {
  font-size: 1.1rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--color-accent-hover);
}

/* === Layout === */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main.container {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  min-height: calc(100vh - 200px);
}

/* === Header === */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 720px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}
.site-logo:hover {
  color: var(--color-accent);
}

.logo-icon {
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition:
    background-color 0.2s,
    color 0.2s;
}
.nav-link:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}
.nav-link.active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* === Dropdown Navigation === */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-arrow {
  transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.625rem 0.375rem 0.375rem;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
  flex-direction: column;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition:
    background-color 0.15s,
    color 0.15s;
}

.nav-dropdown-item:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

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

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === Language Switcher === */
.lang-switcher {
  display: flex;
  gap: 0.125rem;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  padding: 0.125rem;
}

.lang-link {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--color-text-muted);
  transition:
    background-color 0.2s,
    color 0.2s;
}
.lang-link:hover {
  color: var(--color-text);
}
.lang-link.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* === Theme Toggle === */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.theme-toggle:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

[data-theme="light"] .icon-moon {
  display: none;
}
[data-theme="dark"] .icon-sun {
  display: none;
}

/* === Mobile Menu Toggle === */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
}

/* === Nav Cards (Home) === */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.nav-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  color: var(--color-text);
}

.nav-card-icon {
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.nav-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* === Card Grid (Section Lists) === */
.section-header {
  padding: 2rem 0 1rem;
}

.section-subtitle {
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.card-grid {
  display: grid;
  gap: 0.75rem;
}

.content-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
.content-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.content-card h2 {
  font-size: 1rem;
  font-weight: 500;
}

.content-card p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 0.125rem;
}

/* === Content Pages === */
.content-page {
  padding-top: 1rem;
}

.content-header {
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.back-link:hover {
  color: var(--color-accent);
}

.content-subtitle {
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.hero-image {
  margin: 0 calc(-1 * var(--spacing-md, 1rem)) 1.5rem;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  object-fit: cover;
}

/* Guide location card */
.guide-location-card {
  margin: 0 0 1.5rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}

.guide-location-map {
  width: 100%;
  height: 180px;
}

.guide-location-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.guide-location-distance {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-secondary, #666);
}

.guide-directions-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-accent, #5e6f57);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.guide-directions-link:hover {
  text-decoration: underline;
}

.guide-location-pin {
  background: none !important;
  border: none !important;
}

.content-body h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-border-light);
}

.content-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}

.content-body p {
  margin-bottom: 1rem;
}

.content-body ul,
.content-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content-body li {
  margin-bottom: 0.25rem;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.content-body th,
.content-body td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.content-body th {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.content-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

.content-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-secondary);
}

/* === Floor Plan Placeholder === */
.floor-plan {
  text-align: center;
  padding: 2rem 0;
}

.floor-plan h2 {
  margin-bottom: 1rem;
}

.floor-plan-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  background: var(--color-bg-secondary);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

/* === Guide Map === */
.map-page {
  position: relative;
}

.map-header {
  margin-bottom: 1rem;
}

.map-header h1 {
  margin-top: 0.25rem;
}

#guide-map {
  width: 100%;
  height: 65vh;
  min-height: 400px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  z-index: 1;
}

.house-marker {
  background: none;
  border: none;
}

/* Popup styling */
.guide-popup {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  line-height: 1.4;
}

.guide-popup-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  display: block;
}

.guide-popup strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.guide-popup p {
  font-size: 0.8rem;
  color: #555;
  margin: 0;
}

.guide-popup-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent, #5e6f57);
  text-decoration: none;
}

.guide-popup-link:hover {
  text-decoration: underline;
}

/* Legend */
.map-legend {
  margin-top: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.legend-toggle {
  display: none;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  padding: 0.2rem 0;
  transition: opacity 0.2s;
}

.legend-item:hover {
  color: var(--color-text);
}

.legend-item.disabled {
  opacity: 0.35;
}

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

@media (max-width: 600px) {
  #guide-map {
    height: 55vh;
    min-height: 300px;
    border-radius: var(--radius-sm);
  }

  .legend-items {
    flex-direction: column;
    gap: 0.35rem;
  }

  .map-legend.collapsed .legend-items {
    display: none;
  }

  .legend-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-text-muted);
    float: right;
    margin-top: -0.15rem;
  }
}

/* === Footer === */
.site-footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border-light);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-emergency {
  margin-bottom: 1.5rem;
}

.footer-emergency h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-emergency);
  margin-bottom: 0.75rem;
}

.emergency-grid {
  display: grid;
  gap: 0.5rem;
}

.emergency-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.emergency-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.emergency-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

a.emergency-value {
  color: var(--color-emergency);
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

/* === Season Badge === */
.season-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* === Responsive === */
@media (max-width: 640px) {
  .site-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .lang-switcher {
    display: none;
  }

  .site-header.menu-open .site-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-md);
  }

  /* Mobile dropdown: inline, no absolute positioning */
  .nav-dropdown-menu {
    position: static;
    border: none;
    box-shadow: none;
    margin-top: 0;
    padding: 0 0 0 1rem;
    min-width: auto;
  }

  .nav-dropdown:hover .nav-dropdown-menu {
    display: none;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: flex;
    flex-direction: column;
  }

  .site-header.menu-open .lang-switcher {
    display: flex;
    position: absolute;
    top: 56px;
    right: 1rem;
    z-index: 101;
  }

  .nav-cards {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .emergency-grid {
    grid-template-columns: 1fr;
  }
}

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