/* ========================================================
   Tema Global & Design System - Influencers App
   ======================================================== */

:root {
  --bg-color: oklch(0.975 0.008 235);
  --bg-card: oklch(0.996 0.006 235);
  --bg-raised: oklch(0.945 0.018 225);
  --text-primary: oklch(0.235 0.036 252);
  --text-secondary: oklch(0.465 0.035 250);
  --accent-color: oklch(0.49 0.16 244);
  --accent-hover: oklch(0.41 0.17 246);
  --accent-warm: oklch(0.62 0.16 54);
  --accent-ink: oklch(0.31 0.055 252);
  
  --vote-up: oklch(0.48 0.12 160);
  --vote-up-hover: oklch(0.39 0.11 160);
  --vote-down: oklch(0.49 0.17 28);
  --vote-down-hover: oklch(0.41 0.16 28);

  --border-color: oklch(0.875 0.018 242);
  --shadow-sm: 0 1px 2px color-mix(in oklch, var(--text-primary) 10%, transparent);
  --shadow-md: 0 12px 28px -20px color-mix(in oklch, var(--text-primary) 32%, transparent);
  --shadow-lg: 0 24px 48px -28px color-mix(in oklch, var(--text-primary) 45%, transparent);
  --card-radius: 12px;
  --transition: color 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: oklch(0.18 0.025 252);
    --bg-card: oklch(0.235 0.028 252);
    --bg-raised: oklch(0.285 0.032 252);
    --text-primary: oklch(0.965 0.009 235);
    --text-secondary: oklch(0.76 0.025 242);
    --accent-color: oklch(0.72 0.12 238);
    --accent-hover: oklch(0.8 0.11 238);
    --accent-warm: oklch(0.76 0.14 66);
    --accent-ink: oklch(0.91 0.02 238);

    --border-color: oklch(0.36 0.03 252);
    --shadow-sm: 0 1px 2px color-mix(in oklch, var(--bg-color) 70%, transparent);
    --shadow-md: 0 12px 32px -20px color-mix(in oklch, var(--bg-color) 80%, transparent);
    --shadow-lg: 0 24px 48px -28px color-mix(in oklch, var(--bg-color) 92%, transparent);
  }
}

/* Forced Theme Classes override (se o usuário clicar num toggle de tema manual) */
html.theme-light {
  --bg-color: oklch(0.975 0.008 235);
  --bg-card: oklch(0.996 0.006 235);
  --bg-raised: oklch(0.945 0.018 225);
  --text-primary: oklch(0.235 0.036 252);
  --text-secondary: oklch(0.465 0.035 250);
  --accent-ink: oklch(0.26 0.095 252);
  --border-color: oklch(0.875 0.018 242);
  --shadow-sm: 0 1px 2px color-mix(in oklch, var(--text-primary) 10%, transparent);
  --shadow-md: 0 12px 28px -20px color-mix(in oklch, var(--text-primary) 32%, transparent);
  --shadow-lg: 0 24px 48px -28px color-mix(in oklch, var(--text-primary) 45%, transparent);
}
html.theme-dark {
  --bg-color: oklch(0.18 0.025 252);
  --bg-card: oklch(0.235 0.028 252);
  --bg-raised: oklch(0.285 0.032 252);
  --text-primary: oklch(0.965 0.009 235);
  --text-secondary: oklch(0.76 0.025 242);
  --border-color: oklch(0.36 0.03 252);
  --shadow-sm: 0 1px 2px color-mix(in oklch, var(--bg-color) 70%, transparent);
  --shadow-md: 0 12px 32px -20px color-mix(in oklch, var(--bg-color) 80%, transparent);
  --shadow-lg: 0 24px 48px -28px color-mix(in oklch, var(--bg-color) 92%, transparent);
}

/* ========================================================
   Resets and Base
   ======================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    linear-gradient(115deg, color-mix(in oklch, var(--bg-raised) 54%, var(--bg-color)) 0 22rem, var(--bg-color) 22rem 58%, color-mix(in oklch, var(--accent-color) 7%, var(--bg-color)) 58%),
    repeating-linear-gradient(90deg, transparent 0 5.9rem, color-mix(in oklch, var(--border-color) 24%, transparent) 5.9rem 6rem);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent-color) 38%, transparent);
  outline-offset: 3px;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1rem, 2.4vw, 2rem) 1.25rem clamp(2rem, 5vw, 4.5rem);
}

/* ========================================================
   Typography
   ======================================================== */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 6vw, 4.9rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
