/* ========================================================
   THRONE OF GRACE 2.0 (ZOE) - MOBILE-FIRST ENHANCED STYLES
   ======================================================== */

/* Prevent iOS tap highlight & box-sizing normalize */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Viewport & Safe Area Containment (Prevents horizontal shift on mobile) */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Prevent iOS Safari 16px auto-zoom on form focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Touch manipulation: removes 300ms double-tap delay on mobile */
button, 
a, 
input, 
select, 
textarea,
.flip-card {
  touch-action: manipulation;
}

/* Smooth momentum scrolling on iOS */
.scroll-touch,
.flip-card-back,
#mobile-menu-drawer,
.tab-content,
.overflow-x-auto,
.overflow-y-auto {
  -webkit-overflow-scrolling: touch;
}

/* Custom & Minimal Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 21, 48, 0.05); 
}
::-webkit-scrollbar-thumb {
  background: rgba(10, 37, 88, 0.25); 
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #0a2558; 
}

/* Marquee Animation */
@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.animate-marquee {
  display: inline-block;
  animation: marquee 25s linear infinite;
  white-space: nowrap;
}

/* 3D Flip Cards for Ministers (Optimized for Mobile Touch) */
.flip-card {
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

@media (hover: hover) and (pointer: fine) {
  .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
  }
}

.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 1.5rem;
}

.flip-card-back {
  transform: rotateY(180deg);
  overflow-y: auto;
}

/* Mobile Fly-out & Drawer Animations */
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Safe padding utilities for notch devices */
.pb-safe {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

/* ========================================================
   CLICKABLE ENLARGEABLE IMAGES & LIGHTBOX MODAL
   ======================================================== */
.zoomable-img,
img.zoomable,
.clickable-img,
main img:not(.no-lightbox),
header img:not(.no-lightbox) {
  cursor: zoom-in;
  transition: transform 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease;
}

.zoomable-img:hover,
img.zoomable:hover,
main img:not(.no-lightbox):hover {
  filter: brightness(1.05);
}

#image-lightbox-modal {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#image-lightbox-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#image-lightbox-modal img {
  max-height: 88vh;
  max-width: 95vw;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

