/* ============================================================
   PAGES.CSS – Estilos para páginas internas
   Projeto Minas 2035 | Design System v2
   ============================================================ */

/* ── PAGE HERO (menor que o hero da home) ───────────────── */
.page-hero {
  position: relative;
  padding-top: calc(var(--navbar-h) + var(--sp-16));
  padding-bottom: var(--sp-16);
  background: var(--bg);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(0,229,255,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 90% 90%, rgba(79,70,229,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--trans-fast);
}

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

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.4;
}

.breadcrumb-current {
  color: var(--text-secondary);
}

/* Page hero title */
.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-4);
  color: var(--text-primary);
}

.page-hero .page-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--sp-8);
  max-width: 640px;
}

/* Quick stats strip */
.page-stats {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.page-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.page-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.page-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ── PAGE LAYOUT (conteúdo + sidebar TOC) ───────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--sp-16);
  align-items: start;
  padding-block: var(--sp-16);
}

/* ── TABLE OF CONTENTS (sidebar) ────────────────────────── */
.toc {
  position: sticky;
  top: calc(var(--navbar-h) + var(--sp-6));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
}

.toc-title {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.toc-list a {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  transition: all var(--trans-fast);
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0,229,255,0.05);
}

.toc-list a.toc-sub {
  font-size: var(--text-xs);
  padding-left: var(--sp-5);
  color: var(--text-muted);
}

/* ── ARTICLE CONTENT ────────────────────────────────────── */
.article-content {
  min-width: 0;
}

/* Section divider with label */
.content-section {
  padding-bottom: var(--sp-12);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-12);
}

.content-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.content-section h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
}

.content-section h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
}

.content-section p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--sp-4);
}

.content-section ul,
.content-section ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.content-section ul li,
.content-section ol li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.65;
}

.content-section ul li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 8px;
}

.content-section ol {
  counter-reset: ol-counter;
}

.content-section ol li {
  counter-increment: ol-counter;
}

.content-section ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── METRIC CARDS ────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-block: var(--sp-8);
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  transition: all var(--trans-med);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-grad);
}

.metric-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow-cyan);
}

.metric-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.metric-value {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.metric-unit {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--sp-2);
}

.metric-trend.up { color: var(--color-success); }
.metric-trend.down { color: var(--color-error); }

/* ── TIMELINE ────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-block: var(--sp-8);
  position: relative;
  padding-left: var(--sp-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-indigo));
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  padding-bottom: var(--sp-8);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--sp-8) + 2px);
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

.timeline-year {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: var(--sp-2);
}

.timeline-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── QUOTE BLOCK ─────────────────────────────────────────── */
.quote-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--sp-6) var(--sp-8);
  margin-block: var(--sp-8);
}

.quote-block blockquote {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: var(--sp-3);
}

.quote-block cite {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: normal;
}

/* ── BENCHMARK TABLE ─────────────────────────────────────── */
.bench-table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--sp-8);
  font-size: var(--text-sm);
}

.bench-table th {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: var(--bg-surface);
}

.bench-table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.bench-table tr:last-child td { border-bottom: none; }

.bench-table tr:hover td {
  background: rgba(0,229,255,0.03);
}

.bench-table .td-highlight {
  color: var(--text-primary);
  font-weight: 600;
}

.bench-table .td-accent {
  color: var(--accent-cyan);
  font-family: var(--font-heading);
  font-weight: 700;
}

/* ── REFERENCE LIST ──────────────────────────────────────── */
.reference-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-block: var(--sp-6);
}

.reference-item {
  display: flex;
  gap: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  padding: var(--sp-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.reference-num {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  flex-shrink: 0;
  height: fit-content;
  margin-top: 2px;
}

.reference-item a {
  color: var(--accent-cyan);
}

/* ── TAG LIST ────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-block: var(--sp-4);
}

.tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.18);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  transition: all var(--trans-fast);
}

.tag:hover {
  background: rgba(0,229,255,0.15);
  color: var(--text-primary);
}

/* ── CALLOUT BOX ─────────────────────────────────────────── */
.callout {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--radius-xl);
  margin-block: var(--sp-6);
}

.callout-info {
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.18);
}

.callout-warning {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.18);
}

.callout-icon {
  flex-shrink: 0;
  width: 20px;
  margin-top: 2px;
  color: var(--accent-cyan);
}

.callout-warning .callout-icon { color: var(--color-warning); }

.callout p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ── PROJECT CARDS ───────────────────────────────────────── */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-4);
  align-items: start;
  transition: all var(--trans-med);
}

.project-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-cyan);
}

.project-card h4 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.project-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.55;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
}

.status-proposal {
  background: rgba(79,70,229,0.12);
  border: 1px solid rgba(79,70,229,0.25);
  color: #818cf8;
}

.status-active {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--color-success);
}

.status-study {
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.22);
  color: var(--accent-cyan);
}

/* ── RESPONSIVE (páginas internas) ──────────────────────── */
@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  .toc { display: none; }
}

@media (max-width: 768px) {
  .page-hero h1 {
    font-size: var(--text-3xl);
  }
  .page-stats {
    gap: var(--sp-5);
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bench-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
