/* Solo le damos el mismo tamaño a las imágenes, sin tocar la cuadrícula del tema */
.resource img {
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
    object-position: center !important;
}


/* Quitar línea de los títulos Últimas Publicaciones y Categorías */
.preview-block h2, 
.preview-block h3, 
.preview-block h2 a, 
.preview-block h3 a {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}





/* =========================================
   BARRA SUPERIOR AZUL ISTRA (EL DEFINITIVO) 
   ========================================= */

/* 1. Pintar toda la franja superior de azul */
.main-header__top-bar {
    background-color: #1a1555 !important;
    padding-top: 15px !important; 
    padding-bottom: 15px !important;
    /* Si quieres que ocupe toda la pantalla de lado a lado, quita las diagonales de la siguiente línea: */
    max-width: 100% !important; padding-left: 5% !important; padding-right: 5% !important;
}

/* 2. Volver las letras de "Búsqueda avanzada" a color blanco */
.main-header__advanced-search {
    color: #ffffff !important;
    font-weight: bold !important;
    text-decoration: none !important;
}

/* 3. Darle estilo a la cajita blanca de texto para que resalte */
.main-header__search-form input {
    background-color: #ffffff !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 8px 12px !important;
}




/* =========================================
   ARREGLOS PARA LA PÁGINA DE CATEGORÍAS
   ========================================= */
/* =========================================
   EL RESCATE DEFINITIVO DEL LOGO SUPERIOR
   ========================================= */

/* 1. Destruir los límites de la caja del logo */
.site-title,
.site-title a,
.main-header__logo,
header .logo {
    max-width: 500px !important; /* Le damos medio metro de espacio si quiere */
    width: auto !important;
    overflow: visible !important; /* Prohibido cortar el contenido */
    display: inline-block !important;
}

/* 2. Obligar a la imagen a mostrarse al 100% sin recortes */
.site-title img,
.main-header__logo img,
header img {
    width: auto !important;
    max-width: 100% !important;
    height: 65px !important; /* Altura ideal */
    max-height: 65px !important;
    object-fit: contain !important; /* Esto garantiza que no se mutile la imagen */
    object-position: left center !important; /* Pegadito a la izquierda */
}

/* =========================================
   OCULTAR FOTO GIGANTE EN PÁGINAS INTERIORES
   ========================================= */

/* Ocultar el banner de la foto en todas las páginas que NO sean la principal */
body:not(.site-page-inicio) .banner {
    display: none !important;
}

/* Reducir el margen superior de la página para que el título suba bonito */
body:not(.site-page-inicio) #content {
    padding-top: 30px !important;
}

/* =========================================
   FULMINAR LA PALABRA "FICHAS"
   ========================================= */
.item-set-items > h3 {
    display: none !important;
}


/* =========================================
   RESCATE DEFINITIVO DE LOS LOGOS DEL FOOTER
   ========================================= */

/* 1. Forzar a que la imagen se muestre entera */
footer img, 
.main-footer img,
.site-footer img {
    height: 50px !important;       /* Altura fija y profesional */
    max-height: 50px !important;
    width: auto !important;        /* El ancho se ajusta solito */
    max-width: none !important; 
    object-fit: contain !important; /* La regla mágica: PROHIBIDO RECORTAR */
    display: inline-block !important;
}

/* 2. Liberar las cajas invisibles que envuelven los logos */
footer a, 
.main-footer a,
.site-footer a,
footer figure,
.main-footer figure {
    overflow: visible !important; /* Si la imagen es más ancha que la caja, que se vea igual */
    display: inline-block !important;
}


/* =========================================
   ARREGLOS EN LA PÁGINA DE CATEGORÍAS (CORREGIDO)
   ========================================= */

/* 1. Reemplazar "Conjuntos de fichas" por "Categorías" (Ahora apuntando al H2) */
body.item-set.browse #content > h2 {
    visibility: hidden !important; 
    position: relative !important;
}

body.item-set.browse #content > h2::after {
    content: "Categorías" !important; /* El nuevo título */
    visibility: visible !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    color: #1a1555 !important; /* Lo puse en azul institucional para que resalte más, si no te gusta cámbialo a #333 */
}

/* =========================================
   ELIMINAR BARRA DE CONTROLES EN CATEGORÍAS
   (Oculta ordenar y búsqueda avanzada)
   ========================================= */

body.item-set.browse .browse-controls {
    display: none !important;
}





/* =========================================
   ARREGLO EN LA PÁGINA "VER TODOS LOS TRABAJOS"
   ========================================= */

/* Reemplazar "Fichas" por "Todos los Trabajos" */
body.item.browse #content > h1,
body.item.browse #content > h2 {
    visibility: hidden !important; 
    position: relative !important;
}

body.item.browse #content > h1::after,
body.item.browse #content > h2::after {
    content: "Todos los Trabajos" !important; /* Puedes cambiar este texto por el que prefieras */
    visibility: visible !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    color: #1a1555 !important; /* Mantuve el azul institucional */
}




/* =========================================
   FULMINAR SECCIÓN "MEDIOS" POR COMPLETO
   ========================================= */

body.item.show .media-list,
body.item.show #media,
body.item.show .resource-media {
    display: none !important;
}