/* =====================================================================
   Petaaf — Blog
   Estilos das paginas de artigo e da listagem do blog.
   Reutiliza os tokens de design de css/styles.css (carregado antes).
   Estrutura:
     1. Barra de progresso de leitura
     2. Layout base da pagina de blog
     3. Cabecalho do artigo (breadcrumb, titulo, meta)
     4. Capa do artigo
     5. Layout (corpo + aside)
     6. Tipografia do corpo (prose)
     7. Caixa de dica (callout)
     8. Citacao (blockquote)
     9. Resumo / takeaways
     10. FAQ
     11. Aside (compartilhar + CTA)
     12. Continue lendo (posts relacionados)
     13. Listagem do blog (blog/index.html)
     14. Responsividade
   ===================================================================== */

/* ============== 1. BARRA DE PROGRESSO DE LEITURA ============== */
.reading-progress {
  position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 200;
  background: transparent; pointer-events: none;
}
.reading-progress span {
  display: block; height: 100%; width: 0;
  background: var(--brand-gradient);
  border-radius: 0 3px 3px 0;
  transition: width .12s ease-out;
}

/* Botão flutuante "voltar ao topo" (injetado por blog.js) */
.to-top {
  position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px);
  width: 48px; height: 48px; border-radius: 50%; z-index: 150;
  background: var(--orange); color: #fff; box-shadow: var(--shadow-md);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, background-color .18s ease, visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: #ff5b29; transform: translateY(-3px); }
.to-top::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5l7 7-1.4 1.4L13 8.8V20h-2V8.8l-4.6 4.6L5 12z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5l7 7-1.4 1.4L13 8.8V20h-2V8.8l-4.6 4.6L5 12z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ================= 2. LAYOUT BASE DA PAGINA ================= */
.blog-page { background: var(--light-cream); }
.blog-page main { display: block; }

/* ================= 3. CABECALHO DO ARTIGO ================= */
.article__head {
  max-width: 800px;
  padding-block: clamp(28px, 5vw, 56px) clamp(20px, 3vw, 32px);
  text-align: center;
}

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; font-size: .82rem; font-weight: 600; color: var(--muted);
  margin-bottom: 26px;
}
.breadcrumb a { color: var(--muted); transition: color .16s ease; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb span[aria-current] { color: var(--orange); }
.breadcrumb .sep { opacity: .5; }

.article__cat {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-peach); color: var(--orange);
  font-weight: 700; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--r-pill); margin-bottom: 18px;
}
.article__cat::before {
  content: ""; width: 14px; height: 14px; background: var(--orange);
  -webkit-mask: var(--paw-mask) center/contain no-repeat;
          mask: var(--paw-mask) center/contain no-repeat;
}

.article__title {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.1rem);
  font-weight: 900; letter-spacing: -.015em; line-height: 1.08;
}
.article__dek {
  color: var(--muted); font-size: clamp(1.05rem, 1rem + .4vw, 1.22rem);
  margin: 18px auto 0; max-width: 60ch; line-height: 1.5;
}

.article__meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px; margin-top: 26px; color: var(--muted); font-size: .9rem; font-weight: 600;
}
.article__author { display: inline-flex; align-items: center; gap: 9px; color: var(--body-dark); }
.article__avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; background: var(--card-mint); border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.article__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--divider); }

/* ================= 4. CAPA DO ARTIGO ================= */
.article__cover {
  position: relative; max-width: 960px; margin: 0 auto;
  aspect-ratio: 2 / 1; border-radius: var(--r-lg); overflow: hidden;
  display: grid; place-items: center; box-shadow: var(--shadow-md);
}
.article__cover::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120px 120px at 18% 24%, rgba(255,255,255,.45), transparent 70%),
    radial-gradient(160px 160px at 82% 78%, rgba(255,255,255,.28), transparent 70%);
}
.article__cover-emoji {
  position: relative; font-size: clamp(64px, 12vw, 120px);
  filter: drop-shadow(0 10px 18px rgba(16,42,46,.22));
}
/* Capa com foto real (sobrepõe o gradiente de fallback) */
.article__cover--photo::before { display: none; }
.article__cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ================= 5. LAYOUT (CORPO + ASIDE) ================= */
.article__layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 296px;
  gap: clamp(36px, 5vw, 68px); align-items: start;
  max-width: 1040px; margin: 0 auto;
  padding-block: clamp(40px, 6vw, 72px);
}

