/* =========================================
   1. VARIABLES Y TEMA
   ========================================= */
:root {
    /* Paleta de Colores */
    --color-primary: #1a2530;      /* Azul oscuro institucional */
    --color-secondary: #c5a059;    /* Dorado litúrgico/premium */
    --color-secondary-hover: #e0b865; 
    
    /* Fondos y Textos (Modo Claro) */
    --color-bg-body: #fdfbf7;      /* Blanco hueso (cálido) */
    --color-bg-card: #ffffff;      /* Blanco puro */
    --color-bg-alt: #f3f4f6;       /* Gris muy suave */
    --color-bg-input: #ffffff;     /* Fondo de inputs */
    
    --color-text-main: #333333;    /* Gris muy oscuro */
    --color-text-muted: #666666;
    --color-border: #e5e5e5;
    
    /* Componentes */
    --nav-bg: rgba(26, 37, 48, 0.98); /* Casi opaco para legibilidad */
    --footer-bg: #0a0f14;
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 25px rgba(0,0,0,0.12);
}

/* --- TEMA OSCURO --- */
body.dark-mode {
    --color-primary: #0f151c;      /* Azul casi negro */
    --color-secondary: #d4af37;    /* Dorado más brillante */
    --color-secondary-hover: #f0c448;
    
    --color-bg-body: #121212;      /* Fondo casi negro */
    --color-bg-card: #1e1e1e;      /* Gris oscuro material */
    --color-bg-alt: #181818;       
    --color-bg-input: #2a2a2a;     /* Inputs oscuros */
    
    --color-text-main: #e0e0e0;    /* Blanco roto */
    --color-text-muted: #adb5bd;    
    --color-border: #333333;
    
    --nav-bg: rgba(10, 10, 10, 0.98);
    --footer-bg: #000000;
}

/* =========================================
   2. REGLAS GENERALES Y TIPOGRAFÍA
   ========================================= */
html {
    scroll-behavior: smooth;       /* Deslizamiento suave al navegar */
    scroll-padding-top: 90px;      /* Para que el menú fijo no tape el título */
}

body {
    font-family: 'Lato', 'Segoe UI', sans-serif; /* Fuente principal legible */
    color: var(--color-text-main);
    background-color: var(--color-bg-body);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Títulos Elegantes */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: var(--color-secondary);
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* Bootstrap Overrides para Dark Mode */
body.dark-mode .bg-light, 
body.dark-mode .bg-white {
    background-color: var(--color-bg-card) !important;
    color: var(--color-text-main) !important;
}
body.dark-mode .text-dark { color: var(--color-text-main) !important; }
body.dark-mode .text-muted { color: var(--color-text-muted) !important; }
body.dark-mode .border { border-color: var(--color-border) !important; }

/* =========================================
   3. NAVBAR (Navegación)
   ========================================= */
.navbar {
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    
    /* Configuración Sticky (Pegajosa) */
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-brand span {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #fff;
    margin-left: 10px;
    letter-spacing: 0.5px;
}

.navbar-logo {
    height: 45px;
    width: auto;
    border-radius: 6px;
    background: rgba(255,255,255,0.95);
    padding: 2px;
}

.nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
    transition: color 0.3s;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.nav-link:hover, .nav-link.active { color: #fff !important; }

/* Línea dorada al pasar el ratón */
.nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width .3s;
    margin: 4px auto 0;
}
.nav-link:hover::after { width: 80%; }

/* =========================================
   4. BOTONES Y HERO
   ========================================= */
.hero {
    height: 85vh;
    min-height: 500px;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.4)), url('FotoPortada.jpg'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero h1 { 
    color: #fff !important; 
    font-size: clamp(2.5rem, 5vw, 4.5rem); 
    text-shadow: 2px 2px 15px rgba(0,0,0,0.8);
    font-weight: 700;
}
.hero p {
    font-size: 1.3rem;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.8);
    max-width: 700px;
    margin: 0 auto 20px;
}

/* Botón Principal (Dorado) */
.btn-custom {
    background: linear-gradient(135deg, var(--color-secondary), #b08d45);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
}
.btn-custom:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.5);
    filter: brightness(1.1);
}

/* Botón Secundario (Borde Dorado) */
.btn-outline-custom {
    border: 2px solid var(--color-secondary);
    color: var(--color-secondary);
    border-radius: 50px;
    padding: 10px 30px;
    font-weight: 600;
    background: transparent;
    transition: all 0.3s;
}
.btn-outline-custom:hover {
    background-color: var(--color-secondary);
    color: #fff;
    transform: translateY(-2px);
}

/* =========================================
   5. TARJETAS Y SECCIONES
   ========================================= */
