/* 1. Definición de tus variables personalizadas */
:root {
  --rojo: #df0022;
  --verde: #0d9541;
  --amarillo: #fddc11;

  /* 2. Sobrescribimos las variables de Olivero con las tuyas */
  --color--primary-70: var(--rojo);
  --color--primary-60: var(--rojo);
  --color--primary-50: var(--rojo);

  /* Ajustamos el foco y elementos activos al verde */
  --color--blue-20: var(--verde);
}

/*Definimos la fuente Roboto*/
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-v51-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
    font-family: 'Anton'; /* El nombre que tú elijas */
    src: url('../fonts/Anton-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Bebas'; /* El nombre que tú elijas */
    src: url('../fonts/BebasNeue-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
.container {
  max-width: 2300px;
  margin: auto;
}

/*------------------------------------------*/
/* ===== HEADER PRINCIPAL ===== */
header[role="banner"] {
  border-bottom: 5px solid var(--rojo);
  box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  padding-top: 10px;
  margin-bottom: 25px;

}

main,
header[role="banner"] {
  display: grid;
  align-items: center;
  width: 80% !important;
  margin-left: auto;
  margin-right: auto;
}

.region-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 0 20px;
  height: 70px;
  flex-wrap: nowrap;
}

.bg-light {
  width: 100%;
  padding: 0 11%;
  background-color: white !important;
  border-bottom: var(--rojo) 3px solid;
  margin-bottom: 20px;
  min-height: 120px;
}



/* ===== LOGO / BRANDING (izquierda) ===== */
#block-iu-sanlucar-site-branding {
  flex: 0 0 500px;
  display: flex;
  align-items: center;
  margin-right: auto;
  /* Espaciador: empuja búsqueda y menú a la derecha */
}

#block-iu-sanlucar-site-branding img {
  width: auto;
  height: 110px;
}

/* ===== NOMBRE DEL SITIO ===== */
#block-iu-sanlucar-site-branding .site-name {
  display: flex;
  flex-direction: column;
  margin-left: 10px;
  line-height: 1.2;
}

#block-iu-sanlucar-site-branding .site-name a {
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

#block-iu-sanlucar-site-branding .site-slogan {
  font-size: 25px;
  color: #666;
}

/* 1. Centrar verticalmente el logo con el bloque de texto */
/* Asumiendo que el padre común es un contenedor que envuelve a ambos */
.site-logo.d-block, 
.site-logo.d-block + div {
    display: inline-block;
    vertical-align: middle;
    float: none; /* Por si el tema usa floats */
}

/* 2. Reducir el espacio entre los dos textos */
.site-title {
    display: block !important;
    line-height: 1 !important; /* Ajusta este valor (0.8, 1.0) para acercarlos */
    margin-bottom: 0 !important;
    padding-bottom: 1px !important;
    padding-top: 10px !important;
}

.site-slogan {
    line-height: 1 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: block !important;
}




/* ===== BUSCADOR (derecha, antes del menú) ===== */
#block-iu-sanlucar-search-form-narrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin-left: 32%;
}

#search-block-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

#edit-keys {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  width: 160px;
}

#edit-actions {
  display: flex;
  align-items: center;
}

#edit-actions .form-submit {
  height: 32px;
  padding: 0 12px;
  cursor: pointer;
}

/* ===== MENÚ DE NAVEGACIÓN (extremo derecho) ===== */
#block-iu-sanlucar-main-menu {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

#block-iu-sanlucar-main-menu .navbar-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

#block-iu-sanlucar-main-menu .nav-item {
  white-space: nowrap;
}

#block-iu-sanlucar-main-menu .nav-link {
  display: block;
  min-width: 85px;
  padding: 6px 12px;
  font-size: 18px;
  text-decoration: none;
  border-radius: 4px;
}

#block-iu-sanlucar-main-menu .nav-link:hover {
  font-weight: 600;
}

