/* =============================================
   Mays Chapel UMC — Progressive Web App
   style.css
   ============================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  height: 100%;
}

body {
  font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  background: #1a2e1b;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overscroll-behavior: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Install Banner ---------- */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #2c4a2e;
  color: white;
  padding: 10px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.install-banner.hidden {
  display: none;
}

.install-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.install-icon {
  font-size: 24px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.install-text strong {
  font-size: 13px;
  font-weight: 700;
}

.install-text span {
  font-size: 11px;
  opacity: 0.8;
}

.install-accept {
  background: #c8a84b;
  color: #2c4a2e;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.install-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  padding: 4px;
  line-height: 1;
}

/* ---------- App Shell ---------- */
.app {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background: #f5f2ed;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Screens ---------- */
.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

/* ---------- App Header ---------- */
.app-header {
  background: #2c4a2e;
  color: white;
  padding: env(safe-area-inset-top, 0) 20px 0;
  padding-top: max(env(safe-area-inset-top, 0px), 0px);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding-bottom: 12px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

.header-logo {
  width: 38px;
  height: 38px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 3px;
}

.header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.header-sub {
  font-size: 11px;
  opacity: 0.72;
  margin-top: 2px;
  font-weight: 400;
}

/* ---------- Hero (Home) ---------- */
.hero {
  background: linear-gradient(160deg, #2c4a2e 0%, #3d6640 55%, #5a8a5e 100%);
  padding: 28px 24px 36px;
  color: white;
  text-align: center;
}

.hero-cross {
  display: block;
  font-size: 34px;
  margin-bottom: 10px;
}

.hero-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}

.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
}

.hero p {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 8px;
  font-style: italic;
  font-weight: 300;
}


/* ---------- Slideshow ---------- */
.slideshow {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #2c4a2e;
  height: 200px;
}

.slideshow-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.slideshow-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.slideshow-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Skeleton loader shown while fetching */
.slideshow-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #2c4a2e 25%, #3d6640 50%, #2c4a2e 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-skeleton-icon {
  opacity: 0.3;
  width: 48px;
  height: 48px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dot indicators */
.slideshow-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.slideshow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  transition: background 0.3s, transform 0.3s;
}

.slideshow-dot.active {
  background: white;
  transform: scale(1.3);
}

/* Tap zones for manual swipe fallback on desktop */
.slideshow-prev,
.slideshow-next {
  display: none;
}

/* ---------- Page Hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(160deg, #2c4a2e 0%, #3d6640 100%);
  padding: 20px 24px 24px;
  color: white;
  text-align: center;
}

.page-hero h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
}

.page-hero p {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 6px;
}

/* ---------- Scroll Area ---------- */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.scroll-area::-webkit-scrollbar {
  display: none;
}

/* ---------- Quick Actions Grid ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px 16px 0;
}

.quick-btn {
  background: white;
  border: 1px solid #e8e4df;
  border-radius: 14px;
  padding: 10px 4px 9px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, transform 0.1s;
}

.quick-btn:active {
  transform: scale(0.94);
  background: #f0ede8;
}

.quick-icon {
  font-size: 22px;
  line-height: 1;
}

.quick-label {
  font-size: 10px;
  color: #555;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------- Section ---------- */
.section {
  padding: 16px 16px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  color: #2c4a2e;
}

.section-see-all {
  font-size: 12px;
  color: #4a7c4e;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Service Cards ---------- */
.service-card {
  background: white;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid #4a7c4e;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: opacity 0.15s;
}

.service-card:active {
  opacity: 0.75;
}

.service-card--gold {
  border-left-color: #c8a84b;
  background: #fffdf4;
}

.service-time-block {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
}

.service-time {
  font-size: 22px;
  font-weight: 700;
  color: #2c4a2e;
  line-height: 1;
}

.service-time--gold {
  color: #9a7c2e;
}

.service-am {
  font-size: 12px;
  color: #4a7c4e;
  font-weight: 700;
}

.service-am--gold {
  color: #c8a84b;
}

.service-name {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.service-loc {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}

/* ---------- Event Cards ---------- */
.event-card {
  background: white;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: opacity 0.15s;
}

.event-card:active {
  opacity: 0.75;
}

.event-date-box {
  background: #2c4a2e;
  color: white;
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  min-width: 46px;
  flex-shrink: 0;
}

.event-month {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

.event-day {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.event-name {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.event-time {
  font-size: 12px;
  color: #777;
  margin-top: 3px;
}

/* ---------- CTA Card ---------- */
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2c4a2e;
  color: white;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 8px;
}

.cta-card:active {
  opacity: 0.8;
}

/* ---------- Media Cards ---------- */
.media-card {
  background: white;
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  display: block;
  transition: opacity 0.15s;
}

.media-card:active {
  opacity: 0.8;
}

.media-thumb {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
}

.media-thumb--green {
  background: linear-gradient(135deg, #2c4a2e 0%, #4a7c4e 100%);
}

.media-thumb--blue {
  background: linear-gradient(135deg, #1a3a8f 0%, #3b5998 100%);
}

.media-play {
  position: absolute;
  background: rgba(255,255,255,0.22);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}

.media-info {
  padding: 12px 16px 14px;
}

.media-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

.media-meta {
  font-size: 12px;
  color: #777;
  margin-top: 3px;
}

.media-tag {
  display: inline-block;
  background: #eaf3e1;
  color: #2c4a2e;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 7px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------- Promo Card ---------- */
.promo-card {
  background: #eaf3e1;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.promo-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.promo-title {
  font-size: 16px;
  font-weight: 700;
  color: #2c4a2e;
}

.promo-text {
  font-size: 13px;
  color: #555;
  margin-top: 4px;
  line-height: 1.5;
}

.promo-btn {
  display: inline-block;
  margin-top: 12px;
  background: #2c4a2e;
  color: white;
  border: none;
  padding: 9px 22px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.promo-btn:active {
  opacity: 0.8;
}

/* ---------- Give Screen ---------- */
.give-option {
  background: white;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.give-option:active {
  border-color: #4a7c4e;
}

.give-option-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.give-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eaf3e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.give-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

.give-sub {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}

.give-arrow {
  color: #4a7c4e;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.give-verse {
  background: #eaf3e1;
  border-radius: 16px;
  padding: 18px 20px;
  text-align: center;
  margin-bottom: 12px;
}

.give-verse p {
  font-style: italic;
  font-size: 14px;
  color: #2c4a2e;
  line-height: 1.7;
}

.give-verse cite {
  font-size: 12px;
  color: #4a7c4e;
  font-weight: 700;
  display: block;
  margin-top: 8px;
  font-style: normal;
}

.info-box {
  background: white;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.info-box-title {
  font-size: 14px;
  font-weight: 700;
  color: #2c4a2e;
  margin-bottom: 6px;
}

.info-box-text {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

.info-box-address {
  font-size: 12px;
  color: #777;
  margin-top: 6px;
}

/* ---------- Connect Screen ---------- */
.map-card {
  background: #d8e8d9;
  border-radius: 16px;
  margin-bottom: 12px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px dashed #4a7c4e;
  cursor: pointer;
  transition: opacity 0.15s;
}

.map-card:active {
  opacity: 0.8;
}

.map-icon {
  font-size: 32px;
}

.map-address {
  font-size: 14px;
  color: #2c4a2e;
  font-weight: 700;
  line-height: 1.5;
}

.map-cta {
  font-size: 12px;
  color: #4a7c4e;
  font-weight: 700;
}

.connect-card {
  background: white;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.connect-card:active {
  opacity: 0.75;
}

.connect-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #eaf3e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.connect-info {
  flex: 1;
}

.connect-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.connect-detail {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
  line-height: 1.4;
}

.connect-arrow {
  color: #aaa;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.hours-card {
  background: white;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.hours-title {
  font-size: 14px;
  font-weight: 700;
  color: #2c4a2e;
  margin-bottom: 10px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #444;
  padding: 5px 0;
  border-bottom: 1px solid #f0ede8;
}

.hours-row:last-of-type {
  border-bottom: none;
}

.hours-note {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-top: 8px;
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  background: white;
  border-top: 1px solid #e8e4df;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  color: #b0aba4;
  transition: color 0.15s;
  min-height: 56px;
  justify-content: center;
}

.nav-item.active {
  color: #2c4a2e;
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------- Offline Toast ---------- */
.offline-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.3s ease;
  z-index: 999;
  white-space: nowrap;
}

.offline-toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (min-width: 481px) {
  body {
    background: #1a2e1b;
    padding: 24px 0;
  }

  .app {
    border-radius: 40px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    height: 820px;
  }

  .screen {
    height: 100%;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
