/* ==========================================================================
   Templo Nuestra Señora de Schoenstatt - Design System & Modern CSS
   Optimizado para Google PageSpeed Insights (100/100 SEO & Core Web Vitals)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette - Devotional Marian & Regal Gold (Contrast Ratios AAA > 7:1 & AA > 4.5:1) */
  --primary-navy: #09192e;
  --primary-marian: #102a45;
  --marian-blue: #1e3a8a;
  --marian-light: #2563eb;
  --marian-soft: #eff6ff;
  
  --gold-primary: #d4af37;
  --gold-light: #fef08a;
  --gold-dark: #854d0e;
  --gold-gradient: linear-gradient(135deg, #fef08a 0%, #d4af37 50%, #854d0e 100%);
  
  --neutral-dark: #0f172a;
  --neutral-body: #1e293b;
  --neutral-muted: #475569;
  --neutral-light: #f8fafc;
  --white: #ffffff;
  
  /* Glassmorphism & Shadow Tokens */
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 20px 40px -15px rgba(9, 25, 46, 0.1);
  --glass-dark-bg: rgba(9, 25, 46, 0.88);
  --glass-dark-border: rgba(212, 175, 55, 0.35);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(9, 25, 46, 0.14);
  --shadow-gold: 0 10px 30px -5px rgba(212, 175, 55, 0.35);

  /* Typography */
  --font-serif-title: 'Cinzel', serif;
  --font-serif-heading: 'Playfair Display', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--neutral-body);
  background-color: var(--neutral-light);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--neutral-light);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-marian);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-navy);
  font-family: var(--font-serif-heading);
  line-height: 1.25;
}

.title-sacred {
  font-family: var(--font-serif-title);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-gold {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

p {
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: 6rem 0;
}

.text-center {
  text-align: center;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PageSpeed Tap Target Minimum 48px */
.tap-target {
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-dark);
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.badge-blue {
  background: var(--marian-soft);
  color: var(--marian-blue);
  border: 1px solid rgba(37, 99, 235, 0.35);
}

/* Buttons (Tap target > 48px height) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 2.2rem;
  min-height: 48px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-normal);
  outline: none;
}

.btn-primary {
  background: var(--gold-gradient);
  color: var(--primary-navy);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(212, 175, 55, 0.45);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--primary-navy);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--white);
  border-color: var(--marian-blue);
  color: var(--marian-blue);
  transform: translateY(-2px);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold-primary);
  border: 1.5px solid var(--gold-primary);
}

.btn-outline-gold:hover, .btn-outline-gold:focus-visible {
  background: var(--gold-primary);
  color: var(--primary-navy);
}

/* Accessibility Focus States */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold-primary);
  outline-offset: 2px;
}

/* Top Announcement Bar */
.top-bar {
  background: var(--primary-navy);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.top-bar-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.top-bar-info span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-bar-info a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.top-bar-info a:hover {
  color: var(--gold-light);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  transition: var(--transition-normal);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.98);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 84px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.brand-text .brand-title {
  font-size: 1.25rem;
  font-family: var(--font-serif-title);
  font-weight: 700;
  color: var(--primary-navy);
  letter-spacing: 0.02em;
  display: block;
}

.brand-text .brand-subtitle {
  font-size: 0.75rem;
  color: var(--neutral-muted);
  display: block;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--neutral-dark);
  position: relative;
  padding: 0.6rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2.5px;
  background: var(--gold-gradient);
  transition: var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--marian-blue);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--primary-navy);
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
}

/* Hero Section (Centrado con la imagen real del Templo) */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(9, 25, 46, 0.75) 0%, rgba(9, 25, 46, 0.55) 50%, rgba(9, 25, 46, 0.88) 100%), url('assets/hero.jpg') center/cover no-repeat;
  color: var(--white);
  overflow: hidden;
  text-align: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(212, 175, 55, 0.22), transparent 70%);
  pointer-events: none;
}

.hero-centered-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.hero-logo-wrapper {
  margin-bottom: 1.5rem;
}

.hero-logo-img {
  max-height: 140px;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
}

.hero-content .hero-title {
  color: var(--white);
  font-size: 3.6rem;
  font-family: var(--font-serif-title);
  margin: 1.2rem 0;
  line-height: 1.2;
  text-shadow: 0 4px 25px rgba(0,0,0,0.7);
  letter-spacing: 0.02em;
}