#block-iu-sanlucar-main-menu .nav-link.active {
  /* background-color: rgba(0, 0, 0, 0.07);*/
  text-decoration: underline;

}

/* Ocultar el h2 del menú */
#block-iu-sanlucar-main-menu-menu {
  display: none;
}

/*---------------ETABLECE LA UBUCACIÓN DE LOS ELEMENTOS DEL ENCABEZADO *****/

/* Contenedor principal del encabezado */
header {
  width: 80%;
  margin: 0 auto;
  /* Centra el encabezado en la página */
  display: flex;
  justify-content: space-between;
  /* Empuja los grupos a los extremos */
  align-items: center;
  /* Alinea verticalmente al centro */
  padding: 1rem 0;

}

/* Grupo de la izquierda: Logo y Nombre */
.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  /* Espacio entre logo y texto */
}

/* Grupo de la derecha: Menú y Buscador */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  /* Espacio entre el menú y la barra de búsqueda */
}

/* Ajuste para que el menú no tenga márgenes que rompan la línea */
.header-right nav,
.header-right ul {
  margin-bottom: 0;
  display: flex;
  list-style: none;
}


/*------------------------------------------*/
/* ===== TARJETAS DE NOTICIAS (VISTA) ===== */


.primeralinea {

  /* Contenedor principal de la noticia */
  .views-view-responsive-grid__item-inner {
    position: relative;
    overflow: hidden;
    width: 100%;
   /* max-width: 2140px;*/
    /* Basado en tu HTML */
    margin: 0 auto 2em auto;
    font-family:'Bebas';
    
  }

  /* Ajuste de la imagen de fondo */
  .views-field-field-image img {
    display: block;
    width: 100%;
    height:clamp(400px, 50vw, 666px);
    object-fit: cover;
    object-position: center;
  }

  /* Contenedor para posicionar el texto sobre la imagen */
  .views-field-title,
  .views-field-field-subtitulo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    /* Margen lateral */
    text-align: center;
    z-index: 10;
  }

  /* Estilo para el Título (Fondo Negro) */
  .views-field-title {
    bottom: 25%;
    /* Ajusta esta altura según prefieras */
  }

  
  .views-field-title .field-content a {
    background-color: #000;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    padding: 0.2em 0.5em;
    /* El truco para que el fondo se adapte a cada línea: */
    line-height: 1.5;
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    /* Tipografía responsiva: se adapta al ancho de pantalla */
    font-size: clamp(1.2rem, 3vw, 4.5rem);
  }

  .views-field-title a:hover{
    background-color: rgb(53, 52, 52);
  }

  /* Estilo para el Subtítulo (Fondo Rojo) */
  .views-field-field-subtitulo {
    bottom: 4vh;

    /* Posicionado debajo del título */
  }

  .views-field-field-subtitulo .field-content a[href]{
    background-color: var(--rojo);
    color: #fff;
    padding: 0.2em 0.5em;
    line-height: 1.4;
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    font-size: clamp(0.9rem, 2.3vw, 2.8rem);
    text-decoration: none;
  }

  .views-field-field-subtitulo .field-content a:hover{
  color:black;
}
}



