/* =====================================================
   Páginas de modelos gratuitos (/modelos/*)
   Depende de styles.css (vars, botões) e seo-page.css
   ===================================================== */

/* Primeira tela: texto + botões à esquerda, preview à direita.
   Em 1366x768 os botões precisam ficar visíveis sem rolar. */
.modelo-hero {
  padding: 36px 0 28px;
}

.modelo-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 0 36px;
  align-items: start;
}

/* Texto e botões na coluna 1; preview ocupa as duas linhas da coluna 2. */
.modelo-hero__preview {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.modelo-hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.12;
  margin: 12px 0 10px;
}

.modelo-hero__intro {
  max-width: 56ch;
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.modelo-botoes {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.modelo-botoes .btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
}

.modelo-botoes .btn:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.modelo-botoes small {
  font-weight: 500;
  opacity: 0.85;
}

.modelo-hero__nota {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Convite para o app colado nos downloads: botão logo depois do último, legenda curta embaixo.
   Os detalhes do arquivo ficam recolhidos para o convite não descer em celular pequeno. */
.modelo-app {
  display: grid;
  gap: 6px;
  max-width: 420px;
  margin-top: 10px;
}

.modelo-app .btn.btn-outline-custom {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  /* styles.css define o botão contorno com !important; aqui ele precisa se distinguir dos downloads. */
  border-color: var(--brand, #7a563e) !important;
  background: rgba(122, 86, 62, 0.06) !important;
}

.modelo-app p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
}

.modelo-detalhes {
  max-width: 420px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.modelo-detalhes summary {
  cursor: pointer;
  width: fit-content;
  font-weight: 700;
}

.modelo-detalhes p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.modelo-detalhes p[hidden] {
  display: none;
}

@media (max-width: 991px) {
  .modelo-app,
  .modelo-detalhes {
    max-width: none;
  }
}

/* Seletor de ano (planner): sem JS os dois anos aparecem; com JS fica um por vez. */
.modelo-anos {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.modelo-anos button {
  min-width: 84px;
  min-height: 40px;
  padding: 6px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-dark, #5a3e2b);
  font-weight: 800;
  cursor: pointer;
}

.modelo-anos button[aria-selected="true"] {
  background: var(--brand, #7a563e);
  color: #fff;
}

.modelo-anos button:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.modelo-ano + .modelo-ano {
  margin-top: 24px;
}

.modelo-ano[hidden],
.modelo-preview[hidden] {
  display: none;
}

.modelo-preview + .modelo-preview {
  margin-top: 16px;
}

.modelo-destaque {
  max-width: 56ch;
  margin: -6px 0 22px;
  padding: 12px 16px;
  border-left: 4px solid var(--brand, #7a563e);
  border-radius: 6px;
  background: var(--paper);
  line-height: 1.6;
}

/* Preview: imagem da primeira folha sempre no HTML (é o LCP e o fallback);
   o PDF em <iframe> só em tela grande com ponteiro. O iframe é lazy e fica
   display:none no celular, então o navegador nem baixa o PDF lá. */
.modelo-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}

.modelo-preview__link {
  display: block;
}

.modelo-preview__img {
  display: block;
  width: 100%;
  height: auto;
}

.modelo-preview__pdf {
  display: none;
  width: 100%;
  height: 520px;
  border: 0;
  background: #f1ece7;
}

.modelo-preview__legenda {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 992px) and (hover: hover) {
  .modelo-preview__pdf {
    display: block;
  }

  .modelo-preview__link {
    display: none;
  }
}

/* Breadcrumb visível (Início › Modelos › modelo) */
.modelo-breadcrumb {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.modelo-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  text-underline-offset: 3px;
}

.modelo-breadcrumb a:hover,
.modelo-breadcrumb a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
}

.modelo-breadcrumb span[aria-hidden] {
  margin: 0 6px;
}

.modelo-breadcrumb [aria-current] {
  color: var(--title);
  font-weight: 650;
}

/* Hub /modelos */
.modelo-hub__hero {
  padding-bottom: 8px;
}

.modelo-hub__hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.12;
  margin: 12px 0 10px;
}

.modelo-hub__lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.modelo-hub__item {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.modelo-hub__thumb {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.modelo-hub__thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.modelo-secao .modelo-hub__texto h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.modelo-hub__texto h2 a {
  color: var(--brand-dark);
  text-decoration: none;
  text-underline-offset: 4px;
}

.modelo-hub__texto h2 a:hover,
.modelo-hub__texto h2 a:focus-visible {
  text-decoration: underline;
}

.modelo-hub__texto p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.65;
}

.modelo-hub__formatos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modelo-hub__formatos span {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Conteúdo abaixo do download */
.modelo-secao {
  padding: 56px 0;
}

.modelo-secao--contraste {
  background: var(--paper-warm);
  border-block: 1px solid var(--line);
}

.modelo-secao h2 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modelo-secao h3 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
  font-weight: 750;
}

.modelo-secao p,
.modelo-secao li {
  color: var(--muted);
  line-height: 1.75;
}

.modelo-secao p {
  margin: 0 0 12px;
}

.modelo-secao strong {
  color: var(--title);
}

.modelo-lista {
  margin: 0;
  padding-left: 22px;
}

.modelo-lista li + li {
  margin-top: 8px;
}

.modelo-passos {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: passo;
  display: grid;
  gap: 14px;
}

.modelo-passos li {
  position: relative;
  padding-left: 46px;
  counter-increment: passo;
}

.modelo-passos li::before {
  content: counter(passo);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.modelo-passos li strong {
  display: block;
  margin-bottom: 2px;
}

/* Tabela de exemplos de escrita */
.modelo-tabela {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.95rem;
}

.modelo-tabela th,
.modelo-tabela td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  line-height: 1.6;
}

.modelo-tabela th {
  background: var(--paper-warm);
  color: var(--title);
  font-weight: 750;
}

.modelo-tabela td:first-child {
  color: var(--accent);
}

.modelo-tabela td:last-child {
  color: var(--ink);
}

/* Figura da ficha na seção "o que vem" */
.modelo-figura {
  margin: 20px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.modelo-figura img {
  display: block;
  width: 100%;
  height: auto;
}

.modelo-figura figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

/* Frase-ponte para o produto: uma linha, sem destaque */
.modelo-ponte {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  line-height: 1.7;
}

.modelo-ponte a {
  color: var(--brand-dark);
  font-weight: 700;
  text-underline-offset: 4px;
}

@media (max-width: 991px) {
  .modelo-hero {
    padding-top: 26px;
  }

  .modelo-hero__grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 22px;
  }

  /* No celular o preview vem entre a frase e os botões, com altura contida. */
  .modelo-hero__preview {
    grid-column: auto;
    grid-row: auto;
    order: 2;
  }

  .modelo-hero__acoes {
    order: 3;
  }

  .modelo-preview__img {
    max-height: 200px;
    object-fit: cover;
    object-position: top;
  }

  .modelo-botoes {
    max-width: none;
  }

  /* Rótulo em cima, detalhe embaixo: sem quebra no meio do texto. */
  .modelo-botoes .btn {
    flex-direction: column;
    gap: 0;
    padding-block: 10px;
    line-height: 1.3;
  }

  .modelo-botoes small {
    font-size: 0.82rem;
  }

  .modelo-secao {
    padding: 44px 0;
  }

  .modelo-tabela {
    font-size: 0.9rem;
  }

  .modelo-hub__item {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Vitrine de afiliados (arquivos em /vitrine/, gerados por tools/vitrine no app) */
.modelo-secao .vitrine {
  margin-top: 32px;
}

.modelo-atalhos {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.modelo-atalhos .vitrine-atalho {
  justify-self: start;
}

/* Espaços de anúncio: só aparecem quando recebem uma unidade do AdSense. Altura reservada
   para o texto não pular; ficam a pelo menos uma seção dos downloads e da vitrine. */
.modelo-anuncio {
  width: min(calc(100% - 40px), 760px);
  min-height: 280px;
  margin: 8px auto;
  padding-top: 22px;
  position: relative;
}

.modelo-anuncio::before {
  content: "Publicidade";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modelo-anuncio[hidden] {
  display: none;
}
