/* BookCMS v3 — Frontend Styles — CLEAN BUILD */

:root,
[data-theme="light"] {
  --bg: #faf8f5; --bg2: #fff; --bg3: #f3efe9;
  --text: #2c2c2c; --text-light: #6b7280;
  --accent: #009bdb; --accent-dark: #0078ab; --accent-glow: rgba(0,155,219,0.12);
  --cover-bg: #0a1628; --border: rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05); --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.15); --radius: 12px;
  --nav-bg: rgba(255,255,255,0.92); --card-bg: #fff;
}
[data-theme="dark"] {
  --bg: #0f172a; --bg2: #1e293b; --bg3: #162033;
  --text: #e2e8f0; --text-light: #94a3b8;
  --accent: #38bdf8; --accent-dark: #0ea5e9; --accent-glow: rgba(56,189,248,0.12);
  --cover-bg: #020617; --border: rgba(255,255,255,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2); --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
  --nav-bg: rgba(15,23,42,0.92); --card-bg: #1e293b;
}
[data-theme="dark"] img { filter: brightness(0.9); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', -apple-system, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Page flip */
.page-transition { animation: pageFlipIn 0.45s cubic-bezier(0.22,1,0.36,1); }
@keyframes pageFlipIn { from { opacity:0; transform: perspective(1200px) rotateY(6deg) scale(0.97); } to { opacity:1; transform: perspective(1200px) rotateY(0) scale(1); } }

/* NAV */
.site-nav { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 56px; max-width: 1200px; margin: 0 auto; }
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem; color: var(--text); text-decoration: none; }
.nav-brand:hover { color: var(--accent); }
.nav-brand span { display: none; }
@media(min-width:640px) { .nav-brand span { display: inline; } }
.nav-actions { display: flex; align-items: center; gap: 2px; }
.btn-icon { width: 40px; height: 40px; border: none; background: transparent; border-radius: 10px; cursor: pointer; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; color: var(--text-light); transition: all 0.2s; text-decoration: none; line-height: 1; }
.btn-icon:hover { background: var(--accent-glow); color: var(--accent); }
.reading-progress { height: 3px; background: var(--border); }
.reading-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); width: 0%; transition: width 0.15s; border-radius: 0 2px 2px 0; }
.lang-switcher { position: relative; }
.lang-dropdown { display: none; position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: var(--shadow-md); z-index: 999; min-width: 70px; }
.lang-switcher.open .lang-dropdown { display: flex; flex-direction: column; gap: 2px; }
.lang-dropdown a { display: block; padding: 6px 14px; font-size: 0.78rem; font-weight: 700; color: var(--text-light); border-radius: 6px; text-align: center; letter-spacing: 1px; }
.lang-dropdown a:hover, .lang-dropdown a.active { background: var(--accent); color: #fff; }

/* TOC SIDEBAR */
.toc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.toc-overlay.open { opacity: 1; pointer-events: auto; }
.toc-sidebar { position: fixed; top: 0; right: -340px; width: 340px; height: 100%; background: var(--cover-bg); z-index: 1000; transition: right 0.35s cubic-bezier(0.4,0,0.2,1); overflow-y: auto; }
.toc-sidebar.open { right: 0; }
.toc-sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.toc-sidebar-head h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: #fff; font-weight: 400; }
.toc-close { background: rgba(255,255,255,0.06); border: none; color: rgba(255,255,255,0.5); font-size: 1rem; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.toc-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.toc-sidebar > ul { list-style: none; padding: 10px 0; }
.toc-sidebar li a { display: flex; align-items: center; gap: 12px; padding: 13px 20px; color: rgba(255,255,255,0.55); font-size: 0.88rem; border-left: 3px solid transparent; transition: all 0.2s; }
.toc-sidebar li a:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.9); padding-left: 24px; }
.toc-sidebar li.active > a { color: #fff; border-left-color: var(--accent); background: rgba(0,155,219,0.08); }
.toc-n { font-weight: 700; font-size: 0.72rem; color: var(--accent); min-width: 26px; opacity: 0.8; }
.toc-sub { list-style: none; padding: 0; }
.toc-sub li a { padding: 9px 20px 9px 52px; font-size: 0.82rem; color: rgba(255,255,255,0.4); }

/* HOME HERO */
.home-hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--cover-bg); }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 25% 75%, rgba(0,155,219,0.15) 0%, transparent 55%), radial-gradient(ellipse at 75% 25%, rgba(56,189,248,0.08) 0%, transparent 55%), linear-gradient(180deg, #060d1a, #0a1628 40%, #0f1f38); }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-content { position: relative; z-index: 2; display: flex; align-items: center; gap: 80px; max-width: 1100px; padding: 80px 24px; }
.hero-book { flex-shrink: 0; }
.perspective-wrap { perspective: 1800px; }
.book-3d { position: relative; width: 240px; height: 340px; transform-style: preserve-3d; transform: rotateY(-30deg); transition: transform 0.7s cubic-bezier(0.4,0,0.2,1); cursor: pointer; }
.book-3d:hover { transform: rotateY(-40deg) translateX(-12px); }
.book-cover { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d; z-index: 10; }
.cover-front { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0.25) 0%, rgba(200,200,200,0.05) 3%, rgba(255,255,255,0.1) 4%, transparent 20%), linear-gradient(160deg, #0d2240, #091a30 40%, #0c2040); border-radius: 0 4px 4px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 24px; text-align: center; box-shadow: 3px 0 12px rgba(0,0,0,0.4); }
.cover-icon { font-size: 3.8rem; margin-bottom: 16px; }
.cover-title { font-family: 'Playfair Display', serif; font-size: 1.25rem; color: #fff; line-height: 1.35; margin-bottom: 10px; }
.cover-line { width: 40px; height: 2px; background: var(--accent); margin: 10px 0; border-radius: 1px; }
.cover-sub { font-size: 0.58rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 3px; }
.cover-author { font-size: 0.68rem; color: rgba(255,255,255,0.45); letter-spacing: 1px; margin-top: 10px; }
.book-cover::before { content: ''; position: absolute; left: 0; width: 24px; height: 100%; background: linear-gradient(to right, transparent, rgba(0,0,0,0.08) 20%, rgba(0,0,0,0.15) 50%, transparent), linear-gradient(180deg, #0d2137, #0a1628, #0d2137); transform: translateX(-100%) rotateY(-90deg); transform-origin: right center; }
.book-pages { position: absolute; inset: 0; background: linear-gradient(to right, #ccc8c0, #e8e4de, #f0ece6); border: 3px solid #162a45; border-left: none; border-radius: 0 3px 3px 0; }
.hero-text { color: #fff; max-width: 520px; }
.hero-badge { display: inline-block; padding: 6px 18px; background: rgba(0,155,219,0.1); border: 1px solid rgba(0,155,219,0.2); border-radius: 30px; font-size: 0.68rem; color: var(--accent); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 24px; }
.hero-text h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.2rem,5vw,3.4rem); font-weight: 700; line-height: 1.15; margin-bottom: 20px; }
.hero-subtitle { font-size: 1.05rem; color: rgba(255,255,255,0.5); font-weight: 300; line-height: 1.8; margin-bottom: 12px; }
.hero-tagline { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; font-size: 0.95rem; color: rgba(255,255,255,0.3); margin-bottom: 32px; }
.btn-start { display: inline-block; padding: 16px 40px; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 700; font-size: 0.85rem; letter-spacing: 1.5px; text-transform: uppercase; transition: all 0.3s; box-shadow: 0 4px 25px rgba(0,155,219,0.35); }
.btn-start:hover { background: var(--accent-dark); transform: translateY(-3px); box-shadow: 0 8px 35px rgba(0,155,219,0.45); color: #fff; }

/* HOME TOC */
.home-toc { padding: 100px 0; background: var(--bg2); }
.section-title { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 400; text-align: center; margin-bottom: 12px; }
.section-subtitle { text-align: center; font-size: 0.9rem; color: var(--text-light); margin-bottom: 50px; max-width: 500px; margin-left: auto; margin-right: auto; }
.toc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }
.toc-card { display: flex; align-items: stretch; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.35s cubic-bezier(0.4,0,0.2,1); color: var(--text); text-decoration: none; animation: fadeUp 0.5s ease-out both; }
.toc-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-4px); color: var(--text); }
.toc-card-spine { width: 56px; min-height: 120px; background: var(--cover-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.toc-card-spine::after { content: ''; position: absolute; right: 0; top: 10%; height: 80%; width: 2px; background: linear-gradient(180deg, transparent, rgba(255,255,255,0.08), transparent); }
.toc-num { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--accent); writing-mode: vertical-lr; transform: rotate(180deg); letter-spacing: 2px; }
.toc-card-body { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; }
.toc-card-body h3 { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.toc-card-body p { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; }
.toc-sub-count { font-size: 0.7rem; color: var(--accent); margin-top: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.toc-card-arrow { display: flex; align-items: center; padding: 0 16px; font-size: 1.3rem; color: var(--text-light); transition: all 0.3s; opacity: 0.4; }
.toc-card:hover .toc-card-arrow { color: var(--accent); transform: translateX(4px); opacity: 1; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* CHAPTER HERO */
.chapter-hero { position: relative; min-height: 35vh; display: flex; align-items: center; justify-content: center; background: var(--cover-bg) center/cover no-repeat; text-align: center; }
.hero-full { min-height: 55vh; }
.chapter-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,22,40,0.6), rgba(10,22,40,0.92)); }
.chapter-hero-content { position: relative; z-index: 2; padding: 60px 24px; color: #fff; }
.chapter-hero-content h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem,5vw,3rem); font-weight: 700; margin-bottom: 12px; }
.chapter-excerpt { font-size: 1.05rem; color: rgba(255,255,255,0.55); max-width: 560px; margin: 0 auto; font-style: italic; }
.chapter-label { display: inline-block; font-size: 0.7rem; color: var(--accent); text-transform: uppercase; letter-spacing: 4px; font-weight: 700; margin-bottom: 12px; }
.draft-banner { background: #fef3c7; border-bottom: 2px solid #f59e0b; padding: 12px 20px; text-align: center; font-size: 0.85rem; color: #92400e; }
.draft-banner a { color: #d97706; text-decoration: underline; margin-left: 8px; }

/* ARTICLES GRID */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 50px 0; }
.article-card { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.35s; color: var(--text); text-decoration: none; animation: fadeUp 0.4s ease-out both; }
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: var(--accent); color: var(--text); }
.article-card-img { height: 160px; background: linear-gradient(135deg, var(--cover-bg), #1a2a45) center/cover no-repeat; }
.article-card-body { padding: 24px; flex: 1; }
.article-card-body h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.article-card-body p { font-size: 0.85rem; color: var(--text-light); }
.article-card-arrow { padding: 12px 24px; text-align: right; color: var(--accent); font-size: 1.1rem; opacity: 0.5; transition: opacity 0.3s; }
.article-card:hover .article-card-arrow { opacity: 1; }

/* CHAPTER CONTENT */
.chapter-main { padding: 50px 0 40px; }
.chapter-container { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.layout-side .chapter-container { max-width: 1100px; display: grid; grid-template-columns: 1fr 280px; gap: 40px; }
.layout-magazine .chapter-container { max-width: 900px; }
.layout-magazine .chapter-body { column-count: 2; column-gap: 40px; }
.layout-fullwidth .chapter-container { max-width: 1200px; }
.chapter-heading { margin-bottom: 36px; }
.chapter-heading h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem,5vw,2.8rem); font-weight: 700; line-height: 1.25; }
.article-meta { font-size: 0.78rem; color: var(--text-light); margin-top: 10px; }

/* Typography */
.chapter-body { font-family: 'Source Serif 4', Georgia, serif; font-size: 1.15rem; line-height: 1.9; }
.chapter-body h2 { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; margin: 44px 0 16px; line-height: 1.3; }
.chapter-body h3 { font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 700; margin: 30px 0 10px; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 1px; }
.chapter-body p { margin-bottom: 20px; text-align: justify; hyphens: auto; }
.chapter-body .lead { font-size: 1.25rem; color: var(--text-light); font-style: italic; line-height: 1.75; margin-bottom: 30px; border-left: 3px solid var(--accent); padding-left: 20px; }
.chapter-body blockquote { margin: 30px 0; padding: 24px 28px; background: var(--accent-glow); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; color: var(--text-light); }
.chapter-body table { width: 100%; border-collapse: collapse; margin: 28px 0; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; }
.chapter-body table th { background: var(--cover-bg); color: #fff; padding: 12px 16px; text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 1px; }
.chapter-body table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chapter-body table tr:nth-child(even) td { background: var(--bg3); }
.chapter-body img { border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 24px 0; }
.info-box { margin: 30px 0; padding: 22px 26px; border-radius: var(--radius); font-family: 'DM Sans', sans-serif; font-size: 0.95rem; line-height: 1.65; }
.info-box.tip { background: #ecfdf5; border-left: 4px solid #10b981; }
.info-box.warning { background: #fffbeb; border-left: 4px solid #f59e0b; }
.info-box.plan { background: #eff6ff; border-left: 4px solid var(--accent); }
[data-theme="dark"] .info-box.tip { background: rgba(16,185,129,0.08); }
[data-theme="dark"] .info-box.warning { background: rgba(245,158,11,0.08); }
[data-theme="dark"] .info-box.plan { background: rgba(0,155,219,0.08); }
.info-box strong { display: block; margin-bottom: 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 24px 0; font-family: 'DM Sans', sans-serif; }
.plan-day { padding: 16px; background: var(--card-bg); border-radius: 10px; border: 1px solid var(--border); font-size: 0.85rem; }
.plan-day strong { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 6px; }

/* BLOCKS */
.video-embed { position: relative; width: 100%; padding-bottom: 56.25%; margin: 30px 0; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-md); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-caption { text-align: center; font-family: 'DM Sans', sans-serif; font-size: 0.8rem; color: var(--text-light); margin-top: -22px; margin-bottom: 26px; font-style: italic; }
.block-image figcaption { text-align: center; font-family: 'DM Sans', sans-serif; font-size: 0.8rem; color: var(--text-light); margin-top: 10px; }
.block-html { margin: 30px 0; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.app-label { background: var(--cover-bg); color: rgba(255,255,255,0.8); padding: 10px 18px; font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.block-code { margin: 28px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.code-header { background: var(--bg3); padding: 10px 18px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); }
.block-code pre { padding: 20px; background: #1e1e2e; color: #cdd6f4; font-size: 0.85rem; overflow-x: auto; line-height: 1.6; }
.exercise-widget { margin: 30px 0; padding: 28px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); font-family: 'DM Sans', sans-serif; }
.exercise-widget h4 { font-size: 1rem; font-weight: 700; margin-bottom: 18px; color: var(--accent-dark); }
.exercise-widget label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; margin-top: 12px; }
.exercise-widget input, .exercise-widget select { width: 100%; padding: 11px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit; margin-bottom: 6px; background: var(--bg); color: var(--text); }
.exercise-widget input:focus, .exercise-widget select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.calc-btn { width: 100%; padding: 13px; margin-top: 8px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 0.88rem; font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: 1.5px; }
.calc-btn:hover { background: var(--accent-dark); }
.result { margin-top: 18px; padding: 18px; background: var(--accent-glow); border-radius: 10px; font-size: 0.9rem; line-height: 1.7; display: none; }

/* SIDEBAR */
.chapter-sidebar { position: sticky; top: 80px; align-self: start; }
.sidebar-widget { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 22px; margin-bottom: 16px; }
.sidebar-widget h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); margin-bottom: 14px; }
#autoToc a, .sidebar-art-link { display: block; padding: 8px 12px; font-size: 0.85rem; color: var(--text-light); border-bottom: 1px solid var(--border); border-left: 2px solid transparent; transition: all 0.2s; text-decoration: none; }
#autoToc a:hover, .sidebar-art-link:hover { color: var(--accent); padding-left: 16px; }
#autoToc a.active, .sidebar-art-link.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; background: var(--accent-glow); }

/* PAGINATION */
.chapter-pagination { border-top: 1px solid var(--border); padding: 36px 0; }
.pag-flex { display: flex; justify-content: space-between; gap: 16px; }
.pag-link { flex: 1; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.3s; color: var(--text); text-decoration: none; }
.pag-link:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); color: var(--text); }
.pag-next { text-align: right; }
.pag-dir { display: block; font-family: 'DM Sans', sans-serif; font-size: 0.7rem; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.pag-title { font-weight: 600; font-size: 0.95rem; }

/* SHARE BAR */
.share-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 28px 24px; border-top: 1px solid var(--border); }
.share-label { font-family: 'DM Sans', sans-serif; font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; font-size: 0.85rem; font-weight: 700; transition: all 0.25s; border: none; cursor: pointer; text-decoration: none; color: #fff; }
.share-fb { background: #1877f2; }
.share-tw { background: #000; font-family: serif; }
.share-link { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* NEWSLETTER */
.newsletter-section { padding: 60px 0; background: var(--bg3); border-top: 1px solid var(--border); }
.newsletter-box { max-width: 460px; margin: 0 auto; text-align: center; }
.newsletter-icon { font-size: 2rem; margin-bottom: 14px; }
.newsletter-box h3 { font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 500; color: var(--text-light); margin-bottom: 20px; line-height: 1.5; }
.newsletter-form { display: flex; gap: 8px; max-width: 380px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 12px 18px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.9rem; font-family: inherit; background: var(--card-bg); color: var(--text); }
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form button { padding: 12px 24px; background: var(--accent); color: #fff; border: none; border-radius: 10px; font-weight: 700; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.newsletter-form button:hover { background: var(--accent-dark); }
.newsletter-status { font-size: 0.82rem; margin-top: 12px; color: var(--accent); min-height: 20px; }

/* STICKY VIDEO */
.sticky-video { position: fixed; bottom: 24px; right: 24px; width: 340px; z-index: 900; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(20px) scale(0.92); pointer-events: none; transition: all 0.35s cubic-bezier(0.4,0,0.2,1); }
.sticky-video.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.sticky-video-close { position: absolute; top: 8px; right: 8px; z-index: 10; width: 28px; height: 28px; background: rgba(0,0,0,0.75); color: #fff; border: none; border-radius: 50%; cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.sticky-video-inner { position: relative; padding-bottom: 56.25%; background: #000; }
.sticky-video-inner iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* FOOTER */
.site-footer { padding: 32px 0; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-light); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--text-light); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-social a:hover { color: var(--accent); }
.ad-slot { padding: 16px 0; text-align: center; }
.ad-header { border-bottom: 1px solid var(--border); background: var(--bg3); }
.ad-footer { border-top: 1px solid var(--border); background: var(--bg3); }

/* 404 */
.page-404 { display: flex; align-items: center; justify-content: center; min-height: 100vh; text-align: center; }
.not-found h1 { font-family: 'Playfair Display', serif; font-size: 8rem; color: var(--accent); line-height: 1; margin-bottom: 12px; }
.not-found p { font-size: 1.1rem; color: var(--text-light); margin-bottom: 28px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-content { flex-direction: column; text-align: center; gap: 36px; padding: 50px 20px; }
  .hero-subtitle, .hero-tagline { margin-left: auto; margin-right: auto; }
  .book-3d { width: 180px; height: 255px; }
  .toc-grid { grid-template-columns: 1fr; }
  .layout-side .chapter-container { grid-template-columns: 1fr; }
  .layout-magazine .chapter-body { column-count: 1; }
  .chapter-sidebar { position: static; }
  .pag-flex { flex-direction: column; }
  .pag-next { text-align: left; }
  .sticky-video { width: 260px; bottom: 12px; right: 12px; }
  .toc-sidebar { width: 300px; right: -300px; }
  .articles-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) { .hero-text h1 { font-size: 1.8rem; } .chapter-body { font-size: 1.05rem; } .chapter-body h2 { font-size: 1.4rem; } }
@media print { .site-nav, .toc-sidebar, .toc-overlay, .sticky-video, .chapter-pagination, .ad-slot, .site-footer, .newsletter-section, .share-bar, .nav-actions { display: none !important; } body { background: #fff; color: #000; } }

/* Print button in share bar */
.share-print { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
