:root {
    /* Paleta de colores */
    --primary-color: #de528c;
    --secondary-color: #2c3e50;
    --secondary-color-rgb: 44, 62, 80; /* Equivalente en RGB de #2c3e50 */
    --accent-color: #4ecdc4;
    --light-gray: #f8f9fa;
    --text-color: #333;
    --white: #ffffff;

    /* Tipografía */
    --font-secondary: 'Roboto', sans-serif;
    --font-primary: 'Merriweather', serif;

    /* Espaciado */
    --space-unit: 1rem;
    --space-xs: calc(0.5 * var(--space-unit));
    --space-sm: calc(0.75 * var(--space-unit));
    --space-md: calc(1.25 * var(--space-unit));
    --space-lg: calc(2 * var(--space-unit));

    /* Anchos */
    --max-text-width: 720px;
}

body, html {
    margin: 0;
    padding: 0;
}


/* ===== HEADER  ===== */

/* Añadir al inicio de styles.css */
.Sec_INICIO, 
.Sec_PUBLICACIONES, 
.GRUPOSCLINICOS {
    display: none;
}

.Sec_INICIO {
    display: block; /* Mostrar solo INICIO por defecto */
}   


.header {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    height: 70px; /* Altura aumentada */
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar {
    width: 100%;
    max-width: 1200px;
    padding: 0 var(--space-md);
}

.nav_lista {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0;
    margin: 0;
    list-style: none;
    height: 100%;
}

.navbar_item {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 var(--space-xs); /* Espacio alrededor de cada item */
}

.navbar a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: var(--space-sm) var(--space-md); /* Mayor área de click */
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 4px;
}

/* Efecto hover - Subrayado animado */
.navbar a::after {
    content: '';
    position: absolute;
    bottom: 8px; /* Posición más baja */
    left: var(--space-md);
    width: 0;
    height: 3px;
    background: var(--accent-color);
    transition: width 0.3s ease;
    transform: translateX(0);
    border-radius: 2px;
}

.navbar a:hover::after {
    width: calc(100% - 2 * var(--space-md)); /* Ancho completo menos paddings */
}

/* Área de hover más grande */
.navbar a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        height: 60px;
    }
    
    .navbar_item {
        padding: 0;
    }
    
    .navbar a {
        font-size: 0.95rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .navbar a::after {
        bottom: 6px;
        left: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .header {
        height: 50px;
    }
    
    .navbar a {
        font-size: 0.85rem;
    }
    
    .nav_lista {
        gap: var(--space-xs);
    }
}


/* ===== INICIO  ===== */


#INICIO {
    scroll-margin-top: 70px; /* Usar variable --space-lg */
    background: var(--light-gray);
}

#PUBLICACIONES {
    scroll-margin-top: 70px; /* Usar variable --space-lg */
}

    /* ===== Imagen Inicio  ===== */