.segundalinea {
  .views-view-responsive-grid__item {
    width: 100%;
    background-color: #efefef;
    margin-bottom: 30px;
  }

  .views-view-responsive-grid__item-inner {
    width: 100%;
  }

  .views-field-title {
    padding: 0px 20px;

  }

  .views-field-title a[href] {
    color: black;
    font-size: 30px;
    font-size: clamp(1rem, 2vw, 2.3rem);
    line-height: 1.1;    
    text-decoration: none;
    font-family: 'Bebas', sans-serif;
  }

  .views-field-title a:hover {
    color: var(--rojo);
  }

  .views-field-field-subtitulo a[href] {
    font-size: clamp(.9rem, 1.5vw, 1.5rem);
    color: dimgray;
    padding: 10px 20px;
    padding-bottom: 20px;
    line-height: 1.2;
    text-decoration: none;
    display: block;


  }

  /* El estado hover */
.views-field-field-subtitulo a[href]:hover {
  color:var(--rojo); /* Cambia al color que prefieras */
}


  .views-field-created {
    font-size: clamp(0.6rem, 8vw, 0.9rem);
    line-height: 1.2;
    font-weight: bold;
    padding: 3px 10px 3px 10px;
    color: white;
    background-color: var(--rojo);
    margin-bottom: 10px;
  }

  img {
    width: 100%;
    /* O el ancho que prefieras */
    height:clamp(200px, 50vw, 300px);
    /* Altura fija solicitada */
    object-fit: cover;
    /* Recorta la imagen para llenar el contenedor */
    object-position: center;
    /* Centra el recorte (valor por defecto) */
  }
}

.listainicio {
  /* background-color: yellow;*/
  /* Esto alinea la imagen y el grupo de textos */

  .fila-flex {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  /* Busca la clase específica de tu campo de imagen en el inspector */
  .views-field-field-image img {
    width: 100px;
    /* Ancho fijo */
    height: 100px;
    /* Alto fijo IGUAL al ancho */
    min-width: 100px;

    /* Opcional: si quieres que sea responsivo pero siempre circular:
     width: 400px;
     aspect-ratio: 1 / 1; 
  */

    border-radius: 5px;
    /* Esto ahora sí creará un círculo */
    object-fit: cover;
    /* ESTO ES VITAL: evita que la foto se vea "aplastada" */
    object-position: center;
    /* Centra el recorte en el medio de la foto */

    /* Reset de estilos por si el tema de Drupal añade bordes o paddings */
    max-width: none;
    padding: 0;
    display: block;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  }

  .views-field-field-image:hover img {
    transform: scale(1.25);
    /* Amplía la imagen un 15% */
    cursor: pointer;
    /* Cambia el cursor para indicar que es interactivo */
  }

  .views-field-title a[href] {
    color: black;
    font-size: 30px;
    font-size: clamp(16px, 2.5vw, 30px);
    /* responsive, no desborda */
    text-decoration: none;
    line-height: normal;
    font-family: "Roboto", sans-serif;

  }

  .views-field-field-subtitulo a[href]{
    font-size: clamp(14px, 2.5vw, 20px);
    color: dimgray;

  }
/* Seleccionamos el contenedor del bloque de texto */
.views-field-created .field-content {
  display: block;
}

/* Si los dos bloques (imagen y texto) están uno al lado del otro */
.views-row { /* O el contenedor que agrupe imagen y texto */
  display: flex;
  align-items: flex-start; /* Esto fuerza a que todos los hijos se alineen arriba */
}

  .fecha {
    font-size: clamp(12px, 2.5vw, 16px);
    color:var(--rojo);
  }

  .views-field-title a:hover {
    color: var(--rojo);
  }

}

/*------------------------------------------*/
/* ===== PAGINA  ===== */

.page-node-type-article {
  .field--name-title {
    padding-bottom: 30px;
    color: #df0022;
     font-family: 'Bebas', sans-serif;
     font-size: 4rem;
  }

  .fecha-creacion-personalizada {
    background-color: dimgray;
    color: white;
    width: 100px;
    text-align: center;
    font-weight: bold;
  }

  .field--type-image {
    height: auto;
    text-align: center;
    padding: 30px 0px;
  }

  .field--name-field-media-oembed-video {
    text-align: center;
    padding-bottom: 30px;

    iframe {
      width: 800px;
      height: 600px;
    }
  }

  .field--name-field-subtitulo {
    text-align: left;
    font-size: clamp(22px, 3vw, 30px);
    line-height: normal;
    padding-bottom: 15px;
    font-weight: 600;
  }

  .field--name-body {
    color: dimgray;
    font-size: clamp(12px, 3.5vw, 20px);
    line-height: auto;
    padding-bottom: 30px;
  }

  p.western span {
    /*para las entradas nuevas copiadas de wp*/
    font-size: clamp(12px, 3.5vw, 20px) !important;
  }
}

/*------------------------------------------*/
/* ===== MENÚ PRINCIPAL ===== */

.menu--level-1 ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 20px;
}

