/* ══════════════════════════════════════════════════════════
   Blog — lista e páginas de post
   Usa os tokens e componentes de css/project.css (pj-*)
   ══════════════════════════════════════════════════════════ */

.bl-page { --bl-col: 700px; }

/* ── Metadados e etiquetas ─────────────────────────────────── */
.bl-meta { font-size: .85rem; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }

.bl-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.bl-tags li, .bl-tags a {
  display: inline-flex; align-items: center; min-height: 28px;
  padding: .2rem .7rem; border-radius: 100px;
  font-size: .76rem; font-weight: 700; color: var(--pj-accent);
  background: color-mix(in srgb, var(--pj-accent) 9%, transparent);
  text-decoration: none;
}
.bl-tags li:has(a) { padding: 0; background: none; }
.bl-tags a:hover { background: color-mix(in srgb, var(--pj-accent) 16%, transparent); }

/* ══════════ LISTA ══════════ */
.bl-hero-inner { position: relative; z-index: 1; padding: 2.5rem 2.5rem 4rem; }
.bl-hero .pj-hero-lead { margin-bottom: 0; }

.bl-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.25rem; }
.bl-chip {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: .45rem 1.05rem; border-radius: 100px;
  font-size: .88rem; font-weight: 700; text-decoration: none;
  color: var(--text-2); background: var(--pj-card); border: 1px solid var(--pj-line);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.bl-chip:hover { color: var(--text); border-color: var(--pj-accent); }
.bl-chip.is-active { background: var(--pj-brand); border-color: var(--pj-brand); color: #fff; }

.bl-list { padding: 4.5rem 0 6rem; }

.bl-card {
  background: var(--pj-card);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 24px 48px -32px rgba(13, 13, 28, .35), 0 1px 3px rgba(0, 0, 0, .05);
  transition: transform .25s ease, box-shadow .25s ease;
}
.bl-card:hover { transform: translateY(-4px); box-shadow: 0 32px 60px -32px rgba(13, 13, 28, .45), 0 1px 3px rgba(0, 0, 0, .05); }
.bl-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }

.bl-card-cover { aspect-ratio: 16 / 10; background: var(--pj-alt); overflow: hidden; }
.bl-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.bl-card:hover .bl-card-cover img { transform: scale(1.03); }
.bl-card-cover-empty { display: grid; place-items: center; height: 100%; background: var(--pj-brand); }
.bl-card-cover-empty img { width: 56px; height: auto; opacity: .9; }
.bl-card:hover .bl-card-cover-empty img { transform: none; }

.bl-card-body { display: flex; flex-direction: column; gap: .7rem; padding: 1.5rem 1.6rem 1.75rem; flex: 1; }
.bl-card-title { font-size: 1.3rem; font-weight: 800; line-height: 1.25; letter-spacing: -.015em; color: var(--text); }
.bl-card-excerpt { font-size: .98rem; line-height: 1.65; color: var(--text-2); }
.bl-card .bl-tags { margin-top: auto; padding-top: .4rem; }

.bl-card--featured { margin-bottom: 2.5rem; }
.bl-card--featured .bl-card-link { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.bl-card--featured .bl-card-cover { aspect-ratio: auto; min-height: 360px; }
.bl-card--featured .bl-card-body { justify-content: center; padding: 2.5rem; gap: 1rem; }
.bl-card--featured .bl-card-title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); color: var(--pj-accent); }
.bl-card--featured .bl-card-excerpt { font-size: 1.05rem; }
.bl-card--featured .bl-tags { margin-top: .5rem; }

.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }

.bl-empty { text-align: center; padding: 3rem 1rem; color: var(--text-2); font-size: 1.05rem; }
.bl-empty-title { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: .5rem; }
.bl-empty a { color: var(--pj-accent); font-weight: 700; }