.section-padding { padding: 80px 0; }
.bg-alt { background-color: var(--color-bg-alt); }

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3.5rem;
    position: relative;
    padding-bottom: 15px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background-color: var(--color-secondary);
}

.card {
    background-color: var(--color-bg-card);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden; 
}
.card:hover { 
    transform: translateY(-5px); 
    box-shadow: var(--shadow-hover);
    border-color: var(--color-secondary); 
}

/* Cabecera de tarjeta (ej: Horarios Misa) */
.card-header-custom {
    background-color: var(--color-primary);
    color: white;
    padding: 18px;
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    border-bottom: none;
}
body.dark-mode .card-header-custom { 
    color: var(--color-secondary); 
    border-bottom: 1px solid var(--color-border);
}

/* Iconos alineados */
.card-title i, .bi {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    padding-bottom: 2px;
}

/* =========================================
   6. NUEVAS TARJETAS DE NOTICIAS
   ========================================= */
.news-card {
    transition: box-shadow 0.3s ease; 
    background: var(--color-bg-card);
    overflow: hidden; 
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}

.hover-underline:hover {
    text-decoration: underline !important;
    color: var(--color-secondary) !important;
}

/* Contenedor de Medios (Aspect Ratio Fijo) */
.media-container {
    background-color: #000;
    position: relative;
}

.object-fit-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    background-size: 50%;
    background-color: rgba(255, 255, 255, 0.8) !important;
    filter: invert(1);
}

.carousel-indicators [data-bs-target] {
    background-color: var(--color-secondary);
    height: 4px;
    border-radius: 2px;
}

.badge-news-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--color-primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.book-card-mini {
    transition: opacity 0.2s;
}
.book-card-mini:hover {
    opacity: 0.8;
}

/* Fixes Espaciado Noticias */
.news-card p:first-child { margin-top: 0 !important; }
.news-card .card-body > *:first-child { margin-top: 1rem !important; }
.news-card .card-body { padding-top: 0 !important; }
.news-card img, .news-card video, .news-card .carousel, .news-card .media-container {
    display: block; margin-bottom: 0 !important;
}

/* =========================================
   7. FORMULARIOS
   ========================================= */
.form-control, .form-select {
    background-color: var(--color-bg-input);
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background-color: var(--color-bg-input);
    color: var(--color-text-main);
    border-color: var(--color-secondary); 
    box-shadow: 0 0 0 0.25rem rgba(197, 160, 89, 0.15); 
    outline: none;
}

.form-control::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

.form-label {
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* =========================================
   8. COMPONENTES ESPECÍFICOS
   ========================================= */

/* Galería */
.gallery-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: center top;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s;
    box-shadow: var(--shadow-soft);
}
.gallery-img:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
    z-index: 2;
    filter: brightness(1.05);
}

/* Campamento / Noticias */
.camp-badge {
    background-color: var(--color-secondary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.camp-card.bg-primary {
    background-color: var(--color-bg-card) !important;
    border: 1px solid var(--color-border) !important;
}
.camp-card.bg-primary .camp-section-title {
    color: var(--color-secondary) !important;
}
.camp-card.bg-primary p, 
.camp-card.bg-primary small,
.camp-card.bg-primary div {
    color: var(--color-text-main) !important; 
}

/* Tablas */
.table-custom { width: 100%; margin-bottom: 0; }
.table-custom td, .table-custom th {
    padding: 15px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
}
.table-custom tr:last-child td { border-bottom: none; }

/* =========================================
   9. UTILIDADES Y FOOTER
   ========================================= */

/* Modales */
.modal-content {
    background-color: var(--color-bg-card);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}
.modal-header { border-bottom: 1px solid var(--color-border); }
.modal-footer { border-top: 1px solid var(--color-border); }
.btn-close { filter: invert(0); opacity: 0.7; } 
body.dark-mode .btn-close { filter: invert(1); }

/* Mapa */
.map-responsive iframe { 
    border-radius: 12px; 
    width: 100%; 
    height: 400px; 
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
}

/* Botón flotante Modo Oscuro */
.dark-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    background: var(--color-secondary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}
.dark-toggle:hover { 
    transform: scale(1.1) rotate(15deg); 
    background-color: var(--color-secondary-hover);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: #aaa;
    padding: 3rem 0;
    font-size: 0.9rem;
}
footer h5 { color: #fff; margin-bottom: 1.5rem; }
footer a { color: #aaa; }
footer a:hover { color: var(--color-secondary); }

/* UTILIDAD ZOOM */
.zoom-trigger {
    cursor: zoom-in;
    transition: filter 0.2s;
}
.zoom-trigger:hover {
    filter: brightness(0.9);
}