/* ============================================================
   INSTITUTO INTELLOS — Components
   Cards · página inicial · artigo · FAQ · share · autor
   ============================================================ */

/* ---------- Tag (categoria única) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--mint-soft); color: var(--mint-strong);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }

/* ---------- Page header ---------- */
.page-head { padding-block: var(--sp-8) var(--sp-6); }
.page-head .eyebrow { display: block; margin-bottom: var(--sp-3); }
.page-head__desc { color: var(--ink-2); font-size: 1.15rem; max-width: 56ch; margin-top: var(--sp-4); line-height: 1.55; }

/* ---------- Section header ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.sec-head__link { font-weight: 600; font-size: 0.92rem; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.sec-head__link svg { width: 16px; height: 16px; transition: transform 0.2s; }
.sec-head__link:hover svg { transform: translateX(3px); }

/* ---------- Grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* ============================================================
   ARTICLE CARD
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.card__title {
  font-weight: 700; font-size: 1.26rem; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--ink); text-wrap: balance; transition: color 0.2s var(--ease);
}
.card:hover .card__title { color: var(--primary); }
.card__excerpt { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.card__foot { margin-top: auto; display: flex; align-items: center; gap: var(--sp-2); padding-top: var(--sp-2); }
.card__date { font-size: 0.8rem; color: var(--faint); font-weight: 500; }
.card__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* ---------- Featured card (home) ---------- */
.feature {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.feature:hover { box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.feature__media { overflow: hidden; background: var(--surface-2); min-height: 340px; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.feature:hover .feature__media img { transform: scale(1.03); }
.feature__body { padding: var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-4); justify-content: center; }
.feature__title {
  font-weight: 800; font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); line-height: 1.06;
  letter-spacing: -0.025em; color: var(--ink); text-wrap: balance; transition: color 0.2s var(--ease);
}
.feature:hover .feature__title { color: var(--primary); }
.feature__excerpt { color: var(--ink-2); font-size: 1.05rem; line-height: 1.55; }
.feature__meta { display: flex; align-items: center; gap: var(--sp-2); color: var(--muted); font-size: 0.88rem; font-weight: 500; margin-top: var(--sp-1); }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article { max-width: 760px; margin-inline: auto; padding-top: var(--sp-7); }
.article__top { display: flex; flex-direction: column; gap: var(--sp-4); }
.breadcrumb { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.86rem; color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb svg { width: 14px; height: 14px; color: var(--faint); }

.article__title { font-weight: 800; font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem); line-height: 1.06; letter-spacing: -0.03em; color: var(--ink); text-wrap: balance; }
.article__sub { font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); font-weight: 400; }

.article__byline { display: flex; align-items: center; gap: var(--sp-3); padding-block: var(--sp-2); }
.article__byline .meta { display: flex; flex-direction: column; gap: 1px; }
.article__byline .name { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.article__byline .date { font-size: 0.84rem; color: var(--muted); }

.article__hero { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; margin-block: var(--sp-6); background: var(--surface-2); }
.article__hero img { width: 100%; height: 100%; object-fit: cover; }

/* avatar */
.avatar {
  border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 40px; height: 40px; font-size: 0.95rem; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.6rem; }

/* ---------- Inline TOC ("Encontre neste artigo") ---------- */
.toc-box {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: var(--sp-5) var(--sp-6); margin-block: var(--sp-6);
}
.toc-box h4 {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--primary); font-weight: 700; margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.toc-box h4 svg { width: 17px; height: 17px; }
.toc-box ol { list-style: none; padding: 0; counter-reset: toc; display: grid; gap: 2px; }
.toc-box li { counter-increment: toc; }
.toc-box a {
  display: flex; gap: var(--sp-3); padding: 7px 0; font-size: 0.96rem;
  color: var(--ink-2); font-weight: 500; transition: color 0.18s; line-height: 1.4;
}
.toc-box a::before {
  content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums;
  color: var(--mint-strong); font-weight: 700; font-size: 0.82rem; flex: 0 0 auto; padding-top: 2px;
}
.toc-box a:hover { color: var(--primary); }
.toc-box a.is-active { color: var(--primary); font-weight: 700; }

/* ============================================================
   PROSE (corpo do artigo)
   ============================================================ */
.prose { font-size: 1.16rem; line-height: 1.78; color: var(--ink-2); }
.prose > * + * { margin-top: 1.4em; }
.prose p { text-wrap: pretty; }
.prose h2 {
  font-weight: 700; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em;
  color: var(--ink); margin-top: 1.9em; scroll-margin-top: 96px;
}
.prose h3 { font-weight: 700; font-size: 1.28rem; color: var(--ink); margin-top: 1.5em; scroll-margin-top: 96px; }
.prose a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--mint-strong); }
.prose figure { margin-block: 2em; }
.prose figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.prose figcaption { font-size: 0.84rem; color: var(--muted); margin-top: var(--sp-3); padding-left: var(--sp-3); border-left: 2px solid var(--mint); }

