/*--- GENERALES ---*/

html {
  scroll-behavior: smooth;
}
article {
	max-width: 800px;
	margin: auto;
}
#header {
	border-bottom: 5px solid #f48801;
}
.singular .entry-meta .author::after {
display: none;
}
.d-none {
	display:none !important;
}
.custom-logo {
	display: block;
	max-width: 250px;
	padding: 10px 0px;
	margin: 0 20px;
}
/* Titulos */
h2.wp-block-heading {
    color: #cb0017;
}
h4.wp-block-heading {
    color: #777 !important;
}
h5.wp-block-heading {
    font-weight: lighter;
}
/* Ocultar faldón CC en contenidos */
iframe[src*="cc-urjc-online"]:not(.footer-cc) {
	display: none;
}

/*--- HOME ---*/

.home .wp-block-button__link {
	border-radius: 100px;
	background: #f48801;
	font-size: 20px;
	font-weight: initial;
	width: 200px;
	padding: 10px;
}
.home .entry-header {
	position: absolute;
	z-index: -1000000;
	top: -10000000px;
}
.home .wp-block-newspack-blocks-homepage-articles article {
    border: 1px solid #eee;
    border-radius: 5px;
}

.home .wp-block-newspack-blocks-homepage-articles article .post-thumbnail {
    max-height: 200px;
    overflow: hidden;
    }
