/* ===================================================================
   Aesthetic Curator — Hub personal · estilos y sistema de temas
   Variables en formato "r g b" para soportar opacidad de Tailwind.
   =================================================================== */

/* ---------- TEMAS ---------- */
html[data-theme="light"] {
  --bg: 255 249 237;
  --surface: 255 249 237;
  --surface-lowest: 255 255 255;
  --surface-low: 249 243 232;
  --surface-c: 243 237 226;
  --surface-high: 237 231 221;
  --surface-highest: 232 226 215;
  --surface-variant: 232 226 215;
  --surface-muted: 223 209 188;
  --surface-dim: 223 217 207;
  --surface-dark: 30 30 30;
  --on-bg: 29 27 21;
  --on-variant: 68 71 72;
  --primary: 10 10 10;
  --on-primary: 255 255 255;
  --primary-container: 33 33 33;
  --accent: 148 74 0;        /* naranja por defecto */
}
html[data-theme="dark"] {
  --bg: 18 18 18;
  --surface: 30 30 30;
  --surface-lowest: 10 10 10;
  --surface-low: 36 36 36;
  --surface-c: 42 42 42;
  --surface-high: 52 52 52;
  --surface-highest: 60 60 60;
  --surface-variant: 52 52 52;
  --surface-muted: 64 60 54;
  --surface-dim: 24 24 24;
  --surface-dark: 10 10 10;
  --on-bg: 240 236 228;
  --on-variant: 176 174 168;
  --primary: 245 245 245;
  --on-primary: 18 18 18;
  --primary-container: 232 226 215;
  --accent: 255 142 46;      /* acento más brillante en oscuro */
}
html[data-theme="sepia"] {
  --bg: 240 230 213;
  --surface: 244 235 220;
  --surface-lowest: 250 243 230;
  --surface-low: 237 226 207;
  --surface-c: 231 219 198;
  --surface-high: 224 211 188;
  --surface-highest: 217 203 178;
  --surface-variant: 224 211 188;
  --surface-muted: 206 188 158;
  --surface-dim: 222 209 188;
  --surface-dark: 60 48 34;
  --on-bg: 60 48 34;
  --on-variant: 109 92 70;
  --primary: 45 33 22;
  --on-primary: 250 243 230;
  --primary-container: 60 48 34;
  --accent: 158 90 20;
}

html { scroll-behavior: smooth; }
body { background-color: rgb(var(--bg)); color: rgb(var(--on-bg)); }

.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.icon-fill { font-variation-settings: 'FILL' 1; }

/* ---------- COMPONENTES BASE ---------- */
.bento-card {
  border: 1px solid rgb(var(--on-bg) / 0.10);
  padding: 24px;
  background-color: rgb(var(--surface));
  transition: border-color 0.2s ease, background-color 0.3s ease;
}
.bento-card:hover { border-color: rgb(var(--on-variant) / 0.6); }

.ghost-button, .btn-ghost {
  border: 1px solid rgb(var(--on-bg) / 0.10);
  background-color: transparent;
  transition: all 0.2s ease;
}
.ghost-button:hover, .btn-ghost:hover {
  background-color: rgb(var(--primary));
  color: rgb(var(--on-primary));
  border-color: rgb(var(--primary));
}
.ghost-button:hover .material-symbols-outlined,
.btn-ghost:hover .material-symbols-outlined { color: rgb(var(--on-primary)); }

/* Botón primario sólido */
.btn-primary {
  background: rgb(var(--primary));
  color: rgb(var(--on-primary));
  transition: background-color .2s ease, transform .1s ease;
}
.btn-primary:hover { background: rgb(var(--accent)); }
.btn-primary:active { transform: scale(.98); }

/* Enlaces de navegación */
.nav-link.active {
  background-color: rgb(var(--surface-highest));
  color: rgb(var(--primary));
  font-weight: 700;
}
.nav-link.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  color: rgb(var(--primary));
}

/* ---------- ICONOS DE MARCA (redes) — integrados al color del tema ---------- */
.brand { transition: color .2s ease, transform .2s ease; }
.brand:hover { transform: translateY(-1px); }

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(var(--on-bg) / 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--on-bg) / 0.35); }

/* ---------- MODO ADMIN ---------- */
body:not(.is-admin) .admin-only { display: none !important; }
.editable { position: relative; }
body.is-admin .editable { outline: 1px dashed rgb(var(--accent) / 0.4); outline-offset: 4px; border-radius: 2px; }
body.is-admin .editable:hover { outline-color: rgb(var(--accent)); cursor: text; }

/* ---------- CAMPOS DE FORMULARIO ---------- */
.ac-input, .ac-textarea, .ac-select {
  width: 100%;
  background: rgb(var(--surface-lowest));
  border: 1px solid rgb(var(--on-bg) / 0.12);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
  color: rgb(var(--on-bg));
  transition: border-color .2s ease;
}
.ac-input:focus, .ac-textarea:focus, .ac-select:focus {
  outline: none; border-color: rgb(var(--accent));
}
.ac-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.ac-label { font-family: "JetBrains Mono"; font-size: 12px; letter-spacing: .05em;
  text-transform: uppercase; color: rgb(var(--on-variant)); margin-bottom: 6px; display: block; }

/* ---------- MODAL ---------- */
.ac-modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgb(0 0 0 / 0.45); backdrop-filter: blur(4px);
}
.ac-modal.open { display: flex; animation: fade .2s ease; }
.ac-modal-panel {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--on-bg) / 0.12);
  border-radius: 8px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: 28px; animation: pop .2s ease;
}
.ac-modal-panel.lg { max-width: 720px; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }

/* ---------- TOAST ---------- */
#ac-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 200; background: rgb(var(--primary)); color: rgb(var(--on-primary));
  padding: 12px 20px; border-radius: 999px; font-size: 13px; font-family: "JetBrains Mono";
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 30px rgb(0 0 0 / .2);
}
#ac-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- POPOVER DE TEMA ---------- */
.theme-pop {
  position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 60;
  background: rgb(var(--surface)); border: 1px solid rgb(var(--on-bg) / 0.12);
  border-radius: 8px; padding: 16px; width: 230px; display: none;
  box-shadow: 0 12px 40px rgb(0 0 0 / .15);
}
.theme-pop.open { display: block; animation: pop .15s ease; }
/* En móvil el botón de tema está en la barra superior: el menú abre hacia abajo */
#theme-pop-m { top: calc(100% + 10px); bottom: auto; }
.swatch { width: 26px; height: 26px; border-radius: 999px; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: rgb(var(--on-bg)); }

/* ---------- UTILIDADES ---------- */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prose-body p { margin-bottom: 1rem; line-height: 1.7; }
.prose-body h2 { font-size: 24px; font-weight: 600; margin: 1.5rem 0 .5rem; }
.prose-body h3 { font-size: 18px; font-weight: 600; margin: 1.25rem 0 .5rem; }
.prose-body ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 1rem; }
.prose-body blockquote { border-left: 2px solid rgb(var(--accent)); padding-left: 1rem; font-style: italic; margin: 1rem 0; color: rgb(var(--on-variant)); }
