/* =========================================================
   Blog — LG Soluciones Jurídicas
   Depende de las variables y componentes de styles.css
   (:root, .btn, .card, .eyebrow, [data-reveal], .hero-bg…)
   ========================================================= */

/* =========================================================
   HERO DEL BLOG
   ========================================================= */
.blog-hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  padding: 9rem 0 5rem;
  overflow: hidden;
  background: var(--navy-950);
}
.blog-hero-media {
  background-position: center 30%;
  background-size: 118% auto;
  animation: kenburns 18s var(--ease) forwards;
}
.blog-hero-content { position: relative; z-index: 2; max-width: 720px; }
.blog-hero-content h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  margin: 0.5rem 0 1rem;
}
.blog-hero-lead {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.08rem;
  max-width: 54ch;
  margin-bottom: 2rem;
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(11, 18, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.6rem 0.6rem 0.6rem 1.2rem;
  max-width: 560px;
  backdrop-filter: blur(6px);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.blog-search:focus-within {
  border-color: var(--gold);
  background: rgba(11, 18, 32, 0.75);
}
.blog-search-icon { color: var(--gold-soft); flex: none; }
.blog-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0;
}
.blog-search input::placeholder { color: rgba(255, 255, 255, 0.5); }
.blog-search input:focus { outline: none; }

/* =========================================================
   BARRA DE FILTROS
   ========================================================= */
.blog-toolbar {
  position: sticky;
  top: 65px; /* justo debajo del encabezado fijo (~65 px), no detrás de él */
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}
.blog-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.is-active { background: var(--navy-950); border-color: var(--navy-950); color: var(--gold-soft); }
.blog-count { margin: 0; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

/* =========================================================
   TINTES POR CATEGORÍA (misma foto, distinto tono)
   ========================================================= */
.blog-thumb, .blog-featured-media {
  --cat-tint: 22, 38, 61;   /* navy por defecto */
  --cat-pos: center 20%;
}
[data-category="inmobiliario"]  .blog-thumb, [data-category="inmobiliario"]  .blog-featured-media { --cat-tint: 70, 80, 105; --cat-pos: 25% 10%; }
[data-category="cartera"]       .blog-thumb, [data-category="cartera"]       .blog-featured-media { --cat-tint: 168, 133, 58; --cat-pos: 45% 20%; }
[data-category="empresarial"]   .blog-thumb, [data-category="empresarial"]   .blog-featured-media { --cat-tint: 41, 64, 99;  --cat-pos: 60% 15%; }
[data-category="responsabilidad"] .blog-thumb, [data-category="responsabilidad"] .blog-featured-media { --cat-tint: 96, 40, 52;  --cat-pos: 35% 25%; }
[data-category="consumo"]       .blog-thumb, [data-category="consumo"]       .blog-featured-media { --cat-tint: 34, 92, 79;  --cat-pos: center 30%; }

/* =========================================================
   ARTÍCULO DESTACADO
   ========================================================= */
.blog-featured-section { padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: 0; }
.blog-featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
  background: var(--navy-950);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  min-height: 380px;
}
.blog-featured-media {
  position: relative;
  display: block;
  background-image:
    linear-gradient(150deg, rgba(var(--cat-tint), 0.62), rgba(11, 18, 32, 0.78)),
    url("../img/hero-960.jpg");
  background-size: cover;
  background-position: var(--cat-pos);
  min-height: 240px;
}
.blog-featured-body {
  padding: clamp(1.8rem, 4vw, 3rem);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.blog-featured-body h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0.5rem 0 1rem; }
.blog-featured-body h2 a { color: #fff; transition: color 0.2s var(--ease); }
.blog-featured-body h2 a:hover { color: var(--gold-soft); }
.blog-featured-body p:not(.blog-meta) { color: rgba(255, 255, 255, 0.75); margin-bottom: 1.6rem; }

.blog-cat {
  position: absolute;
  left: 1.2rem;
  top: 1.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-950);
  background: var(--gold-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.blog-meta {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  margin: 0 0 0.3rem;
}
.blog-featured .blog-meta { color: var(--gold-soft); opacity: 0.9; }

/* =========================================================
   GRID DE ARTÍCULOS
   ========================================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.6rem;
}
.blog-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); border-color: var(--gold); }
.blog-card.is-hidden { display: none; }

.blog-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background-image:
    linear-gradient(150deg, rgba(var(--cat-tint), 0.68), rgba(11, 18, 32, 0.55)),
    url("../img/hero-960.jpg");
  background-size: cover;
  background-position: var(--cat-pos);
}
.blog-body { padding: 1.5rem 1.6rem 1.7rem; display: flex; flex-direction: column; flex: 1; }
.blog-meta { color: var(--gold-text); }
.blog-featured .blog-meta { color: var(--gold-soft); }
.blog-body h3 { font-size: 1.2rem; margin: 0.3rem 0 0.6rem; line-height: 1.3; }
.blog-body h3 a { color: var(--ink); transition: color 0.2s var(--ease); }
.blog-body h3 a:hover { color: var(--navy-800); text-decoration: underline; text-underline-offset: 3px; }
.blog-excerpt { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.1rem; flex: 1; }
.blog-readmore {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-900);
  align-self: flex-start;
  transition: color 0.2s var(--ease), gap 0.2s var(--ease);
}
.blog-readmore:hover { color: var(--gold); }

.blog-loading {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 1rem 0;
}

.blog-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 1rem;
}
.link-reset {
  font: inherit;
  color: var(--navy-900);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.link-reset:hover { color: var(--gold); }

/* =========================================================
   CTA FINAL
   ========================================================= */
.blog-cta {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
}
.blog-cta-bg {
  position: absolute;
  inset: -10% -6%;
  background-image: url("../img/hero-960.jpg");
  background-size: cover;
  background-position: 65% 20%;
  opacity: 0.28;
}
.blog-cta-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 0%, rgba(22, 38, 61, 0.92), rgba(11, 18, 32, 0.97));
}
.blog-cta-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.blog-cta-inner .eyebrow { color: var(--gold-soft); }
.blog-cta-inner h2 { max-width: 32ch; margin-bottom: 1.8rem; }

/* =========================================================
   ARTÍCULO INDIVIDUAL (post.html)
   ========================================================= */
.post-article { padding-top: clamp(7rem, 12vw, 9rem); }
.post-container { max-width: 760px; }
.post-back {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.6rem;
  transition: color 0.2s var(--ease);
}
.post-back:hover { color: var(--gold); }
.post-back--bottom { margin-top: 2.5rem; margin-bottom: 0; }

.post-head { margin-bottom: 1.6rem; }
.post-cat { position: static; display: inline-block; margin-bottom: 0.9rem; }
.post-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 0.7rem; }
.post-meta { color: var(--muted); text-transform: none; letter-spacing: normal; font-size: 0.88rem; }