.imagen_inicio_div {
    position: relative;
    height: calc(100vh - 70px); /* Ajusta la altura (50% de la altura de la ventana) */
    min-height: 500px;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
        url("/images/Foto_div_inicio.webp") center calc(0% + 40px)/cover fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.imagen_inicio_overlay_text {
    text-align: center;
    max-width: 800px;
    padding: var(--space-md);
}

.imagen_inicio_overlay_text h1 {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}


    /* ===== INICIO: Contenido  ===== */


.contenido_INICIO {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

/* Contenedor de la sección que divide texto e imagen */
.INICIO_parte {
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
    align-items: center;
    background: var(--white);
    padding: var(--space-lg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.INICIO_parte:nth-child(even) {
    flex-direction: row-reverse;
}

/* Texto alineado vertical y horizontalmente */
.INICIO_texto {
    width: 50%;
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: justify;
}

.INICIO_texto p {
    margin-bottom: var(--space-md);
    font-family: var(--font-primary);
}

.INICIO_texto p:last-child {
    margin-bottom: 0;
}

/* Imagen también centrada */
.img_container {
    width: 50%;
    max-width: 500px;
}

.img {
    display: flex;
    justify-content: center; /* Centra el contenido horizontalmente */
    align-items: center;     /* Centra el contenido verticalmente */
}

.INICIO_parte_1_imagen, .INICIO_parte_2_imagen {
    width: 75%;
    max-width: 450px;
    height: auto;
    display: block;
}

.INICIO_parte_3_imagen {
    width: 90%;
    max-width: 450px;
    height: auto;
    display: block;
}

.INICIO_imagen {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.INICIO_parte_2 {
    flex-direction: row-reverse;
}

.div_foto_GC {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid black;
}

.img_GC {
    width: 500px;
    height: auto;
}

/* ===== RESPONSIVE PARA SECCIÓN INICIO ===== */

@media (max-width: 1024px) {
    .INICIO_parte {
        gap: var(--space-md);
        padding: var(--space-md);
    }
    
    .INICIO_texto, 
    .img_container {
        width: 100%;
    }
    
    .INICIO_texto {
        font-size: 1.1rem;
    }
    
    .INICIO_parte_1_imagen, 
    .INICIO_parte_2_imagen, 
    .INICIO_parte_3_imagen {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
}

@media (max-width: 768px) {
    .INICIO_texto {
        font-size: 1rem;
        line-height: 1.6;
    }

    .contenido_INICIO {
        padding: var(--space-md);
    }

    .imagen_inicio_div {
        position: relative;
        height: calc(100vh - 60px);
    }
}

@media (max-width: 480px) {
    .imagen_inicio_overlay_text h1 {
        font-size: 1.8rem;
    }

    .INICIO_parte:nth-child(even) {
        flex-direction: column;
    }
    
    .INICIO_parte {
        padding: var(--space-sm);
        flex-direction: column;
    }
    
    .footer_text {
        font-size: 1.1rem;
    }

    .imagen_inicio_div {
        position: relative;
        height: calc(100vh - 50px);
    }
}

/* ===== PUBLICACIONES ===== */

    /* ===== TEXTO INTRODUCTORIO ===== */

.PUBLICACIONES_intro {
    width: 100%;
    max-width: var(--max-text-width);
    margin: var(--space-lg) auto;
    text-align: center;
}

.PUBLICACIONES_intro_texto {
    font-size: 1.4rem;
    line-height: 1.6;
    font-weight: 300;
    color: var(--secondary-color);
    font-family: var(--font-primary);
}

    /* ===== ESTRUCTURA PRINCIPAL ===== */

.contenido_PUBLICACIONES {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.PUBLICACIONES_parte {
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
    align-items: center;
}

.PUBLICACIONES_parte_1,
.PUBLICACIONES_parte_3,
.PUBLICACIONES_parte_4 {
    flex-direction: row-reverse;
}

.PUBLICACIONES_parte_2 {
    flex-direction: row;
}

/* Contenedores de texto e imagen */
.PUBLICACIONES_texto {
    width: 50%;
    max-width: 600px;
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: justify;
}

figure {
    margin: 0; /* Elimina márgenes por defecto */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.epigrafe {
    text-align: center;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: rgba(var(--text-color), 0.8); /* Color con opacidad */
    margin-top: var(--space-xs);
    padding: 0 var(--space-md);
    max-width: 80%; /* Limita el ancho para mejor legibilidad */
    line-height: 1.4;
    font-style: italic; /* Toque elegante */
}

    /* ===== IMÁGENES ===== */

.img_container {
    width: 50%;
    max-width: 500px;
}

.PUBLICACIONES_imagen {
    width: 100%;
    height: auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}


    /* ===== OTRAS PUBLICACIONES ===== */


.publicaciones_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas */
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    grid-auto-rows: 1fr; /* Altura uniforme para filas */
    align-items: start;
}


@media (max-width: 480px) {
    .publicaciones_grid {
        grid-template-columns: 1fr; /* 1 columna en móviles */
    }
}

.publicacion {
    display: flex;                /* Necesario para altura uniforme */
    flex-direction: column;       /* Organizar elementos en columna */
    height: 100%;                 /* Altura completa del contenedor */
    position: relative;           /* Para contenedor de imagen */
    overflow: hidden;
    gap: 0;
}

.publicacion_img_container {
    aspect-ratio: 3/4;
    width: 70%;
    margin: 0 auto calc(var(--space-xs) * 0.5) auto; /* Arriba | Laterales | Abajo | Laterales */
    overflow: hidden;
}

.publicacion img {
    width: 100%;
    height: 100%;
    object-fit: contain;      /* Muestra toda la imagen sin recortar */
    object-position: center; /* Prioriza la parte superior */
    padding: 10px;            /* Espacio interno para respiro */
}

.publicacion_contenido p {
    margin-bottom: auto;
    line-height: 1.4;
    flex-grow: 1;             /* Ocupar espacio disponible */
    display: block;
    align-items: center;      /* Centrar texto verticalmente */
    text-align: center;       /* Centrar texto horizontalmente */
    padding: 0; /* Espaciado interno mínimo */
}

.publicacion_contenido {
    display: flex;
    flex-direction: column;
    height: 35%;
    min-height: 120px;        /* Altura mínima para texto */
    padding: var(--space-xs);
    gap: var(--space-xs);    /* Espacio mínimo entre texto y botón */
    justify-content: space-between;
    gap: var(--space-xs);
}

.descargar_pdf {
    margin-top: auto;   /* Empuja el botón hacia abajo */
    margin-bottom: var(--space-xs);
    align-self: center;           /* Centrado horizontal */
    width: auto;           /* Ancho según contenido */
    
    /* Mantén todos los estilos originales */
    background: var(--primary-color);
    color: var(--white);
    border: none;
    min-width: 140px; /* Ancho mínimo consistente */
    padding: 0.6rem 1.5rem; /* Padding horizontal para mejor aspecto */    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.descargar_pdf:hover {
    background: var(--white);
    color: var(--primary-color);
    font-weight:bold;
    transform: translateY(-2px);
    box-shadow: 4px 4px 10px var(--primary-color);
}


/* Estilos para títulos de sección */
.titulo_seccion {
    text-align: center;
    font-size: 2em;
    font-weight: 600;
    margin: 50px auto 30px;
    color: #2c3e50;
    position: relative;
    width: 80%;
}

.titulo_los_afectos{
    font-size: 2rem;
}

.titulo_seccion::after {
    content: "";
    display: block;
    width: 100px;
    height: 3px;
    background: #de528c;
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Modificador específico para Otras Publicaciones */
.titulo_otras_publicaciones {
    margin-top: 40px;
    margin-bottom: 20px;
}

/* Modificador para Litura */
.titulo_litura {
    margin-top: 70px;
    margin-bottom: 40px;
}


    /* ===== SECCIÓN LITURA ===== */


.litura_lista {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 2rem;
}

.litura_fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.litura_fila:hover {
    background: #fff;
    box-shadow: 0 4px 8px rgba(222, 82, 140, 0.1);
    transform: translateX(5px);
}

.litura_titulo {
    font-size: 1.05rem;
    color: #444;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.litura_boton {
    background: #de528c;
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 1rem;
}

.litura_boton:hover {
    background: #c74379;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--secondary-color);
}

    /* ===== CINE AL DIVAN ===== */


.logo_cine_al_divan {
    text-align: center;
    margin: 50px auto 30px;
    max-width: 500px;
    padding: 0 var(--space-md);
}

.logo_cine_al_divan img {
    width: 100%;
    height: auto;
    max-width: 400px;
}

.cine_al_divan_texto {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md) 50px;
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-color);
    font-family: var(--font-primary);
}

.cine_al_divan_texto p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.texto_centrado {
    text-align: center;
    margin: 0.5rem 0;
    padding: 0.5rem;
    font-style: italic;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 1.1rem;
}

    /* ===== COLABORADORES ===== */

.colaboradores_container {
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
    align-items: flex-start;
}

.colaboradores_lista {
    width: 50%;
    padding-right: var(--space-md);
}

.colaboradores_fotos {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.colaborador_foto_container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.colaborador_foto_container img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive para colaboradores */
@media (max-width: 768px) {
    .colaboradores_container {
        flex-direction: column;
    }
    
    .colaboradores_lista,
    .colaboradores_fotos {
        width: 100%;
        padding-right: 0;
    }
    
    .colaboradores_fotos {
        margin-top: var(--space-md);
    }
}

@media (max-width: 768px) {
    .cine_al_divan_texto {
        font-size: 1rem;
        padding: 0 1rem 30px;
    }
    
    .texto_centrado {
        padding: 1rem;
        margin: 1.5rem 0;
        font-size: 1rem;
    }
}


/* ===== GRUPOS CLINICOS ===== */


.GRUPOSCLINICOS {
    background: var(--light-gray);
    padding: var(--space-lg) 0 0 0;
}

.contenido_GC {
    max-width: 800px; /* Reducido de 1200px para hacerlo más angosto */
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.GC_parte {
    background: var(--white);
    padding: var(--space-lg);
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: var(--space-lg);
}

.GC_texto {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-color);
    font-family: var(--font-primary);
    text-align: justify;
}

.GC_texto p {
    margin-bottom: var(--space-md);
}

.destacado {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.6;
}

.GC_imagen_container {
    width: 100%;
    margin: var(--space-lg) 0;
    display: flex;
    justify-content: center;
}

.GC_imagen_horizontal {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .GC_imagen_horizontal {
        border-radius: 6px;
    }
}

@media (max-width: 768px) {
    .GC_parte {
        padding: var(--space-md);
    }
    
    .GC_texto {
        font-size: 1rem;
    }
    
    .destacado {
        font-size: 1.1rem;
    }
    
    .contenido_GC {
        max-width: 90%; /* Más ancho en móviles para mejor legibilidad */
    }
}


/* ===== FOOTER ===== */


.footer {
    position: relative;
    overflow: hidden;
    background-color: var(--primary-color);
    color: var(--white);
    padding: var(--space-lg) var(--space-md);
    margin-top: auto;
    border-top: 2px solid rgba(var(--secondary-color-rgb), 0.1);
}

.footer_text {
    width: 100%;
    max-width: var(--max-text-width);
    margin: 0 auto;
    font-family: var(--font-primary);
    font-size: 1.4rem;
    line-height: 1.6;
    text-align: center;
    text-wrap: pretty;
    padding: var(--space-xs);
}

/* ===== CONTACTO ===== */
.contacto {
    position: relative;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: var(--space-md) var(--space-md);
    text-align: center;
    font-family: var(--font-primary);
    font-size: 1.3rem;
}

.contacto::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.contacto_contenido {
    max-width: var(--max-text-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.contacto_item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.contacto_enlace {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contacto_enlace:hover {
    color: var(--white);
    text-decoration: underline;
}

.contacto_icono {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .contacto {
        padding: var(--space-sm);
    }
}


/* ===== RESPONSIVE ===== */


@media (max-width: 768px) {
    .titulo_seccion {
        font-size: 1.7em;
        margin: 40px auto 25px;
    }
    
    .titulo_seccion::after {
        width: 70px;
        margin-top: 12px;
    }
    
    .titulo_otras_publicaciones {
        margin-top: 30px;
    }
    
    .titulo_litura {
        margin-top: 50px;
    }

    .litura_lista {
        width: 100%;
        padding-right: 0;
    }
    
    .litura_fila {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 1rem;
    }
    
    .litura_boton {
        margin-left: 0;
        width: 100%;
    }
    
    .contenido_PUBLICACIONES {
        padding: var(--space-md);
    }

    .publicacion_img_container {
        width: 60%;          /* Más pequeño en móviles */
    }
    
    .publicacion_contenido {
        min-height: 160px;
    }
    
    .publicaciones_grid {
        grid-auto-rows: minmax(360px, auto);
        grid-template-columns: repeat(2, 1fr);
    }

    .publicacion {
        height: auto; /* Flexibilidad en móviles */
    }

    .contenido_INICIO, 
    .contenido_PUBLICACIONES,
    .contenido_GC {
        padding: var(--space-md) var(--space-sm);
    }
    
    body {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    
    .descargar_pdf, 
    .litura_boton {
        padding: var(--space-sm) var(--space-md);
        min-width: 160px;
    }
}

@media (max-width: 1024px) {
    .PUBLICACIONES_parte {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .PUBLICACIONES_texto,
    .img_container {
        width: 100%;
        max-width: none;
    }
    
    .PUBLICACIONES_intro_texto {
        font-size: 1.2rem;
    }
}

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

.INICIO_parte,
.PUBLICACIONES_parte,
.GC_parte {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Retrasos escalonados */
.INICIO_parte_1 { animation-delay: 0.1s; }
.INICIO_parte_2 { animation-delay: 0.3s; }
.INICIO_parte_3 { animation-delay: 0.5s; }

.entrevista_destacada {
    background-color: #fdf1f5;
    border-left: 6px solid var(--primary-color);
    padding: 2rem;
    margin: 3rem auto;
    max-width: 1000px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.entrevista_contenido {
    text-align: center;
}

.entrevista_titulo {
    font-size: 1.8rem;
    color: var(--secondary-color);
    font-family: var(--font-primary);
    margin-bottom: 1rem;
}

.entrevista_texto {
    font-size: 1.2rem;
    font-family: var(--font-primary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.entrevista_boton {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.entrevista_boton:hover {
    background-color: #c64378;
}
