/*
 * _article-shell.css — CSS do ARTIGO-DETALHE (split de _listing.css, Sprint 3).
 * Carregado SO na pagina do artigo. Contem: aliases de tokens + classes
 * compartilhadas que o artigo usa + a secao do artigo (portada de article.css).
 * As classes de LISTAGEM (ac-*, newsletter, hub-*, etc.) NAO entram aqui.
 * fade-up removido de proposito (sem animacao de entrada no artigo).
 */

/* Aliases: nomes do prototipo -> tokens --cms-* (escopo local) */
.artigos-scope {
  --ink: var(--cms-ink);
  --ink-2: var(--cms-ink-2);
  --ink-3: var(--cms-ink-3);
  --muted: var(--cms-muted);
  --line: var(--cms-line);
  --line-2: var(--cms-line-2);
  --surface: var(--cms-surface);
  --surface-2: var(--cms-surface-2);
  --bg: var(--cms-bg);
  --bg-2: var(--cms-bg-2);
  --primary: var(--cms-primary);
  --accent: var(--cms-accent);
  --brand-indigo: var(--cms-brand-indigo);
  --radius-card: var(--cms-radius-card);
  --radius-sm: var(--cms-radius-sm);
  --gap-river: var(--cms-gap-river);
  --shadow-sm: var(--cms-shadow-sm);
  --shadow: var(--cms-shadow);
  --shadow-lg: var(--cms-shadow-lg);
  --font-display: var(--cms-font-display), "Poppins", system-ui, sans-serif;
  --font-ui: var(--cms-font-ui), "Plus Jakarta Sans", system-ui, sans-serif;
  --scale: 1;
  --chip-bg: var(--cms-surface);
}

/* -- Compartilhadas usadas pelo artigo -- */
.artigos-scope .wrap { max-width: var(--site-max-width, 80rem); margin: 0 auto; padding: 0 1rem; width: 100%; }
.artigos-scope .crumbs { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.artigos-scope .crumbs a:hover { color: var(--accent); }
.artigos-scope .crumbs .sep { opacity: .5; }
.artigos-scope .crumbs .cur { color: var(--ink-2); }
.artigos-scope .tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-weight: 800; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; padding: 5px 10px; border-radius: 7px; white-space: nowrap; }
.artigos-scope .tag--solid { color: #fff; }
.artigos-scope .meta-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.artigos-scope .meta-row .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.artigos-scope .author { display: flex; align-items: center; gap: 10px; }
.artigos-scope .author__av { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--font-display); font-size: 14px; }
.artigos-scope .author__name { font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.2; }
.artigos-scope .widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px; }
.artigos-scope .widget__head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.artigos-scope .widget__head .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.artigos-scope .widget__head h3 { font-size: 16.5px; font-weight: 700; margin: 0; }
.artigos-scope .widget__list { display: flex; flex-direction: column; gap: 14px; }

/* ============================================================
   PÁGINA DO ARTIGO (portado de article.css — escopado)
   ============================================================ */