/* ══════════ POST ══════════ */
.bl-draft-bar {
  position: sticky; top: 0; z-index: 50;
  padding: .7rem 1.25rem; text-align: center;
  background: #FFE7B8; color: #4A3200; font-size: .9rem; font-weight: 600;
}
.bl-draft-bar a { color: inherit; font-weight: 800; margin-left: .4rem; }

.bl-post-hero { padding-top: 2rem; }
.bl-post-head { position: relative; z-index: 1; max-width: calc(var(--bl-col) + 5rem); padding-bottom: 4rem; }
.bl-post-hero:has(+ .bl-cover) .bl-post-head { padding-bottom: 8rem; }

.bl-crumb { margin-bottom: 1.75rem; }
.bl-crumb a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: .9rem; font-weight: 700; color: var(--pj-accent); text-decoration: none;
}
.bl-crumb a:hover { text-decoration: underline; }

.bl-post-title {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -.03em;
  color: var(--text); margin: .9rem 0 0;
  text-wrap: balance;
}
.bl-post-lead { font-size: 1.2rem; line-height: 1.65; color: var(--text-2); margin-top: 1.25rem; text-wrap: pretty; }
.bl-post-head .bl-tags { margin-top: 1.5rem; }

.bl-cover { max-width: 1080px; margin: -5.5rem auto 0; padding: 0 2.5rem; position: relative; z-index: 2; }
.bl-cover img {
  display: block; width: 100%; max-height: 640px; object-fit: cover;
  border-radius: 1.25rem;
  box-shadow: 0 40px 80px -40px rgba(13, 13, 28, .5);
}

/* Corpo do texto: coluna de leitura, imagens "largas" ocupam mais espaço */
.bl-body {
  display: grid;
  grid-template-columns: 1fr min(var(--bl-col), calc(100% - 5rem)) 1fr;
  padding: 4rem 0 2rem;
  font-size: 1.12rem; line-height: 1.8; color: var(--text-2);
}
.bl-body > * { grid-column: 2; }
.bl-body > * + * { margin-top: 1.4em; }

