/* ============================================================
   SAFE BAIT — Article & Resources Stylesheet
   Supplements styles.css for blog/recursos pages
   ============================================================ */

/* ── Article Hero ───────────────────────────────────────────── */
.article-hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 60%, #0a3a7a 100%);
  padding: calc(var(--nav-h) + 56px) 0 56px;
  position: relative;
  overflow: hidden;
}
.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 400px at 80% 50%, rgba(14,188,176,.12) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 10% 80%, rgba(6,63,147,.25) 0%, transparent 60%);
  pointer-events: none;
}
.article-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
}
.article-hero-cat {
  display: inline-block;
  background: rgba(14,188,176,.18);
  color: var(--secondary-light);
  border: 1px solid rgba(14,188,176,.35);
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--r-full);
  margin-bottom: 20px;
}
.article-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 20px;
}
.article-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 20px;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: rgba(255,255,255,.65);
}
.article-meta-item svg {
  width: 14px;
  height: 14px;
  opacity: .7;
  flex-shrink: 0;
}
.article-hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,.8);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 760px;
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.article-tag {
  font-size: .78rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.15);
  padding: 3px 12px;
  border-radius: var(--r-full);
  transition: background .2s, color .2s;
}
.article-tag:hover {
  background: rgba(14,188,176,.2);
  color: var(--secondary-light);
}

/* ── Article Breadcrumb ─────────────────────────────────────── */
.article-breadcrumb {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-white);
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  font-size: .83rem;
  color: var(--text-muted);
}
.breadcrumb-list li + li::before {
  content: '›';
  margin-right: 4px;
  opacity: .5;
}
.breadcrumb-list a {
  color: var(--primary);
  text-decoration: none;
  transition: color .2s;
}
.breadcrumb-list a:hover { color: var(--secondary-dark); text-decoration: underline; }
.breadcrumb-list [aria-current] { color: var(--text-muted); }

/* ── Article Layout ─────────────────────────────────────────── */
.article-main {
  padding: 56px 0 80px;
  background: var(--bg-white);
}
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--cpad);
}

/* ── Prose Typography ───────────────────────────────────────── */
.prose {
  min-width: 0;
  color: var(--text-body);
  font-size: 1.05rem;
  line-height: 1.75;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
  margin: 2.4em 0 .75em;
  padding-bottom: .4em;
  border-bottom: 2px solid var(--border-light);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin: 1.8em 0 .6em;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 1.4em 0 .5em;
}
.prose p {
  margin-bottom: 1.3em;
}
.prose p:last-child { margin-bottom: 0; }
.prose ul,
.prose ol {
  margin: 1em 0 1.3em 1.4em;
}
.prose li {
  margin-bottom: .5em;
  padding-left: .25em;
}
.prose ul > li::marker { color: var(--secondary); }
.prose ol > li::marker { color: var(--primary); font-weight: 600; }
.prose strong { color: var(--text-dark); font-weight: 600; }
.prose em { font-style: italic; color: var(--text-muted); }
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(6,63,147,.35);
  transition: color .2s, text-decoration-color .2s;
}
.prose a:hover {
  color: var(--secondary-dark);
  text-decoration-color: var(--secondary);
}
.prose blockquote {
  margin: 1.6em 0;
  padding: 18px 24px;
  background: var(--bg-light);
  border-left: 4px solid var(--secondary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}
.prose blockquote p { margin-bottom: 0; }
.prose code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: .88em;
  background: var(--bg-subtle);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}
.prose pre {
  background: var(--bg-darker);
  color: #e2e8f0;
  padding: 20px 24px;
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: .88rem;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: .95rem;
}
.prose th {
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  text-align: left;
  padding: 11px 16px;
}
.prose td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.prose tr:nth-child(even) td { background: var(--bg-light); }
.prose tr:last-child td { border-bottom: none; }
.prose hr {
  border: none;
  border-top: 2px solid var(--border-light);
  margin: 2.5em 0;
}
.prose img {
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  margin: 1.5em 0;
}

