/*
 * Bitraga - capa visual moderna de la web publica.
 * Se carga DESPUES de style.css y lo anula; para volver al diseno anterior basta con quitar su <link>.
 * Solo ASCII: las paginas se sirven en ISO-8859-1.
 */

:root {
    --azul: #044F90;
    --azul-osc: #033A6B;
    --azul-claro: #EAF1F8;
    --rosa: #D8035C;
    --texto: #1F2A37;
    --suave: #5B6776;
    --fondo: #F1F5F9;
    --linea: #E2E8F0;
    --radio: 12px;
    --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
    --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
html { background: var(--fondo); }
body {
    font-family: var(--fuente);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0;
    color: var(--texto);
    -webkit-font-smoothing: antialiased;
}
p { margin-bottom: 1em; }
a { color: var(--azul); text-decoration: none; }
a:hover { color: var(--rosa); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--azul);
    outline-offset: 2px;
}
img { max-width: 100%; }

.wrapper {
    width: 100% !important;
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 20px 24px;
    background: transparent;
}

/* ---------- Cabecera ---------- */
#cabecera_principal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    margin: 0 0 20px;
    padding: 18px 28px;
    background: #fff;
    border: 0;
    border-top: 4px solid var(--azul);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}
#cabecera_principal > div:last-child { display: none; }
#logo {
    float: none;
    position: static;
    flex: 0 0 246px;
    width: 246px;
    max-width: 100%;
    height: 80px;
    margin: 0;
    background-position: center left;
    background-size: contain;
}
#arriba {
    float: none;
    position: static;
    flex: 0 0 200px;
    width: 200px;
    max-width: 100%;
    height: 56px;
    margin: 0;
    padding: 0;
    border: 0;
    background-position: center left;
    background-size: contain;
}
#iconos {
    float: none;
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 0 auto;
    display: flex;
    gap: 8px;
}
#iconos a { display: block; line-height: 0; }
#iconos .bandera {
    width: 32px;
    height: auto;
    border: 2px solid transparent !important;
    border-radius: 4px;
    box-shadow: 0 0 0 1px var(--linea);
    filter: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
#iconos .bandera:hover {
    filter: none;
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px var(--azul);
}

/* ---------- Estructura ---------- */
.colocar { display: flex; align-items: flex-start; gap: 24px; justify-content: flex-start; }
#lateral.one-fourth {
    float: none;
    flex: 0 0 270px;
    width: 270px;
    margin: 0;
    position: sticky;
    top: 16px;
}
#centro.three-fourth {
    float: none;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    margin: 0;
    min-height: 420px;
    padding: 28px 32px;
    background: #fff;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

/* ---------- Menu lateral ---------- */
#opciones {
    float: none;
    position: static;
    width: 100%;
    padding: 18px 14px;
    font-family: var(--fuente);
    font-size: 15px;
    color: var(--suave);
    background: #fff;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}
#opciones > div:first-of-type { padding: 0 14px 12px; font-size: 13px; color: var(--suave) !important; border-bottom: 1px solid var(--linea); margin-bottom: 10px; }
#opciones ul { float: none; position: static; width: 100%; margin: 0; padding: 0; }
#opciones ul li {
    display: block;
    height: auto;
    padding: 0;
    line-height: 1.4;
    background: none;
}
#opciones #tiny > li > a,
#opciones .btn-menu {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 2px 0;
    padding: 10px 14px;
    font: 600 15px/1.4 var(--fuente);
    color: var(--azul);
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    word-break: break-word;
}
#opciones #tiny > li > a:hover,
#opciones .btn-menu:hover {
    background: var(--azul-claro);
    color: var(--azul);
    text-decoration: none;
}
#opciones .submenu { width: auto; margin: 2px 0 6px 14px; padding-left: 8px; border-left: 2px solid var(--linea); }
#opciones .submenu li a {
    display: block;
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 400;
    border-radius: 6px;
    color: var(--suave);
}
#opciones .submenu li a:hover { background: var(--azul-claro); color: var(--azul); text-decoration: none; }
/* Elemento activo: la pagina lo marca con color rosa en linea */
#opciones a[style*="216, 3, 92"],
#opciones a[style*="D8035C"],
#opciones span[style*="216, 3, 92"],
#opciones span[style*="D8035C"] { font-weight: 700; }
#opciones .submenu a[style*="216, 3, 92"],
#opciones .submenu a[style*="D8035C"] { background: #FDEBF3; }

/* ---------- Titulos ---------- */
.titulo_seccion {
    min-height: 0;
    margin: 28px 0 14px !important;
    padding: 2px 0 2px 14px;
    font: 700 20px/1.3 var(--fuente);
    color: var(--azul);
    border: 0;
    border-left: 4px solid var(--rosa);
}
#centro > .titulo_seccion:first-child { margin-top: 0 !important; }