.home .wp-block-newspack-blocks-homepage-articles article .post-thumbnail img {
	border-radius: 5px 5px 0 0;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper {
	padding: 10px 0px;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper .cat-links {
    line-height: 1.4em;
    min-height:31px;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper .cat-links, .home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper .entry-title, .home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper p:first-of-type  {
    padding: 0 20px;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper h2.entry-title {
    min-height:80px;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper p:first-of-type  {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    max-height: 65px;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper .more {
	border-top: 1px solid #eee;
    padding: 15px 0 5px;
    margin-top: 20px;
    text-align:center;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper .more a {
 color: #4a5568;
 font-size:1.3em;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper .more a:hover {
 opacity: 0.8;
 text-decoration:none;
}
.home .wp-block-newspack-blocks-homepage-articles button {
display: block;
margin: 40px auto;
padding: 15px;
width: 300px;
border-radius: 100px;
border: 1px solid #f48801;
color: #f48801;
background:transparent;
}
.home .wp-block-newspack-blocks-homepage-articles button:hover {
background:#f48801;
color: #ffffff;
	opacity:1;
}
/*---- Resonsive GRID Home ----*/


@media screen and (min-width: 704px) and (max-width: 1173px) {
    .home .wpnbha.columns-3 article, .home .wpnbha.columns-3 article:last-of-type {
        flex-basis: calc(50% - 8px);
    }
}
@media screen and (min-width: 704px) and (max-width: 853px) {
    .home .wp-block-newspack-blocks-homepage-articles article .post-thumbnail {
	   max-height: 150px;
    }
}
@media screen and (max-width: 703px) {
    .home .wpnbha.columns-3 article, .home .wpnbha.columns-3 article:last-of-type {
        flex-basis: calc(100% - 16px);
        max-width: 450px;
    }
    .home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper h2.entry-title {
        min-height: 50px;
    }
}

/*----------  Cabecera de Contenido  ----------*/

.overlay {
	width: 100vw;
	height: 100vh;
	object-fit: cover;
	position: absolute;
	background: rgba(0,0,0,.7);
	top: 0;
	left: 0;
}
.entry-thumbnail.alignwide {
	--width: 100vw;
	overflow: hidden;
	max-height: calc(100vh - 57px);
    position: relative;
}

.entry-thumbnail.alignwide img {
	width: 100vw;
	height: 100vh;
	object-fit: cover;
}

.header ~ .content.container {
	padding-top: 0;
}
.single-post .entry-header-text {
	position: absolute;
	padding: 50px 25px;
	z-index: 1;
	border-top: 1px solid #fff;
	border-bottom: 1px solid #fff;
	bottom: 5%;
	max-width: 800px;
	width: 94%;
}
.single-post .entry-title {
	color: #fff;
}

/*-------- MAIN A 800 PX DE ANCHO -------*/
@media (min-width: 1024px) {
    .content-narrow .main, .no-sidebar .main, .page-template-narrow .main {
        margin-left: 155px;
        margin-right: 155px;
    }
}

/*------ SOLUCIN H2 AGRUPADOS ALINEADOS A LA IZQ ------*/
.wp-block-group.alignfull h2.alignfull {
margin: 80px auto 40px 10px;
}
@media (min-width: 1024px) {
.wp-block-group.alignfull h2.alignfull {
	max-width: 800px;
	margin: 80px auto 40px auto;
}
}
/*------ IMG Separadores de sección ------*/
.wp-block-image.alignfull {
position: relative;
}
.wp-block-image.alignfull > img {
position: absolute;
top: 0;
}
.wp-block-image.alignfull {
height: 150px;
overflow: hidden;
margin-top:60px;
margin-bottom: 60px;
    margin-left: calc(50% - var(--width)/2);
    margin-right: calc(50% - var(--width)/2);
}
@media screen and (min-width: 519px) {
     .wp-block-image.alignfull > img {
        top: calc(50% - 150px);
    }
    .wp-block-image.alignfull {
        height: 150px;
    }
}
@media screen and (min-width: 768px) {
    .wp-block-image.alignfull > img {
        top: calc(50% - 220px);
    }
    .wp-block-image.alignfull {
        height: 200px;
    }
}
@media screen and (min-width: 1024px) {
    .wp-block-image.alignfull > img {
        top: calc(50% - 300px);
    }
    .wp-block-image.alignfull {
        height: 300px;
    }
}

.wp-block-image.alignfull::before {
  content: '';
  width: 100%;
  height: 100%;
  display: block;
background: rgba(244,135,1,0.94);
background: -moz-linear-gradient(45deg, rgba(244,135,1,0.94) 0%, rgba(244,135,1,0.86) 9%, rgba(244,135,1,0) 100%);
background: -webkit-gradient(left bottom, right top, color-stop(0%, rgba(244,135,1,0.94)), color-stop(9%, rgba(244,135,1,0.86)), color-stop(100%, rgba(244,135,1,0)));
background: -webkit-linear-gradient(45deg, rgba(244,135,1,0.94) 0%, rgba(244,135,1,0.86) 9%, rgba(244,135,1,0) 100%);
background: -o-linear-gradient(45deg, rgba(244,135,1,0.94) 0%, rgba(244,135,1,0.86) 9%, rgba(244,135,1,0) 100%);
background: -ms-linear-gradient(45deg, rgba(244,135,1,0.94) 0%, rgba(244,135,1,0.86) 9%, rgba(244,135,1,0) 100%);
background: linear-gradient(45deg, rgba(244,135,1,0.94) 0%, rgba(244,135,1,0.86) 9%, rgba(244,135,1,0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f48701', endColorstr='#f48701', GradientType=1 );
  z-index: 3;
  position: relative;
  opacity: 0.7;
}
.wp-block-image.alignfull::after {
  content: url('https://urjconline.atavist.com/wp-content/uploads/2021/04/tri.png');
  width: 100%;
  height: 100%;
  display: block;
  z-index: 3;
  position: relative;
  opacity: 0.3;
  top: -300px;
}

/*--- Cajas grises de contenido ---*/
.wp-block-group.has-background {
	margin-top: 40px;
	margin-bottom: 40px;
}

/*-- MENÚ DESPLEGABLE --*/
.nav .sub-menu {
	left: -75px;
	width: 250px;
}
@media screen and (min-width: 1024px) {
    .nav .sub-menu {
        left: -75px;
        width: 250px;
    }
}
.nav ul li ul li a {
	text-transform: full-size-kana;
}

/* Slider comparacin de imágenes */
div.jx-control {
	color: #0008 !important;
}
div.jx-arrow.jx-left, div.jx-arrow.jx-right {
filter: invert(100%) sepia(100%) saturate(2%) hue-rotate(17deg) brightness(107%) contrast(101%);
}

/* Entry header */
article > .entry-header, .page-header {
	margin-top: 48px;
}


/*----- TABLA DE CONTENIDOS -----*/
#toc_container {
  width: 100% !important;
  padding: 40px 30px 30px;
  border-radius: 5px;
  border-width: 2px!important;
  margin: -20px auto 50px;
}
#toc_container .toc_number {
  visibility: hidden;
  position: absolute;
}
#toc_container ul li {
  margin: 15px 0
}
#toc_container .toc_title {
  font-size: 24px;
  text-align: left!important;
  margin-bottom: 30px!important;
  width: 100%!important;
}
#toc_container span.toc_toggle {
  float: right;
  font-size: 14px;
  font-weight: bold;
  color: #aaa;
}
#toc_container span.toc_toggle a {
  color: #999!important;
}

/*TOC primer nivel*/
ul.toc_list>li>a {
    color: #1a1a1a !important;
}
/* TOC segundo nivel */
ul.toc_list>li>ul>li>a {
    color: #333 !important;
    font-size: 1rem;
}
/* TOC tercer nivel */
ul.toc_list>li>ul>li>ul>li>a {
    color: #666 !important;
    font-size: .9rem;
}
/* TOC margin */
#toc_container ul li {
    margin: 10px 0;
}


/* OCULTAR NAVEGACION ENTRE ENTRADAS AL FINAL DEL ARTÍCULO */
.navigation.post-navigation[aria-label="Entradas"] {
	display: none;
}

/* IMG THUMBNAIL */
.img-thumbnail {
	border: 1px solid #ccc;
	padding: 5px;
	border-radius: 5px;
	display: table;
	margin: 0 auto 2rem;
}

/* SOMBRA EN IMAGENES */
.wp-block-image figure img, figure.wp-block-image img {
  box-shadow: 0 0 25px #ccc;
  border-radius: 5px;
}
.no-shadow img {
	box-shadow: none !important;
}

/*BANNER DE MÁS INFO*/
.masinfo {
    padding: 25px 30px 15px;
    border-radius: 5px;
    background: #8c8c971a;
}
.masinfo p {
    margin-bottom: 10px;
}
/*OCULTAR TEMPORALMENTE*/
.ocultar {
	display:none;
	visibility:hidden;
}

/*Botones tipos de pregunta*/
.tiposPregunta a.wp-block-button__link.has-white-color.has-accent-background-color.has-text-color.has-background.has-link-color.wp-element-button {
    background: #F48801;
    margin-bottom: 10px;
    font-size: 16px;
    padding: 10px 20px;
    margin-top: 10px;
}
.tiposPregunta a.wp-block-button__link.has-white-color.has-accent-background-color.has-text-color.has-background.has-link-color.wp-element-button:hover {
   opacity:0.8;
}

/* =========================================
   Estilos Personalizados para el Buscador - FINAL
   ========================================= */

/* --- 1. Contenedor Principal --- */
form.searchandfilter ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Espacio entre elementos */
    list-style: none;
    padding: 0;
    margin: 30px auto;
    width: 100%;
    /* Quitamos el wrap por defecto para controlar mejor escritorio vs movil */
}

form.searchandfilter li {
    margin: 0 !important;
}

/* --- 2. Estilos COMUNES (Altura y Decoración) --- */
form.searchandfilter input[type="text"],
form.searchandfilter select#ofcategory,
form.searchandfilter input[type="submit"] {
    height: 55px; /* Altura */
    padding: 0 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

/* Efecto Hover común */
form.searchandfilter input[type="text"]:hover,
form.searchandfilter select#ofcategory:hover,
form.searchandfilter input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

/* Estilos específicos del Select (Flecha) */
form.searchandfilter select#ofcategory {
    background-color: #ffffff;
    color: #555;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 40px;
}

/* Estilos del Botón */
form.searchandfilter input[type="submit"] {
    /* background-color: #f39c12; */ /* Descomenta si pierdes el color naranja */
    color: white;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap; /* Asegura que el texto del botón no se rompa */
}

/* ==========================================================
   VERSION ESCRITORIO (Pantallas grandes: +769px)
   Aquí arreglamos el "descuajeringue" usando flex:1
   ========================================================== */
@media (min-width: 769px) {
    form.searchandfilter ul {
        flex-wrap: nowrap; /* OBLIGA a estar en una sola línea */
        max-width: 1000px; /* Ancho máximo total */
    }

    /* El input de búsqueda (Li contenedor) */
    form.searchandfilter li:has(input[name="ofsearch"]) {
        flex: 2; /* Este elemento intentará crecer el DOBLE que los demás */
        min-width: 250px; /* Pero nunca será menor de 250px */
    }
    /* En caso de que el navegador no soporte :has (seguridad), aplicamos al input directo */
    form.searchandfilter input[name="ofsearch"] {
        width: 100%; /* Ocupa todo el espacio que le de el flex padre */
        min-width: 250px; 
    }

    /* El select de categorías */
    form.searchandfilter li:has(select) {
        flex: 1; /* Crece de forma normal */
        min-width: 200px;
    }
    form.searchandfilter select#ofcategory {
        width: 100%; /* Se adapta al espacio flexible */
    }

    /* El botón */
    form.searchandfilter li:has(input[type="submit"]) {
        flex: 0 0 auto; /* No crece ni encoge, se queda en su tamaño */
    }
}

/* ==========================================================
   VERSION MOVIL (Pantallas pequeñas: -768px)
   ========================================================== */
@media (max-width: 768px) {
    form.searchandfilter ul {
        flex-direction: column; /* Uno debajo de otro */
        padding: 0 20px;
    }
    
    form.searchandfilter li {
        width: 100%;
    }

    form.searchandfilter input[name="ofsearch"],
    form.searchandfilter select#ofcategory,
    form.searchandfilter input[type="submit"] {
        width: 100%; /* Ocupan todo el ancho */
        margin-bottom: 5px;
    }
}
/* ==========================================================================
   1. BUSCADOR (Search & Filter) - Estilo Flotante y Moderno
   ========================================================================== */

/* Contenedor Principal */
form.searchandfilter ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 30px auto;
    width: 100%;
}

