/*
 * Stylesheet for the Concilio Iglesia Evangélica Pentecostal website.
 * The design draws inspiration from modern church websites, using the
 * colour palette of the provided logo (deep blues, warm golds and
 * off‑white tones). Responsive layouts and simple animations help
 * create a dynamic yet accessible experience.
 */

/* Root colour variables to ensure consistency throughout the site */
:root {
  --color-primary: #002f5e; /* deep blue for headers and backgrounds */
  --color-secondary: #1e5a9d; /* medium blue for accents */
  --color-accent: #f5b642; /* warm gold accent colour */
  --color-light: #f7f9fc; /* off‑white background */
  --color-dark: #1f2933; /* dark grey for text */
  --transition-speed: 0.4s;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--color-light);
}

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

h1,
h2,
h3 {
  margin: 0 0 1rem 0;
  font-weight: 700;
  color: var(--color-primary);
}

p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

ul {
  margin: 0;
  padding: 0;
}

/* Container to constrain width and centre content */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header and navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 47, 94, 0.9);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.logo img {
  /* Hide the logo in the fixed header; a larger version will appear
     below the navigation for better symmetry */
  display: none;
}

/* A larger, centred logo displayed below the header on every page */
/*
 * A larger, centred logo displayed below the header on every page.
 * Increase the top margin so the logo sits well below the fixed navigation
 * bar and appears fully visible. Give a slightly larger width to make
 * the emblem more prominent and maintain equal spacing above and below.
 */
.body-logo {
  text-align: center;
  /* Provide enough space above the logo so it doesn’t overlap the fixed header */
  margin: 4rem 0 2rem;
}
.body-logo img {
  width: 260px;
  height: auto;
}

nav {
  display: flex;
  align-items: center;
  transition: transform var(--transition-speed) ease;
}

nav a {
  margin-left: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  position: relative;
  padding: 0.5rem 0;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--color-accent);
  transition: width var(--transition-speed) ease;
}

nav a:hover::after {
  width: 100%;
}

/* Hamburger menu for small screens */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background-color: #ffffff;
  margin-bottom: 5px;
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

/* Hero section */
.hero {
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* Colour will be controlled in the overlay instead of here */
  color: var(--color-primary);
  text-align: center;
  padding-top: 4rem; /* offset for fixed header */
}

.hero-overlay {
  /* Use a light translucent panel to improve legibility on darker backgrounds */
  /* Use a dark translucent background to ensure text legibility over the hero image */
  /* Reduce the darkness of the overlay so that the hero copy is more legible and the background artwork is visible */
  background: rgba(0, 0, 0, 0.45);
  padding: 2rem 1.5rem;
  border-radius: 8px;
  max-width: 800px;
  color: #ffffff;
}

/* Ensure hero overlay headings and paragraphs remain white for contrast against the colourful background */
.hero-overlay h1,
.hero-overlay p {
  color: #ffffff;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Styling for the fixed verse within the hero section */
.hero-verse {
  font-style: italic;
  color: var(--color-accent);
  font-size: 1rem;
  margin-bottom: 1rem;
}

/*
 * Fancy button inspired by open source UI elements. A pill‑shaped button with a
 * moving gradient bar when hovered. The pseudo‑element creates a sweeping
 * gradient that animates into view. Colours derive from the primary palette
 * so the effect matches the rest of the site.
 */
.btn {
  position: relative;
  display: inline-block;
  padding: 0.8rem 2rem;
  font-weight: 600;
  border-radius: 30px;
  overflow: hidden;
  color: var(--color-dark);
  background-color: var(--color-accent);
  transition: color var(--transition-speed) ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 300%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-secondary),
    var(--color-accent)
  );
  transition: transform 0.5s ease;
  z-index: 0;
}

.btn:hover::before {
  transform: translateX(-50%);
}

.btn span,
.btn {
  position: relative;
  z-index: 1;
}

.btn:hover {
  color: var(--color-dark);
}

/*
 * Loading overlay styles
 * A full‑screen overlay with animated bars to indicate page loading. Colours are
 * derived from the existing palette to maintain visual consistency. The
 * overlay uses a dark translucent background to focus attention on the
 * animation while the page loads.
 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 47, 94, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-overlay .loader {
  display: flex;
  gap: 0.5rem;
}

.loading-overlay .loader span {
  width: 12px;
  height: 30px;
  border-radius: 4px;
  background-color: var(--color-accent);
  animation: loadingBar 1s infinite;
}

/* Offset the animations for each bar and vary the colours slightly */
.loading-overlay .loader span:nth-child(2) {
  animation-delay: 0.2s;
  background-color: var(--color-secondary);
}
.loading-overlay .loader span:nth-child(3) {
  animation-delay: 0.4s;
  background-color: var(--color-primary);
}

@keyframes loadingBar {
  0%, 40%, 100% {
    transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1);
  }
}

/* Section base */
/* Sections are separated when used within a single page but without scroll reveal. */
.section {
  padding: 5rem 0;
  opacity: 1;
  transform: none;
  transition: none;
}

