/**
 * Estilos para Subsitio de Contenidos
 * Basado en el sistema legacy
 */

/* ========================================
   ENCABEZADO CON IMAGEN
   ======================================== */

.imagen-destacada-principal {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.img-fullscreen {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 0;
    filter: brightness(0.5);
}

.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: 1.2rem;
    line-height: 1.8;
    color: #333;
}

.contenido-principal p {
    font-size: 1.2rem;
    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;
}

.galeria-contenido .carousel-item img {
    width: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .galeria-contenido .carousel-item img {
        height: 250px;
    }
}

/* ========================================
   TRÁMITES RELACIONADOS
   ======================================== */

.tramites-relacionados {
    margin-top: 3rem;
}

.tramites-relacionados h3 {
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.tramites-relacionados .servicios-contenido {
    border-top: 1px solid #e5e5e5;
    padding-top: 1.5rem;
}

.tramites-relacionados .servicio {
    padding: 1.5rem 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.tramites-relacionados .servicio:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.tramites-relacionados .icono_servicio {
    margin-bottom: 0.75rem;
}

.tramites-relacionados .icono_servicio i {
    font-size: 2.5rem;
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.tramites-relacionados .nombre_servicio {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    transition: color 0.3s ease;
}

.tramites-relacionados a:hover .icono_servicio i {
    color: var(--color-secondary);
    transform: scale(1.1);
}

.tramites-relacionados a:hover .nombre_servicio {
    color: var(--color-primary);
}

/* Estilos para cuando el icono es una imagen (Contenidos Relacionados) */
.tramites-relacionados .icono_servicio--imagen {
    width: 50px;
    height: 50px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    transition: all 0.3s ease;
}

.tramites-relacionados .icono_servicio--imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tramites-relacionados a:hover .icono_servicio--imagen {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}


/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .imagen-destacada-principal {
        height: 250px;
    }

    .img-fullscreen {
        height: 250px;
    }

    .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;
    }
}

/* ========================================
   TELÉFONOS ÚTILES - CONTACTS TABLE
   ======================================== */

/* Tabla de contactos */
.contacts-table {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Fila de contacto */
.contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.contact-row:last-child {
    border-bottom: none;
}

.contact-row:hover {
    background: rgba(30, 58, 95, 0.02);
}

/* Información del departamento */
.department-info {
    flex: 1;
    padding-right: 2rem;
}

.department-name {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1.6rem;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

/* Botones de contacto */
.contact-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contact-btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Botón de teléfono (principal) */
.phone-btn {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    font-weight: 600;
}

.phone-btn:hover {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* Botón secundario (número corto) */
.whatsapp-btn {
    background: #f0f2f5;
    color: #333;
    border: 2px solid #f0f2f5;
    font-weight: 600;
}

.contact-btn.whatsapp-btn:hover {
    background: var(--color-secondary);
    color: #ffffff;
    border-color: var(--color-secondary);
}

.whatsapp-btn i {
    font-size: 1.1rem;
}

/* Responsive para Contacts Table */
@media (max-width: 768px) {
    .contact-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
        gap: 1rem;
    }
    
    .department-info {
        padding-right: 0;
        width: 100%;
    }
    
    .department-name {
        font-size: 1.5rem;
    }
    
    .contact-buttons {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }
    
    .contact-btn {
        padding: 0.5rem 1rem;
        font-size: 1.2rem;
        flex: 1;
        justify-content: center;
        min-width: auto;
    }
    
    .contacts-table {
        margin: 0 1rem;
    }
}

/* ========================================
   RESEÑA HISTÓRICA - TIMELINE
   ======================================== */

/* Contenedor principal del timeline */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 50px auto;
    padding: 20px 0;
}

/* Línea central vertical */
.timeline::after {
    content: "";
    position: absolute;
    width: 4px;
    background-color: var(--color-primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

/* Imagen dentro del timeline */
.timeline-img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Contenedor de cada evento */
.timeline-container {
    padding: 20px 40px;
    position: relative;
    width: 50%;
}

/* Círculo en cada punto del timeline */
.timeline-container::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border: 4px solid var(--color-primary);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}

/* Posicionamiento izquierda */
.left {
    left: 0;
}

/* Posicionamiento derecha */
.right {
    left: 50%;
}

/* Círculo a la derecha para items izquierdos */
.left::after {
    right: -10px;
}

/* Círculo a la izquierda para items derechos */
.right::after {
    left: -10px;
}

/* Card de contenido */
.content-timeline {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Hover effect en cards */
.content-timeline:hover {
    transform: scale(1.05);
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

/* Responsive para Timeline */
@media screen and (max-width: 768px) {
    /* Línea a la izquierda en móvil */
    .timeline::after {
        left: 20px;
    }
    
    /* Contenedores a ancho completo */
    .timeline-container {
        width: 100%;
        padding-left: 50px;
        padding-right: 25px;
        margin-left: 0;
    }
    
    /* Círculos alineados a la izquierda */
    .timeline-container::after {
        left: 15px;
    }
    
    .timeline-container::before {
        left: 15px;
    }
    
    /* Todos los items alineados a la izquierda */
    .left,
    .right {
        left: 0;
    }
    
    .timeline-container.left::after,
    .timeline-container.right::after {
        left: 10px;
    }
}

@media (max-width: 768px) {
    .timeline::before {
        content: none !important;
        display: none !important;
    }
}

/* ========================================
   ACORDEÓN - ESTILOS LEGACY
   ======================================== */

/* Estilo para el botón del acordeón personalizado */
.accordion-button.btn-accordion {
    background-color: var(--color-primary) !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 1.2rem !important; /* Ajustado para consistencia */
    text-transform: uppercase !important;
    border-radius: 1rem 0rem !important;
}

/* Ocultar sombra del botón de Bootstrap */
.accordion-button:focus {
    box-shadow: none !important;
}

/* Eliminar el ícono de flecha predeterminado de Bootstrap */
.accordion-button.btn-accordion::after {
    display: none;
}

/* Crear flecha personalizada (cuando el botón es .btn-accordion) */
.accordion-button.btn-accordion::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease;
}

/* Rotar la flecha cuando el acordeón está expandido */
.accordion-button.btn-accordion:not(.collapsed)::before {
    transform: translateY(-50%) rotate(-135deg);
}

/* ========================================
   INFO CARD (Para Contacto, etc.)
   ======================================== */

.info-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    margin: 2rem auto;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.info-card-header i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.info-card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.info-card-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-card-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-card-item i {
    font-size: 1.1rem;
    color: var(--color-secondary);
    width: 20px;
    text-align: center;
}

.info-card-item span {
    font-size: 1.1rem;
    color: #343a40;
    font-weight: 500;
}

/* ========================================
   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;
}

@media (max-width: 576px) {
    .item-contenido-modulo {
        height: 140px;
    }

    .item-contenido-modulo .servicio-content p {
        font-size: 0.85rem;
    }
}

/* ========================================
   BOTÓN VOLVER
   ======================================== */

.contenedor-boton-volver {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

/* Estilos de .btn-volver movidos a css/base.css para uso global */

/* ========================================
   NOTICIAS RELACIONADAS
   ======================================== */

.noticias-relacionadas {
    margin-top: 3rem;
    padding-top: 2rem;
}

.noticias-relacionadas h3 {
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.noticias-relacionadas h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e5e5e5;
}

.lista-noticias-relacionadas {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

.item-noticia-relacionada {
    margin-bottom: 1.5rem;
}

.item-noticia-relacionada:last-child {
    margin-bottom: 0;
}

.noticia-link {
    display: flex;
    gap: 0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.noticia-link:hover {
    text-decoration: none;
}

.noticia-imagen-container {
    flex-shrink: 0;
    width: 260px;
    height: 180px;
    overflow: hidden;
    border-radius: 8px 0px 0px 8px;
}

.noticia-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.noticia-link:hover .noticia-imagen {
    transform: scale(1.05);
}

.noticia-contenido {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8f9fa;
    border-radius: 0px 8px 8px 0px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.noticia-link:hover .noticia-contenido {
    background: #f0f1f3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.noticia-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.noticia-categoria {
    display: inline-block;
    background: var(--color-secondary);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.noticia-fecha {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.noticia-fecha i {
    color: #6c757d;
}

.noticia-titulo {
    color: #212529;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    transition: color 0.3s ease;
}

.noticia-link:hover .noticia-titulo {
    color: var(--color-primary);
}

.noticia-resumen {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .noticias-relacionadas h3 {
        font-size: 1.5rem;
    }
    
    .noticia-link {
        flex-direction: column;
        gap: 0;
    }
    
    .noticia-imagen-container {
        width: 100%;
        height: 200px;
        border-radius: 8px 8px 0 0;
    }
    
    .noticia-contenido {
        border-radius: 0 0 8px 8px;
    }
    
    .noticia-titulo {
        font-size: 1.25rem;
    }
    
    .noticia-resumen {
        font-size: 0.95rem;
    }
    
    .noticia-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