form.searchandfilter li {
    margin: 0 !important;
}

/* Estilos COMUNES (Inputs, Select y Botón) */
form.searchandfilter input[type="text"],
form.searchandfilter select#ofcategory,
form.searchandfilter input[type="submit"] {
    height: 55px;
    padding: 0 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

/* Efecto Hover (Levantar) */
form.searchandfilter input[type="text"]:hover,
form.searchandfilter select#ofcategory:hover,
form.searchandfilter input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

/* Personalización del Select (Flecha SVG) */
form.searchandfilter select#ofcategory {
    background-color: #ffffff;
    color: #555;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 40px;
}

/* Botón Buscar */
form.searchandfilter input[type="submit"] {
    color: white;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

/* --- RESPONSIVE ESCRITORIO --- */
@media (min-width: 769px) {
    form.searchandfilter ul {
        flex-wrap: nowrap;
        max-width: 1000px;
    }
    form.searchandfilter li:has(input[name="ofsearch"]) { flex: 2; min-width: 250px; }
    form.searchandfilter input[name="ofsearch"] { width: 100%; min-width: 250px; }
    
    form.searchandfilter li:has(select) { flex: 1; min-width: 200px; }
    form.searchandfilter select#ofcategory { width: 100%; }
    
    form.searchandfilter li:has(input[type="submit"]) { flex: 0 0 auto; }
}

/* --- RESPONSIVE MÓVIL --- */
@media (max-width: 768px) {
    form.searchandfilter ul { flex-direction: column; padding: 0 20px; }
    form.searchandfilter li, 
    form.searchandfilter input, 
    form.searchandfilter select { width: 100%; margin-bottom: 5px; }
}


/* ==========================================================================
   2. ESTILO DE TARJETAS (SOLO CURSOS Y ENTRADAS)
   ========================================================================== */

/* Títulos centrados */
.archive .page-title,
.home h2.wp-block-heading,
.page h2.wp-block-heading {
    text-align: center;
    color: #333;
    font-weight: 800;
    margin-bottom: 30px;
}

/* --- CORRECCIÓN: Quitamos ".page article" para no afectar la estructura --- */
.archive article,   /* Entradas en páginas de categoría */
.wp-block-post {    /* Entradas en bloques estándar */
    background-color: #fff;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none !important;
    margin-bottom: 30px;
}

/* Hover Tarjeta */
.archive article:hover,
.wp-block-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important;
}