.section.active {
  opacity: 1;
  transform: translateY(0);
}

.alt-bg {
  background-color: #ffffff;
}

/* Flex row for mission and vision */
.flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Hover effect for images across the site */

/* Smoothly scale images on hover. Do not apply to iframes (e.g., maps). */
.flex-row .image img,
.love-section .image img,
.marriage-card img {
  transition: transform 0.3s ease;
}

.flex-row .image:hover img,
.love-section .image:hover img {
  transform: scale(1.05);
}

/* Specific hover effect for marriage cards */
.marriage-card {
  overflow: hidden;
}

.marriage-card:hover img {
  transform: scale(1.1);
}

.flex-row.reverse {
  flex-direction: row-reverse;
}

.flex-row .text,
.flex-row .image {
  flex: 1;
  padding: 1rem;
}

.flex-row .image img {
  width: 100%;
  /* Soften the corners of images for a friendlier look */
  border-radius: 12px;
  object-fit: cover;
  /* Ensure images are not overwhelmingly large on wide screens */
  max-width: 450px;
}

/* Values list */
.values-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.values-list li {
  background-color: var(--color-light);
  border-left: 4px solid var(--color-accent);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--color-primary);
}

.values-list li span {
  display: block;
}

/* Coverage list */
.coverage-list {
  list-style: none;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.coverage-list li {
  background-color: var(--color-light);
  border-left: 4px solid var(--color-secondary);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--color-primary);
}

/* Faith list */
.faith-list {
  list-style: none;
  margin-top: 1.5rem;
}

.faith-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 1rem;
}

.faith-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: var(--color-accent);
  font-size: 1rem;
}

.faith-list .ref {
  color: var(--color-secondary);
  font-size: 0.875rem;
  font-style: italic;
  margin-left: 0.25rem;
}

/* Verse of the day section */
.verse-section {
  background-color: var(--color-light);
  text-align: center;
}

.verse-section blockquote {
  margin: 2rem auto;
  padding: 1.5rem 2rem;
  max-width: 800px;
  background-color: #ffffff;
  border-left: 4px solid var(--color-accent);
  border-radius: 4px;
  font-style: italic;
  color: var(--color-dark);
  position: relative;
}

.verse-section blockquote p {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  line-height: 1.5;
}

.verse-section blockquote footer {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-secondary);
}

/* Carousel styles */
.carousel-section {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.carousel-container {
  position: relative;
  width: 100%;
  /* Reduce height so the slide content (promesas) remains visible without excessive scrolling */
  height: 320px;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 300%; /* three slides */
  height: 100%;
  transition: transform 0.8s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Brighten the second carousel slide slightly; the underlying artwork was too dark */
.carousel-slide:nth-child(2) {
  filter: brightness(1.2);
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Darken the overlay so that the white text stands out clearly */
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  /* Position text near the top of the slide so that it remains visible even when the carousel section is partially scrolled */
  justify-content: flex-start;
  align-items: center;
  color: #ffffff;
  padding: 1.5rem;
  text-align: center;
  padding-top: 2rem;
  /* Ensure the overlay appears above the background image */
  z-index: 2;
}

.carousel-overlay h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.carousel-overlay p {
  font-size: 1.125rem;
  max-width: 80%;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 47, 94, 0.6);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  transition: background-color var(--transition-speed) ease;
}

.carousel-control:hover {
  background: rgba(0, 47, 94, 0.8);
}

.carousel-control.prev {
  left: 1rem;
}

.carousel-control.next {
  right: 1rem;
}

/* Map container */
.map-container {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

/* Responsive adjustments for carousel and verse */
@media (max-width: 768px) {
  .verse-section blockquote p {
    font-size: 1rem;
  }
  .carousel-container {
    height: 280px;
  }
  .carousel-overlay h3 {
    font-size: 1.5rem;
  }
  .carousel-overlay p {
    font-size: 0.9rem;
  }
  .carousel-control {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }
}

/* Ensure the carousel section is always visible without requiring scroll-triggered animation */
.carousel-section {
  opacity: 1 !important;
  transform: none !important;
}

/* Caption styles for carousel slides. Each caption sits near the bottom of the slide
   with a dark translucent background for readability. This replaces the previous
   overlay approach to ensure that promises and their verses remain visible. */
.carousel-caption {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 80%;
  text-align: center;
  z-index: 3;
}
.carousel-caption h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
}
.carousel-caption p {
  font-size: 1rem;
  margin: 0;
  color: #ffffff;
}

/* Reference text inside carousel captions */
.carousel-caption .ref {
  font-style: italic;
  font-size: 0.875rem;
  color: #ffeca3; /* light gold for contrast */
}

/*
 * Información de la promesa que se muestra debajo del carrusel.  Esta
 * sección se actualiza dinámicamente mediante JavaScript en función
 * de la diapositiva activa.  Utiliza colores acordes a la paleta del
 * concilio para mantener la coherencia visual.
 */
.promise-info {
  text-align: center;
  margin-top: 2rem;
  color: var(--color-primary);
}
.promise-info h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}
.promise-info p {
  font-size: 1.125rem;
  margin: 0.25rem 0;
  color: var(--color-dark);
}
.promise-info .ref {
  display: inline-block;
  margin-top: 0.25rem;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--color-accent);
}

