/* FG Import — blog (/blog/ e /blog/<post>/, gerados por scripts/gerar-site.mjs)
   Usa as peças de css/style.css (.title, .pill, .btn, .section, .wrap)
   e de css/produtos.css (.p-hero, .migalha, .p-cta, .p-cards, .p-foto, .p-zoom) */

/* o atributo hidden precisa vencer o display dos componentes abaixo */
.b-card[hidden], .b-rede[hidden] { display: none; }

/* ---------- topo ---------- */

.b-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.b-hero--lista .b-hero__grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.b-hero--post .b-hero__grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }

/* página do blog: o post em destaque (fixado no painel ou o mais recente) ocupa a coluna da direita */
.b-destaque { position: relative; overflow: hidden; border-radius: var(--raio); color: var(--tinta); background: var(--papel); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9); }
.b-destaque__img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--nevoa); }
.b-destaque__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.b-destaque__texto { padding: clamp(22px, 2.6vw, 32px); }
.b-destaque__rotulo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .8125rem; font-weight: 700; color: var(--floresta); }
.b-destaque__rotulo::before { content: ""; order: -1; width: 7px; height: 7px; margin-right: -6px; border-radius: 50%; background: var(--sol); }
.b-destaque__rotulo span { padding: 3px 11px; border-radius: var(--raio-pill); background: var(--nevoa); }
.b-destaque__titulo { margin-top: 12px; font-size: clamp(1.25rem, 1.05rem + .8vw, 1.625rem); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--floresta); text-wrap: balance; }
.b-destaque__resumo { margin-top: 10px; font-size: .9375rem; color: var(--tinta-suave); }

/* título do post: frase comum (sem caixa alta), porque os títulos de post são longos */
.b-hero__titulo { margin-top: 18px; max-width: 26ch; font-size: clamp(1.875rem, 1.25rem + 2.1vw, 3rem); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; color: var(--papel); text-wrap: balance; }
.b-hero__titulo--longo { max-width: 30ch; font-size: clamp(1.75rem, 1.2rem + 1.75vw, 2.625rem); }
.migalha + .b-hero__titulo { margin-top: 28px; }
.b-hero__cat { text-decoration: none; transition: background-color .2s; }
.b-hero__cat:hover { background: rgba(246, 248, 240, .26); }
.b-hero--post .migalha li[aria-current] { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 28px; font-size: .875rem; color: rgba(246, 248, 240, .8); }
.b-meta li { display: inline-flex; align-items: center; gap: 8px; }
.b-meta svg { flex: none; width: 17px; height: 17px; fill: none; stroke: var(--salvia-clara); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* a proporção vem da foto (entre 3:4 e 3:2), definida no HTML */
.b-hero__capa { justify-self: end; width: min(100%, 480px); margin: 0; overflow: hidden; border-radius: var(--raio); background: var(--floresta); box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .85); }
.b-hero__capa img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- cards de post ---------- */

.b-lista__cab { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: clamp(32px, 4vw, 48px); }
.b-lista__cab .title { margin-top: 0; }
/* os botões de categoria (.filtros) e o "Ver mais posts" (.lista__mais) ficam em css/produtos.css */

.b-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 28px; }
.b-card { position: relative; display: flex; flex-direction: column; }
.b-card__img { position: relative; order: -1; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--raio); background: var(--nevoa); }
.b-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.b-card__cat { position: absolute; top: 14px; left: 14px; padding: 4px 11px; border-radius: var(--raio-pill); font-size: .75rem; font-weight: 700; color: var(--floresta); background: var(--papel); }
.b-card__titulo { margin-top: 18px; font-size: 1.1875rem; font-weight: 700; line-height: 1.3; color: var(--floresta); text-wrap: pretty; }
.b-card__resumo { display: -webkit-box; margin-top: 8px; overflow: hidden; font-size: .9375rem; color: var(--tinta-suave); -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }

