/* Mis lecturas: botón y desplegable del menú, aviso para retomar, marcas en las
   cards y la página del historial. Lo carga default.hbs sólo con sesión iniciada
   (y la página del historial por su cuenta, para el mensaje sin sesión).
   Colores por variable: en light-mode.css --amarillo pasa a verde. */

:root { --ml-panel: #222; --ml-panel2: #2a2a2a; --ml-line: #333; --ml-txt: var(--crema); --ml-dim: rgba(234,230,225,.62); }
body.light-mode { --ml-panel: #fbfaf8; --ml-panel2: #f1ede8; --ml-line: #ddd6cd; --ml-txt: var(--negro); --ml-dim: rgba(18,18,18,.62); }

/* --- botón en el menú --- */
.ml-btn { position: relative; }
.ml-btn svg { width: 18px; height: 18px; }
.ml-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--amarillo); }
.ml-btn[aria-expanded="true"] { border-color: var(--amarillo); color: var(--amarillo); }

/* --- desplegable --- */
.ml-dd { position: fixed; z-index: 1001; width: 370px; max-width: calc(100vw - 24px); background: var(--ml-panel); color: var(--ml-txt); border: 1px solid var(--ml-line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.45); overflow: hidden; font-family: 'Nunito Sans', sans-serif; }
.ml-dd--hoja { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0; border-bottom: none; max-height: 80vh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 0); }
.ml-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--ml-line); margin: 10px auto 2px; }
.ml-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5); }
.ml-dd-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 8px; }
.ml-dd-h b { font-weight: 700; font-size: 1rem; }
.ml-x { background: none; border: 0; color: var(--ml-dim); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px 6px; }
.ml-x:hover { color: var(--ml-txt); }
.ml-tabs { display: flex; gap: 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--ml-line); }
.ml-tabs button { font: 700 .72rem 'Nunito Sans', sans-serif; letter-spacing: .08em; text-transform: uppercase; padding: .38rem .75rem; border-radius: 999px; border: 1.5px solid var(--ml-line); color: var(--ml-dim); background: none; cursor: pointer; }
.ml-tabs button.on { border-color: var(--amarillo); color: var(--amarillo); }
.ml-item { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--ml-line); color: var(--ml-txt); text-decoration: none; }
.ml-item:hover { background: var(--ml-panel2); }
.ml-item img, .ml-noimg { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; background: var(--ml-panel2); }
.ml-item-b { min-width: 0; flex: 1; }
.ml-item-t { display: block; font-weight: 700; font-size: .86rem; line-height: 1.25; }
.ml-item-m { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: var(--ml-dim); margin-top: 4px; }
.ml-mini { display: inline-block; width: 56px; height: 4px; border-radius: 4px; background: var(--ml-line); overflow: hidden; flex: none; }
.ml-mini i { display: block; height: 100%; background: var(--gradient-main); }
.ml-empty { padding: 22px 16px; font-size: .86rem; color: var(--ml-dim); text-align: center; }
.ml-dd-f { padding: 12px 16px; text-align: center; }
.ml-pill { display: inline-block; font: 700 .76rem 'Nunito Sans', sans-serif; letter-spacing: .1em; text-transform: uppercase; padding: .5rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--amarillo); color: var(--amarillo); background: none; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.ml-pill:hover, .ml-pill.on { background: var(--amarillo); color: var(--negro); }

/* --- aviso para retomar --- */
.ml-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 16px; background: var(--ml-panel2); color: var(--ml-txt); border: 1px solid var(--amarillo); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.45); font-family: 'Nunito Sans', sans-serif; transition: opacity .25s, transform .25s; }
.ml-toast.ml-out { opacity: 0; transform: translate(-50%, 10px); }
.ml-toast-b b { display: block; font-weight: 700; }
.ml-toast-b small { font-size: .76rem; color: var(--ml-dim); }
.ml-go { font: 700 .74rem 'Nunito Sans', sans-serif; letter-spacing: .1em; text-transform: uppercase; background: var(--amarillo); color: var(--negro); border: 0; padding: .55rem 1rem; border-radius: 999px; cursor: pointer; }

