/* Fonts loaded via preconnect in HTML for better performance */

:root {
    /* Paleta Cálida "Comunidad Viva" */
    --bg-cream: #FDF8F3;
    --bg-beige: #F5EBE0;
    --bg-white: #FFFFFF;

    --text-primary: #3D3229;
    --text-secondary: #6B5D4D;
    --text-light: #8B7D6B;

    --accent-terracotta: #C4704B;
    --accent-terracotta-hover: #A85A3A;
    --accent-sage: #7A8B6E;
    --accent-sage-dark: #5C6B52;

    --neutral-border: #E0D5C7;
    --neutral-beige-gold: #E8D5B7;

    /* Sección oscura (contacto/footer) */
    --dark-brown: #3D3229;
    --darker-brown: #2C2420;
    --text-on-dark: #F5EBE0;

    /* Sombras */
    --shadow-soft: 0 4px 20px rgba(61, 50, 41, 0.08);
    --shadow-medium: 0 8px 30px rgba(61, 50, 41, 0.12);
    --shadow-hover: 0 12px 40px rgba(61, 50, 41, 0.15);

    /* Transiciones */
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ================================
   RESET & BASE
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 17px;
    overflow-x: hidden;
}

/* ================================
   ACCESSIBILITY
================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-terracotta);
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    transition: top 0.3s ease;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent-terracotta);
    outline-offset: 2px;
}

/* ================================
   TYPOGRAPHY
================================ */
h1 {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: var(--accent-terracotta);
    line-height: 1.2;
}

h2,
h3,
h4 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    line-height: 1.3;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
}

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

ul {
    list-style: none;
}

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

/* ================================
   LAYOUT UTILITIES
================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }

    .container {
        padding: 0 1.25rem;
    }
}

.bg-white {
    background-color: var(--bg-white);
}

.bg-beige {
    background-color: var(--bg-beige);
}

.bg-dark {
    background-color: var(--dark-brown);
    color: var(--text-on-dark);
}

.bg-dark h2,
.bg-dark h3 {
    color: var(--text-on-dark);
}

.bg-dark p {
    color: rgba(245, 235, 224, 0.85);
}

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

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* ================================
   SECTION TITLE
================================ */
.section-title {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-terracotta);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* ================================
   GRIDS
================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Prevent iOS Zoom on focus */
@media screen and (max-width: 768px) {

    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ================================
   BUTTONS
================================ */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--accent-terracotta);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-terracotta-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--accent-terracotta);
    color: var(--accent-terracotta);
}

.btn-secondary:hover {
    background: var(--accent-terracotta);
    color: white;
}

.btn-sage {
    background: var(--accent-sage);
    color: white;
}

.btn-sage:hover {
    background: var(--accent-sage-dark);
    transform: translateY(-2px);
}

/* ================================
   CARDS
================================ */
.card {
    background: var(--bg-white);
    border-radius: 16px;
    border: 1px solid var(--neutral-border);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    margin-bottom: 1rem;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* ================================
   NAVIGATION
================================ */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease;
}

header.nav-hidden {
    transform: translateY(-100%);
}

nav {
    padding: 1rem 0;
    background: transparent;
    transition: var(--transition-smooth);
}

nav.scrolled {
    background: var(--bg-cream);
    box-shadow: var(--shadow-soft);
    padding: 0.75rem 0;
}

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

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

.nav-logo {
    height: 45px;
    width: 45px;
    border-radius: 8px;
    object-fit: cover;
}

.brand span {
    font-family: 'Caveat', cursive;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-terracotta);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-terracotta);
    transition: var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-terracotta);
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-smooth);
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-cream);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    padding: 5rem 2rem 2rem;
    transition: var(--transition-smooth);
    z-index: 999;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--neutral-border);
}

.mobile-menu a:hover {
    color: var(--accent-terracotta);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
    opacity: 0;
    transition: var(--transition-smooth);
}

.mobile-overlay.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu,
    .mobile-overlay {
        display: block;
    }
}

/* ================================
   HERO SECTION
================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    background: var(--bg-cream);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 50%;
    height: 80%;
    background: var(--bg-beige);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero .grid-2 {
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
}

.hero-image img {
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
}

.hero-image::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    background: var(--neutral-beige-gold);
    border-radius: 20px;
    z-index: -1;
}

.hero-logo {
    width: 120px;
    margin-bottom: 1.5rem;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .hero {
        padding-top: 80px;
        text-align: center;
    }

    .hero .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-text {
        order: 2;
    }

    .hero-image {
        order: 1;
        max-width: 300px;
        margin: 0 auto;
    }

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

    .hero-logo {
        margin: 0 auto 1.5rem;
    }
}

/* ================================
   FEATURE LIST
================================ */
.feature-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: '✓';
    color: var(--accent-sage);
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ================================
   LEAD TEXT
