/* ═══════════════════════════════════════════════════════════════
   DIOCESAN MAP PAGE - IMPROVED STYLES
   ───────────────────────────────────────────────────────────────
   Replace the existing diocesan-map.css with this file
═══════════════════════════════════════════════════════════════ */

/* ── MAIN SECTION ── */
.diocesan-map-section {
  padding-top: 110px;
  background: #f5f7f9;
  min-height: 100vh;
}

.map-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
}

/* ── PAGE HEADER ── */
.map-header {
  background: linear-gradient(135deg, var(--fb-blue) 0%, #002a5c 100%);
  padding: 40px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.map-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.map-header h1 {
  position: relative;
  z-index: 1;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ── MAP BOX ── */
.map-box {
  background: #fff;
  margin: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* ── SEARCH BAR (on top of map) ── */
.map-top-bar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  padding: 0 10px;
}

#parish-search {
  width: 100%;
  padding: 14px 20px;
  padding-left: 45px;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-family: "Cabin", sans-serif;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  outline: none;
  transition: box-shadow 0.3s ease;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 15px center;
  background-size: 18px 18px;
}

#parish-search:focus {
  box-shadow: 0 6px 28px rgba(0, 59, 122, 0.25);
}

#parish-search::placeholder {
  color: #999;
}

/* ── MAP ITSELF ── */
#parishMap {
  width: 100%;
  height: 550px;
  position: relative;
}

/* ── PARISH GRID ── */
.parish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 50px 40px;
  background: #f5f7f9;
}

.parish-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  max-height: 340px;
}

.parish-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
}

.parish-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: #e8e8e8;
  flex: 0 0 55%;
}

.parish-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.parish-card:hover .parish-card-img img {
  transform: scale(1.05);
}

.parish-card-body {
  padding: 20px;
}

.parish-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fb-blue);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.parish-card-address {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE - TABLET
══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .map-header {
    padding: 35px 30px;
  }

  .map-header h1 {
    font-size: 2.2rem;
  }

  #parishMap {
    height: 500px;
  }

  .map-top-bar {
    max-width: 360px;
  }

  .parish-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 40px 30px;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE - MOBILE
══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .diocesan-map-section {
    padding-top: 200px; /* Account for mobile nav height */
  }

  /* Make header more compact on mobile */
  .map-header {
    padding: 30px 20px;
  }

  .map-header h1 {
    font-size: 1.8rem;
  }

  /* Search bar - make it more prominent on mobile */
  .map-top-bar {
    top: 15px;
    width: calc(100% - 20px);
    max-width: none;
    padding: 0 10px;
  }

  #parish-search {
    padding: 12px 18px;
    padding-left: 42px;
    font-size: 14px;
    border-radius: 25px;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.2);
    background-position: 12px center;
    background-size: 16px 16px;
  }

  /* Map height adjustment for mobile */
  #parishMap {
    height: 450px;
  }

  /* Parish grid - single column on mobile */
  .parish-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 30px 16px;
  }

  .parish-card-body {
    padding: 16px;
  }

  .parish-card-title {
    font-size: 1.1rem;
  }

  .parish-card-address {
    font-size: 0.85rem;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE - EXTRA SMALL MOBILE
══════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .map-header h1 {
    font-size: 1.5rem;
  }

  #parish-search {
    font-size: 13px;
    padding: 11px 16px;
    padding-left: 38px;
  }

  #parishMap {
    height: 400px;
  }

  .parish-card-img {
    height: 160px;
  }
}

/* ══════════════════════════════════════════════════════════════
   LANDSCAPE MODE ON MOBILE
══════════════════════════════════════════════════════════════ */
@media (max-width: 896px) and (orientation: landscape) {
  .diocesan-map-section {
    padding-top: 140px;
  }

  .map-header {
    padding: 25px 20px;
  }

  .map-header h1 {
    font-size: 1.6rem;
  }

  #parishMap {
    height: 350px;
  }

  .map-top-bar {
    top: 12px;
  }

  #parish-search {
    padding: 10px 16px;
    padding-left: 38px;
    font-size: 13px;
  }
}

/* ══════════════════════════════════════════════════════════════
   LEAFLET MAP CONTROLS - MOBILE ADJUSTMENTS
══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Move zoom controls to avoid overlapping with search */
  .leaflet-top.leaflet-left {
    top: 70px !important;
  }

  .leaflet-control-zoom {
    margin-top: 10px !important;
  }

  .leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 18px !important;
  }
}
