/* ============================================
   MUNDO COLMEIA — Documentacao Estrategica
   Editorial / Magazine Design System
   ============================================ */

/* --- Design Tokens --- */
:root {
  --mc-ambar:       #C4832A;
  --mc-ambar-light: #D4A04A;
  --mc-ambar-dark:  #9A6620;
  --mc-preto:       #1A1A1A;
  --mc-branco:      #F5F0E8;
  --mc-branco-pure: #FDFAF5;
  --mc-azul:        #1E3A5F;
  --mc-azul-light:  #2A4F7A;
  --mc-verde:       #3D6B4A;
  --mc-verde-light: #4E8A5E;

  --font-heading: Georgia, 'Playfair Display', 'Times New Roman', serif;
  --font-body:    system-ui, 'Nunito', -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --sidebar-w:    240px;
  --content-max:  900px;
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;

  --shadow-card:    0 2px 12px rgba(26, 26, 26, 0.06), 0 1px 4px rgba(26, 26, 26, 0.04);
  --shadow-elevated: 0 8px 32px rgba(26, 26, 26, 0.10), 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow-hover:   0 12px 40px rgba(26, 26, 26, 0.12), 0 4px 12px rgba(26, 26, 26, 0.08);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--mc-branco);
  color: var(--mc-preto);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--mc-preto);
  color: var(--mc-branco);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 2rem 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(245, 240, 232, 0.08);
}

.sidebar-brand h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mc-ambar);
  margin-bottom: 0.25rem;
}

.sidebar-brand span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  color: rgba(245, 240, 232, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--duration-fast) ease,
              background var(--duration-fast) ease,
              padding-left var(--duration-normal) var(--ease-out-expo);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--mc-branco);
  background: rgba(245, 240, 232, 0.04);
  padding-left: 1.5rem;
}

.sidebar-nav a.active {
  color: var(--mc-ambar);
  border-left-color: var(--mc-ambar);
  background: rgba(196, 131, 42, 0.08);
}

.sidebar-nav a .nav-icon {
  font-size: 1rem;
  width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(245, 240, 232, 0.08);
  font-size: 0.68rem;
  opacity: 0.35;
  text-align: center;
}

/* --- Mobile Toggle --- */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--mc-preto);
  color: var(--mc-branco);
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-fast) ease;
}

.sidebar-toggle:active {
  transform: scale(0.92);
}

/* --- Main Content Area --- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2.5rem 4rem;
  flex: 1;
}

/* --- Toolbar (Copy + Print) --- */
.toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.06);
}

.toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(26, 26, 26, 0.12);
  border-radius: var(--radius-sm);
  background: var(--mc-branco-pure);
  color: var(--mc-preto);
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.toolbar button:hover {
  background: var(--mc-preto);
  color: var(--mc-branco);
  border-color: var(--mc-preto);
}

.toolbar button.copied {
  background: var(--mc-verde);
  color: white;
  border-color: var(--mc-verde);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--mc-preto);
  line-height: 1.25;
}

h1 {
  font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--mc-ambar);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--mc-azul);
  position: relative;
  padding-left: 0.75rem;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  background: var(--mc-ambar);
  border-radius: 2px;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--mc-preto);
}

h4 {
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--mc-azul);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}

p {
  margin-bottom: 1.25rem;
}

strong {
  font-weight: 700;
  color: var(--mc-preto);
}

/* --- Links --- */
.main-content a {
  color: var(--mc-azul);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--duration-fast) ease;
}

.main-content a:hover {
  color: var(--mc-ambar);
}

/* --- Lists --- */
ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: var(--mc-ambar);
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

thead th {
  background: var(--mc-azul);
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.06);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: rgba(30, 58, 95, 0.025);
}

tbody tr:hover {
  background: rgba(196, 131, 42, 0.04);
}

/* --- Code --- */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(26, 26, 26, 0.06);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--mc-preto);
  color: var(--mc-branco);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.84rem;
  line-height: 1.6;
  box-shadow: var(--shadow-card);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* --- Blockquotes --- */