.post-media {
  --cat-tint: 22, 38, 61;
  --cat-pos: center 20%;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.6rem 0 2.2rem;
  background-image:
    linear-gradient(150deg, rgba(var(--cat-tint), 0.55), rgba(11, 18, 32, 0.55)),
    url("../img/hero-960.jpg");
  background-size: cover;
  background-position: var(--cat-pos);
}
[data-category="inmobiliario"].post-media  { --cat-tint: 70, 80, 105;  --cat-pos: 25% 10%; }
[data-category="cartera"].post-media       { --cat-tint: 168, 133, 58; --cat-pos: 45% 20%; }
[data-category="empresarial"].post-media   { --cat-tint: 41, 64, 99;   --cat-pos: 60% 15%; }
[data-category="responsabilidad"].post-media { --cat-tint: 96, 40, 52; --cat-pos: 35% 25%; }
[data-category="consumo"].post-media       { --cat-tint: 34, 92, 79;   --cat-pos: center 30%; }

.post-body { font-size: 1.05rem; color: var(--ink); line-height: 1.8; }
.post-body p { margin-bottom: 1.3rem; }
.post-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  line-height: 1.25;
  color: var(--navy-900);
  margin: 2.4rem 0 0.9rem;
}
.post-body h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.6vw, 1.4rem);
  color: var(--navy-900);
  margin: 1.9rem 0 0.7rem;
}
.post-body ul, .post-body ol { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.post-body li { margin-bottom: 0.55rem; padding-left: 0.2rem; }
.post-body li::marker { color: var(--gold); font-weight: 700; }
.post-body strong { color: var(--navy-900); }
.post-figure { margin: 1.8rem 0; }
.post-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-soft); }

