/*
 * ProfVictor (wolf-wp-child), typography refinements
 * Foco em prosa de leitura: .content (single + page).
 * Versão: 1.0.0
 */

.content {
  hyphens: auto;
  -webkit-hyphens: auto;
  font-feature-settings: "kern", "liga", "calt";
}

.content p {
  /* font-size definido no bloco abaixo com --content-font-scale */
  line-height: var(--lh-loose);
  text-wrap: pretty;
  color: var(--ink);
}

.content p + p {
  margin-top: 1em;
}

.content h2,
.content h3,
.content h4 {
  text-wrap: balance;
  letter-spacing: -0.012em;
}

.content h2 { line-height: var(--lh-snug); margin-block: 1.75em 0.6em; }
.content h3 { line-height: var(--lh-normal); margin-block: 1.4em 0.4em; }
.content h4 { line-height: var(--lh-normal); margin-block: 1.2em 0.35em; }

.content ul,
.content ol {
  padding-inline-start: 1.5em;
  line-height: var(--lh-loose);
}
.content li { margin-bottom: 0.4em; }
.content li:last-child { margin-bottom: 0; }
.content li > ul,
.content li > ol { margin-top: 0.4em; }

/* Links inline em prosa, underline moderno */
.content p a,
.content li a,
.content blockquote a {
  text-decoration: underline;
  text-decoration-color: var(--primary-200);
  text-decoration-color: color-mix(in srgb, var(--primary) 45%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.18s ease;
}
.content p a:hover,
.content li a:hover,
.content blockquote a:hover {
  text-decoration-color: var(--primary);
}

/* Selection */
.content ::selection,
.article-header ::selection,
.page-header ::selection,
.page-body ::selection {
  background: var(--primary);
  color: #fff;
}

/* Mobile-first refinements */
@media (max-width: 720px) {
  /* font-size do .content p gerenciado pelo clamp() de --fs-base */
  .content h2 { margin-block: 1.5em 0.5em; }
  .content h3 { margin-block: 1.2em 0.35em; }
}

@media (prefers-reduced-motion: reduce) {
  .content p a,
  .content li a,
  .content blockquote a { transition: none; }
}

/* === text-size === */
:root {
  --content-font-scale: 1;
}

.content p,
.content li,
.content blockquote {
  font-size: calc(var(--fs-base) * var(--content-font-scale));
}
/* @media (max-width: 720px) removido. clamp() de --fs-base ja gerencia mobile. */

/* Glyph "Aa" no botao toggle (mesmo tamanho dos SVG vizinhos) */
/* Painel de opcoes */
.text-size-options {
  display: flex;
  gap: 8px;
  padding: 10px;
  margin-top: 6px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
}
.text-size-options[hidden] { display: none; }

.text-size-option {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.text-size-option > span:first-child { line-height: 1; }
.text-size-option:nth-child(1) > span:first-child { font-size: 14px; }
.text-size-option:nth-child(2) > span:first-child { font-size: 18px; }
.text-size-option:nth-child(3) > span:first-child { font-size: 24px; }

.text-size-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.text-size-option[aria-pressed="true"] {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
}

.text-size-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .text-size-option { transition: none; }
}
/* === /text-size === */

/* === text-size-headings === */
.content h2 {
  font-size: calc(var(--fs-2xl) * var(--content-font-scale)) !important;
}
.content h2::before {
  font-size: calc(var(--fs-2xl) * var(--content-font-scale)) !important;
}
.content h3 {
  font-size: calc(var(--fs-xl) * var(--content-font-scale)) !important;
}
.content h4 {
  font-size: calc(var(--fs-lg) * var(--content-font-scale)) !important;
}
/* @media (max-width: 600px) removido. clamp() de --fs-2xl gerencia mobile. */
/* === /text-size-headings === */
