/*
 * =====================================================================
 * METATRON3 S.A.S - ESTILOS PERSONALIZADOS
 * =====================================================================
 * Versión: 1.3 (Final con ajuste de fondos y limpieza de caracteres)
 * Base: Pico.css
 * Fecha: 25/11/2025
 */

/* ----------------------------------------
 * 1. VARIABLES Y CONFIGURACIÓN BASE (Tema Claro con Dorado/Plateado)
 * ---------------------------------------- */

:root {
    /* Paleta de Colores Metatron3 S.A.S - Expandida */
    --plateado-claro: #f0f3f6; /* Fondo claro base */
    --gris-claro: #d8dbe2; /* Borde o separación suave */
    --gris-medio: #a9adb5; /* Texto secundario */
    --gris-oscuro: #333333; /* Texto principal */
    --dorado-brillo: #cfae46; /* Botón principal (Primary) */
    --dorado-medio: #b5993e; /* Gradiente / Hover */
    --dorado-oscuro: #8b6d37; /* Títulos / Énfasis / Contraste */
    --blanco-puro: #ffffff;
    
    /* Configuración Pico.css */
    --pico-background-color: var(--plateado-claro);
    --pico-color: var(--gris-oscuro); 
    --pico-primary: var(--dorado-brillo);
    --pico-secondary: var(--gris-oscuro);

    /* Estilos globales */
    --transition-speed: 0.3s;
    --pico-border-radius: 6px;
}

/* ----------------------------------------
 * 2. FONDO Y ESTRUCTURA GENERAL
 * ---------------------------------------- */

body {
    background-color: var(--plateado-claro);
    color: var(--gris-oscuro);
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-speed) ease;
}

h1, h2, h3, hgroup h3, p, li {
    color: var(--gris-oscuro);
}

h2 {
    color: var(--dorado-oscuro); 
    font-weight: bold;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

h3 {
    color: var(--dorado-oscuro); 
    font-weight: 600;
}

/* ----------------------------------------
 * 2B. FONDOS ESPECÍFICOS POR PÁGINA (Imagen de Fondo - URLs Públicas)
 * ---------------------------------------- */

/* Estilos de fondo base */
.body-bg {
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
}

/* Fondo para Quiénes Somos (y ahora Index) */
.bg-quienes, .bg-servicios, .bg-contacto {
    /* Opacidad ajustada: 0.7/0.8 */
    background-image: linear-gradient(rgba(240, 243, 246, 0.35), rgba(240, 243, 246, 0.45)), 
                      url('../img/fondo.png');
}



/* ----------------------------------------
 * 3. NAVEGACIÓN Y DIFUMINADOS ELEGANTES
 * ---------------------------------------- */

nav {
    background: linear-gradient(90deg, var(--gris-claro), var(--dorado-medio), var(--gris-claro));
    background-size: 300% 100%; 
    animation: movimiento-navbar 15s ease infinite; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--gris-oscuro);
    position: relative; 
    z-index: 100;
}

@keyframes movimiento-navbar {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

nav a, nav strong a {
    color: var(--gris-oscuro);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

nav a:hover {
    color: var(--dorado-oscuro);
    transform: translateY(-1px);
}

nav a.active {
    color: var(--dorado-oscuro) !important; 
    background-color: rgba(255, 255, 255, 0.3); 
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border-bottom: 2px solid var(--dorado-oscuro); 
    font-weight: bold;
    transition: all var(--transition-speed) ease;
}

nav strong a.active {
    color: var(--dorado-oscuro) !important; 
    background-color: transparent;
    border-bottom: none;
    padding: 0;
}


nav img {
    max-height: 40px;
    width: auto;
    vertical-align: middle;
}

/* ----------------------------------------
 * 4. CONTENIDO Y COMPONENTES
 * ---------------------------------------- */

section:not(:last-of-type) {
    margin: 5rem 0;
    padding: 2rem 0;
    border-image: linear-gradient(to right, transparent 5%, var(--dorado-brillo) 50%, transparent 95%);
    border-image-slice: 1;
    border-bottom: 2px solid; 
}

/* CUADRÍCULA DE SERVICIOS (3 columnas para escritorio) */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 COLUMNAS EN ESCRITORIO */
    gap: 20px; 
    margin-top: 2rem;
    align-items: stretch; /* CRÍTICO: Asegura que todas las tarjetas tengan la misma altura */
}

/* NUEVA CLASE: Cuadrícula principal para secciones (Index, Quiénes Somos, Contacto) */
.main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(250px, 1fr)); 
    gap: 40px; 
    align-items: start; 
    margin-top: 2rem;
}