/* blockquote — destaque */
.prose blockquote {
  font-size: 1.32rem; line-height: 1.45; font-weight: 600; color: var(--ink);
  border-left: 3px solid var(--mint); padding: var(--sp-1) 0 var(--sp-1) var(--sp-5);
  margin-block: 1.8em; letter-spacing: -0.01em;
}

/* ============================================================
   FAQ (Perguntas frequentes)
   ============================================================ */
.faq { display: grid; gap: var(--sp-3); }
.faq__item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color 0.2s var(--ease); }
.faq__item[open] { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.faq__q {
  list-style: none; cursor: pointer; padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  font-weight: 700; font-size: 1.05rem; color: var(--ink);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q .ico { width: 22px; height: 22px; flex: 0 0 auto; color: var(--primary); transition: transform 0.25s var(--ease); }
.faq__item[open] .faq__q .ico { transform: rotate(45deg); }
.faq__a { padding: 0 var(--sp-5) var(--sp-5); color: var(--ink-2); font-size: 1rem; line-height: 1.65; }
.faq__a strong { color: var(--ink); font-weight: 700; }

/* ============================================================
   SHARE (Compartilhe este artigo)
   ============================================================ */
.share { border-block: 1px solid var(--border); padding-block: var(--sp-5); margin-block: var(--sp-7); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.share__label { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.share__btns { display: flex; gap: var(--sp-2); }
.share__btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); transition: all 0.2s var(--ease); }
.share__btn svg { width: 19px; height: 19px; }
.share__btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); }

/* ============================================================
   AUTHOR (Sobre o Autor)
   ============================================================ */
.author { display: flex; gap: var(--sp-5); align-items: flex-start; padding: var(--sp-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); margin-block: var(--sp-7); }
.author__body { display: flex; flex-direction: column; gap: 6px; }
.author__eyebrow { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mint-strong); font-weight: 700; }
.author__name { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); }
.author__bio { color: var(--ink-2); font-size: 0.98rem; line-height: 1.6; margin-top: 4px; }

/* ============================================================
   CATEGORY / LISTING
   ============================================================ */
.listing-count { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.cat-banner {
  border-radius: var(--radius-lg); padding: var(--sp-8); margin-bottom: var(--sp-7);
  background: linear-gradient(135deg, oklch(0.24 0.06 296), oklch(0.34 0.09 290));
  color: #fff; position: relative; overflow: hidden;
}
.cat-banner::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, oklch(0.72 0.13 164 / 0.35), transparent 70%);
}
.cat-banner .eyebrow { color: var(--mint); }
.cat-banner h1 { font-weight: 800; font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); letter-spacing: -0.03em; line-height: 1.04; margin-top: var(--sp-2); }
.cat-banner p { color: oklch(0.86 0.03 290); font-size: 1.1rem; max-width: 52ch; margin-top: var(--sp-3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .feature { grid-template-columns: 1fr; }
  .feature__media { min-height: 0; aspect-ratio: 16/9; }
  .feature__body { padding: var(--sp-6); }
}
@media (max-width: 620px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .prose { font-size: 1.08rem; }
  .author { flex-direction: column; gap: var(--sp-4); }
  .share { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 10vh;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0.2s;
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-bd {
  position: absolute; inset: 0;
  background: oklch(0.15 0.03 296 / 0.72);
  backdrop-filter: blur(8px);
}
.search-modal {
  position: relative; z-index: 1;
  width: 100%; max-width: 600px; margin-inline: var(--sp-5);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.2s var(--ease);
}
.search-overlay.open .search-modal { transform: translateY(0) scale(1); }
.search-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border);
}
.search-ico { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.search-input {
  flex: 1; font-size: 1.05rem; font-family: var(--font);
  background: none; border: none; outline: none; color: var(--ink);
}
.search-input::placeholder { color: var(--faint); }
.search-esc {
  font-size: 0.74rem; font-family: var(--font); font-weight: 600; cursor: pointer;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: var(--radius-sm); white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.search-esc:hover { background: var(--border); color: var(--ink-2); }
.search-results { max-height: 400px; overflow-y: auto; padding: var(--sp-2); }
.search-result {
  display: flex; gap: var(--sp-4); align-items: center;
  padding: var(--sp-3); border-radius: var(--radius); text-decoration: none;
  transition: background 0.15s var(--ease);
}
.search-result:hover,
.search-result.is-focused { background: var(--surface-2); }
.search-result__img {
  width: 72px; height: 50px; object-fit: cover;
  border-radius: var(--radius-sm); flex: 0 0 auto; background: var(--surface-2);
}
.search-result__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.search-result__cat  { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--mint-strong); }
.search-result__title { font-weight: 700; font-size: 0.96rem; color: var(--ink); line-height: 1.3; }
.search-result__meta  { font-size: 0.8rem; color: var(--faint); }
.search-empty { padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--muted); font-size: 0.96rem; }
.search-empty strong { color: var(--ink-2); }
.search-hint {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted);
}
.search-hint kbd {
  font-family: var(--font); font-size: 0.72rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border-2);
  padding: 1px 5px; border-radius: 4px; color: var(--ink-2);
}
