/* ══════════════════════════════════════════════════════════════
   blog.css — FamPlan Blog (extends seo.css)
   ══════════════════════════════════════════════════════════════ */

/* ── Reading Progress Bar ─────────────────────────────────────── */
#read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #1b4332, #52b788, #F89516);
  width: 0%;
  z-index: 9999;
  transition: width .08s linear;
  pointer-events: none;
}

/* ── Category colour tokens ───────────────────────────────────── */
.cat-organizacion { background: #e6f4ee; color: #1c6040; }
.cat-tareas       { background: #fff2dc; color: #8a4d00; }
.cat-rutinas      { background: #e3f1f9; color: #1a5c7e; }
.cat-recompensas  { background: #fff3e0; color: #b06000; }
.cat-calendario   { background: #eeebfc; color: #4a39b0; }
.cat-motivacion   { background: #fdecea; color: #a33030; }
.cat-crianza      { background: #eaf7df; color: #3d6718; }
.cat-autonomia    { background: #e4f7ed; color: #1f6b45; }
.cat-objetivos    { background: #f1e9ff; color: #5c3ca6; }
.cat-habitos      { background: #e8f4ff; color: #225f8f; }
.cat-recuerdos    { background: #fff0f5; color: #9a3154; }
.cat-pantallas    { background: #e9f0ff; color: #254f9b; }
.cat-colegio      { background: #fff0f4; color: #9a3154; }

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: .22rem .8rem;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   BLOG INDEX
   ═══════════════════════════════════════════════════════════════ */

/* ── Blog Hero ──────────────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(155deg, #1b4332 0%, #2d6a4f 55%, #52b788 100%);
  padding: 7rem 0 5rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.blog-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #d8f3dc;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .3rem 1.1rem;
  border-radius: 20px;
  margin-bottom: 1.4rem;
}
.blog-hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 700px;
  margin: 0 auto 1.1rem;
  color: #fff;
}
.blog-hero .hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.8);
  max-width: 510px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}
.blog-search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  z-index: 2;
}
.blog-search {
  width: 100%;
  padding: .9rem 1.2rem .9rem 3.1rem;
  border: none;
  border-radius: 50px;
  font-size: .97rem;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 6px 28px rgba(0,0,0,.18);
  outline: none;
  transition: box-shadow .2s;
}
.blog-search:focus { box-shadow: 0 6px 36px rgba(0,0,0,.28); }
.blog-search::placeholder { color: #9a9a9a; }
.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid #7b8b83;
  border-radius: 50%;
  font-size: 0;
  color: #7b8b83;
  pointer-events: none;
}
.search-icon::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.blog-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + .6rem);
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(27,67,50,.14);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18,48,35,.22);
  overflow: hidden;
  text-align: left;
  z-index: 5;
}
.blog-suggestions.open { display: block; }
.suggestion-item {
  display: block;
  padding: .85rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #edf1ed;
  transition: background .15s;
}
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover,
.suggestion-item:focus { background: #f4faf5; outline: none; }
.suggestion-meta {
  display: block;
  margin-bottom: .22rem;
  color: var(--g2);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.suggestion-item strong {
  display: block;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.35;
}
.suggestion-item small {
  display: block;
  color: var(--mid);
  font-size: .78rem;
  line-height: 1.45;
  margin-top: .25rem;
}
.suggestion-empty {
  padding: 1rem;
  color: var(--mid);
  font-size: .86rem;
  line-height: 1.45;
}
.quick-searches {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  max-width: 560px;
  margin: 1rem auto 0;
}
.quick-searches button {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  padding: .42rem .85rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.quick-searches button:hover,
.quick-searches button:focus-visible {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.5);
  outline: none;
}

/* ── Category Filter ────────────────────────────────────────── */
.cat-filter-wrap {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 60px;
  z-index: 100;
}
.cat-filter {
  display: flex;
  gap: .55rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: .1rem .2rem;
  align-items: center;
}
.cat-filter::-webkit-scrollbar { display: none; }
.cat-pill-btn {
  flex-shrink: 0;
  padding: .42rem 1.05rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: .81rem;
  font-weight: 600;
  color: var(--mid);
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
.cat-pill-btn:hover { border-color: var(--g2); color: var(--g2); background: var(--gp); }
.cat-pill-btn.active { background: var(--g1); color: #fff; border-color: var(--g1); }

/* ── Featured Article ───────────────────────────────────────── */
.featured-article {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(140deg, #1b4332 0%, #2d6a4f 60%, #3a7a5a 100%);
  border-radius: 8px;
  padding: 2.8rem 3.2rem;
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.featured-article:hover { transform: translateY(-5px); box-shadow: 0 18px 52px rgba(27,67,50,.32); }
.featured-article .feat-meta {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.3rem;
  position: relative;
  z-index: 1;
}
.feat-label {
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .07em;
  border: 1px solid rgba(255,255,255,.25);
  padding: .2rem .8rem;
  border-radius: 12px;
}
.featured-article h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.22;
  max-width: 640px;
  margin-bottom: 1rem;
  position: relative; z-index: 1;
}
.featured-article > p {
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 2rem;
  position: relative; z-index: 1;
}
.feat-footer {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  position: relative; z-index: 1;
}
.feat-footer .read-time-badge {
  font-size: .83rem;
  color: rgba(255,255,255,.6);
}
.feat-footer .read-cta {
  font-size: .92rem;
  font-weight: 700;
  color: #d8f3dc;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.12);
  padding: .5rem 1.2rem;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.2);
  transition: background .18s;
}
.featured-article:hover .read-cta { background: rgba(255,255,255,.2); }

/* ── Articles Grid ──────────────────────────────────────────── */
.articles-section {
  padding: 0 0 2rem;
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.article-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 1.6rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow .22s, transform .22s, border-color .22s;
}
.article-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  transform: translateY(-4px);
  border-color: var(--g3);
}
.article-card.hidden { display: none; }
.article-card .card-cat { margin-bottom: .75rem; }
.article-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: .6rem;
}
.article-card p {
  font-size: .88rem;
  color: var(--mid);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.1rem;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .8rem;
  border-top: 1px solid var(--border);
}
.card-read-time { font-size: .78rem; color: var(--dim); }
.card-arrow {
  font-size: .82rem;
  font-weight: 700;
  color: var(--g2);
}

/* ── No results ─────────────────────────────────────────────── */
#noResults {
  display: none;
  text-align: center;
  color: var(--mid);
  padding: 3rem 0;
  font-size: .95rem;
}
#noResults a { color: var(--g2); text-decoration: underline; cursor: pointer; }

/* ── Topic routes ──────────────────────────────────────────── */
.topic-routes {
  padding: 3rem 0 .5rem;
}
.topic-head {
  max-width: 620px;
  margin-bottom: 1.4rem;
}
.topic-head .eyebrow {
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--g2);
  display: block;
  margin-bottom: .55rem;
}
.topic-head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: .45rem;
}
.topic-head p {
  color: var(--mid);
  font-size: .94rem;
  line-height: 1.6;
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.topic-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1.25rem;
  min-height: 170px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.topic-card:hover,
.topic-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--g3);
  box-shadow: 0 8px 26px rgba(27,67,50,.1);
  outline: none;
}
.topic-kicker {
  color: var(--a1);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.topic-card strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
}
.topic-card span:last-child {
  color: var(--mid);
  font-size: .86rem;
  line-height: 1.5;
}

/* ── Blog Pillars ───────────────────────────────────────────── */
.blog-pillars {
  background: #f2f8f4;
  border-top: 1px solid #d3ead9;
  padding: 4.5rem 0;
  margin-top: 4.5rem;
}
.blog-pillars-inner { text-align: center; }
.blog-pillars-inner > .eyebrow {
  font-size: .77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--g2);
  display: block;
  margin-bottom: .7rem;
}
.blog-pillars h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .7rem;
}
.blog-pillars .pillars-sub {
  color: var(--mid);
  font-size: .95rem;
  margin-bottom: 2.8rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  text-align: left;
}
.pillar {
  background: #fff;
  border-radius: 8px;
  padding: 1.8rem;
  border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.pillar:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gp);
  color: var(--g1);
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: .9rem;
}
.pillar h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .45rem;
}
.pillar p {
  font-size: .87rem;
  color: var(--mid);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
   ARTICLE PAGES
   ═══════════════════════════════════════════════════════════════ */

/* ── Blog Nav back link ─────────────────────────────────────── */
nav .back-blog {
  display: inline-flex !important;
  align-items: center;
  gap: .35rem;
  font-weight: 600 !important;
  color: var(--g2) !important;
}
nav .back-blog::before { content: '←'; }

/* ── Article Meta Bar ───────────────────────────────────────── */
.article-meta-bar {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin: 1rem 0 .3rem;
  font-size: .82rem;
  color: var(--mid);
}
.article-meta-bar .sep { opacity: .35; }

/* ── Inline TOC ─────────────────────────────────────────────── */
.article-toc {
  background: linear-gradient(135deg, #edf6f0 0%, #f5f3ef 100%);
  border: 1px solid #cce8d5;
  border-left: 4px solid var(--g2);
  border-radius: 0 8px 8px 0;
  padding: 1.4rem 1.8rem;
  margin: 2.2rem 0 2.6rem;
}
.article-toc .toc-title {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mid);
  margin-bottom: .9rem;
}
.article-toc ol {
  padding-left: 1.3rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.article-toc a {
  font-size: .9rem;
  color: var(--g1);
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}
.article-toc a:hover { color: var(--g2); text-decoration: underline; }

/* ── Related Articles as Cards ──────────────────────────────── */
.related-links {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-links h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--ink);
}
.related-links ul {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .9rem;
}
.related-links li a {
  display: block;
  padding: 1rem 1.25rem;
  background: #f4f9f5;
  border: 1.5px solid #cce8d5;
  border-radius: 8px;
  font-size: .87rem;
  font-weight: 500;
  color: var(--g1);
  text-decoration: none;
  line-height: 1.45;
  transition: background .18s, border-color .18s, transform .18s;
}
.related-links li a:hover {
  background: var(--gp);
  border-color: var(--g2);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .featured-article { padding: 2rem 2.2rem; }
}
@media (max-width: 768px) {
  .blog-hero { padding: 5.5rem 0 4rem; }
  .featured-article { padding: 1.8rem; }
  .featured-article h2 { font-size: 1.4rem; }
  .cat-filter-wrap { top: 58px; }
  .articles-grid { gap: 1.2rem; }
  .blog-pillars { padding: 3rem 0; }
}
@media (max-width: 480px) {
  .blog-hero h1 { font-size: 1.75rem; }
  .blog-hero .hero-sub { font-size: .95rem; }
  .articles-grid { grid-template-columns: 1fr; }
  .featured-article { padding: 1.5rem; }
  .feat-footer { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .related-links ul { grid-template-columns: 1fr; }
  .article-toc { padding: 1.1rem 1.3rem; }
}