/* o link do título cobre o card inteiro */
.b-card__titulo a, .b-destaque__titulo a { text-decoration: none; }
.b-card__titulo a::after, .b-destaque__titulo a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--raio); }
.b-card__titulo a:focus-visible, .b-destaque__titulo a:focus-visible { outline: none; }
.b-card__titulo a:focus-visible::after, .b-destaque__titulo a:focus-visible::after { outline: 3px solid var(--sol); outline-offset: 4px; }
.b-card:hover .b-card__titulo a, .b-destaque:hover .b-destaque__titulo a { text-decoration: underline; text-decoration-color: var(--sol); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.b-card__data, .b-destaque__data { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 14px; font-size: .8125rem; color: var(--tinta-suave); }
.b-card__data time + span, .b-destaque__data time + span { padding-left: 12px; border-left: 1px solid rgba(43, 69, 48, .22); }

/* ---------- texto do post ---------- */

.b-corpo { padding-top: clamp(48px, 6vw, 88px); }
.b-prosa { max-width: 720px; margin-inline: auto; font-size: 1.125rem; line-height: 1.75; color: var(--tinta); }
.b-prosa > * + * { margin-top: 1.25em; }
.b-prosa > :first-child { margin-top: 0; }
.b-prosa :is(h2, h3, h4) { margin-bottom: 0; font-weight: 700; color: var(--floresta); text-wrap: balance; scroll-margin-top: calc(var(--header-h) + 24px); }
.b-prosa h2 { margin-top: 2.1em; font-size: clamp(1.375rem, 1.15rem + .7vw, 1.75rem); line-height: 1.25; letter-spacing: -.01em; }
.b-prosa h3 { margin-top: 1.8em; font-size: 1.25rem; line-height: 1.3; }
.b-prosa h4 { margin-top: 1.6em; font-size: 1.0625rem; line-height: 1.35; }
.b-prosa :is(h2, h3, h4) + * { margin-top: .55em; }
.b-prosa strong { font-weight: 700; color: var(--floresta); }
.b-prosa a { font-weight: 600; color: var(--floresta); text-decoration-color: var(--sol); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.b-prosa a:hover { text-decoration-thickness: 3px; }
.b-prosa :is(ul, ol) { display: grid; gap: .45em; }
.b-prosa ul > li { position: relative; padding-left: 1.4em; }
.b-prosa ul > li::before { content: ""; position: absolute; left: .3em; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--salvia); }
.b-prosa ol { padding-left: 1.4em; list-style: decimal; }
.b-prosa ol > li { padding-left: .3em; }
.b-prosa ol > li::marker { font-weight: 700; color: var(--floresta); }
.b-prosa li > p + p, .b-prosa li > :is(ul, ol) { margin-top: .45em; }
.b-prosa blockquote { margin: 1.8em 0 0; padding: 6px 0 6px 24px; border-left: 3px solid var(--sol); font-size: 1.25rem; font-weight: 500; line-height: 1.55; color: var(--floresta); }
.b-prosa blockquote > * + * { margin-top: .6em; }
.b-prosa hr { height: 1px; margin-block: 2.4em; border: 0; background: rgba(43, 69, 48, .16); }
.b-prosa code { padding: .1em .35em; border-radius: 4px; font-size: .9em; background: var(--nevoa); }
.b-prosa pre { overflow-x: auto; padding: 16px 18px; border-radius: var(--raio); font-size: .875rem; background: var(--nevoa); }
.b-prosa pre code { padding: 0; background: none; }
.b-prosa table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .9375rem; }
.b-prosa :is(th, td) { padding: 10px 14px; border-bottom: 1px solid rgba(43, 69, 48, .14); text-align: left; }
.b-prosa img { border-radius: var(--raio); }

/* foto: mantém a proporção, sem passar da largura do texto nem de 500 px de altura */
.b-prosa :is(.b-figura, .b-galeria, .b-video, .b-botao) { margin-block: 2.2em; }
.b-figura { text-align: center; }
.b-figura .p-foto { width: fit-content; max-width: 100%; margin-inline: auto; background: none; }
.b-figura .p-foto img { width: auto; max-width: 100%; max-height: min(72vh, 500px); margin-inline: auto; }
.b-prosa figcaption { margin-top: 10px; font-size: .875rem; line-height: 1.5; color: var(--tinta-suave); }

