﻿/* =========================================================
   Jaqueline Gayozo · Psicanalista
   Páginas de artigo e índice de artigos.
   Carregado depois de styles.css (reaproveita tokens e shell).
   ========================================================= */

/* ---------- 1. Cabeça do artigo ---------- */
.article {
  padding-top: calc(var(--header-h) + clamp(1.5rem, 3vw, 2.5rem));
  padding-bottom: clamp(2rem, 4vw, 3.25rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.breadcrumb a { color: var(--olive); transition: color .3s var(--ease); }
.breadcrumb a:hover { color: var(--olive-dark); }
.breadcrumb li { display: flex; align-items: center; gap: .55rem; }
.breadcrumb li + li::before { content: "/"; color: var(--sand-line); }
.breadcrumb [aria-current] { color: var(--text-mute); }

.article__head { max-width: 60rem; margin-top: clamp(1.75rem, 3vw, 2.5rem); }

.article__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .9rem;
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--olive);
}
.article__kicker .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.article__kicker time,
.article__kicker .reading { color: var(--text-mute); letter-spacing: .12em; }

.article__title {
  margin-top: 1.1rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.article__lede {
  max-width: 46ch;
  margin-top: 1.5rem;
  font-size: clamp(1.1rem, 1.5vw, 1.32rem);
  line-height: 1.6;
  color: var(--text);
}

.article__byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  padding-top: clamp(1.25rem, 2.5vw, 1.75rem);
  border-top: 1px solid var(--sand-line);
  font-size: .9rem;
}
.article__byline strong { font-weight: 400; color: var(--ink); }
.article__byline span { color: var(--text-mute); }

.article__figure { margin-top: clamp(2.25rem, 4.5vw, 3.5rem); }
.article__figure .media { aspect-ratio: 16 / 9; }
.article__figure figcaption {
  margin-top: .85rem;
  font-size: .82rem;
  color: var(--text-mute);
  max-width: 60ch;
}

/* ---------- 2. Layout de leitura ---------- */
.article__layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

/* Sumário lateral */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  align-self: start;
}
.toc__label {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--sand-line);
}
.toc__list { display: grid; gap: .1rem; margin-top: .9rem; counter-reset: toc; }
.toc__list a {
  position: relative;
  display: block;
  padding: .5rem 0 .5rem 1.9rem;
  font-size: .88rem;
  line-height: 1.45;
  color: var(--text-mute);
  transition: color .3s var(--ease);
}
.toc__list a::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .5rem;
  font-family: var(--font-display);
  font-size: .82rem;
  color: var(--sand-line);
  transition: color .3s var(--ease);
}
.toc__list a:hover { color: var(--ink-soft); }
.toc__list a:hover::before { color: var(--olive-light); }
.toc__list a.is-current { color: var(--olive-dark); }
.toc__list a.is-current::before { color: var(--olive); }

/* ---------- 3. Corpo do texto ---------- */
.article__body {
  max-width: 68ch;
  font-size: clamp(1.04rem, 1.2vw, 1.16rem);
  line-height: 1.78;
  color: var(--text);
  hyphens: auto;
  text-wrap: pretty;
}
.article__body > * + * { margin-top: 1.4em; }

.article__body h2 {
  margin-top: 2.6em;
  margin-bottom: -.35em;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.article__body h3 {
  margin-top: 2em;
  margin-bottom: -.5em;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: .04em;
}

/* capitular na abertura */
.article__body > p:first-of-type::first-letter {
  float: left;
  margin: .06em .1em 0 0;
  font-family: var(--font-display);
  font-size: 4.1em;
  line-height: .78;
  font-weight: 400;
  color: var(--olive);
}

.article__body strong { font-weight: 400; color: var(--ink); }
.article__body em { font-style: italic; }

.article__body a:not(.btn) {
  color: var(--olive-dark);
  text-decoration: underline;
  text-decoration-color: var(--olive-light);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: text-decoration-color .3s var(--ease), color .3s var(--ease);
}
.article__body a:not(.btn):hover { color: var(--olive); text-decoration-color: var(--olive); }

.article__body ul,
.article__body ol { display: grid; gap: .7em; padding-left: 0; }
.article__body li { position: relative; padding-left: 1.6rem; }
.article__body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .82em;
  width: 9px;
  height: 1px;
  background: var(--olive);
}
.article__body ol { counter-reset: ol; }
.article__body ol li::before {
  counter-increment: ol;
  content: counter(ol) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  color: var(--olive);
}

