/************************
 * TOP BAR (CABECERA) FIX
 ************************/
 
#block-bootstrap5-subtheme-topbar a {
  color: #fff;
}

#block-bootstrap5-subtheme-topbar a:hover {
  color: #81b6de;
  text-decoration: none;
}

/* El bloque REAL como contenedor flex (no hay .content) */
#block-bootstrap5-subtheme-topbar {
  background: #006632;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;

  /* layout */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;

  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 20px;
  box-sizing: border-box;
}

.region-header {
    background-color: #006632;
}

.uja-header {
    background-color: white;
    padding-top: 10px;
}

.uja-header-title {
    text-align: center;
}

/* Quitar efectos del wrapper de Drupal */
#block-bootstrap5-subtheme-topbar .field__item {
  display: contents; /* hace que topbar-left/right cuenten como hijos directos */
}

/* Izq / der */
#block-bootstrap5-subtheme-topbar .topbar-left,
#block-bootstrap5-subtheme-topbar .topbar-right {
  display: flex;
  align-items: center;
}

/* Listas inline */
#block-bootstrap5-subtheme-topbar ul.inline {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

/* Contacto: icono + texto en línea */
#block-bootstrap5-subtheme-topbar .topbar-contact li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  font-weight: 700;
}

/* Redes */
#block-bootstrap5-subtheme-topbar .topbar-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Links */
#block-bootstrap5-subtheme-topbar a {
  color: #fff;
  text-decoration: none;
}

#block-bootstrap5-subtheme-topbar a:hover {
  color: #81b6de;
}

/* 🔥 Anula los <br> que ha metido CKEditor dentro del topbar */
#block-bootstrap5-subtheme-topbar br {
  display: none;
}

/* Tamaño iconos */
#block-bootstrap5-subtheme-topbar i {
  font-size: 14px;
  line-height: 1;
}

/* Responsive: apilar */
@media (max-width: 768px) {
  #block-bootstrap5-subtheme-topbar {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  #block-bootstrap5-subtheme-topbar ul.inline {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}


/* =========================
   MENÚ PRINCIPAL (bloque main)
   ========================= */

#block-bootstrap5-subtheme-navegacionprincipal {
  background: #f2f2f2;                /* quita el verde heredado */
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 18px 0;
}

/* El <ul> principal: forzarlo a fila y centrado */
#block-bootstrap5-subtheme-navegacionprincipal > ul.navbar-nav {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;  /* en vez de end */
  align-items: center;
  flex-wrap: nowrap !important;        /* evita saltos raros */
  gap: 28px;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* El padre NO se comporta como botón en click */
#block-bootstrap5-subtheme-navegacionprincipal .dropdown-toggle::after {
  margin-left: 6px;
}


/* Los <li> */
#block-bootstrap5-subtheme-navegacionprincipal > ul.navbar-nav > li.nav-item a {
  padding-block: 10px;
  padding-inline: 20px;
}

/* Links estilo “prod” */
#block-bootstrap5-subtheme-navegacionprincipal a.nav-link {
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .6px;
  color: #1b4f8a;
  padding: 0;                         /* el padding ya lo da el bloque */
  line-height: 1.2;
  background: #f2f2f2;
}

#block-bootstrap5-subtheme-navegacionprincipal a.nav-link:hover,
#block-bootstrap5-subtheme-navegacionprincipal a.nav-link:focus {
  color: #0f3e73;
  text-decoration: none;
}

/* Dropdown: que no “empuje” el menú */
#block-bootstrap5-subtheme-navegacionprincipal .dropdown-menu {
  margin-top: 12px;
}

/* Móvil: que vuelva a columna y con padding normal */
@media (max-width: 991.98px) {
  #block-bootstrap5-subtheme-navegacionprincipal {
    padding: 10px 0;
  }

  #block-bootstrap5-subtheme-navegacionprincipal > ul.navbar-nav {
    flex-direction: column !important;
    align-items: flex-start;
    gap: 12px;
    padding: 0 15px;
  }
}

/* Hover y activo en verde institucional */
#block-bootstrap5-subtheme-navegacionprincipal a.nav-link:hover,
#block-bootstrap5-subtheme-navegacionprincipal a.nav-link:focus,
#block-bootstrap5-subtheme-navegacionprincipal li.nav-item.active > a.nav-link,
#block-bootstrap5-subtheme-navegacionprincipal a.nav-link.is-active {
  background-color: #006632;
  color: white;
}


/************************
 * FOOTER
 ************************/

footer {
  padding: 0;
}

/* Contenedor principal del footer */
#block-bootstrap5-subtheme-contactopie {
  background-color: #006632;
  color: #ffffff;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
  box-sizing: border-box;
}