/* --- marcas en las cards --- */
.ml-flag { position: absolute; left: 12px; bottom: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 4px; font: 700 11px 'Nunito Sans', sans-serif; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--amarillo); color: var(--negro); box-shadow: 0 2px 8px rgba(0,0,0,.35); pointer-events: none; }
.ml-flag--curso { background: rgba(18,18,18,.85); color: var(--crema); bottom: 14px; }
.pc--featured .ml-flag { bottom: auto; top: 52px; left: 14px; }
.ml-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 4; background: rgba(18,18,18,.55); pointer-events: none; }
.ml-bar i { display: block; height: 100%; background: var(--gradient-main); }
a.pc.ml-leida .pc__img { filter: saturate(.4) brightness(.78); }
.ml-ruta { color: var(--amarillo); font-weight: 700; }

/* pasos de una ruta ya leídos (ruta-nav.css pinta la franja) */
.r421-steps a.read { background: rgba(18,18,18,.82); border-color: transparent; color: var(--amarillo); }
.r421-list li.read .r421-c { background: var(--amarillo); border-color: var(--amarillo); color: var(--negro); }
.r421-list li.read .r421-tt { opacity: .6; }

/* --- página /es/mis-lecturas/ --- */
.ml-page { max-width: 980px; margin: 0 auto; padding: calc(80px + 3rem) 28px 4rem; font-family: 'Nunito Sans', sans-serif; color: var(--ml-txt); }
.ml-page-ey { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ml-dim); }
.ml-page h1 { font: italic 900 clamp(2rem, 5vw, 2.8rem) 'Nunito Sans', sans-serif; margin: .2rem 0 1rem; }
.ml-stats { display: flex; gap: 32px; margin: 8px 0 24px; flex-wrap: wrap; }
.ml-stats b { display: block; font: 900 1.9rem 'Nunito Sans', sans-serif; }
.ml-stats span { font-size: .76rem; color: var(--ml-dim); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.ml-ptabs { display: flex; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--ml-line); }
.ml-mes { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ml-dim); margin: 22px 0 2px; }
.ml-prow { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--ml-line); transition: opacity .2s; }
.ml-prow.ml-out { opacity: .35; }
.ml-pimg img { width: 120px; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; display: block; background: var(--ml-panel2); }
.ml-pt { display: block; font-weight: 700; font-size: 1.05rem; line-height: 1.25; color: var(--ml-txt); text-decoration: none; }
.ml-pt:hover { color: var(--amarillo); }
.ml-pm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--ml-dim); margin-top: 6px; }
.ml-pa { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ml-act { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--amarillo); text-decoration: none; white-space: nowrap; }
.ml-quitar, .ml-del { background: none; border: 0; padding: 0; font: 700 .72rem 'Nunito Sans', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--ml-dim); cursor: pointer; }
.ml-quitar:hover, .ml-del:hover { color: var(--ml-txt); }
.ml-del { text-transform: none; letter-spacing: 0; font-size: .82rem; text-decoration: underline; }
.ml-pmore { text-align: center; margin-top: 22px; }
.ml-pfoot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 30px; font-size: .82rem; color: var(--ml-dim); }
.ml-anon { padding: 2rem 0; font-size: 1.05rem; line-height: 1.6; }

@media (max-width: 768px) {
  .ml-toast { left: 12px; right: 12px; transform: none; bottom: 84px; }
  .ml-toast.ml-out { transform: translateY(10px); }
  .ml-page { padding: calc(66px + 1.5rem) 18px 3rem; }
  .ml-prow { grid-template-columns: 84px 1fr; gap: 12px; }
  .ml-pimg img { width: 84px; }
  .ml-pa { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ml-toast, .ml-prow, .ml-pill { transition: none; }
}

/* La página del historial puede ser corta: el footer va siempre al pie de la
   pantalla, no a mitad con el fondo vacío abajo. */
.ml-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.ml-wrap > .ml-page { flex: 1 0 auto; width: 100%; }