.main-grid figure {
    margin: 0; 
    padding: 0;
    width: 100%; 
}

.main-grid figure img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover; 
    border-radius: var(--pico-border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.main-grid > div {
    display: flex;
    flex-direction: column; 
    gap: 1.5rem; 
}

.main-grid hgroup h3 {
    font-size: 1.3rem; 
    color: var(--dorado-oscuro); 
    text-align: left; 
    margin-bottom: 0.5rem;
    display: block; 
}

.main-grid hgroup p, .main-grid article p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0; 
    color: var(--gris-oscuro); 
}

/* Artículos de servicio - EFECTO BOTÓN PEQUEÑO */
.grid article {
    background-color: var(--blanco-puro);
    border: 1px solid var(--gris-claro); 
    border-left: 5px solid var(--dorado-brillo); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease, border-color var(--transition-speed) ease;
    
    display: flex; 
    flex-direction: column; 
    padding: 0.8rem; 
    /* Altura mínima para forzar el stretch en filas de servicios */
    min-height: 250px; 
}

/* Hover en Artículos */
.grid article:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* AJUSTE PARA EL TÍTULO DE SERVICIO (Uniformidad de altura) */
.grid article h3 {
    font-size: 1.1rem; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2; 
    margin-bottom: 0; 
    color: var(--gris-oscuro); 
    word-break: break-word; 
    min-height: 120px; 
}

.grid article h3 > * {
    font-size: 1.5rem; 
    margin-bottom: 0.5rem;
}

/* ----------------------------------------
 * 5. FOOTER (Degradado Oscuro para Contraste)
 * ---------------------------------------- */

footer {
    background: linear-gradient(180deg, var(--dorado-medio), var(--dorado-oscuro));
    color: var(--blanco-puro);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

footer small, footer a {
    color: var(--blanco-puro);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    color: var(--plateado-claro);
}

/* ----------------------------------------
 * 6. ANIMACIONES Y CURSORES
 * ---------------------------------------- */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

a:hover, button:hover, input[type="submit"]:hover, .toggle-button {
    cursor: pointer;
}

::selection {
    background: var(--dorado-oscuro);
    color: white;
}

figure figcaption {
    font-size: 0.65rem; 
    color: #888888; 
    text-align: right;
    margin-top: 0.3rem;
}

figure figcaption a {
    color: #888888;
    text-decoration: none;
}

figure figcaption a:hover {
    color: var(--dorado-oscuro);
}

/* ----------------------------------------
 * 7. MEDIA QUERIES (RESPONSIVE)
 * ---------------------------------------- */

@media (max-width: 992px) {
    /* Tablet: volvemos a 2 columnas para el .grid normal (servicios) */
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid article:nth-child(5):last-child {
        grid-column: span 2; 
        justify-self: center; 
        align-self: center;
        width: 70%; 
        margin: 1rem auto; 
    }

    /* PARA .main-grid en tablet: 1 columna */
    .main-grid {
        grid-template-columns: 1fr; 
        gap: 30px;
    }
    .main-grid figure, .main-grid hgroup, .main-grid article {
        text-align: center; 
    }
    .main-grid hgroup h3 {
        text-align: center; 
    }
}

@media (max-width: 576px) {
    /* Móvil: 1 columna para ambos grids */
    .grid {
        grid-template-columns: 1fr;
    }
    .grid article:nth-child(5):last-child {
        grid-column: span 1;
        width: 100%;
        margin: 1rem 0;
    }
    /* AJUSTE CRÍTICO PARA MÓVIL: Las tarjetas deben ser más altas para el texto */
    .grid article {
        min-height: 300px; 
    }


    .main-grid {
        grid-template-columns: 1fr; 
        gap: 20px;
    }
    .main-grid figure, .main-grid hgroup, .main-grid article {
        text-align: center; 
    }
    .main-grid hgroup h3 {
        text-align: center; 
    }
}

/* ----------------------------------------
 * 8. AJUSTE PARA CENTRAR EL ÚLTIMO ELEMENTO (5to de 5)
 * ----------------------------------------
 */

@media (min-width: 993px) {
    .grid article:nth-child(5):last-child {
        grid-column: 1 / span 3; 
        justify-self: center; 
        align-self: center;
        width: 40%; 
        margin: 1rem auto; 
    }
}


/* ----------------------------------------
 * 9. ESTILOS PARA SUBMENÚS DESPLEGABLES (Accordion)
 * ---------------------------------------- */

.toggle-button {
    user-select: none; 
    cursor: pointer; 
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--gris-claro); 
    width: 100%; 
    transition: background-color var(--transition-speed) ease;
}

