/*
 * Web pública redGDPS: reproduce el aspecto de la plantilla Canvas de la web anterior
 * sobre Bootstrap 5.3 (cabecera, títulos fancy-title, entradas, pie oscuro…).
 * Sin dependencias de jQuery ni de los CSS de Canvas.
 */

:root {
  --web-theme: #d61c38;
  --web-theme-rgb: 214, 28, 56;
  --web-theme-dark: #b3152d;
  --web-header-height: 80px;
  --web-text: #212529;
  --web-muted: #adb5bd;
  --web-border: rgba(0, 0, 0, 0.1);
  --web-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --web-font-secondary: 'PT Serif', Georgia, serif;
  --bs-body-font-family: var(--web-font-body);
  --bs-body-color: var(--web-text);
  --bs-link-color: var(--web-theme);
  --bs-link-color-rgb: var(--web-theme-rgb);
  --bs-link-hover-color: var(--web-theme-dark);
  --bs-link-hover-color-rgb: 179, 21, 45;
  --bs-primary: var(--web-theme);
  --bs-primary-rgb: var(--web-theme-rgb);
}

html { scroll-padding-top: calc(var(--web-header-height) + 1rem); }

body {
  font-family: var(--web-font-body);
  color: var(--web-text);
  background: #fff;
  text-rendering: optimizeLegibility;
}

a { color: var(--web-theme); text-decoration: none; }
a:hover { color: var(--web-theme-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--web-text); font-weight: 600; line-height: 1.5; }
img { max-width: 100%; height: auto; }
::selection { background: var(--web-theme); color: #fff; }

.skip-link {
  position: absolute; top: 0.5rem; left: 0.5rem; z-index: 1100;
  padding: 0.5rem 1rem; background: #fff; border: 2px solid var(--web-theme);
}

/* Separador horizontal (Canvas .line) */
.line { clear: both; width: 100%; margin: 4rem 0; border-top: 1px solid var(--web-border); }

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--web-border);
}

.header-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: var(--web-header-height);
}

.site-logo {
  display: flex;
  align-items: center;
  height: var(--web-header-height);
  margin-right: auto;
  padding-right: 2rem;
}
.site-logo img { height: var(--web-header-height); width: auto; }

.header-misc {
  display: flex;
  align-items: center;
  order: 2;
  gap: 0.25rem;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--web-text);
  font-size: 1.125rem;
  cursor: pointer;
  transition: color 0.2s;
}
.header-icon:hover, .header-icon:focus-visible { color: var(--web-theme); }
.header-icon .icon-close { display: none; }
.search-open .header-icon .icon-open { display: none; }
.search-open .header-icon .icon-close { display: inline-block; }

/* Botón hamburguesa (solo < 992 px) */
.hamburger { position: relative; display: block; width: 22px; height: 16px; }
.hamburger span,
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, top 0.25s;
}
.hamburger::before { top: 0; }
.hamburger span { top: 7px; }
.hamburger::after { top: 14px; }
.menu-open .hamburger::before { top: 7px; transform: rotate(45deg); }
.menu-open .hamburger span { opacity: 0; }
.menu-open .hamburger::after { top: 7px; transform: rotate(-45deg); }

