/* =============================================================================
   Blog inmobiliario — Arrendamientos Metropropiedades
   Hereda los tokens de marca de style.css (:root). Este archivo solo define lo
   propio del blog: columna de lectura, tarjetas de artículo y pie simplificado.
   ========================================================================== */

.blog-body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
}

/* El nav global es position:fixed con 68px de alto. */
.blog-nav .nav-links a[aria-current="page"] {
  color: var(--navy-700);
  font-weight: 700;
}

.blog-nav .btn-publish {
  text-decoration: none;
}

/* ── Contenedores ──────────────────────────────────────────────────────── */

.post-main,
.blog-index-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 104px 24px 80px;
}

/* style.css estiliza el selector de elemento `nav` como barra fija superior.
   Las migas de pan y los enlaces del pie también son <nav> por semántica, así
   que hay que devolverles el flujo normal del documento. */
.post-migas,
.blog-footer-links {
  position: static;
  height: auto;
  background: none;
  backdrop-filter: none;
  border-bottom: none;
  box-shadow: none;
  padding: 0;
  z-index: auto;
  /* El nav global reparte su contenido con space-between; sin esto las migas
     quedaban estiradas de un borde al otro de la página. */
  justify-content: flex-start;
}

/* Migas de pan */
.post-migas {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--neutral-500);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.post-migas a {
  color: var(--neutral-500);
  text-decoration: none;
}

.post-migas a:hover {
  color: var(--navy-700);
  text-decoration: underline;
}

.post-migas-actual {
  color: var(--neutral-600);
  font-weight: 600;
}

/* ── Artículo ──────────────────────────────────────────────────────────── */

.post {
  max-width: 720px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 40px;
}

.post-categoria {
  display: inline-block;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.post-titulo {
  font-family: var(--font-main);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy-950);
  margin: 0 0 20px;
}

.post-resumen {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--neutral-600);
  margin: 0 0 24px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--neutral-500);
  padding-top: 20px;
  border-top: 1px solid var(--neutral-200);
}

.post-autor {
  font-weight: 600;
  color: var(--neutral-600);
}

/* Portada */
.post-portada {
  margin: 0 0 48px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.post-portada img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ── Cuerpo del artículo ───────────────────────────────────────────────── */

.post-cuerpo {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
}

.post-cuerpo p {
  margin: 0 0 24px;
}

.post-cuerpo h2 {
  font-family: var(--font-main);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--navy-900);
  margin: 48px 0 16px;
  scroll-margin-top: 88px;
}

.post-cuerpo a {
  color: var(--navy-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-cuerpo a:hover {
  color: var(--blue-600);
}

.post-cuerpo strong {
  font-weight: 700;
  color: var(--navy-900);
}

.post-cuerpo ul {
  margin: 0 0 24px;
  padding-left: 24px;
}

.post-cuerpo li {
  margin-bottom: 10px;
}

.post-cuerpo li::marker {
  color: var(--brand);
}

.post-cuerpo blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--brand);
}

.post-cuerpo blockquote p {
  font-size: 1.2rem;
  line-height: 1.55;
  font-style: italic;
  color: var(--navy-800);
  margin: 0;
}

.post-destacado {
  margin: 32px 0;
  padding: 20px 24px;
  background: var(--brand-soft);
  border-radius: var(--radius-md);
}

.post-destacado p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--navy-800);
}

.post-figura {
  margin: 32px 0;
}

.post-figura img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.post-figura figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--neutral-500);
  text-align: center;
}

/* ── Preguntas frecuentes ──────────────────────────────────────────────── */

.post-faqs {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--neutral-200);
}

.post-faqs h2 {
  font-family: var(--font-main);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 32px 0 20px;
  scroll-margin-top: 88px;
}

.post-faq-item {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--white);
  transition: border-color .2s;
}

.post-faq-item[open] {
  border-color: var(--brand-accent);
}

.post-faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy-900);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.post-faq-item summary::-webkit-details-marker {
  display: none;
}

.post-faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--brand);
  flex-shrink: 0;
  transition: transform .2s;
}

.post-faq-item[open] summary::after {
  content: "−";
}

.post-faq-respuesta {
  padding: 0 20px 18px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--neutral-600);
}

/* ── Llamado a la acción ───────────────────────────────────────────────── */

.post-cta {
  margin-top: 56px;
  padding: 36px 32px;
  background: var(--gradient-btn);
  border-radius: var(--radius-lg);
  color: var(--white);
  text-align: center;
}

.post-cta h2 {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 12px;
}

.post-cta p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 auto 24px;
  max-width: 520px;
}

.post-cta-acciones {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.post-btn-primario,
.post-btn-secundario {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all .25s ease;
}

.post-btn-primario {
  background: var(--white);
  color: var(--navy-800);
}

.post-btn-primario:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.post-btn-secundario {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.post-btn-secundario:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
}

/* ── Tarjetas de artículo ──────────────────────────────────────────────── */

.tarjeta-post {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.tarjeta-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--brand-accent);
}

.tarjeta-post-foto {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--neutral-100);
}

.tarjeta-post-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

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

.tarjeta-post-sin-foto {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-800), var(--brand));
}

.tarjeta-post-sin-foto span {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.tarjeta-post-texto {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.tarjeta-post-categoria {
  font-family: var(--font-main);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.tarjeta-post-texto h3 {
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy-950);
  margin: 0;
}

.tarjeta-post-texto p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--neutral-500);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tarjeta-post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--neutral-400);
  margin-top: auto;
  padding-top: 8px;
}

/* ── Índice del blog ───────────────────────────────────────────────────── */

.blog-index-header {
  max-width: 760px;
  margin-bottom: 48px;
}