p { margin-bottom: 1rem; color: var(--text-secondary); text-wrap: pretty; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 300;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: var(--text-primary);
  color: var(--bg-card);
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus {
  color: var(--bg-card);
  transform: translateY(0);
}

/* ========================================================
   Header
   ======================================================== */
header.topbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 color-mix(in oklch, var(--bg-card) 75%, transparent);
}

header.topbar .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.header-search-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-color);
  background: color-mix(in oklch, var(--bg-color) 72%, var(--bg-card));
  color: var(--text-primary);
  border-radius: 999px;
  padding: 0.72rem 0.95rem;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.header-search-input::placeholder {
  color: var(--text-secondary);
}

.header-search-input:focus {
  border-color: color-mix(in oklch, var(--accent-color) 55%, var(--border-color));
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent-color) 14%, transparent);
}

.header-search-button {
  border: 1px solid color-mix(in oklch, var(--accent-color) 42%, var(--border-color));
  background: color-mix(in oklch, var(--accent-color) 12%, var(--bg-card));
  color: var(--text-primary);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.header-search-button:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-1px);
}

/* Hover effect for header links */
.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  flex-shrink: 0;
  padding: 0.45rem 0;
  position: relative;
}

.nav-link:hover {
  color: var(--accent-color);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1rem;
  height: 2px;
  background: var(--accent-warm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.nav-link.secondary {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive Scrollable Header */
@media (max-width: 768px) {
  header.topbar {
    padding: 0.65rem 0;
  }
  
  header.topbar .nav-container {
    padding: 0 0.9rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    position: relative;
    flex-wrap: nowrap;
    gap: 0.85rem;
    white-space: nowrap;
  }

  header.topbar .nav-container::-webkit-scrollbar {
    display: none;
  }

  .nav-links-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .header-search {
    flex: 0 0 min(58vw, 250px);
    max-width: 250px;
    gap: 0.45rem;
  }

  .header-search-input {
    padding: 0.62rem 0.82rem;
    font-size: 0.88rem;
  }

  .header-search-button {
    padding: 0.62rem 0.82rem;
    font-size: 0.85rem;
  }

  /* Scroll indicator hint */
  header.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2.25rem;
    background: linear-gradient(90deg, transparent, var(--bg-card));
    pointer-events: none;
  }

  main {
    padding: 1rem 0.85rem;
  }
}

@media (min-width: 769px) {
  .nav-links-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  header.topbar::after {
    display: none;
  }
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-ink);
  letter-spacing: 0;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  transition: var(--transition);
}

.theme-toggle svg {
  display: block;
}

.theme-toggle:hover {
  background-color: var(--bg-raised);
}

/* ========================================================
   Grid Layout (Home)
   ======================================================== */
.title-section {
  text-align: left;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.title-section h1 {
  font-size: clamp(2.25rem, 6vw, 5rem);
  letter-spacing: 0;
}

.title-section p {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
}

.home-hero {
  min-height: clamp(300px, 42vh, 430px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(1.1rem, 2.4vw, 2.1rem) 0 clamp(1.35rem, 3vw, 2.4rem);
}

.home-hero-copy {
  display: grid;
  gap: clamp(1rem, 2vw, 1.45rem);
}

.home-hero-copy h1 {
  font-size: clamp(2.25rem, 4.6vw, 3.45rem);
  margin: 0;
  color: var(--text-primary);
}

.home-hero-copy p {
  font-size: clamp(1.02rem, 1.55vw, 1.14rem);
  line-height: 1.68;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-button,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.hero-button {
  padding: 0.82rem 1.1rem;
  color: var(--bg-card);
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  box-shadow: var(--shadow-md);
}

.hero-button:hover {
  color: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero-button.secondary {
  color: var(--text-primary);
  background: color-mix(in oklch, var(--bg-card) 72%, transparent);
  border-color: var(--border-color);
  box-shadow: none;
}

.hero-button.secondary:hover {
  color: var(--accent-color);
  border-color: color-mix(in oklch, var(--accent-color) 45%, var(--border-color));
  background: var(--bg-card);
}

.hero-portrait-board {
  display: grid;
  grid-template-columns: 0.82fr 1.1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.1rem);
  align-self: center;
  height: clamp(270px, 36vw, 420px);
}

.hero-portrait {
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
  border: 1px solid color-mix(in oklch, var(--border-color) 86%, var(--bg-card));
  background: var(--bg-raised);
  box-shadow: var(--shadow-md);
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.04);
}

.hero-portrait:first-child {
  grid-row: span 2;
}

.hero-portrait-caption {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.62rem 0.72rem;
  border-radius: 10px;
  background: color-mix(in oklch, var(--bg-card) 88%, transparent);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.hero-portrait-caption strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.home-section {
  margin-bottom: clamp(3rem, 7vw, 5.5rem);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1rem, 2vw, 1.45rem);
  flex-wrap: wrap;
}

.section-heading h2 {
  margin-bottom: 0.35rem;
}

.section-heading p {
  margin: 0;
}

.section-link {
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  background: color-mix(in oklch, var(--bg-card) 72%, transparent);
  padding: 0.65rem 0.95rem;
}

.section-link:hover {
  color: var(--accent-color);
  border-color: color-mix(in oklch, var(--accent-color) 50%, var(--border-color));
  background: var(--bg-card);
  transform: translateY(-1px);
}

.ranking-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.ranking-panel {
  padding: clamp(1rem, 2vw, 1.35rem);
}

.ranking-panel h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ranking-panel.is-positive h3 {
  color: var(--vote-up);
}

.ranking-panel.is-negative h3 {
  color: var(--vote-down);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ranking-list-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.88rem 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: color-mix(in oklch, var(--bg-card) 82%, var(--bg-color));
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}

.ranking-list-item:hover {
  color: inherit;
  transform: translateY(-2px);
  border-color: color-mix(in oklch, var(--accent-color) 38%, var(--border-color));
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.ranking-position {
  width: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 900;
}

.ranking-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.ranking-name-wrap {
  flex: 1;
  min-width: 0;
}

.ranking-name {
  font-weight: 850;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-context {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ranking-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-weight: 900;
  white-space: nowrap;
}

.ranking-vote-count {
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 750;
}

.ranking-percentage {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ranking-score.is-positive {
  color: var(--vote-up);
}

.ranking-score.is-negative {
  color: var(--vote-down);
}

.ranking-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.ranking-filter-pill {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.ranking-filter-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
}

.ranking-search-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 340px;
  min-width: min(100%, 340px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.4rem 0.45rem 0.4rem 1rem;
  box-shadow: var(--shadow-sm);
}

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

.ranking-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
}

.ranking-search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
}

.ranking-search-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.ranking-search-submit:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

/* ========================================================
   Cards (Authority & Product)
   ======================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklch, var(--accent-color) 45%, var(--border-color));
}

.card-header {
  position: relative;
  width: 100%;
  height: 200px;
  background-color: var(--bg-raised);
  overflow: hidden;
}

.card-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
}

.card:hover .card-header img {
  transform: scale(1.035);
}

.card-body {
  padding: clamp(1.1rem, 2vw, 1.45rem);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  letter-spacing: 0;
}

.card-title {
  font-size: 1.22rem;
  font-weight: 850;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-title-compact {
  font-size: 1.1rem;
}

.card-subtitle {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-vote-grid {
  margin-top: auto;
  padding-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.card-vote-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.76rem 0.82rem;
  border-radius: 10px;
  min-width: 0;
  font-weight: 850;
}

.card-vote-metric span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
}

.card-vote-metric strong {
  font-size: 1rem;
  white-space: nowrap;
}

.card-vote-metric.is-positive {
  color: var(--vote-up);
  background: color-mix(in oklch, var(--vote-up) 10%, var(--bg-card));
  border: 1px solid color-mix(in oklch, var(--vote-up) 28%, var(--border-color));
}

.card-vote-metric.is-negative {
  color: var(--vote-down);
  background: color-mix(in oklch, var(--vote-down) 10%, var(--bg-card));
  border: 1px solid color-mix(in oklch, var(--vote-down) 28%, var(--border-color));
}

/* ========================================================
   Voting System UI
   ======================================================== */
.vote-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-primary);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.vote-btn.up {
  color: var(--vote-up);
  background: color-mix(in oklch, var(--vote-up) 10%, var(--bg-card));
  border-color: color-mix(in oklch, var(--vote-up) 24%, var(--border-color));
}

.vote-btn.down {
  color: var(--vote-down);
  background: color-mix(in oklch, var(--vote-down) 10%, var(--bg-card));
  border-color: color-mix(in oklch, var(--vote-down) 24%, var(--border-color));
}

.vote-btn:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

.vote-btn.up:hover {
  background: color-mix(in oklch, var(--vote-up) 15%, transparent);
  border-color: var(--vote-up);
}

.vote-btn.down:hover {
  background: color-mix(in oklch, var(--vote-down) 15%, transparent);
  border-color: var(--vote-down);
}

/* ========================================================
   Detail Page (Profile & Product)
   ======================================================== */
.profile-cover {
  width: 100%;
  height: 250px;
  border-radius: var(--card-radius);
  object-fit: cover;
  margin-bottom: -60px;
  box-shadow: var(--shadow-md);
}

.profile-header {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 0 2rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--bg-color);
  object-fit: cover;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.profile-info h1 {
  margin-bottom: 0.25rem;
}

.profile-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.content-reader {
  background: var(--bg-card);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
}

.content-freshness {
  margin: 1.25rem 0 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.content-freshness-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.25rem;
  color: var(--text-primary);
  font-weight: 650;
}

.content-freshness p {
  margin: 0.45rem 0 0;
}

.content-freshness a {
  font-weight: 700;
}

.commerce-disclosure {
  margin: 0.7rem 0 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.project-reference {
  margin-top: 2.5rem;
  padding: 1.25rem 1.35rem;
  border-left: 4px solid var(--accent-color);
  background: color-mix(in oklch, var(--accent-color) 7%, var(--bg-card));
}

.project-reference h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.project-reference p {
  margin: 0;
}

.project-reference a {
  font-weight: 750;
}

.authority-meta-row {
  row-gap: 0.55rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  align-items: end;
  justify-content: space-between;
  gap: clamp(2rem, 6vw, 5rem);
  text-align: left;
}

.footer-brand {
  display: grid;
  gap: 0.55rem;
}

.footer-logo {
  color: var(--accent-ink);
  font-size: 1.15rem;
  font-weight: 850;
}

.footer-brand p {
  margin: 0;
  font-size: 0.92rem;
}

.footer-brand small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem 1.15rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--accent-color);
}

.trust-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1.25rem 0 2rem;
}

.trust-facts div,
.contact-reasons div,
.site-map-section {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: color-mix(in oklch, var(--bg-card) 88%, var(--bg-color));
  padding: 1rem;
}

.trust-facts dt {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.trust-facts dd {
  color: var(--text-primary);
  font-weight: 700;
}

.contact-reasons,
.site-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.site-map-section ul {
  margin-bottom: 0;
}

.authority-tags-row {
  align-items: center;
}

.authority-meta-inline {
  color: var(--text-secondary);
}

.authority-meta-muted {
  font-size: 0.9rem;
}

.authority-social-grid {
  align-items: center;
}

.authority-links-panel {
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent-color) 5%, var(--bg-card)), var(--bg-card));
}

