/* ============================================================================
   NotionMod CSS — sistema de estilos base reutilizable para los mods de DST.
   ----------------------------------------------------------------------------
   CÓMO USARLO / BUENAS PRÁCTICAS
   ============================================================================
   • Nombre del sistema : "nm" (Notion Mod). TODAS las clases llevan el prefijo
     `nm-` para evitar colisiones cuando varios mods cargan estilos juntos.
   • Personalización    : un mod concreto define sus propias variables CSS en
     su raíz (`.nm-mod-<mod>`) o como clase extra, sobrescribiendo las variables
     `--nm-*` a su gusto. No hace falta tocar las reglas.
   • Temas de color     : los callouts y acentos usan variables `--nm-color-*`.
     Si quieres una paleta distinta por mod, cambia esas variables.
   • No modifiques aquí : las reglas son compartidas. Lo que cambia por mod va
     en variables o en un overrides.css específico del mod.

   VARIABLES DEL TEMA (definidas en :root, ajustables por mod)
     --nm-font-sans      tipografía base
     --nm-blue           color acento principal (barras, títulos, badges)
     --nm-blue-soft      fondo suave del acento
     --nm-bg             fondo de la página
     --nm-text           color de texto principal
     --nm-callout-yellow / -brown / -teal   colores de los callouts
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Tokens / variables de tema
--------------------------------------------------------------------------- */
:root {
  --nm-font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Display", "Segoe UI", Helvetica, Arial, sans-serif;

  --nm-blue: #3f8fd6;
  --nm-blue-2: #5eb2e6;
  --nm-blue-soft: #dceefa;
  --nm-blue-ink: #2d7eb0;
  --nm-blue-link: #1a5f96;

  --nm-bg: #ffffff;
  --nm-bg-soft: #f7f6f3;
  --nm-card: #ffffff;

  --nm-text: rgb(55, 53, 47);
  --nm-text-soft: rgba(55, 53, 47, 0.6);
  --nm-text-faint: rgba(55, 53, 47, 0.42);
  --nm-line: rgba(55, 53, 47, 0.09);

  --nm-radius: 14px;
  --nm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --nm-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);

  --nm-callout-yellow-bg: #fbf7e3;
  --nm-callout-yellow-bd: #e9c45a;
  --nm-callout-yellow-tx: #6b5312;
  --nm-callout-brown-bg: #f5ede9;
  --nm-callout-brown-bd: #cf927b;
  --nm-callout-brown-tx: #6f4a3a;
  --nm-callout-teal-bg: #e8f1ec;
  --nm-callout-teal-bd: #6fae8c;
}

/* ---------------------------------------------------------------------------
   2. Reset / base
--------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--nm-font-sans);
  color: var(--nm-text);
  line-height: 1.6;
  background: var(--nm-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

strong {
  color: var(--nm-text);
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   3. Layout / shell
   `.nm-shell`        contenedor raíz de la página (barra + vista)
   `.nm-bar`          barra superior fija (selector de idioma)
   `.nm-view`         contenedor central del contenido
--------------------------------------------------------------------------- */
.nm-shell {
  min-height: 100vh;
}

/* Barra superior + idiomas: ver ../../../../assets/bar.css */

.nm-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* ---------------------------------------------------------------------------
   4. Marca de la barra (ver ../../../../assets/bar.css)
--------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   5. Selector de idiomas (ver ../../../../assets/bar.css)
   `.nm-lang-switch`    contenedor en pastilla
   `.nm-lang-btn`       cada idioma
   `.nm-lang-btn.is-active`  estado seleccionado
--------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   6. Portada y encabezado
   `.nm-cover`   imagen de portada
   `.nm-head`    bloque centrado (ícono + título + subtítulo)
   `.nm-head-icon`  ícono del mod
   `.nm-title`   título de la página
   `.nm-subtitle`
--------------------------------------------------------------------------- */
.nm-cover {
  position: relative;
  border-radius: 0 0 var(--nm-radius) var(--nm-radius);
  overflow: hidden;
  margin-bottom: -46px;
}

.nm-cover img {
  height: 260px;
  width: 100%;
  object-fit: cover;
  object-position: center 10%;
}

.nm-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.28));
}

.nm-head {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 8px 8px;
  text-align: center;
}

.nm-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  font-size: 3.1rem;
  background: #fff;
  border: 1px solid var(--nm-line);
  border-radius: 18px;
  box-shadow: var(--nm-shadow-md);
}

.nm-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 18px 0 6px;
}

.nm-subtitle {
  color: var(--nm-text-soft);
  font-size: 1.05rem;
  margin: 0 0 30px;
}

/* ---------------------------------------------------------------------------
   7. Cuerpo de la página (flujo tipográfico)
--------------------------------------------------------------------------- */
.nm-body > * {
  margin: 1.1em 0;
}

