/* Variables */
:root {
    --primary-color: #8b4513; /* Marrón Carmelita */
    --secondary-color: #f5f5dc; /* Beige */
    --accent-color: #d4af37; /* Dorado */
    --hover-color: #1e90ff; /* Azul para hover indicado en seguir.md */
    --text-color: #333;
    --light-text: #fff;
    --bg-color: #faf9f6;
    --transition-speed: 0.3s;
}

/* Reset Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Info */
.top-header {
    text-align: center;
    padding: 15px 10px;
    background-color: var(--primary-color);
    color: var(--light-text);
}

.top-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.top-header p {
    font-size: 1.1rem;
    color: var(--accent-color);
}

/* Navbar */
.navbar {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: top 0.4s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    flex-wrap: wrap;
}

/* Para ocultar el menu al hacer scroll, se usará JS para añadir la clase .nav-hidden */
.navbar.nav-hidden {
    top: -150px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
}

.nav-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 20px;
}

.nav-logo img {
    height: 60px;
    width: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-menu.left { margin-right: 15px; }
.nav-menu.right { margin-left: 15px; }

.nav-item {
    margin: 0 10px;
}

.nav-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Iconos de FontAwesome que añadiremos via CDN */
.nav-link i {
    font-size: 1.2rem;
}

.nav-link:hover {
    background-color: var(--hover-color);
    color: var(--light-text);
    transform: scale(1.1);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: bold;
}

.menu-toggle i {
    margin-right: 5px;
}

/* Carrusel */
.carousel-container {
    width: 100%;
    height: 190vh;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

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

.carousel-slide.active {
    opacity: 1;
}

/* Rejillas y Layout */
.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.grid-80 {
    flex: 1 1 75%;
}

.grid-20 {
    flex: 1 1 20%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 10px auto;
}

/* Tarjetas (Sesiones de Catequesis) */
.catequesis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all var(--transition-speed) ease;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.card-img-container {
    height: 200px;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.card-content {
    padding: 20px;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.card p {
    color: #666;
    font-size: 0.95rem;
}

.btn-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    margin-top: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-speed) ease;
}

/* Efecto hover especificado: azul, imagen grande, aparece boton */
.card:hover {
    background-color: var(--hover-color);
}

.card:hover h3, .card:hover p {
    color: var(--light-text);
}

.card:hover img {
    transform: scale(1.15);
}

.card:hover .btn-more {
    opacity: 1;
    transform: translateY(0);
    background-color: var(--light-text);
    color: var(--hover-color);
    font-weight: bold;
}

/* Rejilla secundaria (Vertical) */
.vertical-card {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s;
}

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

.vertical-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.vertical-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(139, 69, 19, 0.8);
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

/* Enlaces de interés */
.links-section {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
}

.links-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-color);
    background-color: var(--secondary-color);
    padding: 10px 20px;
    border-radius: 30px;
    transition: all 0.3s;
}

.link-item:hover {
    background-color: var(--hover-color);
    color: #fff;
}

/* Call to action */
.cta-section {
    text-align: center;
    padding: 30px 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    background-color: var(--secondary-color);
}

/* Footer */
footer {
    background-color: #333;
    color: #ccc;
    padding: 40px 20px 20px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.footer-info p {
    margin: 5px 0;
}

.social-links {
    margin-top: 15px;
}

.social-links a {
    color: #fff;
    font-size: 1.5rem;
    margin: 0 10px;
    transition: color 0.3s;
}

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

/* Boton Ir Arriba */
#btn-top {
    position: fixed;
    bottom: -60px; /* Oculto por defecto */
    right: 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: all 0.4s ease;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#btn-top.visible {
    bottom: 20px;
}

#btn-top:hover {
    background-color: var(--hover-color);
    transform: scale(1.1);
}

/* Tabla Contactos */
.contact-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.contact-table th, .contact-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.contact-table th {
    background-color: var(--primary-color);
    color: #fff;
}

/* Página Sabias que */
.sabiasque-container {
    min-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #fff;
}

.watermark {
    position: absolute;
    font-size: 30rem;
    color: rgba(0,0,0,0.03);
    z-index: 1;
}

.sabiasque-text {
    position: relative;
    z-index: 2;
    font-size: 4rem;
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
}

/* Media Queries Responsivo (Móviles) */
@media screen and (max-width: 900px) {
    .nav-container {
        justify-content: space-between;
    }
    
    .nav-logo {
        order: 1;
    }

    .menu-toggle {
        display: block;
        order: 2;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        display: none; /* Oculto por defecto en movil */
    }

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

    .nav-menu.left { order: 3; margin: 0; }
    .nav-menu.right { order: 4; margin: 0; }

    .nav-item {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }

    .nav-link {
        font-size: 0.95rem; /* Letras pequeñas en móvil */
        justify-content: center;
    }

    .grid-80, .grid-20 {
        flex: 1 1 100%;
    }
}

/* Responsividad para Tablas */
@media screen and (max-width: 600px) {
    .contact-table thead {
        display: none;
    }
    .contact-table, .contact-table tbody, .contact-table tr, .contact-table td {
        display: block;
        width: 100%;
    }
    .contact-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }
    .contact-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    .contact-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 15px;
        font-weight: bold;
        text-align: left;
        background-color: var(--secondary-color);
        height: 100%;
        display: flex;
        align-items: center;
        top: 0;
    }
}