/* ================= 6. TIPOGRAFIA DO CORPO ================= */
.article__body { min-width: 0; font-size: 1.07rem; line-height: 1.78; color: var(--body-dark); }
.article__body > p { margin-block: 1.1em; }
.article__body > p:first-child { margin-top: 0; }

/* Primeiro paragrafo em destaque (lead) */
.article__body > .lead { font-size: 1.18rem; line-height: 1.65; color: var(--title-dark); }

.article__body h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 1.95rem); font-weight: 800;
  letter-spacing: -.01em; margin-top: 1.8em; margin-bottom: .5em; scroll-margin-top: 90px;
}
.article__body h3 { font-size: 1.22rem; font-weight: 800; margin-top: 1.5em; margin-bottom: .4em; }

.article__body a { color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.article__body a:hover { color: #ff5b29; }
.article__body strong { font-weight: 700; color: var(--title-dark); }

.article__body ul, .article__body ol { margin-block: 1.1em; padding-left: 0; display: grid; gap: 12px; }
.article__body li { position: relative; padding-left: 34px; }
.article__body ul > li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px;
  background: var(--teal);
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}
.article__body ol { counter-reset: petaaf-ol; }
.article__body ol > li { counter-increment: petaaf-ol; }
.article__body ol > li::before {
  content: counter(petaaf-ol); position: absolute; left: 0; top: .12em;
  width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff;
  font-size: .8rem; font-weight: 800; display: grid; place-items: center; font-family: "Bricolage Grotesque", sans-serif;
}
.article__body ol > li { padding-left: 38px; }

/* ================= 7. CAIXA DE DICA (CALLOUT) ================= */
.callout {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
  background: var(--card-mint); border: 1px solid #cfeee6;
  border-left: 5px solid var(--teal);
  border-radius: var(--r-sm); padding: 20px 22px; margin-block: 1.8em;
}
.callout__icon {
  width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center;
  font-size: 20px; box-shadow: var(--shadow-sm); flex: none;
}
.callout__title { font-family: "Bricolage Grotesque", sans-serif; font-size: 1rem; font-weight: 800; color: var(--teal-dark); margin-bottom: 4px; }
.callout__text { font-size: .98rem; color: var(--body-dark); }

/* ================= 8. CITACAO ================= */
.article__body blockquote {
  position: relative; margin: 2em 0; padding: 8px 0 8px 30px;
  border-left: 4px solid var(--orange);
  font-family: "Fraunces", serif; font-style: italic; font-weight: 600;
  font-size: clamp(1.25rem, 1.1rem + .8vw, 1.55rem); line-height: 1.4; color: var(--title-dark);
}
.article__body blockquote cite {
  display: block; margin-top: 14px; font-family: "Bricolage Grotesque", sans-serif;
  font-style: normal; font-weight: 700; font-size: .92rem; color: var(--orange);
}
.article__body blockquote cite::before { content: "— "; }

/* ================= 9. RESUMO / TAKEAWAYS ================= */
.takeaways {
  background: var(--surface-peach); border: 1px solid var(--divider);
  border-radius: var(--r-md); padding: clamp(22px, 3vw, 30px); margin-block: 2em;
}
.takeaways__title { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; margin-bottom: 14px; }
.takeaways__title::before {
  content: ""; width: 22px; height: 22px; background: var(--orange);
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}
.takeaways ul { display: grid; gap: 12px; margin: 0; }
.takeaways li { position: relative; padding-left: 32px; font-size: 1rem; line-height: 1.5; }
.takeaways li::before {
  content: ""; position: absolute; left: 0; top: .15em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%23fff'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* ================= 10. FAQ ================= */
.faq { margin-block: 2em; }
.faq__title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 1.95rem); font-weight: 800; margin-bottom: 18px; }
.faq__item { border: 1px solid var(--divider); border-radius: var(--r-sm); background: var(--surface-warm); margin-bottom: 12px; overflow: hidden; }
.faq__item summary {
  list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; position: relative;
  font-weight: 700; color: var(--title-dark); font-size: 1.02rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--orange); transition: transform .2s ease; line-height: 1;
}
.faq__item[open] summary::after { content: "\2212"; }
.faq__item .faq__answer { padding: 0 20px 18px; color: var(--body-dark); font-size: .98rem; line-height: 1.65; }