.blog-index-kicker {
  display: inline-block;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 16px;
}

.blog-index-header h1 {
  font-family: var(--font-main);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy-950);
  margin: 0 0 16px;
}

.blog-index-header p {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--neutral-500);
  margin: 0;
}

/* Listado del índice: una fila por artículo. */
.blog-index-lista {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tarjeta-post-fila {
  flex-direction: row;
}

.tarjeta-post-fila .tarjeta-post-foto {
  flex: 0 0 240px;
  aspect-ratio: 4 / 3;
}

.tarjeta-post-fila .tarjeta-post-texto {
  padding: 20px 26px;
  justify-content: center;
}

.tarjeta-post-fila .tarjeta-post-texto p {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Al pasar el cursor, la fila se desplaza en horizontal en vez de levantarse:
   en un listado vertical el movimiento hacia arriba pisa a la fila de encima. */
.tarjeta-post-fila:hover {
  transform: translateX(4px);
}

.blog-index-vacio {
  padding: 64px 24px;
  text-align: center;
  font-size: 1.0625rem;
  color: var(--neutral-500);
  background: var(--neutral-100);
  border-radius: var(--radius-lg);
}

.blog-index-cta {
  margin-top: 64px;
}

/* Relacionados */
.post-relacionados {
  max-width: 1120px;
  margin: 72px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--neutral-200);
}

.post-relacionados h2 {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0 0 24px;
}

.post-relacionados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── Página 404 ────────────────────────────────────────────────────────── */

.error-main {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-caja {
  max-width: 560px;
  text-align: center;
}

.error-codigo {
  display: block;
  font-family: var(--font-main);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--brand-soft);
  margin-bottom: 8px;
}

.error-titulo {
  font-family: var(--font-main);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy-950);
  margin: 0 0 16px;
}

.error-texto {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--neutral-500);
  margin: 0 0 28px;
}

.error-acciones {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* Los botones del CTA están pensados sobre el fondo oscuro del bloque de
   llamado a la acción. Aquí el fondo es claro, así que hay que invertirlos:
   el primario en blanco sobre blanco era invisible. */
.error-acciones .post-btn-primario {
  background: var(--gradient-btn);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(0, 24, 146, 0.18);
}

.error-acciones .post-btn-primario:hover {
  box-shadow: 0 10px 26px rgba(0, 24, 146, 0.26);
}

.error-btn-oscuro {
  color: var(--navy-800);
  border-color: var(--neutral-200);
}

.error-btn-oscuro:hover {
  background: var(--neutral-100);
  border-color: var(--brand-accent);
}

.error-ayuda {
  font-size: 0.9375rem;
  color: var(--neutral-500);
  margin: 0;
}

.error-ayuda a {
  color: var(--navy-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 768px) {
  .error-acciones {
    flex-direction: column;
  }
}

/* ── Pie de página ─────────────────────────────────────────────────────── */

.blog-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.75);
  padding: 48px 24px;
  margin-top: 80px;
}

.blog-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.blog-footer-marca {
  display: flex;
  align-items: center;
  gap: 14px;
}

.blog-footer-marca img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.blog-footer-marca p {
  margin: 0;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  text-align: left;
  line-height: 1.4;
}

.blog-footer-marca span {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
}

.blog-footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.blog-footer-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s;
}

.blog-footer-links a:hover {
  color: var(--white);
}

.blog-footer-legal {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

/* style.css esconde los enlaces del nav desde 968px porque en la SPA pasan al
   menú hamburguesa (y con !important desde 768px). Las páginas del blog no
   tienen ese menú: sin los enlaces no habría forma de volver al resto del
   sitio, así que se reponen en una segunda fila deslizable. */
@media (max-width: 968px) {
  .blog-nav {
    height: auto !important;
    flex-wrap: wrap;
    padding: 10px 16px 0 !important;
    row-gap: 4px;
  }

  .blog-nav .nav-links {
    display: flex !important;
    order: 3;
    width: 100%;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
  }

  .blog-nav .nav-links::-webkit-scrollbar {
    display: none;
  }

  .blog-nav .nav-links li {
    flex-shrink: 0;
  }

  /* El artículo ya trae su propio llamado a la acción más abajo. */
  .blog-nav .btn-publish {
    display: none;
  }

  /* El nav pasa a dos filas, así que el contenido arranca más abajo. */
  .post-main,
  .blog-index-main {
    padding-top: 118px;
  }
}

@media (max-width: 700px) {
  /* En pantalla estrecha la fila no cabe: foto arriba y texto debajo. */
  .tarjeta-post-fila {
    flex-direction: column;
  }

  .tarjeta-post-fila .tarjeta-post-foto {
    flex: none;
    aspect-ratio: 16 / 10;
  }

  .tarjeta-post-fila .tarjeta-post-texto {
    padding: 20px;
  }

  .tarjeta-post-fila:hover {
    transform: none;
  }
}

@media (max-width: 768px) {
  .post-main,
  .blog-index-main {
    padding-left: 18px;
    padding-right: 18px;
    padding-bottom: 64px;
  }

  .post-cta {
    padding: 28px 20px;
  }

  .post-cta-acciones {
    flex-direction: column;
  }

  .post-btn-primario,
  .post-btn-secundario {
    width: 100%;
  }
}

/* Respeta la preferencia del sistema de reducir movimiento. */
@media (prefers-reduced-motion: reduce) {
  .tarjeta-post,
  .tarjeta-post-foto img,
  .post-btn-primario,
  .post-btn-secundario {
    transition: none;
  }

  .tarjeta-post:hover {
    transform: none;
  }

  .tarjeta-post:hover .tarjeta-post-foto img {
    transform: none;
  }
}
