/* EO reader — công cụ đọc + chia chương cho nội dung dài (xem eo-reader.js, PIPELINE.md "Nội dung dài"). */

/* thanh công cụ đọc */
.eo-reader { --eo-read-bg: transparent; --eo-read-fg: inherit; }
.eo-reader__bar { position: sticky; top: calc(var(--nav-h, 64px) + 8px); z-index: 30; display: inline-flex; align-items: center; gap: 4px; margin: 0 0 16px; padding: 4px 6px; border-radius: 999px;
  background: var(--c-bg, #fff); border: 1px solid var(--c-border, #e5e7eb); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.eo-reader__bar button { min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--c-text, #111); font: 700 15px/1 system-ui, sans-serif; cursor: pointer; }
@media (hover: hover) and (pointer: fine){.eo-reader__bar button:hover{ background: var(--c-surface, #f1f3f5); }}
.eo-reader__bar button.is-active { background: var(--c-accent, #0b5ed7); color: #fff; }
.eo-reader__size { min-width: 46px; text-align: center; font: 600 13px/1 system-ui, sans-serif; color: var(--c-muted, #6b7280); font-variant-numeric: tabular-nums; }
.eo-reader__sep { width: 1px; height: 22px; background: var(--c-border, #e5e7eb); margin: 0 4px; }

/* thân bài: cỡ chữ + nền theo lựa chọn; dòng ~65–75 ký tự */
/* theme thường đặt cỡ chữ đoạn văn bằng px → phải đặt lại trực tiếp trên p/li (độ ưu tiên cao hơn .post-content p) */
.eo-reader .eo-reader__body, .eo-reader .eo-reader__body p, .eo-reader .eo-reader__body li, .eo-reader .eo-reader__body blockquote, .eo-reader .eo-reader__body dd { font-size: calc(1.0625rem * var(--eo-read-scale, 1)); }
.eo-reader__body > :where(p, li, blockquote, h2, h3, h4, ul, ol, dl, pre) { max-width: 56ch; }
.eo-reader .eo-reader__body p { line-height: 1.85; }
.eo-reader[data-eo-read-theme="sepia"] { background: #f6efdf; color: #40331f; border-radius: 16px; padding: clamp(16px, 3vw, 32px); }
.eo-reader[data-eo-read-theme="dark"] { background: #14171c; color: #d7dbe0; border-radius: 16px; padding: clamp(16px, 3vw, 32px); }
.eo-reader[data-eo-read-theme="sepia"] .eo-reader__body :where(p, li, h2, h3, h4, blockquote, figcaption, strong, em) { color: #40331f; }
.eo-reader[data-eo-read-theme="dark"] .eo-reader__body :where(p, li, h2, h3, h4, blockquote, figcaption, strong, em) { color: #d7dbe0; }
.eo-reader[data-eo-read-theme="dark"] .eo-reader__body a { color: #8ecbff; }

/* trang rất dài: content-visibility đặt ở eo-base.css ([data-eo-long], máy chủ gắn sẵn) */

/* nhắc đã về chỗ đang đọc */
.eo-reader__tip { position: fixed !important; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 2147481000 !important; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px);
  padding: 10px 10px 10px 16px; border-radius: 999px; background: #111827; color: #fff; font: 500 14px/1.3 system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: opacity .35s ease, transform .35s ease; }
.eo-reader__tip button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.eo-reader__tip.is-out { opacity: 0; transform: translate(-50%, 10px); }

/* chia chương (<!--nextpage-->): mục lục + chương trước / sau */
.eo-chapters { display: grid; gap: 12px; margin: 24px 0; }
.eo-chapters__toc { border: 1px solid var(--c-border, #e5e7eb); border-radius: 12px; background: var(--c-bg, #fff); }
.eo-chapters__toc > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.eo-chapters__toc > summary::-webkit-details-marker { display: none; }
.eo-chapters__toc > summary::after { content: '▾'; margin-left: auto; transition: transform .2s; }
.eo-chapters__toc[open] > summary::after { transform: rotate(180deg); }
.eo-chapters__toc ol { margin: 0; padding: 0 12px 12px 12px; list-style: none; display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.eo-chapters__toc a, .eo-chapters__toc span.is-current { display: flex; gap: 10px; align-items: baseline; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: inherit; min-height: 40px; background-image: none !important; }
@media (hover: hover) and (pointer: fine){.eo-chapters__toc a:hover{ background: var(--c-surface, #f1f3f5); }}
.eo-chapters__toc span.is-current { background: color-mix(in srgb, var(--c-accent, #0b5ed7) 12%, transparent); font-weight: 700; }
.eo-chapters__toc small { color: var(--c-muted, #6b7280); min-width: 2.2em; font-variant-numeric: tabular-nums; }
.eo-chapters__nav { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.eo-chapters__nav a, .eo-chapters__nav span { flex: 1 1 140px; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--c-border, #d1d5db); font-weight: 700; text-decoration: none; color: inherit; text-align: center; background-image: none !important; }
@media (hover: hover) and (pointer: fine){.eo-chapters__nav a:hover{ border-color: var(--c-accent, #0b5ed7); color: var(--c-accent-ink, var(--c-accent, #0b5ed7)); }}
.eo-chapters__nav span { opacity: .4; }
.eo-chapters__pos { text-align: center; font-size: 13px; color: var(--c-muted, #6b7280); }
@media (prefers-reduced-motion: reduce) { .eo-reader__tip, .eo-chapters__toc > summary::after { transition: none; }}