/* ==========================================================================
   Blog: layout de dos columnas, sidebar, artículo, insertos y prefooter
   ========================================================================== */
.blog-layout {
  display: grid;
  gap: 32px;
  align-items: start;
}
@media (min-width: 900px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

/* ----- Listado ----- */
.blog-list {
  display: grid;
  gap: 22px;
}
@media (min-width: 620px) {
  .blog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.blog-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--soft);
}
.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card__media--empty {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 2.4rem;
}
.blog-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 22px;
}
.blog-card__date {
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.blog-card__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}
.blog-card__title a {
  color: var(--brand-deep);
  text-decoration: none;
}
.blog-card__title a:hover {
  color: var(--brand);
}
.blog-card__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.blog-card__link {
  margin-top: auto;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
}
.blog-empty {
  padding: 40px 0;
  color: var(--muted);
}

/* ----- Sidebar ----- */
.blog-aside {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 96px;
}
.blog-widget {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(7, 120, 162, 0.08);
}
.blog-widget__title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-pale);
  color: var(--brand-deep);
  font-size: 1.05rem;
}
.blog-widget__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.blog-news {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.blog-news__link {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.blog-news__link:hover {
  background: var(--soft);
}
.blog-news__item.is-current .blog-news__link {
  background: var(--brand-pale);
}
.blog-news__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--soft);
}
.blog-news__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-news__thumb--empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
}
.blog-news__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.blog-news__headline {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}
.blog-news__date {
  color: var(--muted);
  font-size: 0.74rem;
}
.blog-widget--banner {
  padding: 0;
  overflow: hidden;
  border: none;
}
.blog-banner {
  display: block;
}
.blog-banner img {
  width: 100%;
  height: auto;
  border-radius: 20px;
}

/* ----- Artículo ----- */
/* La página del artículo va sobre un fondo gris suave y tanto el texto como
   los widgets del sidebar quedan en tarjetas blancas, separados entre sí. */
.blog-article-top {
  background: var(--soft);
}
.blog-article {
  padding: 34px 38px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(7, 120, 162, 0.08);
}
@media (max-width: 620px) {
  .blog-article {
    padding: 22px 20px;
    border-radius: 18px;
  }
}
.blog-article__back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.blog-article__date {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-article__title {
  margin: 0 0 20px;
  color: var(--brand-deep);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.1;
}
.blog-article__cover {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
}
.blog-article__cover img {
  width: 100%;
  height: auto;
}
.blog-article__body {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.7;
}
.blog-article__body p {
  margin: 0 0 18px;
}
.blog-article__body h2,
.blog-article__body h3 {
  margin: 28px 0 12px;
  color: var(--brand-deep);
}
.blog-article__body img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 10px 0;
}
.blog-article__body ul,
.blog-article__body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

/* ----- Insertos dentro del artículo ----- */
.blog-inset {
  margin: 26px 0;
}
.blog-inset--btn {
  text-align: center;
}
.blog-lead {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(150deg, var(--brand-pale), #fff);
  box-shadow: 0 14px 30px rgba(7, 120, 162, 0.1);
}
.blog-lead__title {
  margin: 0 0 14px;
  color: var(--brand-deep);
  font-size: 1.25rem;
}
.blog-lead__status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}
.blog-lead__status--ok {
  color: #1a7f4b;
  background: #e3f8ec;
}
.blog-lead__status--error {
  color: #b3313f;
  background: #fdeaec;
}
.blog-lead__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.blog-lead__row {
  display: grid;
  gap: 12px;
}
@media (min-width: 520px) {
  .blog-lead__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.blog-lead__form input,
.blog-lead__form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbdde4;
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.blog-lead__form input:focus,
.blog-lead__form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(4, 156, 212, 0.13);
}
.blog-lead__check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.82rem;
}
.blog-lead__check input {
  width: auto;
  margin-top: 3px;
}
.blog-inset--wa {
  text-align: center;
}
.blog-wa {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 14px 26px;
  border-radius: 999px;
  color: #fff;
  background: #25d366;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(37, 211, 102, 0.3);
}
.blog-wa:hover {
  background: #1fb457;
}
.blog-wa__icon::before {
  content: "\f232"; /* WhatsApp de Font Awesome, si está cargado */
  font-family: "Font Awesome 6 Brands", "Font Awesome 6 Free", sans-serif;
  font-weight: 400;
}

/* ----- Prefooter: carrusel ----- */
.blog-prefooter {
  margin-top: 8px;
  padding: 34px 0;
  background: var(--soft);
  overflow: hidden;
}
.blog-carousel {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.blog-carousel__track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: blog-carousel-scroll 50s linear infinite;
}
.blog-carousel:hover .blog-carousel__track {
  animation-play-state: paused;
}
.blog-carousel__item {
  flex: 0 0 auto;
  width: 300px;
  height: 190px;
  margin: 0 18px 0 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(7, 120, 162, 0.12);
}
.blog-carousel__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes blog-carousel-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .blog-carousel__track {
    animation: none;
  }
  .blog-carousel {
    overflow-x: auto;
  }
}

/* ----- Prefooter: llamado a la acción (cuando no hay carrusel) ----- */
.blog-prefooter--cta {
  padding: 44px 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}
.blog-cta {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.blog-prefooter--cta .eyebrow {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}
.blog-cta__title {
  margin: 8px 0 6px;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  line-height: 1.1;
}
.blog-cta__lead {
  margin: 0;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.85);
}
.blog-cta__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.blog-prefooter--cta .button-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.blog-prefooter--cta .button-outline:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ----- Filtro y etiquetas del listado ----- */
.blog-filter {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 26px;
}
.blog-search {
  display: flex;
  gap: 8px;
  max-width: 460px;
}
.blog-search input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid #cbdde4;
  border-radius: 12px;
  outline: none;
}
.blog-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(4, 156, 212, 0.13);
}
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.blog-tag {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}
.blog-tag:hover {
  border-color: var(--brand);
  background: var(--brand-pale);
}
.blog-tag.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.blog-result-info {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}
.blog-list--wide {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 4px;
}
.blog-card__tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-pale);
  padding: 3px 9px;
  border-radius: 999px;
  text-decoration: none;
}
.blog-card__tag:hover {
  background: #d3f0fa;
}

/* ----- Etiquetas dentro del artículo ----- */
.blog-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

/* ----- Componentes del cuerpo del artículo (editor) ----- */
.blog-article__body h2.blog-accent,
.blog-article__body .blog-accent {
  border-left: 6px solid var(--brand);
  padding: 2px 0 2px 16px;
  margin: 30px 0 14px;
  color: var(--brand-deep);
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 800;
}
.blog-article__body figure.blog-photo {
  margin: 22px 0;
}
.blog-article__body figure.blog-photo img {
  width: 100%;
  height: auto;
  border-radius: 16px;
}
.blog-article__body figure.blog-photo figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.blog-article__body .blog-thanks {
  margin: 26px 0;
  padding: 20px 22px;
  border: 1px solid #bfe8f7;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--brand-pale), #fff);
  box-shadow: 0 12px 26px rgba(7, 120, 162, 0.10);
}
.blog-article__body .blog-thanks__title {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-deep);
  font-size: 1.15rem;
  font-weight: 800;
}
.blog-article__foot {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