/* ---------- Portada ---------- */
.noticia, .noticia:nth-of-type(even) {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}
.cuerpo_noticia { max-width: 78ch; }
.cuerpo_noticia br:first-child { display: none; }
.cuerpo_noticia p { text-align: left !important; font-size: 16px; line-height: 1.7; }

/* ---------- Formularios ---------- */
#centro input[type="text"], #centro input:not([type]), #centro select, #centro textarea {
    height: 42px;
    padding: 8px 12px;
    margin: 0;
    font: 15px var(--fuente);
    color: var(--texto);
    background: #fff;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}
#centro textarea { height: auto; }
#centro input[type="text"]:focus, #centro input:not([type]):focus, #centro select:focus, #centro textarea:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(4, 79, 144, .15);
    outline: 0;
}
.widget-heading {
    height: auto;
    padding: 14px 0 0;
    background: none;
    border-radius: 0;
    text-shadow: none;
    overflow: hidden;
}
.botonazul {
    float: none;
    display: inline-block;
    margin: 0;
    padding: 10px 24px;
    font: 600 15px/1.2 var(--fuente);
    color: #fff;
    text-shadow: none;
    background: var(--azul) !important;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.botonazul:hover { background: var(--azul-osc) !important; }
.botonazul:active { transform: translateY(1px); }

/* ---------- Tablas (listados y fichas) ---------- */
table.Record {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--linea);
    border-radius: 10px;
    overflow: hidden;
}
.Record th, .Record td {
    padding: 11px 16px !important;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--linea);
    background: #fff;
    overflow-wrap: break-word;
}
.Record tr:last-child > th, .Record tr:last-child > td { border-bottom: 0; }
.Record th { font-weight: 600; }
/* Fichas: etiqueta + valor */
.Record tr.Controls > th { width: 30%; background: #F8FAFC; color: var(--suave); }
/* Cabecera de listado (celdas con texto en negrita) */
.Record tr.Controls:has(td > strong) > th, .Record tr.Controls:has(td > strong) > td,
.Record tr.Controls:has(td > a > strong) > th, .Record tr.Controls:has(td > a > strong) > td {
    background: var(--azul-claro);
    color: var(--azul);
    width: auto;
}
/* Contador de registros */
.Record th[colspan] { width: auto; text-align: right; font-weight: 400; font-size: 13px; color: var(--suave); background: #F8FAFC; }
.Record th[colspan] div { text-align: right; }
/* Filas de datos del listado */
.Record tr:not(.Controls):not(.Bottom):nth-child(even) > td { background: #F8FAFC; }
.Record tr:not(.Controls):not(.Bottom):hover > td { background: var(--azul-claro); }
.Record td a { font-weight: 500; }
/* Columna del ano (width="40"): nunca partir las cifras */
.Record td[width="40"], .Record th[width="40"] { white-space: nowrap; overflow-wrap: normal; width: 4.5em; }
.Record .Bottom td { text-align: center; padding: 14px 16px !important; background: #fff; }
.Bottom { height: auto !important; border: 0 !important; }
.Estilo1 { font-size: 13px; }

/* Paginacion */
.botonflecha {
    display: inline-block;
    margin: 3px 3px;
    padding: 7px 14px;
    font: 500 14px/1.2 var(--fuente);
    color: var(--azul) !important;
    text-shadow: none;
    background: #fff !important;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    box-shadow: none;
    text-decoration: none !important;
    transition: all .15s ease;
}
.botonflecha:hover { background: var(--azul) !important; border-color: var(--azul); color: #fff !important; }

/* ---------- Pie ---------- */
#pie_pagina {
    margin-top: 24px;
    padding: 22px 28px;
    background: #fff;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}
.colocar_lateral { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.colocar_lateral > section { float: none; margin: 0; width: auto; }
.colocar_lateral > section.one-fourth { flex: 0 0 220px; }
.colocar_lateral > section.three-fourth {
    flex: 1 1 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    align-items: center;
    justify-content: space-around;
}
.colocar_lateral aside { float: none; width: auto; margin: 0 !important; padding: 0; }
.colocar_lateral img { width: auto !important; max-width: 100% !important; height: auto; }
.colocar_lateral > section.one-fourth img { width: 100% !important; max-width: 200px !important; }

/* Boton hamburguesa: solo en movil (se muestra en el @media de abajo) */
.btn-hamb { display: none; }

/* ---------- Adaptacion a pantallas pequenas ---------- */
@media only screen and (max-width: 860px) {
    .wrapper { padding: 12px 12px 20px; }
    #cabecera_principal { padding: 14px 16px; gap: 10px 16px; }
    #logo { flex-basis: 200px; width: 200px; height: 64px; }
    #arriba { flex-basis: 160px; width: 160px; height: 46px; }
    .colocar { flex-direction: column; gap: 16px; }
    #lateral.one-fourth { position: static; flex: none; width: 100%; }
    #centro.three-fourth { width: 100%; flex: none; padding: 20px 16px; min-height: 0; }
    /* Menu: barra con ISSN + boton hamburguesa; la lista se despliega debajo */
    #opciones { position: relative; padding: 10px 14px; }
    #opciones > div:first-of-type { display: flex; align-items: center; gap: 5px; min-height: 44px; margin: 0; padding: 0 56px 0 0; border-bottom: 0; }
    .btn-hamb {
        position: absolute;
        top: 10px;
        right: 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0 11px;
        background: var(--azul-claro);
        border: 0;
        border-radius: 10px;
        cursor: pointer;
    }
    .btn-hamb span { display: block; height: 2px; background: var(--azul); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
    .btn-hamb.abierto span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .btn-hamb.abierto span:nth-child(2) { opacity: 0; }
    .btn-hamb.abierto span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    /* style.css ocultaba #tiny esperando un <select>: aqui se muestra solo al abrir */
    #opciones #tiny { display: none !important; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--linea); }
    #opciones #tiny.abierto { display: block !important; }
    #opciones #tiny > li > a, #opciones .btn-menu { padding: 13px 14px; }
    .colocar_lateral { flex-direction: column; }
    .colocar_lateral > section.one-fourth { flex: none; }
    .colocar_lateral > section.three-fourth { width: 100%; }
}
@media only screen and (max-width: 560px) {
    #logo, #arriba { flex: 1 1 100%; width: 100%; background-position: center; }
    #iconos { margin: 0 auto; }
    .Record th, .Record td { padding: 9px 10px !important; }
    .Record tr.Controls > th { width: 38%; }
    .titulo_seccion { font-size: 18px; }
}

/* ---------- Resultados en movil: cada fila pasa a ser una tarjeta ----------
   El JS de indice.php marca las tablas de listado (.lista-movil), su cabecera (.cab-movil),
   las filas (.fila-movil) y etiqueta cada celda con data-label (nombre de la columna). */
@media only screen and (max-width: 1200px) {
    table.lista-movil, .lista-movil tbody {
        display: block;
        width: 100%;
        border: 0;
        background: none;
        overflow: visible;
    }
    .lista-movil tr { display: block; }
    .lista-movil tr:not(.fila-movil) { background: transparent !important; border: 0 !important; height: auto !important; }
    /* Contador de registros */
    .lista-movil th[colspan] { display: block; width: auto; padding: 0 0 10px !important; border: 0; background: none !important; text-align: left; }
    .lista-movil th[colspan] div { text-align: left; }
    /* Cabecera: los enlaces de ordenacion pasan a ser botones */
    .lista-movil tr.cab-movil { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 14px; }
    .lista-movil tr.cab-movil > th, .lista-movil tr.cab-movil > td {
        display: block;
        width: auto !important;
        padding: 6px 14px !important;
        font-size: 13px;
        background: var(--azul-claro);
        border: 0;
        border-radius: 999px;
    }
    .lista-movil tr.cab-movil > :not(:has(a)) { display: none; }
    .lista-movil tr.cab-movil > :has(a)::before { content: "\2195\00a0"; color: var(--suave); }
    /* Filas = tarjetas */
    .lista-movil tr.fila-movil {
        margin: 0 0 12px;
        padding: 12px 16px;
        background: #fff;
        border: 1px solid var(--linea);
        border-radius: 10px;
    }
    .lista-movil tr.fila-movil > td, .lista-movil tr.fila-movil > td.extra {
        display: block;
        width: auto !important;
        padding: 2px 0 !important;
        background: transparent !important;
        border: 0;
    }
    .lista-movil tr.fila-movil > td:first-child { margin-bottom: 4px; font-size: 16px; line-height: 1.35; }
    .lista-movil tr.fila-movil > td:first-child a { font-weight: 600; }
    .lista-movil tr.fila-movil > td[data-label]:not(:first-child)::before {
        content: attr(data-label);
        display: inline-block;
        min-width: 84px;
        margin-right: 8px;
        font-size: 12px;
        font-weight: 600;
        color: var(--suave);
    }
    .lista-movil tr.fila-movil > td[data-label]:not(:first-child) { display: flex; }
    .lista-movil tr.fila-movil > td[data-label]:not(:first-child)::before { flex: 0 0 84px; }
    .lista-movil tr.fila-movil > td.vacio { display: none !important; }
    .lista-movil tr.Bottom { padding-top: 4px; }
    .lista-movil .Bottom td { padding: 8px 0 !important; border: 0; background: none; }
}

@media print {
    #lateral, #iconos, #pie_pagina { display: none; }
    #centro.three-fourth, #cabecera_principal { box-shadow: none; }
}

/* El menu ya es visible en movil: se oculta el <select> que genera selectnav.js */
.selectnav, .styled-select { display: none !important; }

#centro, #cabecera_principal, #pie_pagina, #opciones, .wrapper { box-sizing: border-box; }
#centro { overflow-x: auto; }

.Record th, .Record td, .Record strong { font-family: var(--fuente); }
