/** REGLAS CSS PERSONALIZADAS O QUE SOBREESCRIBEN LAS DE UGR & UGR_CUSTOM **/

/** ****** **/
/** COMMON **/
/** ****** **/
img.align-left {
    padding-right: 20px;
}

/** ****** **/
/** SLIDER **/
/** ****** **/
.block-views-blockslider-block-1 .view-content .views-row {
    padding-bottom: 0;
    margin-bottom: 8px;
}
/* OVERRIDE SWIPER NEXT-PREV ICONS */
.swiper-button-prev::after,
.swiper-button-next::after {
    content: none !important;
}
.swiper-button-prev i,
.swiper-button-next i {
    font-size: 1.875rem;
    color: #476572;
}
.swiper-button-prev i:hover,
.swiper-button-next i:hover {
    color: #fffeff;
}
.block-views-blockslider-block-1 .swiper-pagination-bullet-active {
    background-color: #fffeff;
}

/** ******************* **/
/** BLOCK NOTICIAS HOME **/
/** ******************* **/
.block-views-blocknoticias-block-news-homepage {
    max-width: 1170px;
    margin-right: auto;
    margin-left: auto;
}

/** ************************ **/
/** CONTENIDO ATEMPORAL HOME **/
/** ************************ **/
.block-views-blocktimeless-content-block-1 {
    max-width: 1170px;
    margin-right: auto;
    margin-left: auto;
}
.view-id-timeless-content .view-content .views-row {
    border: 0;
    padding-bottom: 0;
    margin-bottom: 8px;
}
.view-id-timeless-content .view-content .views-row .card-main-wrapper {
    background-color: #476572E4;
    color: #f6f6f6;
}

/** ********** **/
/** ADMIN PAGE **/
/** ********** **/
#toolbar-administration ul li {
    font-size: small;
}

/** ********** **/
/** BREADCRUMB **/
/** ********** **/
.breadcrumb li:first-child:before {
    content: "";
}
#block-fciencias-breadcrumbs {
    margin-bottom: 0.5rem;
}

/** **** **/
/** PAGE **/
/** **** **/
.page-node-type-new .image_left,
.noticia_ugr .image_left {
    clear: both;
}
.page-node-type-new .image_left > [class*="field--type-image"],
.page-node-type-new .image_left > .field--name-field-imagen-galeria .noticia_ugr .image_left > [class*="field--type-image"],
.noticia_ugr .image_left > .field--name-field-imagen-galeria {
    float: right;
    margin: 0.5rem 0 1.5rem 1.5rem;
}
.page-node-type-new .image_left > [class*="field--type-image"]:nth-child(2),
.noticia_ugr .image_left > [class*="field--type-image"]:nth-child(2),
.page-node-type-new .image_left > .field--name-field-imagen-galeria:nth-child(2) {
    display: none;
}

/** ******************************* **/
/** CONTENT TYPE: ARTICLE (NOTICIA) **/
/** ******************************* **/
.noticia_ugr .fechas {
    padding: 1rem 0;
}
/* Eliminar el borde superior de AddToAny de compartir en redes sociales,
 * ya que como lo metemos en un bloque, este ya tiene borde */
.addtoany_list {
    border-top: 0;
}

/** *************** **/
/** PÁGINA NOTICIAS **/
/** *************** **/
/* Mismo tamaño que el h1 de las webs de ugr */
.views-element-container > h2 {
    font-size: 2.625rem;
}

.noticia-item {
    border-bottom: 1px solid #ddd;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.noticia-body {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.noticia-item {
    display: flex;
    margin-bottom: 20px;
}

.noticia-imagen {
    flex-basis: 25%;
    max-width: 25%;
    margin-right: 20px;
    flex-shrink: 0;
}

.noticia-imagen img {
    width: 100%;
    height: auto;
}

.noticia-datos {
    flex-grow: 1;
}

.noticia-fecha {
    color: #888;
    margin-bottom: 10px;
}

.noticia-titulo {
    margin-bottom: 10px;
}
.views-exposed-form {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}
.views-exposed-form label {
    margin-right: 5px;
    font-weight: bold;
}

.views-exposed-form select {
    min-width: 150px;
}

.views-exposed-form .form-submit {
    margin-bottom: 0;
}
.views-exposed-form .form-item {
    display: flex;
    align-items: center;
    margin-right: 10px;
}
.views-exposed-form .form-actions {
    padding-top: 2px;
}

/** ***************** **/
/** TABLE OF CONTENTS **/
/** ***************** **/
#toc-js-block {
    margin-bottom: 1rem;
}
#toc-js-block.toc-js-container {
    overflow-y: visible;
}
.table-of-contents nav {
    width: 50%;
}
.toc-js-container .list-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    list-style: none;
}
.toc-js-container.active ul {
    display: block;
}
.side-menu-toggle {
    cursor: pointer;
    display: block;
    width: 1.5em;
    height: 1.5em;
    background: url('../images/ico-more-less.svg') no-repeat center center;
}