.menu--level-1 li a {
  text-decoration: none;
  padding: 10px 15px;
  display: block;
}

.menu--level-1 li a:hover {
  background-color: #f0f0f0;
  border-radius: 4px;
}

/*------------------------------------------*/
/* ===== ESTILOS GLOBALES ===== */

body {
  font-family: 'Roboto', sans-serif;
}

a.site-title {
  font-size: clamp(18px, 2vw, 38px) !important;
  color:var(--rojo) !important;
  letter-spacing: 0px !important;
}

a:hover {
  color: var(--verde);
}

.button--primary {
  background-color: var(--rojo) !important;
  border-color: var(--rojo) !important;
}

.button--primary:hover {
  background-color: var(--verde) !important;
  border-color: var(--verde) !important;
}

.search-block-form input[type="submit"] {
  background-color: var(--rojo);
  color: white;
}

.search-block-form   #edit-keys {
    width: clamp(150px, 8vw, 200px) !important;
  }

/*----------------------------------------*/
/*   ============ PAGINADOR ========= */

.pager {

  .active>.page-link {
    background-color: black;
    color: white;
  }

  .page-link {
    color: black;
    border-color: silver;

  }

  .page-item.disabled .page-link {
    background-color: #e9e9e9;
  }

}

.feed-icons {
  visibility: hidden;
}

/*----------------------------------------*/
/*   ============ PIE DE PAGINA ========= */

/* Estilos generales */
.amnesty-footer {
  background-color: #000000;
  color: #ffffff;
  padding: 60px 20px 20px 20px;
  font-family: Arial, sans-serif;
}

.footer-container {
  max-width: 100%;
  margin: 0 10%;
}

/* Rejilla de columnas */
.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}

.footer-column {
  flex: 1;
  min-width: 180px;
}

.footer-column h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-column a:hover {
  text-decoration: underline;
}

.footer-column p {
  font-size: 0.85rem !important;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Botón de empleo */
.btn-empleo {
  display: inline-block;
  border: 1px solid #ffffff;
  padding: 10px 20px;
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.8rem;
  transition: background 0.3s;
}


.btn-empleo:hover {
  background: #ffffff;
  color: #000000;
}

/* Línea divisoria */
.footer-divider {
  border: 0;
  border-top: 1px solid #333;
  margin: 40px 0 20px 0;
}

/* Barra inferior y redes sociales */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #cccccc;
}

.legal-links a {
  color: #cccccc;
  text-decoration: none;
  margin-right: 15px;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.social-icons span {
  font-weight: bold;
  margin-right: 10px;
}

.social-icons a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
}




/*------------------------------------------*/
/* ===== RESPONSIVE ===== */

/* === MÓVIL (base) === */
.region-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}

.navbar-brand .site-slogan{
  display: block;
}

.navbar-brand img {
  margin: 0 0.1em 0 0;
}

#block-iu-sanlucar-site-branding {
  flex: 1 1 auto;
  width: 290px;
}

#block-iu-sanlucar-search-form-narrow {
  flex: 0 0 100%;
  order: 3;
}

#block-iu-sanlucar-main-menu {
  flex: 0 0 100%;
  order: 4;
}

#block-iu-sanlucar-main-menu .nav-link.active{
  font-size:16px;
}

.navbar-toggler-icon{
  width: 1em;
  height: 1em;
}

.block-search form{
  flex-direction: row !important;
  #edit-keys{
    margin-top: 9px;
  }
}

.node__media-wrapper video {
    width: 100% !important; /* Cambia 100% por el valor que quieras */
    height: auto !important; /* Para mantener la proporción */
    padding: 20px 0px;

  }
