/* CARINA BUENO — SITE STYLES v2
   Sistema de cores via CSS variables pra suportar dark mode.
*/

:root {
  --bg: #FCFBF7;
  --text: #0A0A0A;
  --text-strong: #0A0A0A;
  --text-muted: #5C5A55;
  --text-subtle: #8A8580;
  --surface: #F2EDE4;
  --border: rgba(10,10,10,0.15);
  --border-strong: rgba(10,10,10,0.4);
  --accent: #1D1DFF;
  --accent-on: #FCFBF7;
  --shadow: 0 8px 20px rgba(0,0,0,0.15);
  --shadow-strong: 0 20px 50px rgba(0,0,0,0.18);
  --scale: 1;
}

[data-theme="dark"] {
  --bg: #0F0E0C;
  --text: #F0EDE5;
  --text-strong: #FFFFFF;
  --text-muted: #A8A29B;
  --text-subtle: #6B6560;
  --surface: #1D1B18;
  --border: rgba(240,237,229,0.15);
  --border-strong: rgba(240,237,229,0.4);
  --accent: #6B6BFF;
  --accent-on: #0A0A0A;
  --shadow: 0 8px 20px rgba(0,0,0,0.4);
  --shadow-strong: 0 20px 50px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: calc(16px * var(--scale)); }
body {
  background: var(--bg);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }

.page { max-width: 1240px; margin: 0 auto; padding: 40px 60px 40px; }
@media (max-width: 800px) { .page { padding: 30px 24px 40px; } }

/* ─── NAV ─────────────────────────────────────── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  letter-spacing: 3.5px;
  font-weight: 500;
  gap: 20px;
}
.nav-brand { font-weight: 500; }
.nav-menu {
  display: flex;
  gap: 24px;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  flex: 1;
  justify-content: center;
}
.nav-menu a { transition: color 0.2s; }
.nav-menu a:hover { color: var(--accent); }
.nav-menu a.active { color: var(--text); border-bottom: 2px solid var(--text); padding-bottom: 2px; }

.nav-right { display: flex; gap: 20px; align-items: center; }

.lang { display: flex; gap: 14px; align-items: baseline; }
.lang .active { color: var(--text); border-bottom: 2px solid var(--text); padding-bottom: 3px; }
.lang span:not(.active) { color: var(--text-muted); cursor: pointer; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  font-family: inherit;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ─── HAMBURGER (mobile only) ─────────────────── */
.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}
.hamburger-btn:hover { border-color: var(--accent); }
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.2s;
  transform-origin: center;
}
.hamburger-btn.active span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.25s;
}
.nav-backdrop.visible { display: block; opacity: 1; }

@media (max-width: 800px) {
  .nav { flex-wrap: nowrap; gap: 12px; align-items: center; }
  .nav-brand { flex: 1; font-size: 15px; letter-spacing: 3px; }
  .nav-right { gap: 10px; }
  .nav-right .lang { font-size: 12px; }
  .theme-toggle { width: 36px; height: 36px; font-size: 14px; }
  .hamburger-btn { display: inline-flex; }

  /* Menu vira drawer lateral */
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 78%;
    max-width: 320px;
    background: var(--bg);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 90px 32px 32px;
    gap: 28px;
    z-index: 99;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.15);
    overflow-y: auto;
    order: initial;
    width: 78%;
    overflow-x: hidden;
    padding-bottom: 32px;
  }
  .nav-menu.open { transform: translateX(0); }
  .nav-menu a {
    font-size: 22px;
    letter-spacing: -0.01em;
    padding: 10px 0;
    border-bottom: none;
    width: 100%;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    text-transform: lowercase;
  }
  .nav-menu a::first-letter { text-transform: uppercase; }
  .nav-menu a.active { color: var(--accent); border-bottom: none; }
}

/* ─── STRIP (subhead) ─────────────────────────── */
.subhead {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--accent);
  font-weight: 500;
  gap: 20px;
  flex-wrap: wrap;
}
.subhead .services-inline {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 3px;
}
.divider { border-top: 1px solid var(--border); margin-top: 22px; }

/* ─── FOOTER ──────────────────────────────────── */
.footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── ROTATING BADGE ──────────────────────────── */
.badge svg circle { fill: var(--accent); }
.badge svg text { fill: var(--accent-on); }

/* ─── ARCHIVE (tabela expansível) ─────────────── */
.archive-toggle { margin-top: 60px; }
.archive-expand {
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 500;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  justify-content: center;
  transition: background 0.2s;
}
.archive-expand:hover { background: var(--surface); }
.archive-expand .chevron {
  display: inline-block;
  transition: transform 0.35s ease;
  font-size: 16px;
}
.archive-expand.open .chevron { transform: rotate(180deg); }