.artigos-scope .wrap-narrow { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

/* barra de leitura */
.artigos-scope .readbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; transform-origin: 0 0; z-index: 9999; background: linear-gradient(90deg, var(--cms-accent, #2563eb), var(--cms-primary, #2563eb)); transition: transform .08s linear; }

/* header centralizado */
.artigos-scope .article__head { padding-top: 30px; text-align: center; }
.artigos-scope .article__head .crumbs { justify-content: center; }
.artigos-scope .article__title { font-family: var(--font-display); font-size: calc(44px * var(--scale)); line-height: 1.08; font-weight: 800; margin: 16px auto 0; max-width: 880px; text-wrap: balance; color: var(--ink); letter-spacing: -.02em; }
.artigos-scope .article__dek { font-size: calc(20px * var(--scale)); line-height: 1.5; color: var(--ink-2); max-width: 720px; margin: 20px auto 0; font-weight: 400; }
/* Bloco de metadados: 720px centrado, autor à esquerda, share à direita.
   text-align: left sobrescreve o text-align: center do article__head pai. */
.artigos-scope .article__meta { display: flex; align-items: center; justify-content: space-between; max-width: 720px; margin: 28px auto 0; padding-top: 22px; border-top: 1px solid var(--line); text-align: left; }

/* hero rounded */
.artigos-scope .article__hero { position: relative; margin: 34px 0 0; border-radius: 22px; overflow: hidden; aspect-ratio: 21/9; box-shadow: var(--shadow); background: var(--surface-2); }
.artigos-scope .article__hero img { width: 100%; height: 100%; object-fit: cover; }
.artigos-scope .article__hero .thumb__art { position: absolute; inset: 0; }
.artigos-scope .article__heroRating { position: absolute; right: 24px; bottom: 24px; background: rgba(12,13,20,.7); backdrop-filter: blur(8px); border-radius: 16px; padding: 12px 18px; display: flex; flex-direction: column; align-items: center; color: #fff; }
.artigos-scope .article__heroRating .n { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; }
.artigos-scope .article__heroRating .l { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #C6C8D6; margin-top: 4px; }

/* grid de corpo */
.artigos-scope .article__grid { display: grid; grid-template-columns: 200px minmax(0, 720px) 320px; gap: 48px; justify-content: center; margin-top: 50px; }
.artigos-scope .sticky-rail { position: sticky; top: 100px; }

/* TOC */
.artigos-scope .toc { border-left: 2px solid var(--line); padding-left: 18px; }
.artigos-scope .toc__title { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.artigos-scope .toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.artigos-scope .toc a { font-size: 14px; font-weight: 600; color: var(--ink-3); line-height: 1.35; transition: .15s; display: block; }
.artigos-scope .toc a:hover { color: var(--ink); }
.artigos-scope .toc a.active { color: var(--accent); }

/* corpo */
.artigos-scope .article__body { font-family: var(--font-ui); font-size: calc(18px * var(--scale)); line-height: 1.75; color: var(--ink-2); }
.artigos-scope .article__body .ls-prose p { margin: 0 0 26px; font-size: inherit; line-height: inherit; color: inherit; }
.artigos-scope .article__body .ls-prose strong { color: var(--ink); font-weight: 700; }
.artigos-scope .article__body .ls-prose h2 { font-size: calc(28px * var(--scale)); font-weight: 700; color: var(--ink); margin: 44px 0 16px; scroll-margin-top: 100px; line-height: 1.2; font-family: var(--font-display); }
.artigos-scope .article__body .ls-prose h3 { font-size: calc(22px * var(--scale)); font-weight: 700; color: var(--ink); margin: 32px 0 12px; font-family: var(--font-display); }

/* resposta rápida (AEO) */
.artigos-scope .article__quick { border-left: 4px solid var(--accent); background: var(--surface); border-radius: 14px; padding: 18px 20px; margin: 0 0 30px; box-shadow: var(--shadow-sm); }
.artigos-scope .article__quick-label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 6px; }
.artigos-scope .article__quick p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink); font-weight: 500; }

/* tags + author box */
.artigos-scope .article__tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.artigos-scope .tagchip { font-size: 13.5px; font-weight: 600; color: var(--ink-3); background: var(--line-2); padding: 7px 13px; border-radius: 20px; }
.artigos-scope .authorbox { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin: 32px 0; }
.artigos-scope .authorbox__by { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.artigos-scope .authorbox__name { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.artigos-scope .authorbox__role { font-size: 14px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.artigos-scope .authorbox p { font-size: 14.5px; line-height: 1.6; color: var(--ink-3); margin: 12px 0 0; }

/* Google Preferred Source badge */
.artigos-scope .gps-badge {
  display: block;
  margin-top: 18px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: .16s;
}
.artigos-scope .gps-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.artigos-scope .gps-badge__img {
  display: block;
  width: 100%;
  height: auto;
}
.artigos-scope .gps-badge__img--dark {
  display: none;
}
.artigos-scope[data-theme="dark"] .gps-badge__img--light {
  display: none;
}
.artigos-scope[data-theme="dark"] .gps-badge__img--dark {
  display: block;
}

/* navegação entre artigos (após author box) */
.artigos-scope .article-nav {
  margin: 0 0 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.artigos-scope .article-nav__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 15px;
  text-decoration: none;
  transition: .16s;
}
.artigos-scope .article-nav__card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: var(--shadow-sm);
}
.artigos-scope .article-nav__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.artigos-scope .article-nav__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.artigos-scope .article-nav__date {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.artigos-scope .article-nav__empty {
  display: none;
}

/* sharebar */
.artigos-scope .sharebar { display: flex; align-items: center; gap: 10px; }
.artigos-scope .sharebar__label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.artigos-scope .sharebar__btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; transition: .16s; text-decoration: none; }
.artigos-scope .sharebar__btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.artigos-scope .sharebar--v { flex-direction: column; margin-top: 28px; }

/* ad slot */
.artigos-scope .adslot { border: 1px dashed var(--line); border-radius: 16px; padding: 14px; text-align: center; }
.artigos-scope .adslot__tag { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.artigos-scope .adslot__box { margin-top: 10px; height: 230px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; align-content: center; gap: 10px; color: var(--ink-3); font-size: 13px; }

/* widget de produto (rail direita) */
.artigos-scope .prod { display: grid; grid-template-columns: 64px 1fr; gap: 13px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid transparent; transition: .15s; }
.artigos-scope .prod:hover { background: var(--line-2); }
.artigos-scope .prod__img { width: 64px; height: 64px; border-radius: 11px; overflow: hidden; position: relative; }
.artigos-scope .prod__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.artigos-scope .prod__brand { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
.artigos-scope .prod__name { font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.artigos-scope .prod__price { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--primary); margin-top: 1px; }

/* ── Mídia responsiva — max-width: 100% evita overflow de img/video/iframe ── */
.artigos-scope img,
.artigos-scope video,
.artigos-scope iframe { max-width: 100%; height: auto; }
.artigos-scope .wrap-narrow { box-sizing: border-box; }
.artigos-scope .wrap { box-sizing: border-box; }

/* min-width: 0 no corpo evita que itens de grid transbordem a coluna (CSS Grid
   usa min-width: auto por padrão — qualquer conteúdo largo expande o item). */
.artigos-scope .article__body { min-width: 0; }
.artigos-scope .article__rail-left,
.artigos-scope .article__rail-right { min-width: 0; }

/* Textos longos e URLs não quebram o layout */
.artigos-scope .article__title { overflow-wrap: break-word; word-break: break-word; }
.artigos-scope .article__body .ls-prose { overflow-wrap: break-word; }

/* ── Rail widget em mobile (fica oculto acima de 1080px) ── */
.artigos-scope .article__mobile-rail { display: none; margin-bottom: 28px; }

@media (max-width: 1180px) {
  .artigos-scope .article__grid { grid-template-columns: minmax(0, 720px) 320px; }
  .artigos-scope .article__rail-left { display: none; }
}

@media (max-width: 1080px) {
  /* minmax(0,1fr) em vez de 1fr: força a coluna a poder encolher até 0,
     resolvendo o overflow quando o conteúdo é mais largo que o viewport. */
  .artigos-scope .article__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
  .artigos-scope .article__rail-right { display: none; }
  .artigos-scope .article__mobile-rail { display: block; }
}

@media (max-width: 720px) {
  /* Títulos */
  .artigos-scope .article__title { font-size: 28px; letter-spacing: -.015em; }
  .artigos-scope .article__dek  { font-size: 17px; }

  /* Corpo do artigo: fonte levemente menor para melhor leitura no mobile */
  .artigos-scope .article__body { font-size: 16px; }

  /* Meta: coluna em telas pequenas */
  .artigos-scope .article__meta { flex-direction: column; align-items: flex-start; gap: 14px; }

  /* Hero: proporção mais "quadrada" no mobile — 16:9 */
  .artigos-scope .article__hero { border-radius: 14px; aspect-ratio: 16/9; }

  /* Author box: empilha no mobile */
  .artigos-scope .authorbox { flex-direction: column; gap: 14px; }

  .artigos-scope .article-nav { grid-template-columns: 1fr; }

  /* Padding lateral menor para ganhar espaço de leitura */
  .artigos-scope .wrap-narrow { padding: 0 16px; }
  .artigos-scope .wrap { padding: 0 12px; }

  /* Reduz gap da grid no mobile */
  .artigos-scope .article__grid { margin-top: 24px; }
}
