/* =============================================
   MINIUPDATE.CSS - Migración Responsiva STJOld
   Fecha: Enero 2026
   ============================================= */

/* === FUENTE GLOBAL === */
body, body * {
    font-family: 'Roboto', Arial, Helvetica, sans-serif !important;
}

/* === ESTILOS BASE RESPONSIVOS === */
img { max-width: 100% !important; height: auto !important; }
table { max-width: 100% !important; }
#right { margin-top: 0; }

/* Override background legacy (bg.gif) */
#content {
    background-image: none !important;
    background-color: #fff !important;
}

/* Forzar imágenes con width/height inline a ser fluidas */
img[width] { width: auto !important; max-width: 100% !important; height: auto !important; }
img[height] { height: auto !important; }
#right img { max-width: 100% !important; height: auto !important; }

/* Banner principal - misma altura que sidebar header */
#flash {
    height: 156px;
    overflow: hidden;
    position: relative;
}

#flash img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: bottom;
}

/* Forzar tablas con width inline a ser fluidas */
table[width] { width: 100% !important; max-width: 100% !important; }
table[align="center"] { margin-left: auto !important; margin-right: auto !important; }

/* Contenido dentro de tablas fluido */
table td img { max-width: 100% !important; width: auto !important; height: auto !important; }

/* Líneas punteadas fluidas */
.linea {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.linea img { max-width: 100% !important; width: 100% !important; }

/* === HEADER MÓVIL === */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #1a5c3a 0%, #0d3d26 100%);
    color: #fff;
    z-index: 1001;
    padding: 0 15px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-header h1 {
    font-size: 14px;
    margin: 0;
    flex: 1;
    text-align: center;
    font-weight: 500;
    padding: 0 10px;
}

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === OVERLAY SIDEBAR === */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* === ENCABEZADO VERDE SIDEBAR === */
.sidebar-header-green {
    background: linear-gradient(135deg, #1a5c3a 0%, #0d3d26 100%);
    padding: 15px 10px;
    text-align: center;
    margin: -10px -10px 15px -10px;
}

.sidebar-header-green img {
    max-width: 80px;
    margin-bottom: 8px;
}

.sidebar-header-green h2 {
    color: #fff;
    font-size: 12px;
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
}

/* === GRIDS Y COMPONENTES RESPONSIVOS === */
.circulares-grid {
    max-width: 100% !important;
    overflow: hidden !important;
}

.cta-wrap, .cta-wide {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.cta-wide {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.cta-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* === MEDIA QUERY MÓVIL/TABLET === */
@media (max-width: 991px) {

    /* Circulares grid - una columna en móvil */
    .circulares-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .cta-wrap {
        width: 100% !important;
    }

    .cta-wide {
        flex-wrap: wrap !important;
        padding: 10px !important;
    }

    .cta-text {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 12px !important;
    }

    .cta-text strong {
        font-size: 13px !important;
    }
    /* Mostrar header móvil */
    .mobile-header {
        display: flex;
    }

    /* Ajustar body para header fijo */
    body {
        padding-top: 56px;
    }

    /* Sidebar colapsable */
    #left {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        overflow-y: auto !important;
        background: #fff !important;
        z-index: 1000 !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 0 !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    #left.sidebar-open {
        transform: translateX(0);
        padding-top: 56px !important;
    }

    /* Header verde pegado a bordes en móvil */
    .sidebar-header-green {
        margin: 0 0 15px 0 !important;
        padding: 15px 12px !important;
    }

    /* Side menu mismo ancho que header verde */
    #left .side-menu {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #left .side-menu-list {
        border-left: none !important;
        border-right: none !important;
        border-radius: 0 !important;
    }

    /* Padding lateral solo para otros contenidos */
    #left > div:not(.sidebar-header-green) {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Área principal ocupa todo el ancho */
    #right {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 10px 15px !important;
        box-sizing: border-box !important;
    }

    #content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ajustes de contenido */
    #flash img {
        width: 100% !important;
    }

    #menuhorizontal {
        padding: 10px 5px !important;
    }

    #menuhorizontal table {
        font-size: 11px;
    }

    /* Tablas responsivas */
    .tabla_menudo td {
        display: block;
        width: 100% !important;
        text-align: center !important;
        padding: 8px 5px !important;
    }

    .tabla_menudo td[width="0%"] {
        display: none;
    }
}

/* === LAYOUT DESKTOP === */
@media (min-width: 992px) {
    /* Contenedor principal centrado con Flexbox */
    #content {
        width: 1024px !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
    }

    /* Sidebar fijo 280px */
    #left {
        width: 280px !important;
        min-width: 280px !important;
        flex-shrink: 0;
        box-sizing: border-box !important;
        float: none !important;
        margin: 0 !important;
    }

    /* Contenido principal ocupa el resto (744px) */
    #right {
        width: 744px !important;
        flex: 1;
        box-sizing: border-box !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 0 0 0 !important;
    }
}

/* === SIDEBAR CONSISTENTE === */
/* Todos los elementos del sidebar al 100% */
#left * {
    box-sizing: border-box !important;
}

#left > * {
    width: 100% !important;
}

/* Header verde y menú con mismo padding */
.sidebar-header-green {
    width: 100% !important;
    padding: 15px 12px !important;
    margin: 0 0 15px 0 !important;
    box-sizing: border-box !important;
}

#left .side-menu,
#left aside.side-menu {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
}

/* Forzar tablas internas del sidebar a 100% */
#left table,
#left table[width],
#left table[width="235"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#left td {
    box-sizing: border-box !important;
}

/* Logo dentro del sidebar */
#left #logo,
#left .text-center {
    width: 100% !important;
}

/* === TRANSPARENCIA - CONTENIDO CENTRADO Y FLUIDO === */

