/* Publicações: cartões, lista, filtros e página de artigo. Usa os tokens de tema de styles.css. */

/* ---------- Cartões ---------- */
.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post { display: flex; }
.post__link {
  position: relative; flex: 1; display: flex; flex-direction: column; gap: 12px;
  padding: 26px 24px 52px; text-decoration: none; color: var(--fg);
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.post__link:hover { border-color: var(--fg); transform: translateY(-3px); }
.post h3 { font-size: 21px; line-height: 1.2; }
.post__sum { color: var(--fg-2); font-size: 15px; }
.post__more { position: absolute; left: 24px; bottom: 20px; font-size: 20px; color: var(--accent); transition: transform .3s var(--ease); }
.post__link:hover .post__more { transform: translateX(6px); }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 11px; color: var(--fg-2); }
.post__area { color: var(--accent); }
.post__draft { padding: 3px 6px; border: 1px dashed currentColor; border-radius: 3px; color: #C27A12; }
:root[data-theme="noir"] .post__draft { color: var(--accent); }

/* Destaque: o primeiro cartão ocupa duas colunas e fica invertido */
.post--featured { grid-column: span 2; grid-row: span 2; }
.post--featured .post__link { background: var(--i-bg); color: var(--i-fg); border-color: var(--i-bg); padding: 34px 32px 60px; justify-content: flex-end; min-height: 300px; }
.post--featured h3 { font-size: clamp(26px, 2.8vw, 36px); max-width: 18em; }
.post--featured .post__sum, .post--featured .post__meta { color: var(--i-fg-2); }
.post--featured .post__area, .post--featured .post__more { color: var(--i-accent); }
.post--featured .post__more { left: 32px; bottom: 26px; }
:root[data-theme="noir"] .post--featured .post__link { box-shadow: 8px 8px 0 var(--accent); }
:root[data-theme="noir"] .post--featured h3 { font-size: clamp(30px, 3.4vw, 44px); }

.posts__foot { margin-top: 28px; }

/* ---------- Página de lista ---------- */
.phero { padding: clamp(40px, 7vw, 96px) 0 24px; }
.phero h1 { font-size: clamp(42px, 6vw, 88px); }
.ptools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 0; border-block: 1px solid var(--line); margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 14px/1 var(--f-body); padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg-2); cursor: pointer; }
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--hl); color: var(--on-hl); border-color: var(--hl); }
:root[data-theme="noir"] .chip { border-radius: 0; }
.psearch { position: relative; min-width: 260px; }
.psearch svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--fg-2); stroke-width: 2; }
.psearch input { width: 100%; font: 500 15px/1.2 var(--f-body); color: var(--fg); background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px 11px 38px; }
.pcount { font: 700 16px/1.3 "Manrope", var(--f-body); margin-bottom: 14px; color: var(--fg-2); }
.pempty { padding: 40px; text-align: center; border: 1px dashed var(--line); color: var(--fg-2); }
.pnews { margin-top: clamp(48px, 6vw, 80px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt); }
.pnews h2 { font-size: 26px; }
.pnews p { color: var(--fg-2); margin-top: 6px; }

/* ---------- Artigo ---------- */
.article { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--pad) clamp(80px, 10vw, 120px); }
.article__back { display: inline-block; margin-bottom: 28px; color: var(--fg-2); text-decoration: none; text-transform: none; }
.article__back:hover { color: var(--fg); }
.article h1 { font-size: clamp(36px, 5vw, 60px); margin: 16px 0 0; }
.article .lead { margin-top: 20px; }
.article__by { margin-top: 22px; color: var(--fg-2); text-transform: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.article__share { font-family: var(--f-mono); font-size: 12px; }
.article__note { margin-top: 18px; padding: 12px 16px; border-left: 3px solid #C27A12; background: color-mix(in srgb, #C27A12 12%, transparent); font-size: 15px; }
.article__note--lang { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.article__body { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); font-size: 18px; line-height: 1.75; }
.article__body > * + * { margin-top: 1.1em; }
.article__body h2 { font-size: 26px; margin-top: 1.8em; }
.article__body ul { padding-left: 1.2em; }
.article__body li + li { margin-top: .5em; }
.article__body li::marker { color: var(--accent); }
.article__cta { margin-top: 56px; padding: 32px; border-radius: var(--radius); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.article__cta h2 { font-size: 26px; }
.article__related { margin-top: 56px; }
.article__related > h2 { font-size: 12px; color: var(--accent); margin-bottom: 16px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .04em; }
.article__related .posts { grid-template-columns: 1fr 1fr; }
.article__missing { font-size: 20px; margin-bottom: 20px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1020px) {
  .posts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .posts, .article__related .posts { grid-template-columns: 1fr; }
  .post--featured { grid-column: auto; grid-row: auto; }
  .post--featured .post__link { min-height: 0; }
  .psearch { min-width: 0; width: 100%; }
}

.section--tight { padding-top: 24px; }

/* ---------- Imagens das publicações ---------- */
.post__img { display: block; height: auto; width: calc(100% + 48px); margin: -26px -24px 6px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; background: var(--line); }
.post__link { overflow: hidden; }
.post__link:hover .post__img { filter: saturate(1.1); }
/* Destaque: a imagem passa a fundo, com véu para garantir contraste do texto */
.post--featured .post__link { isolation: isolate; }
.post--featured .post__img { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; aspect-ratio: auto; border-radius: 0; z-index: -2; }
.post--featured .post__link::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--i-bg) 35%, transparent) 0%, color-mix(in srgb, var(--i-bg) 92%, transparent) 62%, var(--i-bg) 100%); }
.article__cover { display: block; height: auto; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-top: 28px; border-radius: var(--radius); background: var(--line); }
:root[data-theme="noir"] .post__img, :root[data-theme="noir"] .article__cover { filter: grayscale(1) contrast(1.15); }
:root[data-theme="noir"] .post__link:hover .post__img { filter: grayscale(0) contrast(1.05); }