blockquote {
  border-left: 4px solid var(--mc-ambar);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: rgba(196, 131, 42, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: rgba(26, 26, 26, 0.8);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* --- Horizontal Rule --- */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(26, 26, 26, 0.12), transparent);
  margin: 2.5rem 0;
}

/* ============================================
   INDEX PAGE — Cards & Hero
   ============================================ */

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  margin-bottom: 2rem;
  position: relative;
}

.hero::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--mc-ambar);
  margin: 2rem auto 0;
  border-radius: 2px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 2rem + 3vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--mc-preto);
  margin-bottom: 0.75rem;
  border-bottom: none;
  padding-bottom: 0;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem);
  font-style: italic;
  color: var(--mc-ambar-dark);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.hero-subtitle {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.45);
  font-weight: 600;
}

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 3rem;
}

.doc-card {
  background: var(--mc-branco-pure);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--mc-preto);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform var(--duration-normal) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo);
  border: 1px solid rgba(26, 26, 26, 0.04);
  position: relative;
  overflow: hidden;
}

.doc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--mc-ambar);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.doc-card:hover::before {
  transform: scaleX(1);
}

.doc-card .card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.doc-card .card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mc-azul);
}

.doc-card .card-desc {
  font-size: 0.85rem;
  color: rgba(26, 26, 26, 0.6);
  line-height: 1.5;
}

.doc-card .card-arrow {
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mc-ambar);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--duration-fast) ease,
              transform var(--duration-normal) var(--ease-out-expo);
}

.doc-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* --- Executive Summary --- */
.exec-summary {
  margin: 3rem 0;
  padding: 2.5rem;
  background: var(--mc-branco-pure);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(26, 26, 26, 0.04);
}

.exec-summary h2 {
  margin-top: 0;
  text-align: center;
  padding-left: 0;
}

.exec-summary h2::before {
  display: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
  padding: 1.25rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--mc-branco);
  transition: transform var(--duration-fast) ease;
}

.stat-item:hover {
  transform: scale(1.03);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.4rem);
  font-weight: 700;
  color: var(--mc-ambar);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(26, 26, 26, 0.5);
  margin-top: 0.4rem;
}

.stat-detail {
  font-size: 0.75rem;
  color: rgba(26, 26, 26, 0.4);
  margin-top: 0.25rem;
  font-style: italic;
}

/* --- Section Title --- */
.section-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mc-ambar);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.78rem;
  color: rgba(26, 26, 26, 0.35);
  border-top: 1px solid rgba(26, 26, 26, 0.06);
  margin-top: auto;
}

.site-footer a {
  color: var(--mc-ambar);
  text-decoration: none;
}

/* --- Badge (Score) --- */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--mc-verde);
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(61, 107, 74, 0.3);
}

.score-badge.score-high {
  background: var(--mc-verde);
}

.score-badge.score-medium {
  background: var(--mc-ambar);
}

.score-badge.score-low {
  background: #C0392B;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--duration-normal) var(--ease-out-expo);
    box-shadow: var(--shadow-elevated);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .main-content {
    padding: 4rem 1.25rem 3rem;
  }

  .hero {
    padding: 3rem 1rem 2rem;
  }

  .hero-title {
    letter-spacing: 0.04em;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .exec-summary {
    padding: 1.5rem;
  }

  .toolbar {
    justify-content: center;
  }

  table {
    font-size: 0.8rem;
  }

  thead th,
  tbody td {
    padding: 0.5rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-item {
    padding: 1rem 0.5rem;
  }
}

/* --- Sidebar Overlay --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible {
  display: block;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .sidebar,
  .sidebar-toggle,
  .sidebar-overlay,
  .toolbar {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .main-content {
    max-width: 100%;
    padding: 0;
  }

  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  h1 {
    border-bottom-color: #333;
  }

  h2 {
    color: #333;
  }

  h2::before {
    background: #333;
  }

  a {
    color: #333;
    text-decoration: underline;
  }

  table {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  thead th {
    background: #333;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  pre {
    border: 1px solid #ccc;
    background: #f5f5f5 !important;
    color: #333 !important;
    box-shadow: none;
  }

  .doc-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .hero::after {
    background: #333;
  }
}
