/**
 * SOCIETEXT ORIGINAL DESIGN SYSTEM & ENGINE
 * - Paleta y colores editoriales originales (Papel suave, Tinta profunda, Terracota y Ocre).
 * - Barra superior limpia con contorno sutil y botones claros.
 * - Icono de perfil universal que mantiene la foto del usuario.
 * - Selector de idioma integrado.
 */

:root {
  --paper: #f7f3ea;
  --paper-soft: #fbfaf6;
  --paper-canvas: #f4efe6;
  --ink: #171d22;
  --ink-soft: #2c343b;
  --muted: #697077;
  --line: #ded7ca;
  --line-gold: rgba(176, 131, 55, 0.24);
  --forest: #1f4c40;
  --terracotta: #9b4f38;
  --ochre: #b08337;
  --blue: #2b4870;
  --white: #ffffff;
  --shadow-subtle: 0 12px 40px rgba(23, 29, 34, 0.08);
}

html,
body,
.site-shell,
main,
section,
article,
footer,
.hero,
.courtesy-menu,
.lit-v2-container,
.debates-v2-layout,
.branches-tree-layout,
.poetry-app,
.contact-v1,
.profile-page-shell {
  background-color: var(--paper-canvas) !important;
  background: var(--paper-canvas) !important;
  color: var(--ink) !important;
}

/* Tipografía original */
h1, h2, h3, h4, h5, h6,
.site-title,
.brand-wordmark,
strong, b {
  color: var(--ink) !important;
  -webkit-font-smoothing: antialiased;
}

p, label, li, td, th {
  color: var(--ink-soft) !important;
  -webkit-font-smoothing: antialiased;
}

.eyebrow, small, .meta, .card-meta, .text-muted, .profile-public-code {
  color: var(--muted) !important;
  font-weight: 600 !important;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--terracotta) !important;
}


/* Botones claros con colores originales */
.top-action-btn,
.nav-btn,
.btn-clear,
.lang-btn,
.button:not(.primary) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 8px 12px !important;
  height: 38px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  border: 1px solid var(--line-gold) !important;
  color: var(--ink) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 6px rgba(23, 29, 34, 0.04) !important;
  transition: all 0.2s ease !important;
}

.top-action-btn:hover,
.nav-btn:hover,
.btn-clear:hover,
.lang-btn:hover,
.button:not(.primary):hover {
  background: #f4eee2 !important;
  border-color: var(--terracotta) !important;
  color: #000000 !important;
  box-shadow: 0 4px 14px rgba(155, 79, 56, 0.15) !important;
  transform: translateY(-1px);
}

.button.primary,
.action-publish-btn {
  background: #191714 !important;
  color: #fff8e8 !important;
  border-color: #191714 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(23, 29, 34, 0.2) !important;
}

.button.primary *,
.action-publish-btn * {
  color: inherit !important;
}

.button.primary:hover,
.action-publish-btn:hover {
  background: #000000 !important;
  box-shadow: 0 6px 20px rgba(23, 29, 34, 0.3) !important;
  transform: translateY(-1px);
}

/* Tarjetas y paneles originales */
.card,
.panel,
.menu-option,
.discussion-card,
.essay-row,
.branch-node,
.literature-card,
.hero-logo-panel,
.menu-badge-stage,
.comment-card,
.auth-box {
  background: rgba(255, 253, 248, 0.96) !important;
  border: 1px solid rgba(222, 215, 202, 0.8) !important;
  color: var(--ink) !important;
  box-shadow: 0 4px 18px rgba(23, 29, 34, 0.05) !important;
}

input, textarea, select {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--ochre) !important;
  box-shadow: 0 0 10px rgba(176, 131, 55, 0.2) !important;
  outline: none !important;
}

/* Avatar de perfil universal con foto persistente */
.top-avatar,
.top-avatar-badge,
.nav-profile-avatar {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid rgba(176, 131, 55, 0.3) !important;
  background: #11161b !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  position: relative !important;
  transition: transform 0.15s ease, border-color 0.2s ease !important;
}

.top-avatar:hover,
.top-avatar-badge:hover {
  transform: scale(1.06) !important;
  border-color: var(--terracotta) !important;
}

.top-avatar img,
.top-avatar-badge img,
.nav-profile-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 50% !important;
}

/* Popovers interactivos originales */
.societext-popover-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(23, 29, 34, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999998;
  display: none;
}

.societext-interactive-popover {
  position: fixed;
  z-index: 1000000;
  display: none;
  background: #ffffff;
  border: 1px solid var(--line-gold);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(23, 29, 34, 0.15);
  color: var(--ink);
  box-sizing: border-box;
}

.societext-interactive-popover .popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(222, 215, 202, 0.8);
}

.societext-interactive-popover .popover-close {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.societext-interactive-popover button.popover-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.15s ease;
  text-align: left;
  font-size: 0.9rem;
}

.societext-interactive-popover button.popover-item:hover,
.societext-interactive-popover button.popover-item.is-selected {
  background: #f4eee2 !important;
  border-color: var(--terracotta) !important;
  color: #000000 !important;
}

/* Ocultar elementos móviles residuales */
.mobile-4-5-frame-shell,
.mobile-4-5-integrated-view,
.mobile-topbar-4-5,
.societext-mobile-hud,
.mobile-drawer-overlay,
.mobile-drawer,
.mobile-only {
  display: none !important;
}

.desktop-integrated-view,
.desktop-only {
  display: block !important;
}