.bl-body h2 { font-size: 1.75rem; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; color: var(--text); margin-top: 2.2em; }
.bl-body h3 { font-size: 1.3rem; font-weight: 800; line-height: 1.3; color: var(--pj-accent); margin-top: 1.8em; }
.bl-body h2 + *, .bl-body h3 + * { margin-top: .7em; }
.bl-body strong, .bl-body b { color: var(--text); font-weight: 700; }
.bl-body a { color: var(--pj-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.bl-body ul, .bl-body ol { padding-left: 1.4em; }
.bl-body li + li { margin-top: .45em; }
.bl-body li::marker { color: var(--pj-accent); font-weight: 700; }
.bl-body code {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: .88em;
  padding: .12em .4em; border-radius: .35em; white-space: nowrap;
  background: color-mix(in srgb, var(--pj-accent) 9%, transparent); color: var(--text);
}
.bl-body hr { border: 0; height: 1px; background: var(--pj-line); margin: 3em 0; }

.bl-body blockquote {
  position: relative;
  padding: .25rem 0 .25rem 1.5rem;
  border-left: 3px solid var(--pj-highlight);
  font-size: 1.35rem; line-height: 1.55; font-weight: 600; color: var(--text);
  margin-top: 2em; margin-bottom: .6em;
}

.bl-body figure { margin-top: 2.2em; }
.bl-body figure + * { margin-top: 2em; }
.bl-body figure img { display: block; width: 100%; height: auto; border-radius: 1rem; cursor: zoom-in; }
.bl-body figcaption { margin-top: .75rem; font-size: .88rem; line-height: 1.5; color: var(--text-2); text-align: center; }

.bl-body figure.wide { grid-column: 1 / -1; width: 100%; max-width: 1080px; margin-left: auto; margin-right: auto; padding: 0 2.5rem; }

.bl-body figure.gallery {
  grid-column: 1 / -1; width: 100%; max-width: 1080px; margin-left: auto; margin-right: auto; padding: 0 2.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem;
}
.bl-body figure.gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.bl-body figure.gallery figcaption { grid-column: 1 / -1; margin-top: 0; }

/* vídeo: só carrega o YouTube depois de carregar no play */
.bl-video { margin-top: 2.2em; }
.bl-video-play, .bl-video iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 1rem;
}
.bl-video-play {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: radial-gradient(circle at 50% 40%, #2a3546, #12161d);
  color: #fff; cursor: pointer; font: inherit;
}
.bl-video-icon {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: #fff; color: #12161d; padding-left: 4px;
  transition: transform .2s ease;
}
.bl-video-play:hover .bl-video-icon { transform: scale(1.08); }
.bl-video-label { font-size: .9rem; font-weight: 700; opacity: .85; }

/* fim do post */
.bl-post-foot {
  max-width: var(--bl-col); margin: 1rem auto 0; padding: 2rem 0 5rem;
  border-top: 1px solid var(--pj-line);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.bl-author { display: flex; align-items: center; gap: .9rem; }
.bl-author img { border-radius: .7rem; }
.bl-author-name { font-weight: 800; color: var(--text); }
.bl-author-role { font-size: .9rem; color: var(--text-2); }
.bl-author-role a { color: var(--pj-accent); font-weight: 700; }
.bl-share { cursor: pointer; font-family: inherit; }

.bl-pager { background: var(--pj-alt); padding: 3rem 0; }
.bl-pager-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.bl-pager-link {
  display: flex; flex-direction: column; gap: .4rem;
  padding: 1.5rem 1.75rem; border-radius: 1rem; background: var(--pj-card);
  text-decoration: none; color: inherit;
  box-shadow: 0 16px 36px -28px rgba(13, 13, 28, .4);
  transition: transform .2s ease;
}
.bl-pager-link:hover { transform: translateY(-3px); }
.bl-pager-link--next { text-align: right; grid-column: 2; }
.bl-pager-dir { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pj-accent-2); }
.bl-pager-title { font-size: 1.08rem; font-weight: 800; color: var(--text); line-height: 1.35; }

/* ver foto em grande */
.bl-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; background: rgba(8, 10, 14, .92);
  cursor: zoom-out; animation: bl-fade .2s ease;
}
.bl-lightbox img { max-width: 100%; max-height: 100%; border-radius: .75rem; object-fit: contain; }
@keyframes bl-fade { from { opacity: 0; } }

/* ══════════ Responsivo ══════════ */
@media (max-width: 900px) {
  .bl-card--featured .bl-card-link { grid-template-columns: 1fr; }
  .bl-card--featured .bl-card-cover { min-height: 0; aspect-ratio: 16 / 10; }
  .bl-card--featured .bl-card-body { padding: 1.75rem 1.6rem 2rem; }
}

@media (max-width: 700px) {
  .bl-hero-inner { padding: 1.5rem 1.25rem 3rem; }
  .bl-list { padding: 3rem 0 4rem; }
  .bl-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .bl-post-head { padding-bottom: 3rem; }
  .bl-post-hero:has(+ .bl-cover) .bl-post-head { padding-bottom: 5rem; }
  .bl-post-lead { font-size: 1.08rem; }
  .bl-cover { margin-top: -3.5rem; padding: 0 1.25rem; }
  .bl-cover img { border-radius: 1rem; }
  .bl-body { grid-template-columns: 1fr min(var(--bl-col), calc(100% - 2.5rem)) 1fr; padding-top: 2.75rem; font-size: 1.06rem; }
  .bl-body h2 { font-size: 1.45rem; }
  .bl-body blockquote { font-size: 1.15rem; }
  .bl-body figure.wide, .bl-body figure.gallery { padding: 0 1.25rem; }
  .bl-body figure.gallery { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .bl-body figure.gallery img { border-radius: .6rem; }
  .bl-post-foot { margin: 1rem 1.25rem 0; padding-bottom: 3.5rem; }
  .bl-pager-inner { grid-template-columns: 1fr; }
  .bl-pager-link--next { grid-column: 1; }
}
