* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #1f2937;
  background: #ffffff;
  line-height: 1.6;
}

.container {
  width: min(1100px, 90%);
  margin: 0 auto;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

nav a {
  color: #374151;
  text-decoration: none;
}

nav a:hover {
  color: #000000;
}

nav a.active {
  color: #000000;
  font-weight: 700;
}

.hero {
  padding: 120px 0;
  background: #f3f4f6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1;
  margin: 12px 0 24px;
}

h2 {
  font-size: 2rem;
  margin-top: 0;
}

.intro {
  max-width: 700px;
  font-size: 1.2rem;
}

.button {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 20px;
  background: #111827;
  color: white;
  text-decoration: none;
  border-radius: 6px;
}

.section {
  padding: 80px 0;
}

.alternate {
  background: #f9fafb;
}

footer {
  padding: 30px 0;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
}

.ukraine-flag {
  width: 30px;
  height: 20px;
  display: inline-flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.12);
}

.ukraine-flag span {
  display: block;
  width: 100%;
  height: 50%;
}

.flag-blue { background: #0057b7; }
.flag-yellow { background: #ffd700; }

.page-hero {
  padding: 90px 0 70px;
  background: #f3f4f6;
}

.register-placeholder {
  min-height: 260px;
  padding: 32px;
  border: 2px dashed #9ca3af;
  border-radius: 10px;
  background: #ffffff;
}

/* MAP PAGE */
html, body.map-page {
  width: 100%;
  height: 100%;
}

body.map-page {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

body.map-page .site-header {
  position: relative;
  flex: 0 0 auto;
}

.map-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
}

.map-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 22px 18px 26px;
  overflow-y: auto;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.clear-filters {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #111827;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.clear-filters:hover {
  background: #f8fafc;
}

.filter-group + .filter-group {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.filter-group h3,
.marker-legend h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.filter-option,
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 0.95rem;
}

.marker-legend {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.legend-item img {
  width: 24px;
  height: 30px;
  object-fit: contain;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background: #dbeafe;
  font-family: Arial, Helvetica, sans-serif;
}

.church-marker-icon {
  background: transparent;
  border: none;
}

.site-hover-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
}

.site-hover-tooltip .leaflet-tooltip-content {
  margin: 0;
}

.site-hover-card {
  width: 280px;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.site-card-image {
  height: 128px;
  background: #f3f4f6;
}

.site-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf2f7 0%, #f8fafc 100%);
  color: #6b7280;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.site-card-body {
  padding: 16px 16px 14px;
}

.site-card-body h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.35;
}

.site-card-body dl {
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}

.site-card-body dl div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
}

.site-card-body dt {
  font-weight: 700;
  color: #111827;
}

.site-card-body dd {
  margin: 0;
  color: #374151;
}

.site-card-description,
.site-card-address {
  margin: 0;
  font-size: 0.92rem;
  color: #4b5563;
}

.site-card-address {
  margin-top: 10px;
  color: #6b7280;
}

@media (max-width: 960px) {
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .map-sidebar {
    max-height: 38vh;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
}

@media (max-width: 700px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .hero {
    padding: 80px 0;
  }
}

/* Hoverable marker cards */
.site-hover-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
}

.site-hover-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
  min-width: 280px;
  max-width: 340px;
}

.site-hover-popup .leaflet-popup-tip {
  background: #ffffff;
}

.site-hover-card {
  width: min(320px, calc(100vw - 48px));
  max-width: 100%;
}

.site-hover-card h3,
.site-hover-card dd,
.site-card-description,
.site-card-address {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.site-hover-card h3 {
  max-width: 100%;
  line-height: 1.32;
}

.site-card-body dl > div {
  align-items: start;
}

.site-card-body dd {
  min-width: 0;
}
