/* ─── BLOG.CSS ─── */

/* ─── HERO BANNER ─── */
.blog-hero {
  width: 100%;
  height: 420px;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.blog-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(10, 20, 35, 0.78) 0%,
    rgba(10, 20, 35, 0.5) 55%,
    rgba(10, 20, 35, 0.12) 100%
  );
  display: flex;
  align-items: center;
  padding: 0 6vw;
}

.blog-hero-text {
  color: white;
  margin-top: 55px;
}

.blog-hero-text .section-tag {
  background: rgba(95,186,231,0.2);
  color: var(--blue);
  border: 1px solid rgba(95,186,231,0.35);
  font-family: 'Inter Leve';
  margin-bottom: 0.9rem;
  display: inline-block;
}

.blog-hero-text h1 {
  font-family: 'Glacial Indiference Negrita' !important;
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--blue);
  line-height: 1.1;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.blog-hero-text p {
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 1.05rem;
  color: #ffffff;
  max-width: 460px;
  line-height: 1.65;
}

@media (max-width: 600px) {
  .blog-hero { height: 280px; }
  .blog-hero-overlay { justify-content: center; padding: 0 1.5rem; text-align: center; }
  .blog-hero-text p { display: none; }
}

/* ─── HEADER DE SECCIÓN ─── */
.blog-header {
  padding-top: 2.5rem;
  padding-bottom: 0.5rem;
}

/* ─── WRAP DEL BUSCADOR ─── */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: white;
  border: 1.5px solid rgba(196,196,196,0.45);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(95,186,231,0.12);
}

#searchInput,
#empSearchInput,
#tiendaSearchInput {
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--text, #333);
  background: transparent;
  border: none;
  outline: none;
  padding: 0.65rem 1.2rem;
  width: 240px;
  min-width: 0;
}

#searchInput::placeholder,
#empSearchInput::placeholder,
#tiendaSearchInput::placeholder {
  color: rgba(100,100,100,0.45);
}

.btn-buscar {
  background: var(--green, #2C9843);
  color: white;
  border: none;
  padding: 0.65rem 1.4rem;
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
  border-radius: 0 50px 50px 0;
}

.btn-buscar:hover { background: #237a36; }

.btn-buscar svg {
  width: 14px;
  height: 14px;
  stroke: white;
  flex-shrink: 0;
}

/* ─── GRID DE POSTS ─── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ─── CARD ─── */
.blog-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(196,196,196,0.25);
  box-shadow: 0 2px 16px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(95,186,231,0.16);
  border-color: rgba(95,186,231,0.35);
}

/* ─── IMAGEN DE LA CARD ─── */
.blog-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #e8f5fd 0%, #eaf5ec 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-img img { transform: scale(1.04); }

.blog-card-img .img-placeholder {
  color: #C6C6C6;
  opacity: 0.5;
}

/* ─── CUERPO DE LA CARD ─── */
.blog-card-body {
  padding: 1.4rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ─── CATEGORÍA ─── */
.blog-cat {
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.blog-cat::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}

/* ─── TÍTULO DE CARD ─── */
.blog-card h3 {
  font-family: 'Glacial Indiference Negrita' !important;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── EXTRACTO ─── */
.blog-card p {
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 0.87rem;
  color: var(--text-light);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ─── FOOTER DE CARD ─── */
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(196,196,196,0.25);
}

.blog-date {
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 0.76rem;
  color: var(--text-light);
  opacity: 0.7;
}

/* ─── BOTÓN LEER MÁS ─── */
.blog-read-more {
  background: var(--green, #2C9843);
  color: white;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 50px;
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.blog-read-more svg {
  width: 14px;
  height: 14px;
  stroke: white;
  flex-shrink: 0;
}

.blog-read-more:hover {
  background: #237a36;
  transform: translateY(-1px);
}

/* ─── CARD DESTACADA ─── */
.blog-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
  max-height: 320px;
}

.blog-card.featured .blog-card-img {
  width: 45%;
  min-height: 320px;
  flex-shrink: 0;
}

.blog-card.featured .blog-card-body {
  padding: 2rem;
  justify-content: center;
}

.blog-card.featured h3 {
  font-size: 1.35rem;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.blog-card.featured p { -webkit-line-clamp: 4; line-clamp: 4; }

/* ─── ESTADO VACÍO ─── */
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.blog-empty svg { opacity: 0.25; margin-bottom: 1rem; }

.blog-empty p {
  font-family: 'Inter Leve';
  font-weight: 300;
  font-size: 1rem;
  opacity: 0.6;
}

/* ─── SKELETON LOADER ─── */
.blog-skeleton {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(196,196,196,0.2);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-body {
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long   { width: 90%; }
.skeleton-line.title  { height: 18px; width: 85%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; }

  .blog-card.featured {
    flex-direction: column;
    max-height: none;
  }

  .blog-card.featured .blog-card-img {
    width: 100%;
    aspect-ratio: 16/9;
  }

  #searchInput,
  #empSearchInput,
  #tiendaSearchInput { width: 160px; }

  .blog-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-card.featured { grid-column: 1 / -1; }
}