/* ══════════════════════════════════════════════════════════════
   BLOG INMOBILIARIO — estilos públicos
   Depende de base.css (variables, reset, section-container)
   ══════════════════════════════════════════════════════════════ */

/* ── Hero del blog ─────────────────────────────────────────── */
.blog-hero {
  background: var(--verde-hero);
  padding: 6.5rem var(--padding-x) 3.5rem;
  position: relative;
  overflow: hidden;
}

.blog-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23F7F1D4' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.blog-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
}

.blog-hero-label .section-label-line { background: var(--maiz); }
.blog-hero-label .section-label-text { color: rgba(247,241,212,.65); }

.blog-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--arena);
  line-height: 1.15;
  margin-top: 1rem;
  max-width: 640px;
}

.blog-hero-desc {
  margin-top: 0.875rem;
  font-size: 1rem;
  color: rgba(247,241,212,.6);
  max-width: 520px;
  line-height: 1.7;
}

.blog-hero-stat {
  text-align: right;
  flex-shrink: 0;
}

.blog-hero-stat-num {
  font-size: 3rem;
  font-weight: 600;
  color: var(--maiz);
  line-height: 1;
}

.blog-hero-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,241,212,.5);
  margin-top: 0.25rem;
}

/* ── Barra de filtros + búsqueda ───────────────────────────── */
.blog-filters {
  background: var(--offwhite);
  border-bottom: 1px solid rgba(26,26,26,.08);
  position: sticky;
  top: 64px; /* nav mobile */
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 var(--padding-x);
}

@media (min-width: 901px) {
  .blog-filters { top: 76px; } /* nav desktop */
}

/* ── Pills (solo desktop) ──────────────────────────────────── */
.blog-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  padding: 0.75rem 0;
}

.blog-filter-pills::-webkit-scrollbar { display: none; }

/* ── Search ────────────────────────────────────────────────── */
.blog-search {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border: 1.5px solid rgba(26,26,26,.14);
  border-radius: 999px;
  overflow: hidden;
  background: var(--blanco);
  transition: border-color .2s, box-shadow .2s;
  margin: 0.625rem 0;
}

.blog-search:focus-within {
  border-color: var(--verde-urbano);
  box-shadow: 0 0 0 3px rgba(39,92,73,.12);
}

.blog-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  color: var(--negro);
  padding: 0.45rem 0.875rem;
  width: 200px;
  min-width: 0;
}

.blog-search-input::placeholder { color: rgba(105,105,105,.6); }

/* reset nativo del type=search en webkit */
.blog-search-input::-webkit-search-cancel-button { opacity: .5; cursor: pointer; }

.blog-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--gris-medio);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .2s, background .2s;
}

.blog-search-btn:hover { color: var(--verde-urbano); }

/* ── Responsive: mobile oculta pills, search ocupa todo ────── */
@media (max-width: 640px) {
  .blog-filter-pills { display: none; }

  .blog-search {
    flex: 1;
    width: 100%;
    margin: 0.75rem 0;
  }

  .blog-search-input {
    width: 100%;
    flex: 1;
    font-size: 1rem; /* evita zoom en iOS al hacer focus */
    padding: 0.55rem 0.875rem;
  }

  .blog-search-btn {
    width: 44px;
    height: 44px;
  }
}

.blog-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid rgba(26,26,26,.14);
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gris-medio);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: all .25s ease;
  cursor: pointer;
}

.blog-filter-pill:hover {
  border-color: var(--verde-urbano);
  color: var(--verde-urbano);
  background: rgba(39,92,73,.05);
}

.blog-filter-pill.active {
  background: var(--verde-urbano);
  border-color: var(--verde-urbano);
  color: var(--blanco);
}

.blog-filter-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill-dot-noticias  { background: #3B8BEB; }
.pill-dot-guias     { background: var(--maiz); }
.pill-dot-inversion { background: var(--verde-urbano); }

/* enlace "Ver todos" en hero cuando hay búsqueda activa */
.blog-hero-reset {
  color: var(--maiz);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  white-space: nowrap;
}

.blog-hero-reset:hover { color: var(--arena); }

/* accesibilidad: label oculto visualmente */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Grid de posts ─────────────────────────────────────────── */
.blog-section {
  padding: 4rem var(--padding-x) 6rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 2.5rem;
}

/* ── Card de post ──────────────────────────────────────────── */
.post-card {
  background: var(--blanco);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(26,26,26,.07);
  transition: transform .3s ease, box-shadow .3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(26,26,26,.13);
}

.post-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: var(--verde-hero);
}

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

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

.post-card-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.2;
}