/* Contact section */
.contact-section {
  background-color: var(--color-primary);
  color: #ffffff;
}

.contact-section h2 {
  color: #ffffff;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

/*
 * Versículo del día banner
 *
 * The daily verse appears at the top of each page. To make this
 * section stand out, we apply a soft gradient background that
 * echoes the palette of the logo, increase the heading size and
 * insert a small book emoji before the heading text. A fade‑in
 * animation brings the verse into view once it has been loaded
 * by DailyVerses.net.
 */
.verse-day-section {
  text-align: center;
  padding: 2rem 0;
  border-radius: 0.5rem;
  /* subtle gold gradient layered over a light background */
  background: linear-gradient(90deg, rgba(245, 182, 66, 0.3) 0%, rgba(245, 182, 66, 0.15) 50%, rgba(245, 182, 66, 0.3) 100%),
    #ffffff;
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-top: 4rem; /* create space below the fixed header */
}

.verse-day-section h3 {
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.verse-day-section h3::before {
  content: '📖';
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

/* Fade in the daily verse when loaded */
.daily-verses {
  opacity: 0;
  transform: translateY(8px);
  animation: verseFadeIn 0.8s forwards ease-out;
  animation-delay: 0.2s;
  line-height: 1.5;
  font-size: 1.125rem;
}

@keyframes verseFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
 * Scroll reveal animation
 *
 * Any element with the `data-reveal` attribute will start hidden and
 * slide upwards while fading in when it becomes visible in the viewport.
 */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-item {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.contact-item .icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  color: var(--color-accent);
}

.contact-item p {
  margin: 0;
}

.contact-item a {
  color: #ffffff;
  text-decoration: underline;
}

.contact-item a:hover {
  text-decoration: none;
}

/* Barra para el versículo fijo debajo del encabezado */
#verse-banner {
  /* Barra dorada con texto oscuro para destacar el versículo fijo */
  background-color: var(--color-accent);
  color: var(--color-dark);
  width: 100%;
  overflow: hidden;
  padding: 0.5rem 0;
  /* Ajusta el margen superior para que no quede oculto bajo el encabezado fijo */
  margin-top: 64px;
}
#verse-banner .container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}
#verse-banner .verse-text {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}
#verse-banner .verse-text span.ref {
  font-style: italic;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

/* Animación de aparición palabra por palabra para el versículo */
#verse-banner .verse-text span {
  opacity: 0;
  display: inline-block;
  animation: fadeInUp 0.8s forwards;
  /* Añade un pequeño margen para que las palabras no se junten */
  margin-right: 0.25rem;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Matrimonio section styles */
.marriage-section .marriage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.marriage-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  background-color: var(--color-light);
}

.marriage-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Round the corners of marriage images */
  border-radius: 12px;
}

.marriage-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.4;
}

/* Love and repentance section styles */
.love-section .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}

.love-section .image {
  flex: 1;
  min-width: 280px;
}

.love-section .image img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.love-section .text {
  flex: 1;
  min-width: 280px;
}

.love-section .text p {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .love-section .container {
    flex-direction: column;
    text-align: center;
  }
  .marriage-card .overlay {
    font-size: 0.9rem;
  }
}

/*
 * Text-only carousel used on the Promesas page.
 * Each slide is a simple text block that is shown or hidden by toggling
 * the `active` class via a small script. Controls allow manual navigation.
 */
.text-carousel {
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  background: var(--color-primary);
  color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.text-slide {
  display: none;
  text-align: center;
}

.text-slide.active {
  display: block;
}

.text-carousel h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--color-accent);
}

.text-carousel p {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.text-carousel .ref {
  font-style: italic;
  color: var(--color-secondary);
}

.text-carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: #ffffff;
  font-size: 2rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}

.text-carousel-control.prev {
  left: 10px;
}

.text-carousel-control.next {
  right: 10px;
}

/* Footer */
footer {
  background-color: var(--color-primary);
  color: #ffffff;
  text-align: center;
  padding: 1.25rem 0;
  font-size: 0.875rem;
}

/* Responsive styles */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  .hero p {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  /* Reveal nav when hamburger clicked */
  nav {
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background-color: rgba(0, 47, 94, 0.95);
    width: 220px;
    transform: translateX(100%);
    padding: 1rem;
    border-radius: 0 0 0 4px;
  }

  nav.active {
    transform: translateX(0);
  }

  nav a {
    margin: 0.5rem 0;
    display: block;
  }

  .hamburger {
    display: flex;
  }

  /* Animate hamburger into a close icon when active */
  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .flex-row {
    flex-direction: column;
  }
  .flex-row.reverse {
    flex-direction: column;
  }
  .flex-row .image,
  .flex-row .text {
    padding: 0;
  }
  .hero-overlay {
    padding: 1.5rem;
  }
}