.post-notfound { text-align: center; padding: 3rem 0; }
.post-notfound h1 { margin-bottom: 0.6rem; }
.post-notfound p { color: var(--muted); margin-bottom: 1.6rem; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured-media { min-height: 200px; }
  .blog-toolbar-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .blog-hero { min-height: 56vh; padding-top: 7.5rem; }
  .chip-row { gap: 0.45rem; }
  .chip { padding: 0.42rem 0.8rem; font-size: 0.76rem; }
}

/* =========================================================
   ARTÍCULO Y ÁREAS (páginas generadas)
   ========================================================= */
.post-lead {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--navy-800);
  border-left: 3px solid var(--gold);
  padding-left: 1.1rem;
  margin: 0 0 2rem;
}
.post-note {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2rem;
}
.post-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.btn-ghost-dark { border-color: var(--navy-900); color: var(--navy-900); }
.btn-ghost-dark:hover { background: var(--navy-900); color: var(--gold-soft); transform: translateY(-3px); }
.post-related { background: var(--cream); }
.post-related h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1.8rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.4rem; }

.area-split { align-items: start; }
.area-list li { color: var(--ink); font-size: 1.02rem; }
.area-faq { background: var(--paper); }
.area-others { background: var(--cream); padding: 3.5rem 0; }
.area-others h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 1.2rem; }
.chip-link { display: inline-block; text-decoration: none; }
.chip-link:hover { background: var(--navy-950); border-color: var(--navy-950); color: var(--gold-soft); }

.legal-hero { min-height: 44vh; }
.legal-body .post-container { max-width: 760px; }
.legal-body h2 { font-size: 1.5rem; margin: 2rem 0 0.5rem; }
.legal-body p { color: var(--ink); line-height: 1.8; }
.legal-body a { color: var(--navy-900); text-decoration: underline; text-underline-offset: 3px; }
.notfound { padding-top: clamp(8rem, 14vw, 11rem); }
.notfound h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.notfound-h { font-size: 1.3rem; margin: 2.4rem 0 1rem; }

/* =========================================================
   IMÁGENES PERSONALIZADAS (misma mecánica que la foto de la firma:
   tinte por área, zoom al pasar el mouse y cortina dorada al hacer scroll)
   ========================================================= */
.blog-thumb.has-image,
.blog-featured-media.has-image {
  background-image: none;
  background-color: var(--navy-800);
  overflow: hidden;
}
.thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(var(--cat-tint), 0.42), rgba(11, 18, 32, 0.3));
  pointer-events: none;
}
.has-image .blog-cat { z-index: 2; }
.blog-card:hover .thumb-img,
.blog-featured:hover .thumb-img { transform: scale(1.06); }

.post-media {
  position: relative;
  background: var(--navy-800);
  background-image: none;
}
.post-media .img-reveal-bg { object-position: var(--cat-pos); }
.post-media--custom { aspect-ratio: 16 / 9; }
.post-media--custom .img-reveal-bg { object-position: center; }
.media-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(var(--cat-tint), 0.5), rgba(11, 18, 32, 0.42));
  pointer-events: none;
}
.post-media--custom .media-tint {
  background: linear-gradient(150deg, rgba(var(--cat-tint), 0.3), rgba(11, 18, 32, 0.2));
}