/* Secciones de Transparencia centradas */
#right .transparencia-section,
#right .transp-card,
#right .transp-hero,
#right .transparencia-grid,
#right .articulos-btns {
    max-width: 100% !important;
    width: 100% !important;
}

#right .transparencia-title,
#right .transparencia-subtitle,
#right .btn-boletines,
#right .btn-circulares,
#right .circulares-grid,
#right .cta-wrap,
#right .cta-wide,
#right .avisos-domicilio,
#right .archivo-historico,
#right .ah-viewport,
#right .ah-controls {
    max-width: 100% !important;
    width: 100% !important;
}

#right #txt,
#right .txt,
#right > div,
#right > section,
#right > table {
    max-width: 100% !important;
    width: 100% !important;
}

/* Boton Boletines sidebar */
.btn-boletines-xl {
    max-width: 100% !important;
}

/* === ESTADÍSTICAS - Modernizar tablas bordepunteado === */

/* Tablas de estadísticas */
table.bordepunteado {
    border-collapse: separate !important;
    border-spacing: 0 6px !important;
    border: none !important;
    width: 100% !important;
}

/* Celdas principales */
table.bordepunteado td.bordepunteado {
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: #fff !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    color: #1f2937 !important;
    transition: all 0.15s ease;
    text-align: left !important;
}

table.bordepunteado td.bordepunteado:hover {
    border-color: #1a5c3a !important;
    background: #f0fdf4 !important;
}

/* Celda principal (descripcion) */
table.bordepunteado td.bordepunteado:first-child {
    border-radius: 8px 0 0 8px !important;
    border-right: none !important;
}

/* Celda "Detallado" */
table.bordepunteado td.bordepunteado:last-child {
    border-radius: 0 8px 8px 0 !important;
    border-left: 1px solid #f3f4f6 !important;
    text-align: center !important;
    width: 110px !important;
    background: #f9fafb !important;
}

table.bordepunteado td.bordepunteado:last-child:hover {
    background: #f0fdf4 !important;
}

/* Links dentro de las celdas */
table.bordepunteado td.bordepunteado a {
    color: #1a5c3a !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    font-size: 13px !important;
}

table.bordepunteado td.bordepunteado a:hover {
    color: #0d3d26 !important;
    text-decoration: underline !important;
}

/* Celda "Detallado" - icono de descarga */
table.bordepunteado td.bordepunteado:last-child a::before {
    content: '\F30A';
    font-family: 'bootstrap-icons' !important;
    margin-right: 4px;
    font-size: 12px;
}

/* Secciones de materia (blockquote > p > strong) dentro de estadísticas */
#bodycontent blockquote {
    margin: 1.2rem 0 0.6rem 0 !important;
    padding: 0 !important;
}

#bodycontent blockquote p {
    margin: 0 !important;
}

#bodycontent blockquote p strong,
#bodycontent blockquote p .Estilo3 strong {
    display: inline-block;
    background: #1a5c3a;
    color: #fff !important;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Estilo3 usado en encabezados de año */
.Estilo3 strong {
    color: #1a5c3a !important;
}

/* Ajuste para que filas con celda unica (sin detallado) tengan bordes completos */
table.bordepunteado td.bordepunteado:only-child {
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
}

/* Enlace de vuelta a EstadisticaMensual al final */
#bodycontent > p:last-of-type a[href*="EstadisticaMensual"] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1a5c3a;
    font-weight: 500;
    text-decoration: none;
    font-size: 14px;
}

#bodycontent > p:last-of-type a[href*="EstadisticaMensual"]:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    table.bordepunteado td.bordepunteado {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
    table.bordepunteado td.bordepunteado:last-child {
        width: 80px !important;
    }
    #bodycontent blockquote p strong,
    #bodycontent blockquote p .Estilo3 strong {
        font-size: 12px !important;
        padding: 5px 12px;
    }
}

/* === SIDEBAR MENU - DIVISORES Y DESTACADOS === */

/* Divisor entre grupos de menú (legacy) */
.side-menu-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 8px 12px;
}

/* Divisor inline dentro de la lista */
.sm-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0;
    list-style: none;
}

/* Títulos de sección en el menú */
.sm-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 12px 6px 12px;
    margin: 0;
    list-style: none;
    border-top: 1px solid #e5e7eb;
}

.sm-section-title:first-child {
    border-top: none;
    padding-top: 6px;
}

/* Items destacados (Lista de Acuerdos, Sentencias, etc.) */
.sm-link.sm-highlight {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border-left: 3px solid #1a5c3a !important;
    font-weight: 600 !important;
}

.sm-link.sm-highlight:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
}

.sm-link.sm-highlight i {
    color: #1a5c3a !important;
}

/* Texto pequeño en links del menú */
.sm-link small {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 400;
}

/* === BUSCADOR SIDEBAR === */
.sidebar-search {
    padding: 12px;
    margin: 10px 0;
}

.search-form {
    width: 100%;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s;
}

.search-input-wrap:focus-within {
    border-color: #1a5c3a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,92,58,0.1);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #374151;
    outline: none;
    width: 100%;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: #1a5c3a;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.search-btn:hover {
    background: #0d3d26;
}

.search-btn i {
    font-size: 14px;
}

/* === SIDEBAR - UNIDAD DE IGUALDAD DE GENERO === */
.sidebar-genero {
    margin: 12px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    overflow: hidden;
}

.sidebar-genero-header {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    color: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-genero-header i {
    font-size: 16px;
}

.sidebar-genero-banners {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-genero-banners a {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(147,51,234,0.15);
    transition: all 0.2s;
}

.sidebar-genero-banners a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147,51,234,0.25);
}

.sidebar-genero-banners img {
    width: 100%;
    height: auto;
    display: block;
}
