/* Nexus AI Themes — Reader Experience Layer (Phase 9)
   Themed via design tokens. */

/* ── Floating reading toolbar ──────────────────────────────── */
.nexus-reader-toolbar{position:fixed;right:18px;top:50%;transform:translateY(-50%);z-index:50;display:flex;flex-direction:column;gap:6px;background:var(--c-surface);border:1px solid var(--c-border);border-radius:14px;padding:8px;box-shadow:0 6px 24px rgba(0,0,0,.12)}
.nx-reader-btn{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:46px;padding:7px 6px;background:transparent;border:0;border-radius:9px;color:var(--c-text);cursor:pointer;font-size:11px;font-weight:600;font-family:var(--font-head);transition:background .15s,color .15s}
.nx-reader-btn:hover{background:var(--c-bg)}
.nx-reader-btn.is-active{background:var(--c-primary);color:var(--c-on-primary,#fff)}
.nx-reader-btn-label{font-size:10px;line-height:1}
.nx-textsize{display:flex;gap:2px;border-top:1px solid var(--c-border);border-bottom:1px solid var(--c-border);padding:4px 0;margin:2px 0}
.nx-textsize .nx-reader-btn{min-width:0;padding:5px 6px;font-size:13px}
.nx-text-dec{font-size:11px!important}
.nx-text-inc{font-size:15px!important}
@media(max-width:900px){
  .nexus-reader-toolbar{top:auto;bottom:0;right:0;left:0;transform:none;flex-direction:row;justify-content:center;border-radius:0;border-left:0;border-right:0;border-bottom:0;padding:6px}
  .nx-textsize{border:0;border-left:1px solid var(--c-border);border-right:1px solid var(--c-border);padding:0 4px;margin:0 2px}
}

/* ── Collections (bookmarks + history lists) ───────────────── */
.nexus-reader-collection{background:var(--c-surface);border:1px solid var(--c-border);border-radius:var(--r-lg);padding:18px 20px;margin:24px 0}
.nexus-reader-collection-title{font-family:var(--font-head);font-size:17px;margin:0 0 12px}
.nexus-reader-items{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.nexus-reader-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:8px;border-bottom:1px solid var(--c-border)}
.nexus-reader-item:last-child{border-bottom:0;padding-bottom:0}
.nexus-reader-item-link{font-weight:600;font-size:14px;text-decoration:none;color:var(--c-text)}
.nexus-reader-item-link:hover{color:var(--c-primary)}
.nexus-reader-remove{flex:none;width:24px;height:24px;border-radius:50%;border:0;background:var(--c-bg);color:var(--c-muted);cursor:pointer;font-size:15px;line-height:1}
.nexus-reader-remove:hover{background:var(--c-danger,#dc2626);color:#fff}
.nexus-reader-empty{color:var(--c-muted);font-size:14px;margin:0}

/* ── Reading time inline badge ─────────────────────────────── */
.nexus-reading-time{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--c-muted)}

/* ── Text size scaling (opt-in, only when changed) ─────────── */
html[data-nx-scale] .entry-content{font-size:calc(1.0625rem * var(--nx-reader-scale,1));line-height:1.75}
html[data-nx-scale] .entry-content p,
html[data-nx-scale] .entry-content li{font-size:inherit}

/* ── Focus mode ────────────────────────────────────────────── */
body.nx-focus .nexus-sidebar,
body.nx-focus .widget-area,
body.nx-focus .nexus-related,
body.nx-focus #comments,
body.nx-focus .nexus-ad,
body.nx-focus .nx-mobile-only,
body.nx-focus .breadcrumbs,
body.nx-focus .nexus-share-bar{display:none!important}
body.nx-focus .nexus-article,
body.nx-focus .entry-content{max-width:720px;margin-left:auto;margin-right:auto}
body.nx-focus .site-header{opacity:.25;transition:opacity .2s}
body.nx-focus .site-header:hover{opacity:1}

/* ── Jump links (heading anchors) ──────────────────────────── */
.entry-content .nx-has-anchor{position:relative}
.entry-content .nx-heading-anchor{position:absolute;left:-1.1em;top:0;opacity:0;color:var(--c-primary);text-decoration:none;font-weight:700;transition:opacity .15s}
.entry-content .nx-has-anchor:hover .nx-heading-anchor,
.entry-content .nx-heading-anchor:focus{opacity:1}
@media(max-width:760px){.entry-content .nx-heading-anchor{position:static;margin-left:6px;opacity:.5}}

html{scroll-behavior:smooth}
