/* ==========================================================================
   1. GLOBAL RESETS & TYPOGRAPHY
   ========================================================================== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;               /* Removed body top-padding so hero extends to the top edge */
  font-family: 'Roboto', sans-serif;
  background-color: #fffaf5;
  color: #333;
  display: flex;            /* Sticky footer layout */
  flex-direction: column;   
  line-height: 1.8;
  overflow-x: hidden;
}

main {
  flex: 1;                  /* Pushes footer to the bottom */
}

h1, h2 {
  font-family: 'Playfair Display', serif; 
}

/* Transformation Centre Slogan */
.slogan-text {
  font-weight: 600;
  letter-spacing: 1px;
  color: #d4af37; /* Gold */
  margin-bottom: 2rem;
}

/* Headers with golden underline */
h2, h3, h4 {
  position: relative;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #4b0000;
}

h2::after, h3::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  margin: 0.5rem auto 0;
  background-color: #d4af37; /* Gold */
  border-radius: 2px;
}

.maroon-heading {
  color: #4b0000;
}

.hidden {
  display: none;
}

/* Apply History Page Paragraph Styling Globally across all Main Content */
main p, 
.section-block p, 
.article-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   2. GLOBAL HEADER & NAVIGATION
   ========================================================================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  
  /* Fixed positioning overlay */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  
  /* Transparent background with glass blur effect */
  background-color: rgba(255, 250, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Flex logo */
.header-logo2 {
  width: 70px;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  animation: glowPulse 2s infinite alternate, fadeIn 1.2s ease-in-out;
  transition: transform 0.3s ease;
}

/* Flex NAV LINKS */
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: black;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #d4af37; /* Gold */
}

/* Navbar toggle (Mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #d4af37;
  cursor: pointer;
}

/* Mobile Nav */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  .menu-toggle { 
    display: block; 
  }
  
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    border-radius: 0 0 0 8px;
    z-index: 10;
    
    /* Transparent background for mobile dropdown */
    background-color: rgba(255, 250, 245, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .nav-links.active { display: flex; }
}

/* ==========================================================================
   3. SHARED STRUCTURAL COMPONENTS (Sections, Cards, Buttons)
   ========================================================================== */
.section-block, 
main article, 
main section:not(.hero-slideshow):not(.page-header):not(.cta-banner):not(.bg-light) {
  padding: 3rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.bg-light {
  background-color: #f1f1f1;
  width: 100%;
  max-width: 100%;
  padding: 4rem 2rem;
  box-sizing: border-box;
}

/* Keep grid sections wider when displaying cards */
.section-block:has(.card-grid) {
  max-width: 1200px;
}

.bg-light h2, .bg-light p, .bg-light .card-grid, .bg-light a, .bg-light div {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

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

.card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  border-top: 4px solid #800000;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-role {
  font-style: italic;
  color: #666;
  margin-bottom: 1rem;
}

/* History Page Link Style Applied Globally to Inline Text Links */
main p a, 
main li a, 
.text-link,
.article-content a {
  color: #800000;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #d4af37; /* Gold underline */
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: all 0.3s ease;
  display: inline;
  margin-top: 0;
}

main p a:hover, 
main li a:hover, 
.text-link:hover,
.article-content a:hover {
  color: #d4af37;
  text-decoration-color: #800000;
  background-color: rgba(212, 175, 55, 0.1); /* Gold highlight */
}

/* Base Buttons */
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary, 
a.btn-primary {
  background-color: #d4af37; /* Gold */
  color: #111 !important;
  padding: 0.8rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s ease;
  display: inline-block;
}

.btn-primary:hover, 
a.btn-primary:hover {
  background-color: #f3c63f !important;
}

.btn-secondary, 
a.btn-secondary {
  background-color: transparent;
  color: #ffffff !important;
  border: 2px solid #ffffff;
  padding: 0.8rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease;
  display: inline-block;
}

.btn-secondary:hover, 
a.btn-secondary:hover {
  background-color: #ffffff;
  color: #111 !important;
}

/* Button for light backgrounds */
.btn-outline-maroon, 
a.btn-outline-maroon {
  background-color: transparent;
  color: #800000 !important;
  border: 2px solid #800000;
  padding: 0.8rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-outline-maroon:hover, 
a.btn-outline-maroon:hover {
  background-color: #800000;
  color: #ffffff !important;
}

.cta-banner {
  background-color: #800000;
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

/* ==========================================================================
   4. HERO SLIDESHOW & PAGE HEADERS
   ========================================================================== */
.hero-slideshow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 8rem 2rem 5rem 2rem; /* Extra top padding ensures text clears the overlaying header */
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  background-color: #1a0000; /* Fallback dark color */
}

.slideshow-container {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  z-index: 1;
}

.slide {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.slide.active {
  opacity: 1;
}

/* Dark tint overlay for text legibility */
.slide::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 0, 0, 0.75);
}

.hero-content.z-index-top {
  position: relative;
  z-index: 2; /* Keeps text above images and overlay */
}

.hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #ffffff !important;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #f1f1f1 !important;
  max-width: 700px;
  margin: 0 auto 2.5rem auto;
  line-height: 1.6;
}