/** **************************** **/
/** BOTONES ENLACE: OVERRIDE UGR **/
/** **************************** **/
.wrapper-botones {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.wrapper-botones .paragraph--type--boton-enlace {
    flex: 0 0 auto;
}



/** ************* **/
/** MEDIA QUERIES **/
/** ************* **/
@media (max-width: 768px) {
    /* Noticia */
    .noticia-item {
        flex-direction: column; /* Apila imagen y datos */
    }

    .noticia-imagen {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .noticia-body {
        -webkit-line-clamp: 5;
    }

    /* Filtro */
    .views-exposed-form {
        flex-direction: column; /* Apila los elementos */
        align-items: flex-start;
    }

    .views-exposed-form .form-item,
    .views-exposed-form .form-actions {
        display: inline-block;
        text-align: right;
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
    .views-exposed-form .form-actions input {
        margin-right: 0;
    }

    .views-exposed-form select {
        width: 100%;
    }

    .views-exposed-form .form-submit {
        width: auto;
    }

}

@media (max-width: 480px) {
    .noticia-titulo {
        font-size: 1.8rem;
    }

    .views-exposed-form label {
        font-size: 0.9em;
    }

    .views-exposed-form select {
        font-size: 0.9em;
    }
}

/*Duplicamos las reglas de twocol para poder usarlas siempre*/

.layout--twocol-section {
  display: flex;
  flex-wrap: wrap;
}

.layout--twocol-section > .layout__region {
  flex: 0 1 100%;
}

@media screen and (min-width: 40em) {
  .layout--twocol-section.layout--twocol-section--50-50 > .layout__region--first,
  .layout--twocol-section.layout--twocol-section--50-50 > .layout__region--second {
    flex: 0 1 50%;
  }

  .layout--twocol-section.layout--twocol-section--33-67 > .layout__region--first,
  .layout--twocol-section.layout--twocol-section--67-33 > .layout__region--second {
    flex: 0 1 33%;
  }

  .layout--twocol-section.layout--twocol-section--33-67 > .layout__region--second,
  .layout--twocol-section.layout--twocol-section--67-33 > .layout__region--first {
    flex: 0 1 67%;
  }

  .layout--twocol-section.layout--twocol-section--25-75 > .layout__region--first,
  .layout--twocol-section.layout--twocol-section--75-25 > .layout__region--second {
    flex: 0 1 25%;
  }

  .layout--twocol-section.layout--twocol-section--25-75 > .layout__region--second,
  .layout--twocol-section.layout--twocol-section--75-25 > .layout__region--first {
    flex: 0 1 75%;
  }
}

/*Botones*/
.paragraph.paragraph--type--boton-enlace.paragraph--view-mode--default {
  text-align: left;
}

.paragraph.paragraph--type--boton-enlace.paragraph--view-mode--default.center{
  text-align: center;
}

.layout--fourcol-section 
.paragraph--type--boton-enlace a {
  display: block;
  width: 90%;
  box-sizing: border-box;
  text-align: center;
  padding: 1rem 0.5rem;
  font-size: 0.9rem;
}

/*Back to top*/
.back-to-top {
  position: fixed;
  right: 0.5rem;
  bottom: 0;
  width: 48px;
  height: 44px;

  background-color: #7eacf4; 
  color: #ffffff;

  border: none;
  border-radius: 3px;

  cursor: pointer;
  text-align: center;

  opacity: 0;
  visibility: hidden;
  z-index: 9997;

  transform: translateY(100%);
  transition: transform 0.4s ease, opacity 0.4s ease, bottom 0.4s ease;
}

/* Visible */
.back-to-top.show {
  bottom: 1rem;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover*/
.back-to-top:hover {
  color: #7eacf4; 
  background-color: #ffffff;
}

/* Icono */
.back-to-top::before {
  content: "\f106";
  font-family: "FontAwesome";
  font-size: 26px;      
  font-weight: 900;    
  line-height: 44px;
  display: block;
}


/************************************************************/
/* LAYOUT 3 BOTONES — GRID PERFECTO Y TEXTO CENTRADO       */
/************************************************************/

/* Grid real: mismas columnas, mismo gap */
.layout--threecol-section:has(.paragraph--type--boton-enlace) {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;                 /* más aire → sensación de orden */
  align-items: stretch;
}

/* Cada región ocupa su celda completa */
.layout--threecol-section:has(.paragraph--type--boton-enlace)
> .layout__region {
  display: flex;
}

/* El botón ocupa TODA la celda */
.layout--threecol-section:has(.paragraph--type--boton-enlace)
.paragraph--type--boton-enlace a.btn-doble {
  width: 100%;
  height: 100%;
}

/* Botón: centrado REAL (texto + icono) */
.btn-doble {
  display: flex;
  align-items: center;          /* CENTRADO VERTICAL REAL */
  justify-content: center;      /* CENTRADO HORIZONTAL */
  gap: 0.5rem;                  /* espacio texto ↔ icono */

  min-height: 80px;
  padding: 1rem 1.5rem;

  text-align: center;
  line-height: normal;          /* MUY IMPORTANTE */
  white-space: normal;
}


/* Icono ligeramente separado del texto */
.btn-doble::after {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin-top: 12px;  
}


/* Responsive */
@media (max-width: 1024px) {
  .layout--threecol-section:has(.paragraph--type--boton-enlace) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .layout--threecol-section:has(.paragraph--type--boton-enlace) {
    grid-template-columns: 1fr;
  }
}


summary {
  cursor: pointer;
  position: relative;
  padding-left: 23px;
  font-size: 125%;
  line-height: 2;
}

details[open] summary::before {
  transform: rotate(90deg);
}

summary::before {
  content: "\276F";
  position: absolute;
  left: 0;
  transition: transform 0.3s ease;
  color: #2d68c4;
}