/* =========================================================================
   FKweb Social — Camada 3: Base
   Reset, tipografia, comportamento global e utilitários.
   Consome apenas tokens semânticos de tokens.css.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  /* âncoras (#post-12, #response-9) não param debaixo da barra fixa */
  scroll-padding-top: calc(var(--fk-appbar-h) + var(--fk-space-5));
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--fk-bg);
  color: var(--fk-text);
  font-family: var(--fk-font-sans);
  font-size: var(--fk-ui-base);
  line-height: var(--fk-leading-normal);
  font-weight: var(--fk-weight-regular);
  font-feature-settings: 'cv05' 1, 'cv11' 1; /* Inter: 'l' e 'a' mais legíveis */
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }

img, svg, video, canvas { display: block; max-width: 100%; }
svg { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; background: none; border: none; padding: 0; }

a {
  color: var(--fk-text-brand);
  text-decoration: none;
  transition: color var(--fk-duration-fast) var(--fk-ease);
}
a:hover { color: var(--fk-text-brand-hover); }

:focus-visible {
  outline: 2px solid var(--fk-accent);
  outline-offset: 2px;
  border-radius: var(--fk-radius-xs);
}

::selection { background: var(--fk-accent-strong); color: var(--fk-accent-contrast); }

hr { border: 0; border-top: 1px solid var(--fk-border); margin: var(--fk-space-7) 0; }

/* Barras de rolagem discretas e no tom do tema */
* { scrollbar-width: thin; scrollbar-color: var(--fk-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--fk-border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--fk-radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--fk-text-subtle); background-clip: content-box; }

/* -------------------------------------------------------------------------
   Tipografia — papéis
   ------------------------------------------------------------------------- */
.fk-h1, .fk-h2, .fk-h3, .fk-h4, .fk-h5,
.fk-titulo {
  font-family: var(--fk-font-brand);
  font-weight: var(--fk-weight-regular);
  letter-spacing: var(--fk-tracking-title);
  line-height: var(--fk-leading-snug);
  color: var(--fk-text);
}
.fk-h1 { font-size: var(--fk-ui-2xl); line-height: var(--fk-leading-tight); }
.fk-h2 { font-size: var(--fk-ui-xl); }
.fk-h3 { font-size: var(--fk-ui-lg); }
.fk-h4 { font-size: var(--fk-ui-md); }
.fk-h5 { font-size: var(--fk-ui-base); }

.fk-titulo {
  font-size: var(--fk-ui-2xl);
  line-height: var(--fk-leading-tight);
  margin: 0 0 var(--fk-space-6);
}

.fk-muted  { color: var(--fk-text-muted); }
.fk-subtle { color: var(--fk-text-subtle); }
.fk-mono   { font-family: var(--fk-font-mono); font-variant-numeric: tabular-nums; }

/* Rótulo de seção: "ÁLBUM", "POSTAGENS", "3 PESSOAS" */
.fk-section-label {
  display: block;
  font-size: var(--fk-ui-2xs);
  font-weight: var(--fk-weight-semibold);
  letter-spacing: var(--fk-tracking-wide);
  text-transform: uppercase;
  color: var(--fk-text-subtle);
  margin: 0 0 var(--fk-space-4);
}

/* Números em contadores nunca "dançam" */
.like-count, .rel-cnt, .reply-count, .trend-count, .perfil-stats strong,
.fkweb-notif__badge, .fk-welcome__score {
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
   Utilitários
   ------------------------------------------------------------------------- */
[hidden] { display: none !important; }

.inline-form { display: inline; margin: 0; }

.fk-voltar {
  display: inline-flex;
  align-self: flex-start;   /* dentro de .fkode (flex column) a área clicável não estica */
  align-items: center;
  gap: var(--fk-space-2);
  font-size: var(--fk-ui-sm);
  font-weight: var(--fk-weight-medium);
  color: var(--fk-text-muted);
  margin-bottom: var(--fk-space-5);
  padding: var(--fk-space-1) 0;
}
.fk-voltar:hover { color: var(--fk-text-brand); }

.form-dica {
  display: block;
  font-size: var(--fk-ui-xs);
  font-weight: var(--fk-weight-regular);
  color: var(--fk-text-subtle);
  margin-top: var(--fk-space-1);
  line-height: var(--fk-leading-normal);
}

.feed-vazio {
  color: var(--fk-text-subtle);
  text-align: center;
  padding: var(--fk-space-12) var(--fk-space-5);
  font-size: var(--fk-ui-base);
  line-height: var(--fk-leading-relaxed);
}

.fk-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------------------
   Movimento
   ------------------------------------------------------------------------- */
@keyframes fk-spin  { to { transform: rotate(360deg); } }
@keyframes fk-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fk-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(.94); }
  100% { transform: scale(1); }
}
/* Realce temporário ao chegar por link de notificação */
@keyframes fk-realce {
  0%   { box-shadow: 0 0 0 1px var(--fk-accent), 0 0 0 5px var(--fk-accent-tint); }
  100% { box-shadow: 0 0 0 1px transparent, 0 0 0 5px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