/* Imágenes */
.archive article img,
.wp-block-post img {
    border-radius: 0 !important;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Ocultar Metadatos Generales */
.archive .entry-meta,
.wp-block-post-date,
.wp-block-post-author {
    display: none !important;
}


/* ==========================================================================
   3. ESTILO ESPECÍFICO PARA LA HOME (Bloque Newspack)
   ========================================================================== */

/* Tarjeta Home */
.wp-block-newspack-blocks-homepage-articles article {
    background-color: #fff !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
    border: none !important;
    overflow: hidden;
    transition: transform 0.3s ease;
    padding-bottom: 20px;
    margin-bottom: 30px;
    height: 100%;
}

.wp-block-newspack-blocks-homepage-articles article:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important;
}

/* Imagen Home */
.wp-block-newspack-blocks-homepage-articles article figure,
.wp-block-newspack-blocks-homepage-articles article img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    margin: 0 0 15px 0 !important;
    border-radius: 0 !important;
}

/* Ajustes de Texto y Espaciado */
.wp-block-newspack-blocks-homepage-articles .entry-title,
.wp-block-newspack-blocks-homepage-articles .entry-summary,
.wp-block-newspack-blocks-homepage-articles p {
    padding-left: 20px !important;
    padding-right: 20px !important;
    text-align: left !important;
}

/* Gap Fix */
.wp-block-newspack-blocks-homepage-articles .entry-title {
    font-size: 1.2rem !important;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    padding-bottom: 0 !important;
}

.wp-block-newspack-blocks-homepage-articles .entry-summary,
.wp-block-newspack-blocks-homepage-articles .entry-summary p {
    margin-top: 0 !important;
    padding-top: 0 !important;
    color: #666;
}
/* Aumentar separación entre el título de la categoría y las tarjetas */
.archive .page-header,
.archive .page-title {
    margin-bottom: 60px !important; /* Antes estaba en 30px, lo doblamos */
}
/* Ocultar Metadatos Home */
.wp-block-newspack-blocks-homepage-articles .entry-meta,
.wp-block-newspack-blocks-homepage-articles .avatar,
.wp-block-newspack-blocks-homepage-articles .byline,
.wp-block-newspack-blocks-homepage-articles time {
    display: none !important;
}
.home .wp-block-newspack-blocks-homepage-articles article .entry-wrapper h2.entry-title {
    min-height:55px!important;
}