/* =============================================================================
   XM Blog — Estilos del content type Blog
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Banner hero
   ----------------------------------------------------------------------------- */
.blog-banner {
  position: relative;
  width: 100%;
  min-height: 212px;
  background-size: cover;
  background-position: center;
  background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 80px;
  box-sizing: border-box;
  overflow: hidden;
  margin-bottom: 24px;
}

.blog-banner__social {
  position: absolute;
  left: -9px;
  top: 5%;
  background-color: rgba(217, 217, 217, 0.44);
  padding: 20px 10px 20px 22px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(5px);
  z-index: 2;
}

.blog-banner__social img {
  width: 25px;
  height: auto;
  filter: brightness(0) invert(1);
  transition: transform 0.3s ease;
  display: block;
}

.blog-banner__social img:hover {
  transform: scale(1.1);
}

.blog-banner__tag {
  position: absolute;
  top: 0;
  right: 50px;
  background-color: #440099;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 0px 0px 22px 0px;
  letter-spacing: 0.05em;
  z-index: 2;
}

@media (max-width: 768px) {
  .blog-banner {
    padding: 40px 20px;
  }
  .blog-banner__social {
    display: none;
  }

  /* Video YouTube: reducir altura en mobile */
  .blog__body iframe {
    width: 100% !important;
    height: 250px !important;
  }
}

/* -----------------------------------------------------------------------------
   2. Categoría + fecha
   ----------------------------------------------------------------------------- */
.blog-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: #333;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 12px;
}

.blog-meta__category {
  font-weight: 600;
  color: #440099;
}

.blog-meta__separator {
  color: #999;
}

.blog-meta__date {
  color: #555;
}

/* -----------------------------------------------------------------------------
   3. Índice de contenidos (TOC)
   ----------------------------------------------------------------------------- */
.blog-toc {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 32px;
  background-color: #ede8f8;
}

.blog-toc::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 230%;
  height: 100%;
  background-image: url('../images/ondas-indice.svg');
  background-repeat: no-repeat;
  background-size: 45% auto;
  background-position: top right;
  pointer-events: none;
  z-index: 0;
}

.blog-toc__title,
.blog-toc__list {
  position: relative;
  z-index: 1;
}

.blog-toc__title {
  font-size: 22.4px;
  font-weight: 600;
  color: #1e1a2fbd;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #c4adea;
}

