/**
 * Estilos para Subsitio de Contenidos
 * Basado en el sistema legacy
 */

/* ========================================
   ENCABEZADO CON IMAGEN
   ======================================== */

.imagen-destacada-principal {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.img-fullscreen {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 0;
}

.contenido-overlay {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    z-index: 2;
    color: #fff;
}

.linea-encima {
    width: 60px;
    height: 5px;
    background-color: var(--color-primary);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.titulo-visible {
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    color: #fff;
    margin: 0;
}

.titulo-contenido {
    font-size: 1.7rem;
    color: var(--color-primary);
    font-weight: 700;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

.contenedor-contenido {
    max-width: 85%;
    margin: 3rem auto;
}

@media (max-width: 768px) {
    .contenedor-contenido {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* ========================================
   SIDEBAR - LISTADO DE CONTENIDOS
   ======================================== */

.contenedor_listado {
    border-right: 1px solid #e5e5e5;
    padding-right: 2rem;
    text-align: right;
}

.contenedor_listado a {
    text-decoration: none;
}

.contenedor_listado a .item {
    border-bottom: 1px dotted #e5e5e5;
    padding: 1rem;
    text-transform: uppercase;
    font-weight: 500;
    color: #333;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.contenedor_listado a:hover .item {
    color: var(--color-primary);
}

/* Listado móvil */
.contenedor_listado_movil {
    border-top: 3px solid #e5e5e5;
    padding-top: 1rem;
}

.contenedor_listado_movil a {
    text-decoration: none;
}

.contenedor_listado_movil a .item {
    border-bottom: 1px dotted #e5e5e5;
    padding: 1rem;
    text-transform: uppercase;
    font-weight: 500;
    color: #333;
    text-align: left;
    font-size: 0.85rem;
}

.contenedor_listado_movil a:hover .item {
    color: var(--color-primary);
}

/* ========================================
   DETALLE DEL CONTENIDO
   ======================================== */

.contenedor_detalle {
    padding-left: 0;
}

@media (min-width: 992px) {
    .contenedor_detalle {
        padding-left: 2rem;
    }
}

.contenido-principal {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.contenido-principal p {
    margin-bottom: 1rem;
}

.contenido-principal img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.contenido-principal iframe {
    max-width: 100%;
    border-radius: 0.5rem;
}

.contenido-principal h2,
.contenido-principal h3,
.contenido-principal h4 {
    color: var(--color-primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.contenido-principal ul,
.contenido-principal ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.contenido-principal a {
    color: var(--color-primary);
}

.contenido-principal a:hover {
    color: var(--color-primary-hover, #125a96);
}

/* ========================================
   GALERÍAS EMBEBIDAS
   ======================================== */

.galeria-contenido {
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.galeria-contenido .carousel-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .galeria-contenido .carousel-item img {
        height: 250px;
    }
}

/* ========================================
   MÓDULOS DE CONTENIDOS RELACIONADOS
   ======================================== */

.item-contenido-modulo {
    position: relative;
    height: 180px;
    color: white;
    display: flex;
    align-items: flex-end;
    padding: 15px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: all 0.4s ease;
    overflow: hidden;
    border-radius: 8px;
}

.item-contenido-modulo .fondo-imagen {
    position: absolute;
    inset: 0;
    background-image: url("/imagenes/estructura/no_imagen.jpg");
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
    z-index: 0;
}

.item-contenido-modulo::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    transition: background 0.4s ease;
}

.item-contenido-modulo .servicio-content {
    position: relative;
    z-index: 2;
    transition: transform 0.5s ease;
}

.item-contenido-modulo .servicio-content p {
    margin: 0;
    color: #fff;
    line-height: 1.3;
    font-size: 1rem;
    font-weight: 600;
}

.item-contenido-modulo .underline {
    width: 50px;
    height: 3px;
    background: var(--color-secondary);
    margin-top: 8px;
    transition: width 0.5s ease;
}

.item-contenido-modulo:hover .fondo-imagen {
    transform: scale(1.15);
}

.item-contenido-modulo:hover::before {
    background: rgba(0, 0, 0, 0.3);
}

.item-contenido-modulo:hover .servicio-content {
    transform: translateY(-8px);
}

.item-contenido-modulo:hover .underline {
    width: 80px;
}

/* ========================================
   TRÁMITES RELACIONADOS
   ======================================== */

.tramites-relacionados .servicios-contenido {
    border-top: 1px solid #e5e5e5;
    padding-top: 1.5rem;
}

.tramites-relacionados .servicio {
    padding: 1rem;
    transition: all 0.3s ease;
}

.tramites-relacionados .icono_servicio i {
    font-size: 1.7rem;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.tramites-relacionados .nombre_servicio {
    color: var(--color-primary);
    font-size: 0.85rem;
    padding-top: 0.5rem;
    transition: color 0.3s ease;
}

.tramites-relacionados a:hover .icono_servicio i,
.tramites-relacionados a:hover .nombre_servicio {
    color: var(--color-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .imagen-destacada-principal {
        height: 200px;
    }
    
    .img-fullscreen {
        height: 200px;
    }
    
    .titulo-visible {
        font-size: 1.75rem;
    }
    
    .contenedor_listado {
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding-right: 0;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
        text-align: left;
    }
}

@media (max-width: 576px) {
    .item-contenido-modulo {
        height: 140px;
    }
    
    .item-contenido-modulo .servicio-content p {
        font-size: 0.85rem;
    }
}