/* citação em destaque */
.article__body blockquote {
  margin-top: 2.2em;
  margin-bottom: 2.2em;
  padding-left: clamp(1.25rem, 3vw, 2rem);
  border-left: 1px solid var(--olive-light);
}
.article__body blockquote p {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.32;
  color: var(--ink);
}
.article__body blockquote cite {
  display: block;
  margin-top: .9rem;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-style: normal;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* nota lateral / observação */
.note {
  margin-top: 2.2em;
  margin-bottom: 2.2em;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  background: var(--cream-soft);
  border-left: 2px solid var(--olive);
  font-size: .97rem;
  line-height: 1.7;
}
.note__label {
  display: block;
  margin-bottom: .5rem;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--olive);
}
.note > * + * { margin-top: .8em; }

/* fim do texto */
.article__end {
  margin-top: 2.6em;
  padding-top: 1.6em;
  border-top: 1px solid var(--sand-line);
  font-size: .95rem;
  color: var(--text-mute);
}
.article__end p + p { margin-top: .7em; }

/* ---------- 4. Rodapé do artigo ---------- */
.article__foot {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
  max-width: 68ch;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
  border-top: 1px solid var(--sand-line);
}

.tags { display: flex; flex-wrap: wrap; gap: .55rem; }
.tags li a,
.tags li span {
  display: block;
  padding: .45rem 1rem;
  border: 1px solid var(--sand-line);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--ink-soft);
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.tags li a:hover { color: var(--olive-dark); border-color: var(--olive-light); background: var(--white); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.share__label { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-mute); }
.share__btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.05rem;
  border: 1px solid var(--sand-line);
  font-size: .85rem;
  color: var(--ink-soft);
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.share__btn svg { width: .95rem; height: .95rem; }
.share__btn:hover { color: var(--olive-dark); border-color: var(--olive-light); background: var(--white); }
.share__status { font-size: .82rem; color: var(--olive); }

/* ---------- 5. Convite ao contato ---------- */
.invite {
  display: grid;
  gap: 1.15rem;
  justify-items: start;
  max-width: 68ch;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  background: var(--cream-soft);
}
.invite h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.14;
}
.invite p { font-size: 1rem; max-width: 48ch; }

/* ---------- 6. Leia também ---------- */
.related { padding-block: clamp(2.25rem, 4.5vw, 3.75rem); background: var(--cream-soft); }
.related__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
/* .related__link está definido em styles.css (usado também na home) */

/* ---------- 7. Índice de artigos ---------- */
.archive { padding-top: calc(var(--header-h) + clamp(1.75rem, 4vw, 3rem)); padding-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.archive__head { max-width: 62ch; margin-top: clamp(1.5rem, 3vw, 2.25rem); }

.archive__list { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* artigo em destaque no índice */
.post--feature { grid-column: 1 / -1; }
.post--feature .post__link {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.post--feature .media { margin-bottom: 0; aspect-ratio: 4 / 3; }
.post--feature .post__body { display: grid; gap: .85rem; justify-items: start; }
.post--feature h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -.01em;
  transition: color .35s var(--ease);
}
.post--feature .post__link:hover h2 { color: var(--olive-dark); }
.post--feature .post__body p { font-size: 1.02rem; max-width: 44ch; }

.post__body { display: grid; gap: .5rem; justify-items: start; }

/* ---------- 8. Página 404 ---------- */
.notfound {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 3rem) var(--gutter) 4rem;
  text-align: center;
}
.notfound__inner { display: grid; justify-items: center; gap: 1.35rem; max-width: 44ch; }
.notfound__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 300;
  line-height: 1;
  color: var(--olive);
  opacity: .35;
}
.notfound h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.1;
}

/* ---------- 9. Voltar ao topo ---------- */
.to-top {
  position: fixed;
  left: clamp(1rem, 2.5vw, 2rem);
  bottom: clamp(1rem, 2.5vw, 2rem);
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.1rem;
  background: rgba(239, 233, 223, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--sand-line);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .45s var(--ease), transform .55s var(--ease-out), color .3s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--olive-dark); }
.to-top svg { width: .9rem; height: .9rem; }

/* ---------- 10. Responsivo ---------- */
@media (max-width: 1024px) {
  .article__layout { grid-template-columns: 1fr; gap: 2rem; }
  .toc {
    position: relative;
    top: auto;
    padding: 1.25rem 1.35rem;
    background: var(--cream-soft);
  }
  .toc__list { display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; }
  .toc__list a { padding-block: .35rem; }
  .post--feature .post__link { grid-template-columns: 1fr; }
  .post--feature .media { aspect-ratio: 16 / 10; }
}

@media (max-width: 760px) {
  .article__body { font-size: 1.05rem; line-height: 1.75; }
  .article__body > p:first-of-type::first-letter { font-size: 3.4em; }
  .article__figure .media { aspect-ratio: 4 / 3; }
  .to-top { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .to-top { transition-duration: .001ms; }
}

@media print {
  .toc, .share, .invite, .related, .to-top, .breadcrumb { display: none !important; }
  .article__layout { grid-template-columns: 1fr; }
  .article__body { max-width: none; font-size: 11pt; }
}