/* En pantallas medianas y móviles los filtros ocupan varias filas: si se quedaran pegados
   taparían la imagen del artículo, así que se desplazan con la página. */
@media (max-width: 900px) {
  .blog-toolbar { position: static; }
}

/* Filtro del blog: el destacado también se filtra y el buscador informa cuántos resultados hay */
.blog-featured-section.is-hidden { display: none; }
.blog-search-status {
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  color: var(--gold-soft);
}
.blog-search-status .link-reset { color: #fff; font-weight: 600; }
.blog-search-status .link-reset:hover { color: var(--gold-soft); }
.chip[aria-pressed="true"] { background: var(--navy-950); border-color: var(--navy-950); color: var(--gold-soft); }

/* Encabezados de páginas internas en móvil: la imagen se dimensiona por el ALTO para cubrir todo el
   encabezado (con textos largos queda más alto que la imagen). Conserva el zoom lento original. */
@media (max-width: 900px) {
  .blog-hero .hero-media {
    background-size: auto 106%;
    background-position: 64% 20%;
    animation-name: kenburnsH;
  }
}
@keyframes kenburnsH {
  from { background-size: auto 126%; }
  to { background-size: auto 106%; }
}

/* ---- Versión larga del área: título, párrafo y lista con ✓ (texto de "Areas_de_Practica_Pagina_Web") ---- */
.area-long { background: var(--cream); }
.area-long-inner { max-width: 1000px; }
.area-long h2 { margin: 0 0 1rem; font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.1; }
.area-long-lead { max-width: 64ch; margin: 0 0 2rem; color: var(--ink); font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.7; }
.area-checks { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0.9rem 1.4rem; }
.area-checks li {
  margin: 0;
  padding: 1.15rem 1.2rem 1.15rem 3rem;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.55;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.area-checks li::before { left: 1.15rem; top: 1.5rem; width: 14px; height: 7px; }
.area-checks li:hover { border-color: var(--gold); box-shadow: var(--shadow-soft); transform: translateY(-3px); }
@media (min-width: 900px) { .area-checks { grid-template-columns: 1fr 1fr; } }

/* ---- Políticas de tratamiento de datos (texto largo) ---- */
.legal-body ul { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.legal-body li { margin-bottom: 0.6rem; line-height: 1.75; color: var(--ink); padding-left: 0.2rem; }
.legal-body li::marker { color: var(--gold); font-weight: 700; }
.legal-body h3 { font-size: 1.15rem; margin: 1.8rem 0 0.4rem; color: var(--navy-900); }
.legal-long h2 { scroll-margin-top: 96px; padding-top: 0.4rem; border-top: 1px solid var(--line); }
.legal-long h2:first-of-type { border-top: 0; }
.legal-toc { margin: 0 0 2.4rem; padding: 1.4rem 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.legal-toc-title { margin: 0 0 0.7rem; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); }
.legal-toc ol { margin: 0; padding-left: 1.3rem; columns: 2; column-gap: 2rem; }
.legal-toc li { margin: 0 0 0.35rem; padding: 0; font-size: 0.95rem; line-height: 1.45; break-inside: avoid; }
.legal-toc li::marker { color: var(--gold-text); font-weight: 600; }
.legal-body .legal-toc a { text-decoration: none; color: var(--navy-900); }
.legal-body .legal-toc a:hover { color: var(--gold-text); text-decoration: underline; }
.legal-defs { margin: 0 0 1.4rem; }
.legal-defs > div { padding: 0.9rem 0 0.9rem 1.1rem; border-left: 2px solid var(--gold); margin-bottom: 0.7rem; }
.legal-defs dt { font-weight: 700; color: var(--navy-900); margin: 0 0 0.2rem; }
.legal-defs dd { margin: 0; line-height: 1.75; color: var(--ink); }
.legal-note { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
@media (max-width: 700px) { .legal-toc ol { columns: 1; } }