/* Base Markdown Styles */
.content-reader h2, .content-reader h3 {
  margin-top: 2rem;
  color: var(--text-primary);
}

.content-reader ul, .content-reader ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.content-reader pre {
  background: oklch(0.2 0.02 250);
  color: oklch(0.96 0.01 240);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.chip-content {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.chip-content svg {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tag-chip {
  font-size: 0.85rem;
  font-weight: 600;
}

.social-chip {
  border-radius: 10px;
}

.info-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.info-chip:hover .chip-content svg {
  transform: translateX(1px) scale(1.08);
}

.tag-chip:hover {
  border-color: color-mix(in oklch, var(--accent-color) 55%, var(--border-color));
  background: color-mix(in oklch, var(--accent-color) 10%, var(--bg-card));
  color: var(--text-primary);
}

.social-chip:hover {
  border-color: color-mix(in oklch, var(--accent-color) 45%, var(--border-color));
  background: color-mix(in oklch, var(--accent-color) 8%, var(--bg-card));
  color: var(--accent-color);
}

/* ========================================================
   Product Specific
   ======================================================== */
.buy-btn {
  display: inline-block;
  background: var(--text-primary);
  color: var(--bg-card);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
  width: 100%;
}
.buy-btn:hover {
  color: var(--bg-card);
  opacity: 0.94;
  transform: translateY(-2px);
}

/* ========================================================
   Footer
   ======================================================== */
footer.bottombar {
  padding: clamp(2rem, 5vw, 3.25rem) 1.25rem;
  border-top: 1px solid var(--border-color);
  background: color-mix(in oklch, var(--bg-card) 78%, var(--bg-color));
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .home-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.4rem 0 2.4rem;
  }

  .home-hero-copy {
    gap: 1rem;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-button {
    flex: 1 1 12rem;
  }

  .hero-portrait-board {
    min-height: 300px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 170px 130px;
  }

  .hero-portrait:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .hero-portrait-caption {
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.55rem;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-link {
    width: 100%;
  }

  .card-vote-grid {
    gap: 0.5rem;
  }

  .card-vote-metric {
    padding: 0.68rem 0.7rem;
    gap: 0.45rem;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .content-reader {
    padding: 1.35rem;
    margin-bottom: 2rem;
  }

  .authority-hero {
    margin-bottom: 1.35rem !important;
  }

  .authority-hero-cover {
    height: 180px !important;
  }

  .authority-hero-body {
    padding: 0 1rem 1rem 1rem !important;
  }

  .authority-hero-avatar {
    width: 108px !important;
    height: 108px !important;
    margin-top: -54px !important;
    border-width: 4px !important;
  }

  .authority-hero-title {
    font-size: 1.9rem !important;
    margin-bottom: 0.7rem !important;
  }

  .authority-meta-row {
    gap: 0.45rem !important;
    font-size: 0.95rem !important;
    align-items: flex-start !important;
  }

  .authority-meta-row .info-chip {
    padding: 0.35rem 0.65rem;
  }

  .authority-meta-row .tag-chip {
    font-size: 0.78rem;
  }

  .authority-tags-row {
    gap: 0.45rem !important;
  }

  .authority-tags-row .info-chip {
    padding: 0.35rem 0.65rem;
  }

  .authority-meta-inline {
    width: 100%;
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.45;
  }

  .authority-meta-muted {
    font-size: 0.82rem !important;
  }

  .authority-social-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem !important;
  }

  .authority-social-grid .info-chip {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
  }

  .authority-social-grid .chip-content {
    width: 100%;
    justify-content: center;
    gap: 0.35rem;
  }

  .authority-links-panel {
    margin-top: -0.5rem !important;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.5rem;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .ranking-context {
    display: none;
  }
}

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

.authority-facts {
  margin: 0 0 2rem;
}

.authority-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.75rem;
}

.authority-fact-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.authority-fact-card span {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.authority-fact-card strong {
  color: var(--text-primary);
  font-size: 1.05rem;
}

@media (max-width: 640px) {
  .authority-facts-grid {
    display: flex;
    overflow-x: auto;
    gap: 0.65rem;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
  }

  .authority-fact-card {
    flex: 0 0 145px;
    scroll-snap-align: start;
  }
}

.site-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 8px 0;
  padding: 0 12px;
  overflow: hidden;
}
.site-ad--quiet { margin: 6px 0; }
.site-ad[hidden] { display: none; }
.site-ad-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-ad-frame {
  display: block;
  border: 0;
  overflow: hidden;
  border-radius: 8px;
}
.site-ad-native { width: 100%; overflow: hidden; }
body.site-ads-on { padding-bottom: 72px; }

/* Projetos: leitura e acesso à plataforma comercial. */
.authority-projects {
  margin-top: 2rem;
  min-width: 0;
}

.authority-project-shortcut {
  margin-top: 1rem;
}

#authority-projects-title {
  scroll-margin-top: 6rem;
}

.authority-commerce-disclosure {
  margin: 0 0 1.5rem;
}

.card-commerce {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.card-commerce-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--bg-color);
  font-size: 0.9rem;
  font-weight: 700;
}

.card-commerce-link:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--bg-raised);
}

.card-commerce-link svg {
  flex-shrink: 0;
}

.project-hero {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.project-hero-image {
  flex: 1 1 18rem;
  min-width: 0;
  max-width: 400px;
}

.project-hero-copy {
  flex: 2 1 18rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-wrap: anywhere;
}

@media (min-width: 769px) and (max-width: 1100px) {
  header.topbar .nav-container {
    overflow-x: auto;
    justify-content: flex-start;
    gap: 1rem;
    padding-block: 0.25rem;
  }

  header.topbar .nav-container > * {
    flex-shrink: 0;
  }

  .header-search {
    flex: 0 0 250px;
  }
}