================================ */
.lead {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ================================
   QUOTE / BLOCKQUOTE
================================ */
.quote-container {
    background: var(--bg-beige);
    border-left: 4px solid var(--accent-sage);
    padding: 2rem;
    border-radius: 0 12px 12px 0;
    position: relative;
}

.quote-container::before {
    content: '"';
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    color: var(--accent-sage);
    opacity: 0.3;
    position: absolute;
    top: 0;
    left: 1rem;
    line-height: 1;
}

.quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.quote p {
    color: var(--text-primary);
}

.quote-container figcaption,
.quote cite {
    display: block;
    font-style: normal;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* ================================
   CONSEJO PASTORAL
================================ */
.pastor-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.pastor-card {
    background: var(--bg-white);
    border-radius: 16px;
    border: 1px solid var(--neutral-border);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    text-align: center;
    width: 300px;
    max-width: 100%;
    flex: 0 1 350px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.pastor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.pastor-org {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: auto;
    padding-bottom: 1.5rem;
}

.pastor-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-terracotta);
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 15px rgba(196, 112, 75, 0.2);
}

.pastor-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pastor-role {
    color: var(--accent-terracotta);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}



.pastor-education {
    text-align: left;
    margin-bottom: 1.5rem;
}

.pastor-education h4 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.pastor-education ul {
    list-style: none;
}

.pastor-education li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.pastor-education li::before {
    content: '•';
    color: var(--accent-sage);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.pastor-social a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-sage);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-sage);
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.pastor-social a:hover {
    background: var(--accent-sage);
    color: white;
}

/* ================================
   DOCTRINE / CREDO SECTION
================================ */
.doctrine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.doctrine-item {
    text-align: center;
    padding: 1.5rem;
}

.doctrine-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.doctrine-item p {
    font-size: 0.95rem;
}

/* ================================
   COURSES SECTION
================================ */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.course-category {
    background: var(--bg-white);
    border-radius: 16px;
    border: 1px solid var(--neutral-border);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.course-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.course-category h3 {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-terracotta);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.course-category ul li {
    padding: 0.6rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--neutral-border);
}

.course-category ul li:last-child {
    border-bottom: none;
}

.sep-badge {
    text-align: center;
    margin-top: 3rem;
    padding: 1.25rem 2rem;
    background: var(--bg-white);
    border: 2px solid var(--accent-sage);
    border-radius: 12px;
    display: inline-block;
}

.sep-badge p {
    color: var(--accent-sage);
    font-weight: 600;
    font-size: 1rem;
}

/* ================================
   CONTACT SECTION
================================ */
.contact-info li {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-info li span {
    font-size: 1.25rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 235, 224, 0.3);
    color: var(--text-on-dark);
    font-weight: 500;
    transition: var(--transition-smooth);
}

.social-links a:hover {
    background: var(--accent-terracotta);
    border-color: var(--accent-terracotta);
}

/* Contact Form */
.contact-form {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--neutral-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-cream);
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-terracotta);
    box-shadow: 0 0 0 3px rgba(196, 112, 75, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.w-100 {
    width: 100%;
}

/* ================================
   FOOTER
================================ */
footer {
    background: var(--darker-brown);
    color: var(--text-on-dark);
    padding: 4rem 0 2rem;
}

.footer-brand {
    margin-bottom: 1.5rem;
}

.footer-logo {
    height: 70px;
    width: 70px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    object-fit: cover;
}

.footer-brand h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.75rem;
    color: var(--text-on-dark);
}

footer p {
    color: rgba(245, 235, 224, 0.7);
    font-size: 0.95rem;
}

.footer-quote {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 3px solid var(--accent-sage);
}

.footer-quote blockquote p,
.footer-quote p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: rgba(245, 235, 224, 0.85);
}

.footer-quote figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: rgba(245, 235, 224, 0.6);
}

.copyright {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: rgba(245, 235, 224, 0.5);
}

/* ================================
   ANIMATIONS
================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Default state for elements with JS */
.animate-on-scroll {
    opacity: 0;
}

/* Visible state when JS adds class */
.animate-on-scroll.visible {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Fallback for no-JS: show all content */
.no-js .animate-on-scroll {
    opacity: 1;
}

/* Staggered animation for grid items */
.grid-3 .animate-on-scroll:nth-child(1).visible {
    animation-delay: 0s;
}

.grid-3 .animate-on-scroll:nth-child(2).visible {
    animation-delay: 0.1s;
}

.grid-3 .animate-on-scroll:nth-child(3).visible {
    animation-delay: 0.2s;
}

/* ================================
   RESPONSIVE UTILITIES
================================ */
@media (max-width: 768px) {
    .section {
        padding: 3.5rem 0;
    }

    .container {
        padding: 0 1.25rem;
    }

    .section-title::after {
        width: 40px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        padding: 12px 28px;
    }
}

/* Imagen redondeada utility */
.img-rounded {
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

/* ================================
   REDUCED MOTION
================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}