.nm-text {
  margin: 0.6em 0;
}

/* Variantes de color del párrafo (editor: Párrafo → Color). */
.nm-text--soft {
  color: var(--nm-text-soft);
}
.nm-text--blue {
  color: var(--nm-blue-ink);
}
.nm-text--brown {
  color: var(--nm-callout-brown-tx);
}

/* Enlace en bloque (editor: Enlace). Una sola ancla + href editable. */
.nm-link {
  display: inline-block;
  margin: 0.6em 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--nm-blue-ink);
  background: linear-gradient(135deg, var(--nm-blue-soft), #eaf4fb);
  border: 1px solid rgba(63, 143, 214, 0.25);
  text-decoration: none;
  transition: filter 0.15s, transform 0.15s;
}

.nm-link::after {
  content: " ↗";
}

/* Variante interna (misma página / #ancla): flecha recta. */
.nm-link--internal::after {
  content: " →";
}

.nm-link:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.nm-link:empty::before {
  content: "(enlace sin texto)";
  opacity: 0.5;
  font-weight: 400;
}

/* Lista genérica (editor: Ítem de lista). No confundir con
   .nm-changelog-list, que vive dentro de la tarjeta del changelog. */
.nm-list {
  margin: 12px 0;
  padding: 6px 18px 6px 38px;
  text-align: left;
}

.nm-list li {
  margin: 7px 0;
  line-height: 1.55;
  text-align: left;
}

.nm-list li::marker {
  color: var(--nm-blue);
  font-weight: 700;
}

.nm-section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 1.6em 0 0.4em;
  scroll-margin-top: 80px;
}

.nm-section-title::before {
  content: "";
  display: inline-block;
  vertical-align: 0.28em;
  width: 8px;
  height: 30px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--nm-blue-2), var(--nm-blue));
  margin-right: 12px;
}

.nm-rule {
  border: none;
  height: 1px;
  background: var(--nm-line);
  margin: 34px 0;
}

/* ---------------------------------------------------------------------------
   8. Intro del mod (icono + texto de arranque)
--------------------------------------------------------------------------- */
.nm-mod-intro {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 34px;
}

.nm-mod-intro .nm-mod-icon {
  flex: 0 0 auto;
}

.nm-mod-intro .nm-mod-icon img {
  width: 120px;
  aspect-ratio: 1;
  border-radius: 16px;
  box-shadow: var(--nm-shadow-sm);
}

.nm-mod-intro .nm-leading {
  flex: 1 1 auto;
  font-size: 1.08rem;
}

/* ---------------------------------------------------------------------------
   9. Tarjetas de características
   `.nm-features`      lista contenedora
   `.nm-feature`       tarjeta individual
   `.nm-feature-badge`  icono/número al inicio
   `.nm-feature-title`
   `.nm-feature-text`
   `.nm-feature-text .nm-mark`  palabra destacada en azul
--------------------------------------------------------------------------- */
.nm-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 22px 0;
}

.nm-feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--nm-card);
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  padding: 20px 22px;
  box-shadow: var(--nm-shadow-sm);
}

.nm-feature-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--nm-blue-soft), #eaf4fb);
  color: var(--nm-blue-ink);
  font-weight: 800;
  font-size: 1.15rem;
}

.nm-feature-body {
  flex: 1 1 auto;
  min-width: 0;
}

.nm-feature-title {
  font-weight: 700;
  font-size: 1.08rem;
  margin: 0 0 6px;
  display: block;
}

.nm-feature-text {
  margin: 0;
  color: var(--nm-text);
}

.nm-feature-text .nm-mark {
  font-weight: 600;
  color: var(--nm-blue-ink);
}

/* ---------------------------------------------------------------------------
   10. Callouts / notas destacadas
    Uso: `.nm-callout` + modificador de color
    `.nm-callout--yellow` / `--brown` / `--teal`
--------------------------------------------------------------------------- */
.nm-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--nm-radius);
  padding: 14px 18px;
  margin: 16px 0;
  border-left: 4px solid transparent;
}

.nm-callout .nm-callout-icon {
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1.5;
}

.nm-callout p {
  margin: 0;
}

.nm-callout--yellow {
  background: var(--nm-callout-yellow-bg);
  border-color: var(--nm-callout-yellow-bd);
  color: var(--nm-callout-yellow-tx);
}

.nm-callout--brown {
  background: var(--nm-callout-brown-bg);
  border-color: var(--nm-callout-brown-bd);
  color: var(--nm-callout-brown-tx);
}

.nm-callout--teal {
  background: var(--nm-callout-teal-bg);
  border-color: var(--nm-callout-teal-bd);
}