/* Columnas */
#block-bootstrap5-subtheme-contactopie > * {
  width: 100%;
  padding: 0 1rem 1.5rem;
  box-sizing: border-box;
}

/* Breakpoints */
@media (min-width: 576px) {
  #block-bootstrap5-subtheme-contactopie > * {
    width: 50%;
  }
}
@media (min-width: 992px) {
  #block-bootstrap5-subtheme-contactopie > * {
    width: 25%;
  }
}

/* Enlaces footer */
#block-bootstrap5-subtheme-contactopie a {
  color: #fff;
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
#block-bootstrap5-subtheme-contactopie a:hover {
  text-decoration: underline;
}

/* Logo */
#block-bootstrap5-subtheme-contactopie .logo img {
  max-width: 160px;
  height: auto;
  display: block;
  float: none !important;
}

/* Menús */
#block-bootstrap5-subtheme-contactopie .nav {
  margin: 0;
  padding: 0;
}
#block-bootstrap5-subtheme-contactopie .nav-link {
  padding: 0;
  margin-bottom: 6px;
}

/* Redes footer */
footer { padding: 0; background-color: #006632; }

.region-footer { padding: 0; }

#redessociales {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

#block-bootstrap5-subtheme-redessocialesfooter img {
  width: 28px;
  height: auto;
}

/* Copyright */
#block-bootstrap5-subtheme-copyright {
  background-color: #4D4D4D;
  color: #ffffff;
  text-align: center;
  padding: 15px 0;
}

#block-bootstrap5-subtheme-copyright a {
  color: #fff;
  text-decoration: none;
}
#block-bootstrap5-subtheme-copyright a:hover {
  color: #81b6de;
}

#block-bootstrap5-subtheme-copyright .copyright {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  padding: 0 1rem;
}

#actualidaduja { 
  margin-top: 50px;
}


/* ===== Sección 4 iconos (Layout Builder fourcol) ===== */
.layout--fourcol-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

/* Evitar que los bloques se estiren raro */
.layout--fourcol-section .layout__region {
  width: 100%;
}

/* Cada bloque */
.layout--fourcol-section .block-inline-blockbloque-imagen-enlace {
  position: relative;
  text-align: center;
  padding: 1.25rem 0.75rem;
}

/* Ocultar labels "image" y "enlace" */
.layout--fourcol-section .block-inline-blockbloque-imagen-enlace .field__label {
  display: none !important;
}

/* Título debajo, estilo similar al original */
.layout--fourcol-section .block-inline-blockbloque-imagen-enlace h2 {
  margin: 0.75rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0b5b2a; /* ajusta si quieres */
}

/* Contenedor circular */
.layout--fourcol-section .block-inline-blockbloque-imagen-enlace .field--name-field-image .field__item {
  width: 170px;
  height: 170px;
  margin: 0 auto;
  position: relative;
  overflow: hidden; /* por si alguna imagen sobresale */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* La imagen centrada y contenida */
.layout--fourcol-section .block-inline-blockbloque-imagen-enlace .field--name-field-image img {
  max-width: 78%;
  max-height: 78%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}


/* Quitar el texto "/empleo" "/practicas"... pero dejar clickable todo el bloque */
.layout--fourcol-section .block-inline-blockbloque-imagen-enlace .field--name-field-enlace {
  margin: 0;
}

.layout--fourcol-section .block-inline-blockbloque-imagen-enlace .field--name-field-enlace a {
  position: absolute;
  inset: 0;
  z-index: 2;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}

/* Accesibilidad: foco visible al tabular */
.layout--fourcol-section .block-inline-blockbloque-imagen-enlace .field--name-field-enlace a:focus {
  outline: 3px solid #0b5b2a;
  outline-offset: 6px;
}

/* Responsive: que respire en móvil */
@media (max-width: 768px) {
  .layout--fourcol-section .block-inline-blockbloque-imagen-enlace .field--name-field-image .field__item {
    width: 140px;
    height: 140px;
  }
  .layout--fourcol-section .block-inline-blockbloque-imagen-enlace h2 {
    font-size: 1.2rem;
  }
}

@media (max-width: 992px) {
  .layout--fourcol-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .layout--fourcol-section {
    grid-template-columns: 1fr;
  }
}

/* Reordenar contenido: imagen arriba, título abajo */
.layout--fourcol-section
.block-inline-blockbloque-imagen-enlace {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Imagen primero */
.layout--fourcol-section
.field--name-field-image {
  order: 1;
}

/* Título debajo */
.layout--fourcol-section
.block-inline-blockbloque-imagen-enlace h2 {
  order: 2;
  margin-top: 0.75rem;
}

/* Tamaño de imagen más limpio */
.layout--fourcol-section
.field--name-field-image img {
  max-width: 130px;
  max-height: 130px;
}