/* Subpage Headers (About, Contact, History, etc.) */
.page-header, .hero-blended {
  background-color: #5a0000;
  background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('../images/rgc-subukia-cathedral.jpg');
  background-size: cover;
  background-position: center;
  color: #ffffff !important;
  padding: 8rem 2rem 5rem 2rem; /* Extra top padding clears the fixed header */
  text-align: center;
}

.page-header h1 {
  color: #ffffff !important;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.page-header::after {
  display: none;
}

/* ==========================================================================
   5. PAGE-SPECIFIC: FORMS & SERVICE TIMES
   ========================================================================== */
.service-times {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  margin: 20px auto;
  text-align: center;
  border-left: 5px solid #d4af37;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.service-times h2 {
  font-size: 1.5rem;
  color: #800000;
  margin-bottom: 20px;
}

.service-times ul {
  list-style-type: none;
  padding: 0;
}

.service-times li {
  font-size: 1rem;
  color: #333;
  margin: 10px 0;
  padding: 8px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.form-group {
  text-align: left;
  margin-bottom: 1.5rem;
}

.form-group label {
  font-weight: bold;
  display: block;
  margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  border-color: #d4af37;
}

/* ==========================================================================
   6. PAGE-SPECIFIC: GIVING
   ========================================================================== */
.give-hero {
  background: linear-gradient(rgba(128, 0, 0, 0.8), rgba(178, 34, 34, 0.85)), url('../images/image 1.jpg') center/cover no-repeat;
  padding: 7rem 0 1rem;
  color: white;
  animation: fadeIn 1.5s ease-in-out;
  position: relative;
  z-index: 1;
}

.give-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.give-intro {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: #fff3d8;
  animation: fadeIn 1.8s ease;
}

.paybill-box {
  background-color: #fffaf5;
  border: 2px solid #d4af37;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
  color: #800000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  animation: fadeIn 1.4s ease;
}

.paybill-box .instructions {
  color: #aa0000;
  font-style: italic;
}

/* ==========================================================================
   7. PAGE-SPECIFIC: CONTACT
   ========================================================================== */
.contact-container {
  display: flex;
  justify-content: space-between;
  padding: 2rem 0;
  gap: 2rem;
  margin-top: 2rem;
  max-width: 1000px !important;
}

.contact-form {
  width: 48%;
  animation: fadeUp 1.5s ease-out;
}

.contact-info {
  width: 48%;
  background-color: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: fadeUp 1.5s ease-out;
}

.email {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.contact-form button {
  background-color: #d4af37;
  color: #4b0000;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.contact-form button:hover {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .contact-container {
    flex-direction: column;
  }
  .contact-form, .contact-info {
    width: 100%;
    box-sizing: border-box;
  }
  .contact-info {
    box-shadow: none;
  }
}

/* ==========================================================================
   8. GLOBAL FOOTER
   ========================================================================== */
footer {
  background-color: #4b0000;
  color: #ffffff;
  padding: 3rem 1.5rem 1.5rem;
  font-size: 0.9rem;
  border-top: 2px solid #d4af37;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto 2rem auto;
  width: 100%;
  box-sizing: border-box;
}

.footer-column {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.footer-column h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #d4af37;
  font-size: 1.1rem;
  text-align: left;
}

.footer-column h4::after {
  display: none;
}

.footer-column ul, 
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li, 
.contact-list li {
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.footer-column a, 
.contact-list a {
  color: #ffffff !important;
  text-decoration: none !important;
  background-color: transparent !important;
  transition: color 0.3s ease;
}

.footer-column a:hover, 
.contact-list a:hover {
  color: #d4af37 !important;
}

.footer-brand {
  align-items: flex-start;
}

.footer-logo {
  width: 95px;
  height: 95px;
  object-fit: contain;
  border-radius: 50%;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.footer-brand-text {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.social-note {
  color: #fff3d8;
  font-style: italic;
  font-size: 0.9rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.social-footer-icons {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-icon-footer {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease, filter 0.3s ease;
  border-radius: 50%;
}

.social-icon-footer:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 6px #d4af37);
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
  }

  .footer-column {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  footer {
    text-align: center;
  }

  .footer-content {
    align-items: center;
  }

  .footer-column {
    align-items: center;
    text-align: center;
  }

  .footer-column h4 {
    text-align: center;
  }

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

  .social-footer-icons {
    justify-content: center;
  }
}

/* ==========================================================================
   9. GLOBAL ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes glowPulse {
  from { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
  to { box-shadow: 0 0 25px rgba(255, 215, 0, 0.9); }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   10. ARTICLE & GENERAL TEXT CONTENT CLASS
   ========================================================================== */
.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.article-content h2, 
.article-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  color: #4b0000;
}

/* Adjust hero section for mobile */
@media (max-width: 768px) {
  .hero-slideshow {
    min-height: 45vh;
    padding: 6rem 1rem 3rem 1rem;
  }
  
  .slide {
    background-position: center center; 
  }

  .hero-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .slogan-text {
    margin-bottom: 1.5rem;
  }
}