/* ---------------------------------------------------------------------------
   10b. Citas (1 slot: insignia + texto; el "título" se hace con negrita).
   Visual de tarjeta como .nm-feature pero standalone (sin .nm-features).
   Uso: `.nm-quote` + `.nm-quote-badge` + `<p data-i18n>`
--------------------------------------------------------------------------- */
.nm-quote {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--nm-card);
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  padding: 20px 22px;
  margin: 16px 0;
  box-shadow: var(--nm-shadow-sm);
}

.nm-quote .nm-quote-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--nm-blue-soft), #eaf4fb);
  color: var(--nm-blue-ink);
  font-weight: 800;
  font-size: 1.15rem;
}

.nm-quote p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

/* ---------------------------------------------------------------------------
   11. Imágenes / figuras
--------------------------------------------------------------------------- */
.nm-figure {
  margin: 22px 0;
  text-align: center;
}

.nm-figure img {
  border-radius: var(--nm-radius);
  box-shadow: var(--nm-shadow-md);
  border: 1px solid var(--nm-line);
  max-width: 100%;
  display: inline-block;
  height: auto;
  vertical-align: middle;
}

/* Alineación del bloque de imagen (editor: Imagen → Alinear). */
.nm-figure--left {
  text-align: left;
}

.nm-figure--center {
  text-align: center;
}

.nm-figure--right {
  text-align: right;
}

/* Párrafo con imagen lateral (editor: Párrafo → Imagen).
   La imagen va a la izquierda por defecto (sin centrar) con una altura
   acorde al texto; el alto se ajusta solo si la imagen es más apaisada. */
.nm-pimg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0.6em 0;
}

.nm-pimg > p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.nm-pimg > img {
  flex: 0 0 auto;
  height: 76px;
  width: auto;
  max-width: 38%;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--nm-line);
}

/* Imagen a la derecha del texto (editor: Párrafo → Imagen → Lado). */
.nm-pimg--right {
  flex-direction: row-reverse;
}

.nm-figure figcaption {
  opacity: 0.55;
  font-size: 85%;
  margin-top: 0.5em;
}

/* ---------------------------------------------------------------------------
   12. Tabla de configuración
--------------------------------------------------------------------------- */
.nm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background: #fff;
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  overflow: hidden;
  box-shadow: var(--nm-shadow-sm);
}

.nm-table th,
.nm-table td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--nm-line);
}

.nm-table th {
  background: var(--nm-bg-soft);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nm-text-soft);
}

.nm-table thead tr th {
  border-bottom: 1px solid var(--nm-line);
}

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

.nm-table tbody tr {
  transition: background 0.12s;
}

.nm-table tbody tr:hover {
  background: #fafbff;
}

.nm-table td.nm-table-key {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   12.0 Bloque de código
--------------------------------------------------------------------------- */
.nm-code {
  margin: 22px 0;
  padding: 14px 18px;
  background: #0f172a;
  color: #dbeafe;
  border-radius: var(--nm-radius);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

/* ---------------------------------------------------------------------------
   12.1 Changelog
---------------------------------------------------------------------------- */
.nm-changelog {
  margin: 22px 0;
  background: #fff;
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  box-shadow: var(--nm-shadow-sm);
  overflow: hidden;
}

.nm-changelog-version {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--nm-blue-ink);
  background: linear-gradient(135deg, var(--nm-blue-soft), #eaf4fb);
}

.nm-changelog-version::before {
  content: "🛠️";
  font-size: 1rem;
}

.nm-changelog-list {
  margin: 0;
  padding: 14px 18px 16px 38px;
}

.nm-changelog-list li {
  margin: 7px 0;
  line-height: 1.55;
}

.nm-changelog-list li::marker {
  color: var(--nm-blue);
  font-weight: 700;
}

/* Enlace superior que salta al changelog */
.nm-changelog-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--nm-blue-ink);
  background: linear-gradient(135deg, var(--nm-blue-soft), #eaf4fb);
  border: 1px solid rgba(63, 143, 214, 0.25);
  text-decoration: none;
  transition: filter 0.15s, transform 0.15s;
}

.nm-changelog-link::after {
  content: " →";
}

.nm-changelog-link:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.nm-changelog-link:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 143, 214, 0.25);
}

/* ---------------------------------------------------------------------------
   13. Pie
--------------------------------------------------------------------------- */
.nm-footer {
  text-align: center;
  color: var(--nm-text-faint);
  font-size: 0.85rem;
  margin-top: 42px;
  border-top: 1px solid var(--nm-line);
  padding-top: 22px;
}

/* ---------------------------------------------------------------------------
   14. Responsive
--------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .nm-mod-intro {
    flex-direction: column;
    text-align: left;
  }

  .nm-mod-intro .nm-mod-icon img {
    width: 96px;
  }

  .nm-title {
    font-size: 2rem;
  }
}

/* Ko-fi: ver ../../../../assets/bar.css */