.b-galeria { display: grid; gap: 14px; }
.b-galeria--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.b-galeria--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.b-galeria__foto .p-foto { aspect-ratio: 1; }
.b-galeria__foto .p-foto img { height: 100%; object-fit: cover; }
.b-galeria__foto figcaption { margin-top: 8px; font-size: .8125rem; }

/* vídeo: MP4 com controles; YouTube só carrega ao tocar; Instagram, TikTok e Vimeo carregam ao chegar perto */
.b-video__quadro { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--raio); background: var(--mata); }
.b-video__quadro :is(video, iframe) { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.b-video__quadro video { object-fit: contain; background: var(--mata); }
.b-video--vertical .b-video__quadro { width: min(100%, 340px); aspect-ratio: 9 / 16; margin-inline: auto; }
.b-video--tiktok .b-video__quadro { width: min(100%, 360px); }
.b-video--vertical figcaption { max-width: 420px; margin-inline: auto; text-align: center; }
/* o Instagram mostra perfil e botões em volta do vídeo (4:5): esta altura é o ponto de partida,
   depois js/blog.js usa a medida que o próprio Instagram informa */
.b-video--instagram .b-video__quadro { width: min(100%, 400px); aspect-ratio: auto; height: calc(min(100vw - 2 * var(--gutter), 400px) * 1.25 + 190px); margin-inline: auto; background: var(--branco); box-shadow: inset 0 0 0 1px rgba(43, 69, 48, .12); }
.b-video--instagram figcaption { max-width: 420px; margin-inline: auto; text-align: center; }
.b-embed { display: block; }
.b-embed img { width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
.b-embed__play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; color: var(--floresta); background: rgba(246, 248, 240, .94); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .65); transition: transform .2s; }
.b-embed__play svg { width: 30px; height: 30px; margin-left: 4px; fill: currentColor; }
.b-embed:hover .b-embed__play, .b-embed:focus-visible .b-embed__play { transform: scale(1.07); }

.b-botao .btn { text-align: center; }

/* ---------- compartilhar ---------- */

.b-compartilhar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; max-width: 720px; margin: clamp(48px, 6vw, 72px) auto 0; padding-top: 28px; border-top: 1px solid rgba(43, 69, 48, .14); }
.b-compartilhar__titulo { font-size: 1rem; font-weight: 700; color: var(--floresta); }
.b-compartilhar ul { display: flex; flex-wrap: wrap; gap: 10px; }
.b-rede { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 18px 8px 14px; border: 1.5px solid rgba(43, 69, 48, .22); border-radius: var(--raio-pill); background: transparent; color: var(--floresta); font-size: .875rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.b-rede:hover { border-color: var(--floresta); background: var(--floresta); color: var(--papel); }
.b-rede svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.b-rede svg path[fill] { stroke: none; }
.b-rede.is-copiado { border-color: var(--floresta); background: var(--nevoa); color: var(--floresta); }

/* ---------- responsivo ---------- */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .b-card:hover .b-card__img img, .b-destaque:hover .b-destaque__img img { transform: scale(1.04); }
}

@media (max-width: 1080px) {
  .b-hero__grid, .b-hero--lista .b-hero__grid, .b-hero--post .b-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .b-destaque { max-width: 640px; }
  .b-hero__capa { justify-self: start; width: min(100%, 460px); }
  .b-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  /* no celular a lista começa logo abaixo do título: o destaque já é o primeiro card */
  .b-hero--lista .b-destaque { display: none; }
  .b-cards { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .b-hero__capa { width: 100%; }
  .b-prosa { font-size: 1.0625rem; }
  .b-galeria--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .b-embed__play, .b-rede, .b-hero__cat { transition: none; }
}