/* ================= 11. ASIDE ================= */
.article__aside { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 18px; }
.aside__card { background: var(--surface-warm); border: 1px solid var(--divider); border-radius: var(--r-md); padding: 22px; }
.aside__card h4 { font-family: "Bricolage Grotesque", sans-serif; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

.share { display: grid; gap: 10px; }
.share__btn {
  display: inline-flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 16px; border-radius: var(--r-pill); font-weight: 700; font-size: .9rem;
  background: var(--cream); color: var(--body-dark); border: 1.5px solid var(--divider);
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background-color .16s ease;
  text-align: left;
}
.share__btn:hover { transform: translateY(-2px); border-color: var(--orange); color: var(--orange); }
.share__btn.is-copied { background: var(--chip-ok); border-color: var(--success); color: var(--teal-dark); }
.share__btn::before { content: ""; width: 18px; height: 18px; background: currentColor; flex: none; }
.share__btn--wa::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15l-1.3 4.7 4.8-1.3A10 10 0 1 0 12 2Zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .1-1.7-.1-.4-.1-.9-.3-1.6-.6-2.8-1.2-4.6-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.8 0-1.3.7-2 .9-2.2.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5.2.5.7 1.8.8 1.9.1.1.1.3 0 .5-.3.5-.5.7-.7 1-.2.2-.4.4-.2.8.2.3.9 1.5 2 2.4 1.3 1.2 2.4 1.5 2.7 1.7.3.1.5.1.7-.1.2-.2.7-.9.9-1.2.2-.3.4-.2.6-.1.3.1 1.6.8 1.9.9.3.2.5.2.5.4.1.1.1.6-.1 1.2Z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15l-1.3 4.7 4.8-1.3A10 10 0 1 0 12 2Zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .1-1.7-.1-.4-.1-.9-.3-1.6-.6-2.8-1.2-4.6-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.8 0-1.3.7-2 .9-2.2.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5.2.5.7 1.8.8 1.9.1.1.1.3 0 .5-.3.5-.5.7-.7 1-.2.2-.4.4-.2.8.2.3.9 1.5 2 2.4 1.3 1.2 2.4 1.5 2.7 1.7.3.1.5.1.7-.1.2-.2.7-.9.9-1.2.2-.3.4-.2.6-.1.3.1 1.6.8 1.9.9.3.2.5.2.5.4.1.1.1.6-.1 1.2Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.share__btn--x::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.2 2H21l-6.5 7.4L22 22h-6l-4.7-6.1L5.9 22H3l7-8L2 2h6.2l4.2 5.6L18.2 2Zm-2.1 18h1.6L8 3.7H6.3L16.1 20Z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.2 2H21l-6.5 7.4L22 22h-6l-4.7-6.1L5.9 22H3l7-8L2 2h6.2l4.2 5.6L18.2 2Zm-2.1 18h1.6L8 3.7H6.3L16.1 20Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.share__btn--copy::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 9h10v12H9zM5 3h10v2H7v12H5z' /%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 9h10v12H9zM5 3h10v2H7v12H5z'/%3E%3C/svg%3E") center/contain no-repeat; }

.cta-card { background: var(--brand-gradient); border: none; color: #fff; text-align: left; }
.cta-card h4 { color: rgba(255,255,255,.85); }
.cta-card .cta-card__head { font-family: "Fraunces", serif; font-size: 1.25rem; font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 8px; }
.cta-card p { font-size: .92rem; opacity: .95; margin-bottom: 16px; }
.cta-card .btn--primary { background: #fff; color: var(--orange); box-shadow: 0 10px 22px rgba(16,42,46,.2); width: 100%; }
.cta-card .btn--primary:hover { background: #fff; color: #ff5b29; }
.cta-card .btn--primary .btn__paw { background: var(--orange); }

/* ================= 12. CONTINUE LENDO ================= */
.related { background: var(--cream); border-top: 1px solid var(--divider); padding-block: clamp(48px, 7vw, 84px); }
.related__title { font-size: clamp(1.7rem, 1.1rem + 2vw, 2.4rem); font-weight: 800; margin-bottom: 28px; }
.related__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }

.rpost { background: var(--surface-warm); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .22s ease, box-shadow .22s ease; }
.rpost:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.rpost a { display: block; color: inherit; }
.rpost__media { aspect-ratio: 16/10; position: relative; display: grid; place-items: center; font-size: 50px; }
.rpost__cat { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(255,255,255,.92); color: var(--orange); font-weight: 700; font-size: .7rem; padding: 4px 11px; border-radius: 999px; }
.bcard__media img, .rpost__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rpost__body { padding: 16px 18px 20px; }
.rpost__body h3 { font-size: 1.05rem; font-weight: 800; line-height: 1.2; }
.rpost__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 700; color: var(--orange); font-size: .86rem; }
.rpost__more::after { content: "\2192"; transition: transform .2s ease; }
.rpost:hover .rpost__more::after { transform: translateX(4px); }

/* ================= 13. LISTAGEM DO BLOG ================= */
.blog-hero {
  background:
    radial-gradient(800px 440px at 85% -10%, var(--cream-strong), transparent 60%),
    radial-gradient(640px 420px at -6% 20%, #fff7ef, transparent 55%),
    var(--cream);
  padding-block: clamp(40px, 6vw, 80px) clamp(28px, 4vw, 48px);
  text-align: center;
}
.blog-hero__title { font-size: clamp(2.2rem, 1.3rem + 3.6vw, 3.4rem); font-weight: 900; letter-spacing: -.015em; }
.blog-hero__lead { color: var(--muted); font-size: clamp(1.05rem, 1rem + .4vw, 1.2rem); margin: 18px auto 0; max-width: 56ch; }

.bloglist { padding-block: clamp(36px, 5vw, 64px); background: var(--light-cream); }
.bloglist__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }

.bcard { background: var(--surface-warm); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .22s ease, box-shadow .22s ease; display: flex; flex-direction: column; }
.bcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.bcard a { display: flex; flex-direction: column; height: 100%; color: inherit; }
.bcard__media { aspect-ratio: 16/9; position: relative; display: grid; place-items: center; font-size: 64px; }
.bcard__cat { position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(255,255,255,.92); color: var(--orange); font-weight: 700; font-size: .72rem; padding: 5px 13px; border-radius: 999px; }
.bcard__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.bcard__body h2 { font-size: 1.28rem; font-weight: 800; line-height: 1.2; }
.bcard__body p { color: var(--muted); font-size: .92rem; margin-top: 10px; line-height: 1.5; }
.bcard__meta { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.bcard__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 700; color: var(--orange); font-size: .9rem; }
.bcard__more::after { content: "\2192"; transition: transform .2s ease; }
.bcard:hover .bcard__more::after { transform: translateX(4px); }

/* ================= 14. RESPONSIVO ================= */
@media (max-width: 900px) {
  .article__layout { grid-template-columns: 1fr; }
  .article__aside { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .article__aside { grid-template-columns: 1fr; }
  .article__cover { aspect-ratio: 3 / 2; }
  .article__body { font-size: 1.02rem; }
}