.blog-toc__list {
  counter-reset: toc-item;
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-toc__item {
  counter-increment: toc-item;
  display: flex;
  gap: 16px;
  align-items: baseline;
  margin: 10px 0;
  font-size: 0.9rem;
}

.blog-toc__item::before {
  content: counter(toc-item) ".";
  min-width: 1.6rem;
  flex-shrink: 0;
  color: #3d3560;
  font-weight: 400;
}

.blog-toc__item a {
  color: #3d3560;
  text-decoration: none;
}

.blog-toc__item a:hover {
  text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   4. Cuerpo del blog
   ----------------------------------------------------------------------------- */
.blog__body {
  line-height: 1.7;
  color: #333;
}

.blog__body h2,
.blog__body h3 {
  scroll-margin-top: 80px;
}

/* -----------------------------------------------------------------------------
   4b. Contenido destacado (CKEditor template: .blog-highlighted-content)
   ----------------------------------------------------------------------------- */
.blog-highlighted-content {
  background-color: #e6f7f8;
  border-radius: 12px;
  padding: 20px 28px;
  margin: 28px 0;
  font-style: italic;
  color: #2a2a2a;
  font-size: 1.05rem;
  line-height: 1.6;
}

.blog-highlighted-content p {
  margin: 0;
}

/* -----------------------------------------------------------------------------
   7. Nota importante (CKEditor template: .blog-important-note)
   ----------------------------------------------------------------------------- */
.blog-important-note {
  background-color: #e3e9e9;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 28px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.blog-important-note__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.blog-important-note__icon svg circle,
.blog-important-note__icon svg path {
  stroke: #440099;
}

.blog-important-note__icon svg circle:last-child {
  fill: #440099;
  stroke: none;
}

.blog-important-note__text {
  flex: 1;
  font-size: 0.95rem;
  color: #333;
}

.blog-important-note__text p {
  margin: 0;
}

/* -----------------------------------------------------------------------------
   8. Tarjeta de autor (CKEditor template: .blog-author-card)
   ----------------------------------------------------------------------------- */
.blog-author-card {
  border: 1px solid #d0d0d0;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 28px 0;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.blog-author-card__image {
  flex-shrink: 0;
}

.blog-author-card__image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.blog-author-card__content {
  flex: 1;
}

.blog-author-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
}

.blog-author-card__bio {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 480px) {
  .blog-author-card {
    padding: 16px;
    gap: 14px;
  }

  .blog-author-card__image img {
    width: 80px;
    height: 80px;
  }

  .blog-author-card__name {
    font-size: 0.95rem;
  }

  .blog-author-card__bio {
    font-size: 0.85rem;
  }
}

/* -----------------------------------------------------------------------------
   9. Temas (palabras clave)
   ----------------------------------------------------------------------------- */
.blog-tags {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.blog-tags__title {
  font-size: 22.4px;
  font-weight: 600;
  color: #1e1a2fbd;
  margin: 0 0 12px 0;
}

.blog-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.blog-tags__item {
  font-size: 0.9rem;
  color: #444;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -----------------------------------------------------------------------------
   10. Artículos destacados (slider relacionados)
   ----------------------------------------------------------------------------- */
.blog-related {
  margin-top: 48px;
}

.blog-related__title {
  font-size: 22.4px;
  font-weight: 600;
  color: #1e1a2fbd;
  margin: 0px 0px 34px 0px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 12px;
  padding-top: 12px;
}

/* Flex row: [arrow] [swiper] [arrow] — arrows are siblings, not absolute */
.blog-related__nav-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-related__swiper {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 44px; /* room for pagination dots */
}

/* Cards */
.blog-related-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-related-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-related-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-related-card__content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-related-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Extra specificity to override site-wide link color */
.blog-related-card .blog-related-card__title a,
.blog-related-card .blog-related-card__title a:visited {
  color: #2ad2c9;
  text-decoration: none;
}

.blog-related-card .blog-related-card__title a:hover {
  text-decoration: underline;
}

.blog-related-card__summary {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.5;
  margin: 0 0 12px 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* "Leer más" — pinned bottom-right */
.blog-related-card .blog-related-card__link,
.blog-related-card .blog-related-card__link:visited {
  color: #2ad2c9;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  align-self: flex-end;
  margin-top: auto;
}

.blog-related-card .blog-related-card__link:hover {
  text-decoration: underline;
}

/* Navigation arrows — outside the swiper, flex siblings */
.blog-related__prev,
.blog-related__next {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  cursor: pointer;
  color: #6a26c7;
  font-size: 3.4rem;
  font-weight: 300;
  line-height: 0.63;
  user-select: none;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.blog-related__prev:hover,
.blog-related__next:hover {
  background: #6a26c7;
  color: #fff;
}

.blog-related__prev::after {
  content: '‹';
  margin-right: 2px;
}

.blog-related__next::after {
  content: '›';
  margin-left: 2px;
}

/* Disabled state (Swiper adds .swiper-button-disabled) */
.blog-related__prev.swiper-button-disabled,
.blog-related__next.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Fewer than 4 slides: hide arrows, left-align, cap card width to match 3-col slot */
.blog-related__nav-wrapper--few .blog-related__prev,
.blog-related__nav-wrapper--few .blog-related__next {
  display: none;
}

.blog-related__nav-wrapper--few .blog-related__swiper .swiper-slide {
  width: 362px;
  max-width: 362px;
}

.blog-related__nav-wrapper--few .blog-related__pagination {
  display: none;
}

/* Swiper slide — auto height so card height: 100% equalises per row */
.blog-related__swiper .swiper-slide {
  height: auto;
}

/* Pagination dots */
.blog-related__pagination {
  text-align: center;
}

.blog-related__pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background-color: rgba(68, 0, 153, 0.25);
  opacity: 1;
  border-radius: 50%;
  margin: 0 4px;
  display: inline-block;
  cursor: pointer;
  transition: background-color 0.2s;
}

.blog-related__pagination .swiper-pagination-bullet-active {
  background-color: #440099;
}
