/* reading-mode.css — Origin Planner Book Reading Mode */

/* ── FLOATING TRIGGER ── */
.rm-trigger {
  position: fixed; bottom: 24px; right: 20px; z-index: 250;
  display: flex; align-items: center; gap: 8px;
  background: #1a1a2e; color: #f9c308; border: none;
  border-radius: 50px; padding: 12px 20px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.3);
  transition: transform .2s, box-shadow .2s;
}
.rm-trigger:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0,0,0,.35); }

/* ── PROGRESS BAR ── */
.rm-progress { display: none; position: fixed; top: 52px; left: 0; height: 2px; width: 0%; background: #f9c308; z-index: 299; transition: width .1s linear; }
body[class*='rm-'] .rm-progress { display: block; }

/* ── TOOLBAR ── */
.rm-toolbar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 300; height: 52px; align-items: center; padding: 0 16px; gap: 12px; border-bottom: 1px solid rgba(0,0,0,.12); }
body[class*='rm-'] .rm-toolbar { display: flex; }
body.rm-sepia .rm-toolbar { background: #f0ead8; border-color: #d8cdb8; }
body.rm-white .rm-toolbar { background: #fff; border-color: #e0e0e8; }
body.rm-night .rm-toolbar { background: #1a1a2e; border-color: rgba(255,255,255,.1); }

.rm-close { background: none; border: none; cursor: pointer; font-size: 13px; font-family: 'DM Sans',sans-serif; font-weight: 600; padding: 6px 12px; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
body.rm-sepia .rm-close, body.rm-white .rm-close { color: #5a4a2a; }
body.rm-night .rm-close { color: rgba(255,255,255,.7); }
.rm-title { flex: 1; text-align: center; font-family: 'Playfair Display',serif; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
body.rm-sepia .rm-title { color: #3a2e1a; }
body.rm-white .rm-title { color: #1a1a2e; }
body.rm-night .rm-title { color: rgba(255,255,255,.8); }
.rm-controls { display: flex; align-items: center; gap: 4px; }
.rm-btn { background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 700; padding: 5px 9px; border-radius: 6px; font-family: 'DM Sans',sans-serif; transition: background .2s; }
body.rm-sepia .rm-btn { color: #5a4a2a; }
body.rm-white .rm-btn { color: #3a3a4a; }
body.rm-night .rm-btn { color: rgba(255,255,255,.7); }
.rm-btn:hover { background: rgba(0,0,0,.07); }
body.rm-night .rm-btn:hover { background: rgba(255,255,255,.08); }
.rm-sep { width: 1px; height: 20px; background: rgba(0,0,0,.12); margin: 0 2px; display: inline-block; vertical-align: middle; }
body.rm-night .rm-sep { background: rgba(255,255,255,.12); }

/* ── BODY THEMES ── */
body[class*='rm-'] { transition: background .3s; }
body.rm-sepia { background: #f8f4e8; padding-top: 52px; }
body.rm-white { background: #ffffff; padding-top: 52px; }
body.rm-night { background: #12121e; padding-top: 52px; }

/* ── HIDE ELEMENTS IN READING MODE ── */
body[class*='rm-'] nav,
body[class*='rm-'] .top-banner-global,
body[class*='rm-'] .post-hero,
body[class*='rm-'] .legal-note,
body[class*='rm-'] .diagram-wrap,
body[class*='rm-'] .product-cta,
body[class*='rm-'] .nl-strip,
body[class*='rm-'] .related-section,
body[class*='rm-'] .rm-trigger,
body[class*='rm-'] #leer-progreso,
body[class*='rm-'] #libro-toc,
body[class*='rm-'] #libro-back-btn { display: none !important; }

/* ── ARTICLE WRAP ── */
body[class*='rm-'] main.article-wrap,
body[class*='rm-'] .article-wrap {
  max-width: 68ch !important; margin: 0 auto !important;
  padding: 32px 24px 100px !important;
  background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
}

/* ── EBOOK HEADER ── */
.ebook-header { display: none; }
body[class*='rm-'] .ebook-header { display: block !important; text-align: center; padding: 0 0 36px; border-bottom: 1px solid rgba(0,0,0,.1); margin-bottom: 40px; }
body.rm-night .ebook-header { border-color: rgba(255,255,255,.1); }
.ebook-header h1 { font-family: 'Playfair Display',serif; font-size: clamp(22px,4vw,34px); font-weight: 900; line-height: 1.2; margin-bottom: 8px; }
body.rm-sepia .ebook-header h1 { color: #2a1f0a; }
body.rm-white .ebook-header h1 { color: #1a1a2e; }
body.rm-night .ebook-header h1 { color: #f0ead8; }
.ebook-header p { font-family: 'DM Sans',sans-serif; font-style: italic; font-size: 14px; }
body.rm-sepia .ebook-header p { color: #8a7a5a; }
body.rm-white .ebook-header p { color: #6b6b7b; }
body.rm-night .ebook-header p { color: rgba(240,234,216,.5); }

/* ── ARTICLE BODY ── */
body[class*='rm-'] .article-body p, body[class*='rm-'] .article-body h2 {
  font-family: 'Lora', Georgia, serif; font-size: var(--rm-size,18px); line-height: 1.9; text-wrap: pretty;
}
body.rm-sepia .article-body p, body.rm-sepia .article-body h2 { color: #3a2e1a; }
body.rm-white .article-body p, body.rm-white .article-body h2 { color: #1a1a2e; }
body.rm-night .article-body p, body.rm-night .article-body h2 { color: #d8d0c0; }
body[class*='rm-'] .article-body h2 { font-family: 'Playfair Display',serif; font-size: calc(var(--rm-size,18px) * 1.3); margin: 40px 0 16px; }
body[class*='rm-'] .article-body p + p { margin-top: 18px; }
body[class*='rm-'] .article-body > p:first-of-type::first-letter {
  font-family: 'Playfair Display',serif; font-size: calc(var(--rm-size,18px) * 4);
  font-weight: 900; float: left; line-height: .75; margin: 6px 10px 0 0;
}
body.rm-sepia .article-body > p:first-of-type::first-letter { color: #b8a068; }
body.rm-white .article-body > p:first-of-type::first-letter { color: #7358c3; }
body.rm-night .article-body > p:first-of-type::first-letter { color: #f9c308; }

/* ── CHAPTERS ── */
body[class*='rm-'] .chapter-card {
  background: transparent !important; border: none !important;
  border-bottom: 1px solid rgba(0,0,0,.1) !important;
  box-shadow: none !important; border-radius: 0 !important;
  padding: 32px 0 !important; margin: 0 !important;
  opacity: 1 !important; transform: none !important;
}
body.rm-night .chapter-card { border-color: rgba(255,255,255,.08) !important; }
body[class*='rm-'] .chapter-header { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 20px; }
body[class*='rm-'] .chapter-num {
  font-family: 'DM Sans',sans-serif !important; font-size: 10px !important;
  text-transform: uppercase; letter-spacing: .15em;
  background: transparent !important; color: #b8a068 !important;
  padding: 0 !important; width: auto !important; height: auto !important;
  min-width: auto !important; border-radius: 0 !important; font-weight: 700 !important;
}
body.rm-night .chapter-num { color: #f9c308 !important; }
body[class*='rm-'] .chapter-card h3, body[class*='rm-'] .chapter-header h3 {
  font-family: 'Playfair Display',serif; font-size: calc(var(--rm-size,18px) * 1.2);
  font-weight: 700; line-height: 1.3; margin-bottom: 0;
}
body.rm-sepia .chapter-card h3 { color: #2a1f0a; }
body.rm-white .chapter-card h3 { color: #1a1a2e; }
body.rm-night .chapter-card h3 { color: #f0ead8; }
body[class*='rm-'] .chapter-card p {
  font-family: 'Lora',Georgia,serif !important; font-size: var(--rm-size,18px) !important;
  line-height: 1.9 !important; text-wrap: pretty; margin-bottom: 0 !important;
}
body[class*='rm-'] .chapter-card p + p { margin-top: 18px !important; }
body.rm-sepia .chapter-card p { color: #3a2e1a; }
body.rm-white .chapter-card p { color: #1a1a2e; }
body.rm-night .chapter-card p { color: #c8c0b0; }

/* ── KEY PHRASE ── */
body[class*='rm-'] .key-phrase {
  font-family: 'Playfair Display',serif !important; font-style: italic;
  font-size: calc(var(--rm-size,18px) * 1.05) !important;
  border-radius: 0 !important; background: transparent !important;
  border-left: 3px solid #b8a068 !important;
  padding: 10px 20px !important; margin: 24px 0 !important;
}
body.rm-night .key-phrase { border-left-color: #f9c308 !important; }
body.rm-sepia .key-phrase { color: #5a4a2a; }
body.rm-white .key-phrase { color: #3a3a4a; }
body.rm-night .key-phrase { color: #d8c89a; }
body[class*='rm-'] .key-phrase::before,
body[class*='rm-'] .key-phrase::after { display: none; }

/* ── TIP BOX ── */
body[class*='rm-'] .tip-box { border-radius: 8px !important; font-family: 'Lora',Georgia,serif; font-size: calc(var(--rm-size,18px)*.9); }
body.rm-sepia .tip-box { background: #ede6d4 !important; color: #3a2e1a; border-left-color: #b8a068 !important; }
body.rm-white .tip-box { background: #f5f5f8 !important; color: #1a1a2e; }
body.rm-night .tip-box { background: rgba(255,255,255,.06) !important; color: #c8c0b0; border-left-color: #f9c308 !important; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .rm-title { font-size: 11px; }
  .rm-btn { padding: 4px 6px; font-size: 12px; }
  body[class*='rm-'] main.article-wrap, body[class*='rm-'] .article-wrap { padding: 24px 16px 80px !important; }
}
