/* ============================================
   BuscoPlan Blog Styles
   ============================================ */

/* --- CATEGORIES BAR --- */
.blog-cats-bar {
  background: var(--blanco);
  border-bottom: 1px solid rgba(60,25,89,0.06);
  padding: 20px 0;
  position: sticky;
  top: 58px;
  z-index: 90;
}
.blog-cats-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.blog-cats-list::-webkit-scrollbar { display: none; }

.blog-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: var(--texto-light);
  background: var(--crema);
  border: 1px solid rgba(60,25,89,0.06);
  transition: all 0.2s;
}
.blog-cat-chip:hover {
  border-color: var(--chip-color, var(--morado));
  color: var(--chip-color, var(--morado));
}
.blog-cat-chip.active {
  background: var(--morado);
  color: white;
  border-color: var(--morado);
}
.chip-count {
  font-size: 0.7rem;
  background: rgba(0,0,0,0.08);
  padding: 1px 7px;
  border-radius: 20px;
}

/* --- BLOG LISTING --- */
.blog-listing {
  padding: 60px 0 80px;
  background: var(--crema);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.posts-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Featured first post */
.post-card-featured {
  grid-column: 1 / -1;
}
.post-card-featured .post-card-link {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}
.post-card-featured .post-card-img { border-radius: 16px 0 0 16px; aspect-ratio: 16/10; }
.post-card-featured .post-card-body { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; }
.post-card-featured .post-card-title { font-size: 1.5rem; }
.post-card-featured .post-card-excerpt { font-size: 1rem; -webkit-line-clamp: 4; }

/* --- POST CARD --- */
.post-card {
  background: var(--blanco);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(60,25,89,0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(60,25,89,0.1);
}
.post-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.post-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--crema-dark);
  position: relative;
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.post-card:hover .post-card-img img {
  transform: scale(1.05);
}
.post-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--crema-dark), var(--crema));
}
.post-card-cat {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--texto-muted);
  margin-bottom: 10px;
}
.meta-dot { opacity: 0.4; }
.post-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--morado-dark);
  line-height: 1.3;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--texto-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  margin-top: auto;
}

/* --- BLOG EMPTY --- */
.blog-empty {
  text-align: center;
  padding: 80px 0;
}
.blog-empty-icon { font-size: 3rem; display: block; margin-bottom: 20px; }
.blog-empty h2 {
  font-family: var(--font-body);
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.blog-empty p { margin: 0 auto; }

/* --- BLOG PAGINATION --- */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(60,25,89,0.08);
}

/* --- SINGLE POST --- */
.blog-post { padding-bottom: 60px; }

.post-header {
  padding: 140px 0 48px;
  background: var(--blanco);
  text-align: center;
}
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--texto-muted);
  text-decoration: none;
  margin-bottom: 32px;
}
.post-back:hover { color: var(--morado); }

.post-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--texto-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.post-cat-badge {
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  max-width: 780px;
  margin: 0 auto;
}
.post-header-excerpt {
  font-size: 1.15rem;
  color: var(--texto-light);
  max-width: 640px;
  margin: 20px auto 0;
}

.post-hero-img {
  margin-top: -10px;
  margin-bottom: 48px;
}
.post-hero-img img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 16px;
}

/* POST BODY */
.post-content {
  background: var(--blanco);
  padding-bottom: 48px;
}
.post-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--texto);
}
.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--morado-dark);
}
.post-body h3 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 12px;
}
.post-body p {
  margin-bottom: 20px;
  max-width: 100%;
  color: var(--texto);
  font-size: inherit;
}
.post-body a {
  color: var(--morado);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-body a:hover { color: var(--naranja); }
.post-body img {
  border-radius: 12px;
  margin: 32px 0;
}
.post-body blockquote {
  border-left: 4px solid var(--naranja);
  margin: 32px 0;
  padding: 20px 28px;
  background: var(--crema);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--texto-light);
}
.post-body ul, .post-body ol {
  margin: 16px 0 24px 24px;
}
.post-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}
.post-body strong { color: var(--morado-dark); }

/* TAGS */
.post-tags {
  max-width: 720px;
  margin: 36px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.post-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--crema);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--morado);
  text-decoration: none;
  transition: all 0.2s;
}
.post-tag:hover { background: var(--morado); color: white; }

/* SHARE */
.post-share {
  max-width: 720px;
  margin: 36px auto 0;
  padding-top: 28px;
  border-top: 1px solid rgba(60,25,89,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-share-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texto-muted);
}
.share-btn {
  padding: 8px 16px;
  border: 1px solid rgba(60,25,89,0.1);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--texto-light);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.share-btn:hover { border-color: var(--morado); color: var(--morado); }

/* RELATED */
.blog-related {
  background: var(--crema);
  padding: 80px 0;
}
.blog-related h2 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 40px;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .post-card-featured .post-card-link { grid-template-columns: 1fr; }
  .post-card-featured .post-card-img { border-radius: 16px 16px 0 0; }
  .post-card-featured .post-card-body { padding: 24px; }
  .post-card-featured .post-card-title { font-size: 1.2rem; }
}

@media (max-width: 768px) {
  .posts-grid, .posts-grid-3 { grid-template-columns: 1fr; gap: 20px; }
  .blog-cats-bar { top: 52px; }
  .post-header { padding: 120px 0 32px; }
  .post-body { font-size: 1rem; }
  .post-share { flex-wrap: wrap; }
}
