/* ================= GLOBAL RESET ================= */
* {
  box-sizing: border-box;
}
body {
  background: #f8f9fa;
}
.navbar {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.site-logo {
  height: 2em; /* MAIN CONTROL */
  width: auto;
}
/* ===== Back button (text style) ===== */
.btn-back-text {
  background: transparent;
  border: none;
  padding: 0;
  color: #0d6efd;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-back-text:hover {
  opacity: 0.8;
}
/* ================= STICKY HEADER ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #ffffff;
  border-bottom: 0.15em solid #8a7f3a;
  box-shadow: 0 0.15em 0.4em rgba(0, 0, 0, 0.08);
}

/* ================= HERO ================= */
.hero {
  position: relative;
  background: url("../images/hero.png") center / cover;
  color: #fff;
  padding: 4em 1em 1.5em;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  letter-spacing: 0.25em;
  font-weight: 700;
}

/* ================= CALENDAR ================= */
.month {
  margin-bottom: 3em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
}

.month-title {
  grid-column: span 7;
  background: #8a7f3a;
  color: #fff;
  padding: 0.6em;
  font-weight: 700;
  text-align: center;
  font-size: clamp(1em, 2.5vw, 1.3em);
}

.day-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.85em;
  text-align: center;
  padding: 0.4em 0;
}
.sun {
  background: #dc2626;
}
.mon {
  background: #f97316;
}
.tue {
  background: #eab308;
}
.wed {
  background: #16a34a;
}
.thu {
  background: #2563eb;
}
.fri {
  background: #1e3a8a;
}
.sat {
  background: #7c3aed;
}

/* ================= DAY CARD ================= */
.day-card {
  height: 10.5em;
  border: 1px solid #d8b4fe;
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
}

.day-card.today {
  border: 0.18em solid #dc2626;
  background: #fff7ed;
}
.day-card.today .day-number {
  color: #dc2626;
  font-weight: 800;
}

.day-number {
  font-size: 1em;
  font-weight: 700;
  margin: 0.4em 0.5em 0;
}

.lunar {
  font-size: 0.8em;
  margin: 0.1em 0.5em 0;
  color: #6b7280;
}

.festival {
  font-size: 0.8em;
  margin: 0.1em 0.5em;
  font-weight: 700;
  color: #b91c1c;
}

.readings {
  margin: 0.3em 0.5em 1.6em;
  font-size: 0.8em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ellipsis {
  position: absolute;
  bottom: 0.4em;
  right: 0.5em;
  font-size: 1.1em;
  color: #6b7280;
  cursor: pointer;
}
.ellipsis:hover {
  color: #4338ca;
}

.empty {
  background: transparent;
  border: none;
}

/* ================= NAV ACTIVE UNDERLINE ================= */
.site-header .nav-link {
  position: relative;
  padding-bottom: 0.3em;
}
.site-header .nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0.15em;
  background-color: #8a7f3a;
  border-radius: 0.1em;
}

/* ================= PAGE LAYOUT ================= */
.page-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-content {
  flex: 1 0 auto;
}

/* ================= FOOTER ================= */
.site-footer {
  background: #f5f5f2;
  border-top: 0.2em solid #8a7f3a;
  padding: 2.5em 1em;
  text-align: center;
  margin-top: auto;
}

/* ================= BACK TO TOP ================= */
.back-to-top {
  position: fixed;
  right: 1.2em;
  bottom: 1.4em;
  width: 3em;
  height: 3em;
  border-radius: 50%;
  background: #8a7f3a;
  color: #fff;
  font-size: 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1em);
  transition: all 0.3s ease;
  z-index: 1050;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: #6f6630;
}
/* ================= CHURCHES ================= */
.church-card {
  border-left: 0.35em solid #8a7f3a;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.church-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.4em 1em rgba(0, 0, 0, 0.08);
}

.service-badge {
  background: #8a7f3a;
}

.service-desc {
  font-style: italic;
  opacity: 0.85;
}

.clergy {
  font-size: 0.9em;
}
/* ===== Reading text overlay ===== */
.reading-overlay {
  max-height: 35vh;
  overflow-y: auto;
  border-bottom: 1px solid #ddd;
  background: #fff;
}

.reading-overlay-header {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  padding: 8px 12px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

/* Centered reading column */
.reading-overlay-body {
  max-width: 680px;
  margin: 0 auto; /* ✅ TRUE centering */
  padding: 16px 20px;
  line-height: 1.8;
  font-size: 1rem;
  text-align: center;
}

/* Mobile tuning */
@media (max-width: 576px) {
  .site-logo {
    height: 80px;
  }
  .reading-overlay {
    max-height: 40vh;
  }

  .reading-overlay-body {
    max-width: 100%;
    padding: 14px 16px;
    font-size: 0.95rem;
  }
}

/* ================= Bible Link ================= */
.reading-link {
  cursor: pointer;
  color: #1a4fa3;
  text-decoration: underline;
}

.reading-link:hover {
  color: #0d6efd;
}
/* ===== Mobile-friendly Bible iframe ===== */

.bible-iframe {
  width: 100%;
  height: calc(100vh - 120px); /* header + toolbar */
  border: 0;
}

/* Fullscreen modal adjustments */
@media (max-width: 576px) {
  .modal-fullscreen-sm-down .modal-content {
    height: 100vh;
  }

  .modal-fullscreen-sm-down .modal-body {
    padding: 0;
  }

  .bible-iframe {
    height: calc(100vh - 110px);
  }

  /* Bigger tap targets */
  .modal-header,
  .modal-body button {
    font-size: 1rem;
  }
}

/* iOS safe-area support */
@supports (padding: env(safe-area-inset-bottom)) {
  .modal-content {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