.archive-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s ease;
}
.archive-content.open { max-height: 8000px; }

.archive-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  gap: 2rem;
  flex-wrap: wrap;
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 500;
}
.archive-filter {
  background: none;
  border: none;
  font: inherit;
  letter-spacing: inherit;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.archive-filter:hover { color: var(--accent); }
.archive-filter.active { color: var(--text); border-bottom-color: var(--text); }
.archive-filter .count { color: var(--text-subtle); margin-left: 0.4rem; font-size: 10px; }

.archive-search {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 500;
}
.archive-search input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text);
  padding: 6px 0;
  font: inherit;
  letter-spacing: 2px;
  color: var(--text);
  outline: none;
  width: 220px;
}
.archive-search input::placeholder { color: var(--text-subtle); }

.archive-counter {
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 500;
}
.archive-counter strong { color: var(--accent); font-weight: 500; }

.archive-table-wrap {
  max-height: 560px;
  overflow-y: auto;
  border: 1px solid var(--border);
  margin-top: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}
.archive-table-wrap::-webkit-scrollbar { width: 10px; }
.archive-table-wrap::-webkit-scrollbar-track { background: transparent; }
.archive-table-wrap::-webkit-scrollbar-thumb {
  background: var(--text-subtle);
  border-radius: 4px;
  border: 2px solid var(--bg);
}
.archive-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.archive-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
  text-align: left;
  padding: 14px 12px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--text);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.archive-table thead th:hover { color: var(--accent); }
.archive-table thead th .arrow {
  font-size: 10px;
  color: var(--text-subtle);
  margin-left: 0.4rem;
}
.archive-table thead th.sorted-asc .arrow::after { content: '↑'; color: var(--accent); }
.archive-table thead th.sorted-desc .arrow::after { content: '↓'; color: var(--accent); }
.archive-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s, color 0.12s;
}
.archive-table tbody tr:hover td { background: rgba(29,29,255,0.05); }
[data-theme="dark"] .archive-table tbody tr:hover td { background: rgba(107,107,255,0.08); }
.archive-table th.col-active, .archive-table td.col-active {
  background: var(--text) !important;
  color: var(--bg) !important;
}
.archive-table th.col-active .arrow { color: var(--bg) !important; }
/* Tags dentro de célula ativa: inverte cores pra continuar visíveis */
.archive-table td.col-active .type-qc {
  color: var(--bg) !important;
  border-color: var(--bg) !important;
}

.archive-title-cell {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 16px;
}
.archive-title-cell .mubi-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.archive-title-cell .mubi-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.archive-title-cell .mubi-link::after {
  content: ' ↗';
  font-size: 10px;
  font-style: normal;
  opacity: 0.4;
  margin-left: 2px;
}
.archive-title-cell .mubi-link:hover::after { opacity: 1; }
.type-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 2px;
}
.type-traducao { background: var(--accent); color: var(--accent-on); }
.type-qc { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.type-sdh { background: #7A2432; color: #FCFBF7; }
[data-theme="dark"] .type-sdh { background: #C25060; color: #0A0A0A; }

.archive-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 20px;
}

/* ─── CTA POPUP ───────────────────────────────── */
.cta-popup {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 22px 28px;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  transform: translateX(-140%);
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.cta-popup.visible { transform: translateX(0); }
.cta-popup-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 20px;
  margin-bottom: 6px;
  padding-right: 20px;
  color: var(--text);
}
.cta-popup-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}
.cta-popup-actions {
  display: flex;
  gap: 10px;
}
.cta-btn {
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
  flex: 1;
  text-align: center;
}
.cta-btn:hover { transform: scale(1.03); }
.cta-btn-primary { background: var(--accent); color: var(--accent-on); }
.cta-btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.cta-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
}
.cta-close:hover { color: var(--text); }
@media (max-width: 500px) {
  .cta-popup { left: 12px; right: 12px; max-width: none; bottom: 12px; }
}

/* ─── BEFORE/AFTER SLIDER ─────────────────────── */
.before-after {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.ba-container { position: relative; width: 100%; height: 100%; }
.ba-before, .ba-after {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
/* .ba-after fica por cima e é recortada por clip-path */
.ba-after {
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}
.ba-divider {
  position: absolute;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-on);
  transform: translateX(-50%);
  pointer-events: none;
  will-change: left;
}
.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-on);
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.ba-labels {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 500;
  color: #FCFBF7;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

/* ─── SERVICES INLINE (rodapé de cada página) ── */
.services-strip {
  margin-top: 40px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}
.services-strip span { display: inline-block; margin: 0 8px; }
.services-strip .service-label { color: var(--text); }
