/* Páginas públicas do Farol. Carrega depois de theme.css e só acrescenta o que é próprio daqui (prefixo pg-).
   Tema claro por padrão; escuro pelo sistema ou pelo botão (data-theme em <html>, guardado só neste navegador). */

:root {
  color-scheme: light dark;
  --pg-beam: color-mix(in srgb, var(--accent) 15%, transparent);
  --pg-measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #8db0e6;
    --accent-contrast: #0b1220;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--bg));
    --bg: #0e141c;
    --surface: #141c27;
    --surface-2: #1b2532;
    --border: #243042;
    --border-strong: #34455b;
    --text: #e8edf4;
    --text-muted: #a9b6c7;
    --text-faint: #8393a8;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --pg-beam: color-mix(in srgb, var(--accent) 20%, transparent);
  }
}
:root[data-theme="dark"] {
  --accent: #8db0e6;
  --accent-contrast: #0b1220;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--bg));
  --bg: #0e141c;
  --surface: #141c27;
  --surface-2: #1b2532;
  --border: #243042;
  --border-strong: #34455b;
  --text: #e8edf4;
  --text-muted: #a9b6c7;
  --text-faint: #8393a8;
  --danger: #f97066;
  --danger-soft: #3a1714;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --pg-beam: color-mix(in srgb, var(--accent) 20%, transparent);
}

body.pg {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 1.0625rem;
  line-height: 1.65;
}
.pg main {
  flex: 1;
}
.pg h1,
.pg h2,
.pg h3 {
  text-wrap: balance;
}
.pg .site-header {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.pg .brand {
  font-weight: 650;
  letter-spacing: -0.01em;
}
.pg-mark {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.pg-brand-sep {
  color: var(--text-faint);
  font-weight: 400;
}
.pg-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pg .lang a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.pg-theme {
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-strong);
  font-size: 0.875rem;
}
.pg-theme[hidden] {
  display: none;
}

/* ---------- Landing ---------- */
.pg-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 11vw, 128px) 0 clamp(48px, 8vw, 88px);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
/* O feixe do farol: um único traço de luz saindo do canto, nada além disso decora a página */
.pg-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 120%;
  height: 160%;
  background: conic-gradient(
    from 196deg at 100% 0%,
    transparent 0deg,
    var(--pg-beam) 9deg,
    transparent 24deg
  );
  pointer-events: none;
}
.pg-hero .container {
  position: relative;
}
.pg-hero h1 {
  max-width: 17ch;
  margin-bottom: 0.45em;
  font-size: clamp(2.25rem, 6.4vw, 4.25rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.pg-hero .lead {
  max-width: 46ch;
  margin-bottom: 0;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--text-muted);
}
.pg-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pg-step;
}
.pg-steps li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 4px 12px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.pg-steps li::before {
  counter-increment: pg-step;
  content: counter(pg-step);
  grid-row: span 2;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.2;
}
.pg-steps h3 {
  margin: 0;
  font-size: 1.125rem;
}
.pg-steps p {
  margin: 0;
  max-width: var(--pg-measure);
  color: var(--text-muted);
}
.pg-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 6vw, 80px);
  align-items: start;
}
.pg-promises {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.pg-promises li {
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  max-width: var(--pg-measure);
}

/* ---------- Item ---------- */
.pg-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(32px, 6vw, 72px);
  padding-top: clamp(32px, 6vw, 64px);
  padding-bottom: 72px;
  align-items: start;
}
.pg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.pg-meta .pg-kind {
  color: var(--accent);
  font-weight: 600;
}
.pg-item h1 {
  max-width: 22ch;
  margin-bottom: 0.5em;
  font-size: clamp(1.875rem, 4.4vw, 3rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.pg-summary {
  max-width: var(--pg-measure);
  font-size: 1.1875rem;
  line-height: 1.6;
}
.pg-section {
  margin-top: 36px;
  max-width: var(--pg-measure);
}
.pg-section h2 {
  margin-bottom: 12px;
  font-size: 1.125rem;
}
.pg-points {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
}
.pg-why {
  margin: 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent);
}
.pg-why p {
  margin: 0 0 8px;
}
.pg-aside {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.pg-aside h2 {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 500;
}
.pg-aside dl {
  margin: 0;
}
.pg-aside dt {
  font-weight: 600;
}
.pg-aside dd {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.pg-aside .button {
  display: block;
  width: 100%;
  text-align: center;
}
.pg-talk {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.pg-talk code {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: 0.875rem/1.3 var(--mono);
  overflow-wrap: anywhere;
}
.pg-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pg-topics li {
  padding: 3px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---------- Feed do tenant ---------- */
.pg-feed-head {
  padding: clamp(36px, 6vw, 64px) 0 12px;
}
.pg-feed-head h1 {
  max-width: 24ch;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}
.pg-feed-head p {
  max-width: 52ch;
  color: var(--text-muted);
}
.pg-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pg-list > li {
  padding: 22px 0;
  border-top: 1px solid var(--border);
  max-width: 76ch;
}
.pg-list h2 {
  margin: 0 0 6px;
  font-size: 1.3125rem;
  line-height: 1.25;
}
.pg-list h2 a {
  color: var(--text);
  text-decoration: none;
}
.pg-list h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.pg-list p {
  margin: 0 0 8px;
  color: var(--text-muted);
}
.pg-pager {
  display: flex;
  gap: 12px;
  padding: 20px 0 64px;
}
.pg-empty {
  max-width: 52ch;
  padding: 40px 0 80px;
  color: var(--text-muted);
}

/* ---------- Página simples (legal, erro) ---------- */
.pg-prose {
  max-width: var(--pg-measure);
  padding: clamp(36px, 6vw, 64px) 0 80px;
}
.pg-prose h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.pg-prose ul {
  padding-left: 1.2em;
}
.pg-prose li {
  margin-bottom: 8px;
}
.pg-error {
  max-width: 52ch;
  padding: clamp(56px, 12vw, 140px) 0 120px;
}
.pg-error h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 650;
}
.pg-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
.pg-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pg-foot p {
  margin: 0;
}

@media (max-width: 860px) {
  .pg-item,
  .pg-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .pg-aside {
    position: static;
    order: 2;
  }
}
@media (max-width: 560px) {
  .pg .site-header .container {
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .pg-hero h1,
  .pg-hero .lead {
    animation: pg-rise 0.6s ease-out both;
  }
  .pg-hero .lead {
    animation-delay: 0.12s;
  }
}
@keyframes pg-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media print {
  .pg-aside .button,
  .pg-tools {
    display: none;
  }
}