.post-card-img-placeholder-noticias  { background: linear-gradient(135deg, #0A3231 60%, #1a5c50); }
.post-card-img-placeholder-guias     { background: linear-gradient(135deg, #3a2f00 60%, #7a6200); }
.post-card-img-placeholder-inversion { background: linear-gradient(135deg, #1a3024 60%, #275C49); }

.post-card-featured-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--maiz);
  color: var(--negro);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.post-card-body {
  padding: 1.375rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.post-card-cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-color-noticias  { color: #1a5cb0; }
.cat-color-guias     { color: #7a6200; }
.cat-color-inversion { color: var(--verde-urbano); }
.cat-dot-noticias    { background: #3B8BEB; }
.cat-dot-guias       { background: #E6C100; }
.cat-dot-inversion   { background: var(--verde-urbano); }

.post-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--negro);
  margin-bottom: 0.625rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--gris-medio);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.post-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgba(26,26,26,.07);
  gap: 0.75rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(105,105,105,.75);
  flex-wrap: wrap;
}

.post-card-meta-sep { opacity: .45; }

.post-card-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--verde-urbano);
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap .2s ease;
}

.post-card-link:hover { gap: .45rem; }

/* ── Empty state ───────────────────────────────────────────── */
.blog-empty {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--gris-medio);
}

.blog-empty-icon { font-size: 2.5rem; opacity: .3; margin-bottom: 1rem; }
.blog-empty h3   { font-size: 1.125rem; font-weight: 600; color: var(--negro); margin-bottom: .5rem; }
.blog-empty p    { font-size: 0.875rem; line-height: 1.6; }

/* ── Paginación del blog ───────────────────────────────────── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}

.blog-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid rgba(26,26,26,.14);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  color: var(--gris-medio);
  text-decoration: none;
  background: transparent;
  transition: all .2s ease;
}

.blog-page-btn:hover:not(.active):not(.disabled) {
  border-color: var(--verde-urbano);
  color: var(--verde-urbano);
}

.blog-page-btn.active {
  background: var(--verde-urbano);
  border-color: var(--verde-urbano);
  color: var(--blanco);
  font-weight: 600;
}

.blog-page-btn.disabled {
  opacity: .35;
  pointer-events: none;
}

.blog-page-btn.wide { width: auto; padding: 0 1rem; }

/* ── Vista de artículo individual ─────────────────────────── */
.article-hero {
  background: var(--verde-hero);
  padding: 7rem var(--padding-x) 3.5rem;
  position: relative;
  overflow: hidden;
}

.article-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23F7F1D4' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.article-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(247,241,212,.5);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.article-breadcrumb a {
  color: rgba(247,241,212,.6);
  text-decoration: none;
  transition: color .2s;
}

.article-breadcrumb a:hover { color: var(--arena); }
.article-breadcrumb-sep     { opacity: .4; }
.article-breadcrumb .current { color: rgba(247,241,212,.5); }

.article-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--maiz);
}

.article-cat-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--maiz);
}

.article-hero-title {
  font-size: clamp(1.625rem, 4vw, 2.75rem);
  font-weight: 600;
  color: var(--arena);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: rgba(247,241,212,.55);
}

.article-meta-sep { opacity: .4; }

.article-meta-item { display: inline-flex; align-items: center; gap: .375rem; }

/* ── Imagen de portada del artículo ────────────────────────── */
.article-cover {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  background: var(--verde-hero);
}

.article-cover img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* ── Contenido del artículo ────────────────────────────────── */
.article-body-wrap {
  padding: 4rem var(--padding-x) 5rem;
  display: grid;
  grid-template-columns: 1fr min(720px, 100%) 1fr;
}

.article-body-wrap > * {
  grid-column: 2;
}

.article-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--negro);
}

.article-content p   { margin: 0 0 1.25rem; }
.article-content h2  { font-size: 1.375rem; font-weight: 600; margin: 2rem 0 0.875rem; line-height: 1.3; }
.article-content h3  { font-size: 1.125rem; font-weight: 600; margin: 1.625rem 0 0.625rem; line-height: 1.35; }
.article-content ul, .article-content ol { padding-left: 1.5rem; margin: 0 0 1.25rem; }
.article-content li  { margin-bottom: 0.375rem; line-height: 1.7; }

.article-content blockquote {
  border-left: 3px solid var(--verde-urbano);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: rgba(39,92,73,.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: #444;
}

.article-content a {
  color: var(--verde-urbano);
  text-decoration: underline;
  text-decoration-color: rgba(39,92,73,.35);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}

.article-content a:hover { text-decoration-color: var(--verde-urbano); }

.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  display: block;
  margin: 1.5rem auto;
}

.article-content strong { font-weight: 600; }
.article-content em     { font-style: italic; }

/* ── CTA al final del artículo ─────────────────────────────── */
.article-cta {
  grid-column: 2;
  margin-top: 3rem;
  padding: 2.5rem;
  background: var(--verde-hero);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.article-cta-text p:first-child {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maiz);
  margin-bottom: 0.375rem;
}

.article-cta-text p:last-child {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--arena);
  line-height: 1.3;
}

.article-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--maiz);
  color: var(--negro);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .2s, transform .2s;
  flex-shrink: 0;
}

.article-cta-btn:hover {
  background: var(--arena);
  transform: translateY(-1px);
}

/* ── Back link ─────────────────────────────────────────────── */
.article-back {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-size: 0.875rem;
  color: var(--verde-urbano);
  text-decoration: none;
  font-weight: 500;
  transition: gap .2s;
}

.article-back:hover { gap: .75rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-hero-inner { grid-template-columns: 1fr; }
  .blog-hero-stat  { text-align: left; }
}

@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-hero { padding: 5.5rem var(--padding-x) 2.5rem; }
  .article-hero { padding: 5.5rem var(--padding-x) 2.5rem; }
  .article-body-wrap { padding: 2.5rem var(--padding-x) 3.5rem; grid-template-columns: 1fr; }
  .article-body-wrap > *, .article-cta, .article-back { grid-column: 1; }
  .article-cta { flex-direction: column; align-items: flex-start; }
}

/* Accesibilidad: foco visible (WCAG 2.4.7) */
.blog-search-input:focus-visible {
  outline:2px solid var(--verde-urbano);
  outline-offset:2px;
}