.hero-content p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.95);
  max-width: 720px;
  margin: 0 auto 2.5rem auto;
  font-weight: 400;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.hero-actions {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Schedule Section */
.schedules-section {
  background: var(--white);
  position: relative;
  margin-top: -30px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 10;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
}

.section-header {
  max-width: 720px;
  margin: 0 auto 4rem auto;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-top: 0.75rem;
}

.section-header p {
  color: var(--neutral-muted);
  font-size: 1.1rem;
}

.schedule-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.schedule-card {
  background: var(--neutral-light);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.schedule-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gold-gradient);
  opacity: 0;
  transition: var(--transition-normal);
}

.schedule-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  background: var(--white);
}

.schedule-card:hover::before {
  opacity: 1;
}

.schedule-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--marian-soft);
  color: var(--marian-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.schedule-card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.time-list {
  list-style: none;
  margin-top: 1rem;
}

.time-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px dashed rgba(71, 85, 105, 0.25);
  font-size: 0.95rem;
}

.time-item:last-child {
  border-bottom: none;
}

.time-tag {
  font-weight: 700;
  color: var(--marian-blue);
  background: var(--marian-soft);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
}

/* Gallery Section */
.gallery-section {
  background: linear-gradient(135deg, #09192e 0%, #102a45 100%);
  color: var(--white);
  position: relative;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(212, 175, 55, 0.3);
  cursor: pointer;
  transition: var(--transition-normal);
  background: var(--primary-navy);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-gold);
  border-color: var(--gold-primary);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(9, 25, 46, 0.92) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-title {
  color: var(--white);
  font-family: var(--font-serif-heading);
  font-size: 1.1rem;
  font-weight: 600;
  transform: translateY(10px);
  transition: var(--transition-normal);
}

.gallery-item:hover .gallery-title {
  transform: translateY(0);
}

.gallery-col-6 { grid-column: span 6; height: 320px; }
.gallery-col-4 { grid-column: span 4; height: 300px; }
.gallery-col-8 { grid-column: span 8; height: 340px; }

/* Sacraments Section */
.sacraments-section {
  background: var(--white);
}

.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.8rem 1.8rem;
  min-height: 48px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: var(--white);
  font-weight: 600;
  color: var(--neutral-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-btn:hover, .tab-btn.active {
  background: var(--primary-navy);
  color: var(--gold-primary);
  border-color: var(--primary-navy);
  box-shadow: var(--shadow-md);
}

.tab-pane {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  animation: fadeIn 0.4s ease-in-out;
}

.tab-pane.active {
  display: grid;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.sacrament-card-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.sacrament-card-img img {
  width: 100%;
  height: auto;
}

.sacrament-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.req-list {
  list-style: none;
  margin: 1.5rem 0;
}

.req-list li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.req-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--gold-dark);
  font-weight: 700;
}

/* Donation Banner */
.donate-banner {
  background: linear-gradient(135deg, #102a45 0%, #09192e 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 4rem 3rem;
  margin: 4rem 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gold-primary);
}

.donate-banner-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.donate-banner h2 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.donate-banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Location & Contact Section */
.contact-section {
  background: var(--white);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.contact-info-box {
  background: var(--neutral-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.contact-form-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-md);
}

.contact-form-box h3 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--primary-navy);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--primary-navy);
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid #cbd5e1;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: var(--marian-blue);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.18);
}

.contact-item {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-navy);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-details h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.contact-details p {
  color: var(--neutral-muted);
  margin-bottom: 0;
}

.map-wrapper {
  grid-column: span 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: 380px;
  margin-top: 1rem;
}

.map-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer */
.footer {
  background: var(--primary-navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 5rem 0 2rem 0;
  border-top: 3px solid var(--gold-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-col h3 {
  color: var(--white);
  font-size: 1.2rem;
  font-family: var(--font-serif-title);
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.2rem 0;
  display: inline-block;
}

.footer-links a:hover, .footer-links a:focus-visible {
  color: var(--gold-light);
  padding-left: 5px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Lightbox Modal for Gallery */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 25, 46, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-gold);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-caption {
  text-align: center;
  color: var(--gold-light);
  font-family: var(--font-serif-heading);
  font-size: 1.2rem;
  margin-top: 1rem;
}

/* Mobile Responsive */
@media (max-width: 992px) {
  .hero-content .hero-title {
    font-size: 2.75rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .gallery-col-6, .gallery-col-4, .gallery-col-8 {
    grid-column: span 12;
    height: 280px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .map-wrapper {
    grid-column: span 1;
  }

  .tab-pane {
    grid-template-columns: 1fr;
  }

  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    display: none;
  }

  .nav-menu.active {
    display: flex;
  }
}