.toggle-button i {
    font-size: 1.5rem;
    color: var(--dorado-oscuro);
    margin-bottom: 0.5rem;
}

.toggle-button:hover {
    background-color: rgba(139, 109, 55, 0.05); 
}

.service-content {
    max-height: 0; 
    overflow: hidden; 
    padding: 0 1rem; 
    transition: max-height 0.4s ease-out, padding 0.4s ease-out, opacity 0.4s ease;
    opacity: 0;
    margin-top: 0.5rem; 
}

/* Estado activo del colapsable */
article.collapsible.active .service-content {
    max-height: 500px; 
    padding: 1rem 0; 
    opacity: 1;
}

/* Contenedor de imagen en el submenú */
.submenu-figure {
    margin: 1rem 0;
    padding: 0;
    text-align: center;
}

.submenu-figure img {
    max-width: 100%; 
    height: auto;
    border-radius: var(--pico-border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/*
 * ----------------------------------------
 * 10. ESTILOS PARA BANNER Y TEMA OSCURO (Index.html)
 * ----------------------------------------
 */

/* --- TEMA OSCURO GENERAL (Aplicado al body.dark-style) --- */

body.dark-style {
    background-color: var(--gris-oscuro); 
}

/* CRÍTICO: Alinea a la izquierda los títulos H2 en las secciones del index.html */
body.dark-style main section h2 {
    text-align: left; 
}


body.dark-style h1, body.dark-style h2, body.dark-style h3, 
body.dark-style p, body.dark-style li, body.dark-style a {
    color: var(--blanco-puro);
}

/* Las secciones dentro del tema oscuro vuelven a tener un fondo claro para contraste */
body.dark-style main section {
    background-color: var(--blanco-puro); 
    color: var(--gris-oscuro);
    padding: 3rem 1rem;
    margin: 3rem auto;
    border-radius: var(--pico-border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.dark-style main section h2, body.dark-style main section h3 {
    color: var(--dorado-oscuro); 
}

/* --- ESTILO DEL BANNER HERO --- */

.hero-banner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* AJUSTE CLAVE: Aumentamos la altura mínima a 75vh */
    min-height: 75vh; 
    padding: 2rem 4rem 0 4rem; /* AJUSTE CLAVE: Añadimos 2rem de padding superior */
    margin-top: 0; 
    
    /* URL PÚBLICA PARA IMAGEN DE FONDO */
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                      url('../img/banner.gif'); 
    background-size: cover;
    background-position: center center;
    color: var(--blanco-puro);
}

.hero-content {
    max-width: 600px;
}

.hero-banner h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--blanco-puro);
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* ... (El resto de la sección 10 permanece igual) ... */

.hero-banner p {
    font-size: 1.25rem;
    color: var(--plateado-claro);
    margin-bottom: 2rem;
}

.hero-cta a {
    margin-right: 1rem;
}

/* --- ESTILOS ADICIONALES PARA EL TEMA OSCURO --- */

/* Ajuste de enlaces/botones dentro del tema oscuro */
body.dark-style a[role="button"].outline {
    border-color: var(--dorado-brillo);
    color: var(--dorado-brillo);
}

body.dark-style a[role="button"].outline:hover {
    background-color: var(--dorado-brillo);
    color: var(--gris-oscuro);
}

/* Ajuste para los "pills" de servicios destacados */
.services-pills a[role="button"] {
    display: block;
    text-align: center;
    margin: 0.5rem;
    border-radius: 50px; 
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.services-pills {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}


/* --- MEDIA QUERIES PARA RESPONSIVE EN BANNER --- */

@media (max-width: 768px) {
    .hero-banner {
        height: 50vh; 
        padding: 0 2rem;
        justify-content: center;
        text-align: center;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-banner h1 {
        font-size: 2rem;
    }
    .hero-cta {
        display: flex;
        flex-direction: column;
    }
    .hero-cta a {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}