/* ── TOC Sidebar ────────────────────────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.toc-box {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 20px 22px;
}
.toc-title {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.toc-list li.toc-h3 { padding-left: 12px; }
.toc-link {
  display: block;
  font-size: .84rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  border-left: 2px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
  line-height: 1.4;
}
.toc-link:hover {
  color: var(--primary);
  background: rgba(6,63,147,.06);
}
.toc-link.active {
  color: var(--primary);
  background: rgba(6,63,147,.08);
  border-left-color: var(--secondary);
  font-weight: 500;
}
.toc-progress {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.toc-progress-label {
  font-size: .76rem;
  color: var(--text-light);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.toc-progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: var(--r-full);
  overflow: hidden;
}
.toc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--r-full);
  width: 0%;
  transition: width .2s var(--ease);
}

/* ── Article Footer CTA ─────────────────────────────────────── */
.article-footer-cta {
  margin-top: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--r-lg);
  padding: 40px 44px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.article-footer-cta::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(14,188,176,.15);
  pointer-events: none;
}
.article-footer-cta h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.25;
  position: relative;
}
.article-footer-cta p {
  font-size: .95rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 22px;
  max-width: 500px;
  position: relative;
}
.article-footer-cta .btn {
  position: relative;
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(14,188,176,.35);
}
.article-footer-cta .btn:hover {
  background: var(--secondary-dark);
  color: #fff;
  box-shadow: 0 6px 24px rgba(14,188,176,.45);
}

/* ── Related Articles ───────────────────────────────────────── */
.article-related {
  padding: 64px 0 80px;
  background: var(--bg-light);
}
.article-related .section-title {
  font-size: 1.5rem;
  margin-bottom: 32px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.related-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
  display: flex;
  flex-direction: column;
}
.related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.related-card-img {
  height: 160px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}
.related-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .25;
}
.related-card-img-placeholder svg {
  width: 48px;
  height: 48px;
  fill: #fff;
}
.related-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.related-card-cat {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--secondary-dark);
  margin-bottom: 8px;
}
.related-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1;
}
.related-card-title a {
  color: inherit;
  transition: color .2s;
}
.related-card-title a:hover { color: var(--primary); }
.related-card-meta {
  font-size: .78rem;
  color: var(--text-light);
}

/* ── Resources Listing ──────────────────────────────────────── */
.recursos-search-bar {
  padding: 48px 0 32px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
}
.recursos-search-wrap {
  position: relative;
  max-width: 560px;
  margin-bottom: 24px;
}
.recursos-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-light);
  pointer-events: none;
}
.recursos-search-input {
  width: 100%;
  padding: 13px 16px 13px 48px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--bg-white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.recursos-search-input::placeholder { color: var(--text-light); }
.recursos-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6,63,147,.1);
}
.recursos-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.recursos-filters-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: 4px;
}
.filter-btn {
  font-family: var(--font-body);
  font-size: .83rem;
  font-weight: 500;
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-white);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(6,63,147,.05);
}
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Article Cards (Resources grid) ────────────────────────── */
.recursos-grid-section {
  padding: 48px 0 80px;
  background: var(--bg-light);
}
.recursos-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 8px;
}
.search-count {
  font-size: .9rem;
  color: var(--text-muted);
}
.search-count strong { color: var(--text-dark); }
.article-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.article-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.article-card-img-link {
  display: block;
  height: 190px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  position: relative;
}
.article-card-img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.article-card:hover .article-card-img-link img { transform: scale(1.04); }
.article-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: .18;
  color: #fff;
}
.article-card-body {
  padding: 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.article-card-cat {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--secondary-dark);
}
.article-card-date,
.article-card-read {
  font-size: .78rem;
  color: var(--text-light);
}
.article-card-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1;
}
.article-card-title a {
  color: inherit;
  transition: color .2s;
}
.article-card-title a:hover { color: var(--primary); }
.article-card-excerpt {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-tags-sm {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.article-tag-sm {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 10px;
  border-radius: var(--r-full);
}

/* ── No Results ─────────────────────────────────────────────── */
.no-results {
  display: none;
  text-align: center;
  padding: 64px 24px;
}
.no-results.visible { display: block; }
.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: .4;
}
.no-results h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.no-results p {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 20px;
}
.no-results .btn-outline {
  display: inline-block;
  padding: 9px 22px;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  background: none;
  font-family: var(--font-body);
  transition: background .2s, color .2s;
}
.no-results .btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr 240px;
    gap: 32px;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    position: static;
    order: -1;
  }
  .toc-box {
    background: var(--bg-subtle);
  }
  .article-footer-cta {
    padding: 28px 24px;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .article-cards-grid {
    grid-template-columns: 1fr;
  }
  .article-hero {
    padding: calc(var(--nav-h) + 36px) 0 40px;
  }
  .recursos-search-bar {
    padding: 32px 0 24px;
  }
}
@media (max-width: 480px) {
  .article-hero-title {
    font-size: 1.7rem;
  }
  .article-footer-cta {
    padding: 24px 20px;
  }
  .article-footer-cta h3 {
    font-size: 1.15rem;
  }
}