/***** solo para moviles cambiamos la noticia principal *****/
@media (max-width: 500px) {
  .field--name-title{
  font-size:26px;
  line-height: 1.2;
}
.views-field-title {
  bottom: 35%;
}

.views-field-field-subtitulo {
  bottom: 5%;
}

.fecha-creacion-personalizada{
  font-size: 12px;
  width: 80px !important;
}

}


/* ===== AJUSTE ESPECÍFICO PARA MENÚ HAMBURGUESA (MÓVIL) ===== */

/* AJUSTE ESPECÍFICO PARA MÓVIL (MAX-WIDTH: 991PX) */
@media (max-width: 991px) {
  /* 1. Forzamos que el contenedor del header sea el punto de referencia */
  .region-nav-additional {
    position: relative !important;
    display: flex !important;
    flex-wrap: wrap !important;
    height: auto !important;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
  }

  /* 2. El bloque del menú DEBE ser absoluto para no empujar nada */
  #block-iu-sanlucar-main-menu {
    position: absolute !important;
    top: 100% !important; /* Se pega al borde inferior del header blanco */
    left: 0 !important;
    width: 100% !important; /* Forzamos el 100% que ahora está al 20% */
    z-index: 1000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 3. Ajustamos la lista (ul) para que sea el panel desplegable */
  #block-iu-sanlucar-main-menu .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important; /* Esto corrige el error del 20% que veo en tu imagen */
    background-color: #f9f9f9;
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--rojo);
    margin: 0 !important;
    padding: 0 !important;
    border-top:1px solid #eee;
  }

  /* 4. Estilo de los enlaces para que sean fáciles de pulsar */
  #block-iu-sanlucar-main-menu .nav-item {
    border-bottom: 1px solid #eee;
    width: 100% !important;
  }

  #block-iu-sanlucar-main-menu .nav-link {
    padding: 15px 25px !important;
    text-align: left !important;
    width: 100% !important;
    display: block !important;
  }

  .region-nav-additional{
    background-color: #f9f9f9;
    z-index: 1050;
    padding-left: 25px;
  }

  /* 5. El buscador se queda arriba en la barra blanca */
  #block-iu-sanlucar-search-form-narrow,
  .search-block-form {
    flex: 0 1 auto !important;
    order: 2 !important; /* Lo mantiene al lado del botón hamburguesa */
    margin-bottom: 0 !important;
  }
}




/* === TABLET (≥ 768px) === */
@media (min-width: 768px) {
 
  .region-header {
    flex-wrap: nowrap;
    padding: 0 20px;
    height: 60px;
  }

 
  #block-iu-sanlucar-site-branding {
    flex: 0 0 auto;
    margin-right: auto;
    width: 600px;
    min-height: 80px;
  }

  #block-iu-sanlucar-search-form-narrow {
    flex: 0 0 auto;
    order: 0;
  }

  #block-iu-sanlucar-main-menu {
    flex: 0 0 auto;
    order: 0;
  }

  #edit-keys {
    width: 120px;
  }

  .navbar-brand img {
	margin: 0 1em 0 0;
}
}

/* === ESCRITORIO (≥ 992px) === */
@media (min-width: 992px) {

  #block-iu-sanlucar-main-menu .nav-link {
    min-width: 66px;
    font-size: 14px;
  }

  #edit-submit {
    font-size: 14px;
  }

  .region-header {
    padding: 0 30px;
    height: 70px;
  }

    #edit-keys {
    width: 180px;
  }
}

/* === PANTALLA GRANDE (≥ 1200px) === */
@media (min-width: 1200px) {

  .region-header {
    padding: 0 48px;
    width: 480px;
  }

  #edit-keys {
    width: 220px;
  }
}

@media (max-width:1600px){
   main{
    width: 95% !important;
  }
  .bg-light{
    padding: 0 3vw !important;
  }
}



