/* Blog — Energy 24 */

/* Sección blog en la home */
#blog .e24-blog-grid--home {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  #blog .e24-blog-grid--home {
    gap: 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#blog .e24-blog-card__title {
  display: block;
  margin-top: 1rem;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--ink, #111) !important;
}

#blog .e24-blog-card__title-link {
  color: inherit;
  text-decoration: none;
}

#blog .e24-blog-card__excerpt {
  margin-top: 0.75rem;
}

/* Ocultar hero de la home si se pegó por error en la página Blog */
body.e24-blog-page section#top,
body.e24-blog-page #top {
  display: none !important;
}

/* Contenedor con márgenes consistentes */
.e24-blog-shell {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.e24-blog-shell--narrow {
  max-width: 48rem;
}

/* Hero del blog */
.e24-blog-hero {
  background: var(--background, #fafafa);
}

.e24-blog-hero__inner {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.e24-blog-hero__title {
  margin-top: 1rem;
  max-width: 20ch;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink, #111);
}

.e24-blog-hero__title--single {
  max-width: 28ch;
  font-size: clamp(1.875rem, 4vw, 2.75rem);
}

.e24-blog-hero__lead {
  margin-top: 1rem;
  max-width: 42rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft, #5c5c5c);
}

.e24-blog-back {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft, #5c5c5c);
  text-decoration: none;
  transition: color 0.15s ease;
}

.e24-blog-back:hover {
  color: var(--ink, #111);
}

/* Contenido principal */
.e24-blog-content {
  padding-block: clamp(2rem, 5vw, 3rem) clamp(3rem, 7vw, 5rem);
}

.e24-blog-content--single {
  padding-block: clamp(2rem, 4vw, 2.75rem) clamp(3rem, 6vw, 4.5rem);
}

/* Filtros de categoría */
.e24-blog-filters {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.e24-blog-filters .pill {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.e24-blog-filters .pill.border-ink {
  color: #fff !important;
}

/* Grid de artículos */
.e24-blog-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .e24-blog-grid {
    gap: 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .e24-blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tarjetas */
.e24-blog-card {
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 1rem;
  background: var(--surface, #fff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.e24-blog-card:hover {
  border-color: color-mix(in srgb, var(--ink, #111) 12%, var(--line, #e8e8e8));
  box-shadow: 0 12px 32px -24px rgb(0 0 0 / 0.35);
  transform: translateY(-2px);
}

.e24-blog-card__media {
  aspect-ratio: 16 / 9;
  background: var(--surface-2, #f4f4f4);
}

.e24-blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.e24-blog-card:hover .e24-blog-card__img {
  transform: scale(1.03);
}

.e24-blog-card__title a {
  text-decoration: none;
  color: inherit;
}

.e24-blog-card__link {
  text-decoration: none;
}

.e24-blog-empty {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-soft, #5c5c5c);
}

/* Paginación */
.e24-blog-pagination {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: flex;
  justify-content: center;
}

.e24-blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink, #111);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.e24-blog-pagination .page-numbers:hover {
  border-color: var(--ink, #111);
}

.e24-blog-pagination .page-numbers.current {
  background: var(--ink, #111);
  border-color: var(--ink, #111);
  color: #fff;
}

.e24-blog-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Prose del artículo */
.e24-prose {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink, #111);
}

.e24-prose > :first-child {
  margin-top: 0;
}

.e24-prose h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.e24-prose h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.e24-prose p,
.e24-prose ul,
.e24-prose ol {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.e24-prose ul,
.e24-prose ol {
  padding-left: 1.25rem;
}

.e24-prose li {
  margin-top: 0.35rem;
}

.e24-prose a {
  color: var(--ink, #111);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.e24-prose strong {
  font-weight: 700;
}

/* CTA al final del artículo */
.e24-blog-cta {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--amber, #f59e0b) 30%, transparent);
  border-radius: 1rem;
  background: var(--amber-soft, #fff8eb);
}

.e24-blog-cta__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink, #111);
}

.e24-prose + .e24-blog-cta {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.e24-blog-cta__text {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft, #5c5c5c);
}

.e24-blog-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