/* Menú principal */
.primary-menu { order: 3; flex-basis: 100%; }
.menu-container { list-style: none; margin: 0; padding: 0; }
.menu-item { position: relative; }
.menu-link {
  display: block;
  width: 100%;
  padding: 0.875rem 0.25rem;
  border: 0;
  background: none;
  color: var(--web-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 22px;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}
.menu-link:hover, .menu-link:focus-visible, .menu-item.is-open > .menu-link { color: var(--web-theme); }
.sub-menu-indicator { margin-left: 0.4rem; font-size: 0.65rem; vertical-align: 0.1em; }
.sub-menu-container { list-style: none; margin: 0; padding: 0; }
.sub-menu-container .menu-link { font-size: 0.875rem; font-weight: 400; padding: 0.625rem 15px; }

/* Buscador desplegable: ocupa la fila de la cabecera */
.top-search-form {
  position: absolute;
  inset: 0 7.75rem 0 0;
  display: flex;
  align-items: center;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 5;
}
/* Al abrir, visible al instante (sin transición de visibility) para que web.js pueda dar el foco al campo. */
.search-open .top-search-form { opacity: 1; visibility: visible; transition: opacity 0.25s, visibility 0s; }
.top-search-form .form-control {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -1px;
  color: var(--web-text);
}
.top-search-form .form-control::placeholder { color: #999; }
.top-search-form .form-control:focus { outline: none; box-shadow: none; }

/* Móvil y tableta (< 992 px): menú plegable bajo la cabecera */
@media (max-width: 991.98px) {
  .primary-menu { display: none; padding-bottom: 1rem; border-top: 1px solid var(--web-border); }
  .menu-open .primary-menu { display: block; max-height: calc(100vh - var(--web-header-height)); overflow-y: auto; }
  .menu-container > .menu-item + .menu-item { border-top: 1px solid rgba(0, 0, 0, 0.05); }
  .has-sub > .menu-link { display: flex; justify-content: space-between; align-items: center; }
  .has-sub > .sub-menu-container { display: none; padding-left: 1rem; }
  .has-sub.is-open > .sub-menu-container { display: block; }
  .site-logo img { height: 64px; }
  .site-logo { height: var(--web-header-height); }
}

/* Escritorio (>= 992 px): menú en línea con desplegables al pasar el ratón */
@media (min-width: 992px) {
  .header-row { flex-wrap: nowrap; }
  .menu-trigger { display: none; }
  .primary-menu { order: 1; flex-basis: auto; }
  .menu-container { display: flex; align-items: center; }
  .menu-container > .menu-item > .menu-link { padding: 29px 15px; white-space: nowrap; }
  .header-misc { margin-left: 0.75rem; }
  .sub-menu-container {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1040;
    width: 240px;
    padding: 0.5rem 0;
    background: #fff;
    border: 1px solid var(--web-border);
    border-top: 2px solid var(--web-theme);
    box-shadow: 0 13px 42px 11px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .menu-item:hover > .sub-menu-container,
  .menu-item:focus-within > .sub-menu-container,
  .menu-item.is-open > .sub-menu-container {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .menu-container > .menu-item:last-child > .sub-menu-container { left: auto; right: 0; }
  .sub-menu-container .menu-link:hover { background: rgba(0, 0, 0, 0.03); }
  /* Como en la web actual: sin flecha junto a las raíces en escritorio. */
  .menu-container > .menu-item > .menu-link .sub-menu-indicator { display: none; }
  .search-open .primary-menu { visibility: hidden; }
  .top-search-form { right: 5.5rem; }
}

/* ---------- Contenido ---------- */

.content-wrap { padding-top: 2rem; padding-bottom: 3rem; }
.page-home .content-wrap { padding-top: 1rem; }

/* Título con línea a la derecha (Canvas .fancy-title.title-border) */
.fancy-title { position: relative; margin-bottom: 2rem; }
.fancy-title h2, .fancy-title h3, .fancy-title .h3 {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-right: 0.75rem;
  background: #fff;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  z-index: 1;
}
.fancy-title.title-border::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  border-top: 1px solid var(--web-border);
}

/* Bloque de encabezado centrado (Canvas .heading-block) */
.heading-block { text-align: center; margin-bottom: 2.5rem; }
.heading-block h2 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -1px; line-height: 1.2; }
.heading-block > span { display: block; margin-top: 0.75rem; color: #6c757d; font-size: 1.25rem; }

/* Entradas (noticias, eventos, blog) */
.entry-image { position: relative; margin-bottom: 1.5rem; }
.entry-image img { display: block; width: 100%; border-radius: 3px; }
.entry-image-placeholder { display: block; width: 100%; height: 100%; min-height: 4rem; background: #f1f3f5; border-radius: 3px; }
.entry-title h2, .entry-title h3, .entry-title h4 { margin: 0; font-weight: 600; line-height: 1.5; }
.entry-title a { color: var(--web-text); }
.entry-title a:hover { color: var(--web-theme); }
.entry-title.title-xs h3 { font-size: 1rem; }
.entry-title.title-sm h3 { font-size: 1.125rem; }
.entry-title h4 { font-size: 0.875rem; }

.entry-meta { margin-top: 0.625rem; overflow: hidden; }
.entry-meta ul { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 -0.75rem -1.25rem; padding: 0; }
.entry-meta li {
  display: flex;
  align-items: center;
  margin: 0 1rem 0.75rem 0;
  color: var(--web-muted);
  font-size: 0.9rem;
}
.entry-meta li::before {
  content: '/';
  width: 4px;
  margin-right: 1rem;
  opacity: 0.5;
}
.entry-meta li i { margin-right: 0.35rem; }

/* Rejilla de novedades: imagen de 150 px de alto, sin recortar */
.listado-home .entry-image { height: 150px; overflow: hidden; }
.listado-home .entry-image a { display: block; height: 100%; }
.listado-home .entry-image img { height: 100%; object-fit: contain; object-position: center bottom; }

/* Eventos grandes */
.listado-eventos .entry-image { margin-bottom: 0; }

/* Entradas pequeñas (eventos secundarios y blog): miniatura de 64 px */
.posts-sm .entry-image { width: 64px; margin-bottom: 0; }
.posts-sm .entry-image img { width: 64px; height: auto; border-radius: 3px; }
.posts-sm .entry-meta { margin-top: 0.25rem; }
.posts-sm .entry-meta li { font-size: 0.8125rem; }
.posts-sm > .entry + .entry { margin-top: 0; }

/* Barra lateral */
.sidebar .widget + .widget { margin-top: 2.5rem; }
.sidebar .widget img { border-radius: 3px; }
#postblog .entry { padding-bottom: 1.5rem; }

/* ---------- Carrusel de portada ---------- */

.home-slider {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #f8f9fa;
}
.slider-track { position: relative; }
/* La diapositiva activa marca la altura; el resto se superpone para el fundido. */
.slider-track .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.slider-track .slide.is-active { position: relative; opacity: 1; visibility: visible; }
.slider-track .slide a { display: block; }
.slider-track .slide img { display: block; width: 100%; height: auto; }
.slide-text { display: flex; align-items: center; justify-content: center; min-height: 12rem; padding: 2rem; font-size: 1.5rem; font-weight: 600; color: var(--web-text); }

.slider-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, background-color 0.3s;
}
.slider-prev { left: 0; border-radius: 0 3px 3px 0; }
.slider-next { right: 0; border-radius: 3px 0 0 3px; }
.home-slider:hover .slider-arrow, .slider-arrow:focus-visible { opacity: 1; }
.slider-arrow:hover { background: rgba(0, 0, 0, 0.6); }
@media (hover: none) { .slider-arrow { opacity: 1; width: 40px; height: 40px; margin-top: -20px; font-size: 1.125rem; } }

/* ---------- Secciones a ancho completo ---------- */

/* Héroe de Minipíldoras (imagen de fondo, texto a la derecha) */
.section-hero {
  position: relative;
  margin: 0 0 1rem;
  padding: 150px 0;
  background-color: #f8f9fa;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}
.emphasis-title { margin-bottom: 2rem; }
.emphasis-title .before-heading {
  display: block;
  margin-bottom: 0.25rem;
  color: #6c757d;
  font-family: var(--web-font-secondary);
  font-style: italic;
  font-size: 1.5rem;
}
.emphasis-title h2 {
  margin: 0;
  font-size: calc(1.475rem + 2.7vw);
  font-weight: 600;
  letter-spacing: -2px;
  line-height: 1.2;
}
@media (min-width: 1200px) { .emphasis-title h2 { font-size: 3.5rem; } }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 26px;
  border: 1px solid #111;
  border-radius: 800px;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6;
  transition: background-color 0.2s, color 0.2s;
}
.btn-pill-dark { background: transparent; color: #111; }
.btn-pill-dark:hover, .btn-pill-dark:focus-visible { background: #111; color: #fff; }

/* Llamada a inscribirse (fondo oscuro) */
.section-cta {
  margin: 0;
  padding: 50px 0;
  text-align: center;
  color: #e9ecef;
  background: #222 url('../img/cta-bg.jpg') no-repeat center center;
  background-size: cover;
}
.section-cta h2 {
  max-width: 960px;
  margin: 0 auto 3rem;
  color: #f8f9fa;
  font-family: var(--web-font-secondary);
  font-size: calc(1.375rem + 1.5vw);
  font-weight: 400;
  line-height: 1.5;
}
.section-cta h2 strong { font-weight: 700; }
@media (min-width: 1200px) { .section-cta h2 { font-size: 2.5rem; } }

.btn-reveal {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 60px;
  border-radius: 800px;
  background: var(--web-theme);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  transition: background-color 0.2s, padding 0.3s;
}
.btn-reveal:hover, .btn-reveal:focus-visible { background: #222; color: #fff; padding-right: 50px; padding-left: 70px; }
@media (max-width: 575.98px) { .btn-reveal { padding: 10px 32px; font-size: 1.0625rem; } .btn-reveal:hover { padding: 10px 32px; } }

/* Otras web y proyectos: rejilla de logos */
.section-otrasweb { margin: 1rem 0; padding: 80px 0; background: #f8f9fa; }
.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: center;
}
@media (min-width: 576px) { .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .logo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.logo-grid .grid-item { display: flex; align-items: center; justify-content: center; transition: opacity 0.2s, transform 0.2s; }
.logo-grid .grid-item:hover { opacity: 0.85; transform: translateY(-2px); }
.logo-grid .grid-item img { display: block; width: 100%; height: auto; }
.logo-grid .grid-item-padded { padding: 1.5rem; background: #fff; }

/* Aviso de contenidos */
.section-disclaimer { padding: 1rem 0; margin: 1rem 0; font-size: 0.8rem; font-style: italic; line-height: 1.5; }
.section-disclaimer p { margin: 0; }

/* ---------- Pie ---------- */

.site-footer {
  position: relative;
  color: #e9ecef;
  background: #23272b url('../img/footer-bg.jpg') repeat center top;
  background-size: cover;
  border-top: 5px solid rgba(255, 255, 255, 0.15);
}
.footer-widgets { padding: 3rem 0; }
.footer-brand { display: flex; align-items: flex-start; gap: 18px; }
.footer-logo { margin-top: 8px; padding-right: 18px; border-right: 1px solid #4a4a4a; width: 138px; height: auto; flex-shrink: 0; }
.footer-brand p { line-height: 1.7; }
.site-footer .line { margin: 30px 0; border-top-color: rgba(255, 255, 255, 0.1); }
.widget-links h4 { margin: 0 0 1.25rem; color: #f8f9fa; font-size: 1.125rem; font-weight: 600; }
.widget-links h4 a { color: inherit; }
.widget-links ul { list-style: none; margin: 0; padding: 0; }
.widget-links li { padding: 4px 0; }
.widget-links li a {
  position: relative;
  display: inline-block;
  padding-left: 14px;
  color: rgba(255, 255, 255, 0.75);
}
.widget-links li a::before {
  content: '\25B8';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.75rem;
  line-height: 24px;
  color: rgba(255, 255, 255, 0.75);
}
.widget-links li a:hover { color: #fff; }

.copyrights {
  padding: 21px 0;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.875rem;
  line-height: 1.65;
}
.copyright-links a { display: inline-block; margin: 0 10px; color: var(--web-muted); }
.copyright-links a:first-child { margin-left: 0; }
.copyright-links a:hover { color: #fff; }

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 0 0 5px;
  border-radius: 6px;
  color: #fff;
  font-size: 0.875rem;
  transition: opacity 0.2s;
}
.social-icon:hover { color: #fff; opacity: 0.85; }
.bg-facebook { background-color: #3b5998; }
.bg-twitter { background-color: #00acee; }

/* ---------- Vistas de contenido (área, página, colección, noticias, agenda) ---------- */

/* Cabecera de página (Canvas .page-title con py-3) */
.page-title { padding: 1rem 0 1.5rem; }
.page-title h1 {
  margin: 0;
  font-size: calc(1.425rem + 2.1vw);
  font-weight: 700;
  line-height: 1.2;
  color: var(--web-text);
}
@media (min-width: 1200px) { .page-title h1 { font-size: 3rem; } }
.page-title-content { padding: 1rem 0 0; }
.page-imprescindibles .page-title { padding: 2rem 0 1rem; }
.page-title-center { padding: 40px 0; text-align: center; }
.page-title-center .page-title-content { padding: 0; }
.page-title-center h1 { font-size: 2.25rem; font-weight: 500; }
.page-title-center .breadcrumb { justify-content: center; }
.page-title .entry-meta ul { justify-content: center; margin-left: 0; }
.page-title .entry-meta li:first-child::before { display: none; }
@media (min-width: 768px) { .page-title:not(.page-title-center) .entry-meta ul { justify-content: flex-start; } }

/* Migas (separador ">", ocultas en móvil como en la web actual) */
.migas .breadcrumb { --bs-breadcrumb-divider: '>'; margin: 1rem 0 0.25rem; font-size: 0.9rem; }
.migas .breadcrumb-item a { color: #495057; }
.migas .breadcrumb-item a:hover { color: var(--web-theme); }
.migas .breadcrumb-item.active { color: #6c757d; }
@media (max-width: 767.98px) { .migas { display: none; } }

/* Cuerpo HTML de páginas y colecciones (contenido del editor) */
/* Medidas de Canvas: p y títulos con 30 px debajo; h2 30, h3 24, h4 18, h5 14, h6 12 px. */
.page-body { line-height: 1.5; overflow-wrap: break-word; }
.page-body p, .page-body ul, .page-body ol, .page-body table { margin-bottom: 30px; }
.page-body h1, .page-body h2, .page-body h3, .page-body h4, .page-body h5, .page-body h6 { margin: 0 0 30px; font-weight: 600; line-height: 1.5; }
.page-body h1 { font-size: 36px; }
.page-body h2 { font-size: 30px; }
.page-body h3 { font-size: 24px; }
.page-body h4 { font-size: 18px; }
.page-body h5 { font-size: 14px; }
.page-body h6 { font-size: 12px; }
.page-body img { max-width: 100%; height: auto; }
.page-body table { max-width: 100%; }
/* URLs largas del contenido heredado: en una celda, break-word no las parte y la tabla ensancha la página en móvil. */
.page-body td, .page-body th { overflow-wrap: anywhere; }
.page-body table.table { width: 100%; }
.page-body iframe, .page-body video { max-width: 100%; }
.page-body .contenidoDestacado { padding: 1rem 1.25rem; border-left: 4px solid var(--web-theme); background: #f8f9fa; }

/* Listados (Canvas .listado): imagen 16:9 recortada al centro */
.listado .entry-image { aspect-ratio: 16 / 9; overflow: hidden; }
.listado .entry-image a { display: block; height: 100%; }
.listado .entry-image img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.listado .entry-image-placeholder { height: 100%; }
.listado .entry-title h2 { margin: 0; font-weight: 600; line-height: 1.5; }
.listado .entry-title.title-xs h2 { font-size: 1rem; }
.entry-content { color: #555; font-size: 0.9375rem; line-height: 1.6; }
.read-more-link { display: inline-flex; align-items: center; gap: 0.25rem; margin-top: 0.5rem; font-size: 0.875rem; }

/* Documentos adjuntos */
.documentos li { padding: 0.25rem 0; }
.documentos i { color: var(--web-theme); }

/* Ficha de evento en su página */
.evento-ficha { padding: 1rem 1.25rem; border-radius: 6px; background: #f8f9fa; }
.evento-ficha li { padding: 0.15rem 0; }
.evento-ficha i { margin-right: 0.35rem; color: var(--web-theme); }
.btn-theme { --bs-btn-color: #fff; --bs-btn-bg: var(--web-theme); --bs-btn-border-color: var(--web-theme); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--web-theme-dark); --bs-btn-hover-border-color: var(--web-theme-dark); }

/* Colección: cabecera con datos de publicación y lista de capítulos */
.coleccion-head .fancy-title h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-right: 0.75rem;
  background: #fff;
  font-size: calc(1.425rem + 2.1vw);
  font-weight: 700;
  line-height: 1.2;
  z-index: 1;
}
@media (min-width: 1200px) { .coleccion-head .fancy-title h1 { font-size: 3rem; } }
/* .well es de Bootstrap 3: en la web actual (BS5) no tiene estilo, solo separa. */
.well { margin-bottom: 1rem; }
.coleccion-imagen { max-width: 100%; padding: 1rem; }
@media (min-width: 768px) { .coleccion-imagen { max-width: 40%; } }
.coleccion-list { margin: 2rem 0 0; clear: both; }
.coleccion-item { display: flex; gap: 1.25rem; padding: 1.25rem 0; border-top: 1px solid var(--web-border); }
.coleccion-item-image { flex: 0 0 120px; }
.coleccion-item-image img { width: 120px; height: auto; border-radius: 3px; }
.coleccion-item-body { flex: 1 1 auto; min-width: 0; }
.coleccion-item-body h2 { margin: 0 0 0.5rem; font-size: 1.25rem; font-weight: 600; }
.coleccion-item-body h2 a { color: var(--web-text); }
.coleccion-item-body h2 a:hover { color: var(--web-theme); }
.coleccion-item-subtitulo { color: #555; font-size: 0.9375rem; }
.coleccion-item-subtitulo p { margin-bottom: 0.25rem; }

/* Agenda: tarjetas blancas sobre fondo gris claro */
.listado-eventos-agenda { display: grid; gap: 30px; }
.event-card {
  padding: 1rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: transform 0.25s, box-shadow 0.25s;
}
.event-card:hover { transform: translateY(-3px); box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); }
.event-image { display: block; margin: 0; }
.event-image img { width: 100%; height: auto; border-radius: 3px; }
.event-image .entry-image-placeholder { min-height: 10rem; }
.event-date a { color: #6c757d; font-size: 0.9rem; font-weight: 500; text-transform: uppercase; }
.event-card .entry-title h3 { margin: 0.25rem 0 1rem; font-size: 1.75rem; line-height: 1.5; }
@media (max-width: 767.98px) { .event-card .entry-title h3 { font-size: 1.25rem; } }
.event-card .badge { font-size: 0.675rem; }
.entry-meta.no-separator li::before { display: none; }
.entry-meta.no-separator ul { margin-left: 0; }
.agenda-sidebar { padding: 1.5rem; border-radius: 8px; background: #fff; box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); }
.agenda-sidebar li { padding: 0.25rem 0; }

/* Paginador con el color del tema */
.pagination {
  --bs-pagination-color: var(--web-text);
  --bs-pagination-hover-color: var(--web-theme);
  --bs-pagination-focus-color: var(--web-theme);
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(var(--web-theme-rgb), 0.25);
  --bs-pagination-active-bg: var(--web-theme);
  --bs-pagination-active-border-color: var(--web-theme);
}

/* ---------- Biblioteca de materiales («Selección redGDPS», /materiales y buscador) ---------- */

.page-title-center .page-title-content span { display: block; color: #6c757d; font-size: 1.125rem; }
.filtro-materiales { list-style: none; margin: 0; padding: 0; }
.filtro-materiales li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 4px 0; }
.filtro-materiales li span { color: #6c757d; font-size: 0.875rem; }
.filtro-materiales .filtro-raiz { margin-top: 0.5rem; font-weight: 600; }
.filtro-materiales .filtro-hija { padding-left: 1rem; }
.filtro-materiales .activo > a { color: var(--web-theme); font-weight: 700; }
.filtro-materiales .filtro-limpiar a { font-size: 0.875rem; }
.materiales-raiz { margin: 1.5rem 0 1.25rem; }
.materiales-hija { margin: 1.25rem 0 1.25rem 2.5rem; }
#listamateriales .material-card { min-height: 260px; }
#listamateriales .material-portada { display: block; height: 180px; text-align: center; }
#listamateriales .material-portada img,
.resultados-materiales .material-portada img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.resultados-materiales .material-portada { display: block; height: 180px; text-align: center; }
.material-video { background: #000; max-height: 220px; }
.material-icono { max-width: 40px; margin-right: 0.5rem; }
small.fechamaterial { font-size: 0.75em; white-space: nowrap; }

/* ---------- Ajustes responsive ---------- */

@media (max-width: 767.98px) {
  .section-hero { padding: 80px 0; background-position: 30% center; }
  .section-hero .emphasis-title, .section-hero .btn-pill { background: rgba(255, 255, 255, 0.9); }
  .section-hero .emphasis-title { padding: 1rem; border-radius: 6px; }
  .line { margin: 3rem 0; }
  .fancy-title { margin-bottom: 1.5rem; }
  .footer-brand { flex-direction: column; gap: 0.75rem; }
  .footer-logo { border-right: 0; padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Acceso a la Selección de materiales junto al carrusel de la portada (como en la web anterior). */
.home-aside { border-radius: 6px; overflow: hidden; background: #f8f9fa; }
.home-aside img { width: 100%; height: 100%; object-fit: cover; display: block; }
