/* ==========================================================================
   Leosplain Dynamic Minimalist Theme Stylesheet
   Contemporary Black & White Aesthetic, Fluid Micro-Interactions, Mobile Ergonomics
   Cookie Banner, Image Lightbox, Print Stylesheet
   ========================================================================== */

:root {
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Noto Sans TC', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Noto Sans TC', 'PingFang TC', sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, Monaco, monospace;

    --max-site-width: 1140px;
    --max-reading-width: 740px;
    --header-height: 68px;

    --ease-out-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --speed-fast: 0.18s;
    --speed-normal: 0.28s;

    --user-reading-font-size: 1.1rem;
}

/* Dark Mode (Default) */
html[data-theme="dark"] {
    --bg-canvas: #09090b;
    --bg-surface: #131316;
    --bg-surface-hover: #1c1c21;
    --bg-muted: #202025;
    --bg-code: #111114;
    --border-subtle: #27272a;
    --border-hover: #3f3f46;
    --border-strong: #ffffff;
    --text-heading: #fafafa;
    --text-body: #d4d4d8;
    --text-muted: #71717a;
    --accent-btn-bg: #ffffff;
    --accent-btn-text: #09090b;
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Light Mode */
html[data-theme="light"] {
    --bg-canvas: #ffffff;
    --bg-surface: #f9f9fb;
    --bg-surface-hover: #f3f3f6;
    --bg-muted: #ececed;
    --bg-code: #f6f7f9;
    --border-subtle: #e4e4e7;
    --border-hover: #a1a1aa;
    --border-strong: #18181b;
    --text-heading: #09090b;
    --text-body: #27272a;
    --text-muted: #71717a;
    --accent-btn-bg: #09090b;
    --accent-btn-text: #ffffff;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------------------------
   Reset & Global Typography
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body.dynamic-minimalist-body {
    background-color: var(--bg-canvas);
    color: var(--text-body);
    font-family: var(--font-body);
    line-height: 1.8;
    font-weight: 400;
    letter-spacing: -0.012em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--speed-normal) ease, color var(--speed-normal) ease;
}

.site-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--speed-fast) ease, opacity var(--speed-fast) ease;
}

a:hover {
    color: var(--text-heading);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Reading Progress Indicator */
.reading-progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 2.5px;
    width: 0%;
    background-color: var(--border-strong);
    z-index: 9999;
    transition: width 0.08s linear;
}

/* --------------------------------------------------------------------------
   Dynamic Scroll Reveal Micro-Animations
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s var(--ease-out-smooth), transform 0.6s var(--ease-out-smooth);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Smart Auto-Hiding Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
    background-color: var(--bg-canvas);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s var(--ease-out-smooth), background-color var(--speed-normal) ease, border-color var(--speed-normal) ease, box-shadow var(--speed-normal) ease;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

.site-header.header-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-inner-wrap {
    max-width: var(--max-site-width);
    margin: 0 auto;
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Brand */
.site-brand {
    flex-shrink: 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--text-heading);
}

.brand-accent-dot {
    width: 6px;
    height: 6px;
    background-color: var(--border-strong);
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 2px;
}

/* Navigation & Long Item Overflow Handling */
.desktop-nav {
    flex: 1;
    min-width: 0; /* Prevents flex blowout on long menu items */
    display: flex;
    justify-content: flex-end;
}

.nav-scroll-wrapper {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    align-items: center;
}

.nav-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    white-space: nowrap;
}

.nav-list li a {
    display: inline-block;
    padding: 8px 14px;
    font-size: 0.885rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all var(--speed-fast) ease;
}

.nav-list li a:hover {
    color: var(--text-heading);
    background-color: var(--bg-surface);
}

.nav-list li.current-menu-item a {
    color: var(--text-heading);
    font-weight: 600;
    background-color: var(--bg-surface);
}

/* Header Action Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.control-btn,
.drawer-toggle-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--speed-fast) ease;
}

.control-btn:hover,
.drawer-toggle-btn:hover {
    color: var(--text-heading);
    border-color: var(--border-hover);
    background-color: var(--bg-surface);
    transform: translateY(-1px);
}

/* Sun / Moon Theme Icon Toggle */
html[data-theme="dark"] .icon-sun {
    display: inline-flex;
}
html[data-theme="dark"] .icon-moon {
    display: none;
}
html[data-theme="light"] .icon-sun {
    display: none;
}
html[data-theme="light"] .icon-moon {
    display: inline-flex;
}

/* Mobile Hamburger Toggle */
.drawer-toggle-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 12px 10px;
}

.drawer-toggle-btn .bar {
    width: 18px;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    transition: transform var(--speed-fast) ease, opacity var(--speed-fast) ease;
}

/* --------------------------------------------------------------------------
   Mobile Drawer Navigation (Smooth Spring Animation)
   -------------------------------------------------------------------------- */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0.25s ease;
}

.mobile-nav-drawer.is-active {
    visibility: visible;
    pointer-events: auto;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-nav-drawer.is-active .drawer-overlay {
    opacity: 1;
}

.drawer-sheet {
    position: absolute;
    top: 0;
    right: 0;
    width: 86%;
    max-width: 360px;
    height: 100%;
    background-color: var(--bg-canvas);
    border-left: 1px solid var(--border-subtle);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.32s var(--ease-out-smooth);
}

.mobile-nav-drawer.is-active .drawer-sheet {
    transform: translateX(0);
}

.drawer-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-brand-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.drawer-dismiss-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.drawer-search-container {
    margin-bottom: 24px;
}

.drawer-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.drawer-links-list li {
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-links-list li a {
    display: block;
    padding: 14px 4px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-heading);
    transition: padding-left var(--speed-fast) ease;
}

.drawer-links-list li a:hover {
    padding-left: 6px;
}

.drawer-extra-links {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.drawer-subhead {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.drawer-legal-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-legal-list li a {
    font-size: 0.9rem;
    color: var(--text-body);
}

/* --------------------------------------------------------------------------
   Search Modal Dialog
   -------------------------------------------------------------------------- */
.search-dialog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 90px 20px 20px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s ease, opacity 0.2s ease;
}

.search-dialog-modal.is-active {
    visibility: visible;
    opacity: 1;
}

.dialog-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.dialog-card {
    position: relative;
    width: 100%;
    max-width: 600px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow-hover);
    z-index: 2;
    transform: scale(0.96);
    transition: transform 0.25s var(--ease-out-smooth);
}

.search-dialog-modal.is-active .dialog-card {
    transform: scale(1);
}

.dialog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.dialog-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.dialog-close-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.dialog-tips {
    margin-top: 14px;
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Modern Search Form Pill */
.dynamic-search-form .search-input-pill {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 5px 8px 5px 14px;
    transition: border-color var(--speed-fast) ease, box-shadow var(--speed-fast) ease;
}

.dynamic-search-form .search-input-pill:focus-within {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(125, 125, 125, 0.15);
}

.search-lens-svg {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 10px;
}

.search-text-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-heading);
    padding: 8px 0;
    font-family: var(--font-body);
}

.search-submit-btn,
.primary-solid-btn {
    background-color: var(--accent-btn-bg);
    color: var(--accent-btn-text);
    border: 1px solid var(--accent-btn-bg);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: transform var(--speed-fast) ease, opacity var(--speed-fast) ease;
}

.search-submit-btn:hover,
.primary-solid-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Layout Canvas & Hero Intro
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
}

.main-page-wrapper {
    padding: 52px 0 88px;
}

.content-canvas {
    max-width: var(--max-site-width);
    margin: 0 auto;
    padding: 0 24px;
}

.content-reading-canvas {
    max-width: var(--max-reading-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.home-hero-zone {
    max-width: 820px;
    margin-bottom: 60px;
}

.hero-tag-pill {
    display: inline-block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 5px 14px;
    border-radius: 24px;
    margin-bottom: 18px;
}

.hero-main-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5.5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.04em;
    color: var(--text-heading);
    margin-bottom: 18px;
}

.hero-lead-text {
    font-size: clamp(1.08rem, 2.2vw, 1.25rem);
    line-height: 1.65;
    color: var(--text-body);
}

/* --------------------------------------------------------------------------
   Articles Grid / Stream (Micro-Interactions)
   -------------------------------------------------------------------------- */
.posts-stream-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.dynamic-post-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    transition: transform var(--speed-normal) var(--ease-out-smooth), border-color var(--speed-normal) ease, box-shadow var(--speed-normal) ease;
}

.dynamic-post-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.card-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.card-category-badge {
    font-weight: 600;
    color: var(--text-heading);
    background-color: var(--bg-muted);
    padding: 3px 10px;
    border-radius: 6px;
}

.card-category-badge:hover {
    opacity: 0.85;
}

.card-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 3.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.36;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.card-heading a {
    color: var(--text-heading);
}

.card-media-wrapper {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.card-cover-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.4s var(--ease-out-smooth);
}

.dynamic-post-card:hover .card-cover-img {
    transform: scale(1.025);
}

.card-summary-text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-body);
    margin-bottom: 22px;
}

.card-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.card-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--bg-muted);
    padding: 3px 10px;
    border-radius: 6px;
    transition: all var(--speed-fast) ease;
}

.tag-chip:hover {
    color: var(--text-heading);
    background-color: var(--border-subtle);
}

.card-read-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
}

.arrow-svg {
    transition: transform var(--speed-fast) var(--ease-spring);
}

.dynamic-post-card:hover .arrow-svg {
    transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Dynamic Pagination
   -------------------------------------------------------------------------- */
.dynamic-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
}

.dynamic-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    background-color: var(--bg-surface);
    transition: all var(--speed-fast) ease;
}

.dynamic-pagination .page-numbers:hover {
    border-color: var(--border-hover);
    color: var(--text-heading);
    transform: translateY(-1px);
}

.dynamic-pagination .page-numbers.current {
    background-color: var(--accent-btn-bg);
    color: var(--accent-btn-text);
    border-color: var(--accent-btn-bg);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Single Post Ergonomics, Typography Controls & Key Insights
   -------------------------------------------------------------------------- */
.modern-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.crumb-separator {
    opacity: 0.4;
}

.crumb-active {
    color: var(--text-heading);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.category-chip {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-heading);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.article-title {
    font-family: var(--font-heading);
    font-size: clamp(1.95rem, 5.2vw, 2.9rem);
    font-weight: 800;
    line-height: 1.26;
    letter-spacing: -0.035em;
    color: var(--text-heading);
    margin-bottom: 24px;
}

.article-sub-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.author-micro-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-thumb-circle {
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
}

.author-byline a {
    font-weight: 600;
    color: var(--text-heading);
}

/* Font Size Adjuster Controls */
.font-size-adjuster {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 3px 8px;
}

.adjuster-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-right: 2px;
}

.font-ctrl-btn {
    background: transparent;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-body);
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--speed-fast) ease;
}

.font-ctrl-btn:hover {
    background-color: var(--bg-muted);
    color: var(--text-heading);
}

.article-hero-figure {
    margin: 32px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

/* GEO & UX: Executive Summary / Key Insights Box */
.key-insights-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--border-strong);
    border-radius: 12px;
    padding: 24px 28px;
    margin: 36px 0;
    box-shadow: var(--card-shadow);
}

.insights-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-heading);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 12px;
}

.insights-sparkle {
    color: var(--border-strong);
}

.insights-body p {
    font-size: 1.025rem;
    line-height: 1.75;
    color: var(--text-body);
    margin-bottom: 0 !important;
}

/* Automated Scrollspy Table of Contents (TOC) */
.dynamic-scrollspy-toc {
    display: none;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 22px 26px;
    margin: 36px 0;
}

.toc-heading-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toc-header-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.toc-toggle-action {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.toc-nav-tree {
    list-style: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toc-nav-tree li a {
    font-size: 0.925rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.55;
    transition: all var(--speed-fast) ease;
}

.toc-nav-tree li a:hover,
.toc-nav-tree li.active-toc-item a {
    color: var(--text-heading);
    font-weight: 600;
    transform: translateX(4px);
}

.toc-nav-tree li.toc-level-3 {
    padding-left: 20px;
    font-size: 0.875rem;
}

/* Article Body Typography (Mobile Ergonomics) */
.article-body {
    font-size: var(--user-reading-font-size);
    line-height: 1.88;
    color: var(--text-body);
    transition: font-size 0.2s ease;
}

.article-body p {
    margin-bottom: 1.85rem;
}

.article-body h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 3.8vw, 1.95rem);
    font-weight: 700;
    line-height: 1.34;
    letter-spacing: -0.025em;
    margin: 3rem 0 1.25rem;
    color: var(--text-heading);
}

.article-body h3 {
    font-family: var(--font-heading);
    font-size: clamp(1.22rem, 3vw, 1.5rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin: 2.4rem 0 1rem;
    color: var(--text-heading);
}

.article-body ul,
.article-body ol {
    margin: 1.3rem 0 1.85rem 1.8rem;
}

.article-body li {
    margin-bottom: 0.6rem;
}

.article-body blockquote {
    background-color: var(--bg-surface);
    border-left: 3px solid var(--border-strong);
    border-radius: 0 10px 10px 0;
    padding: 20px 24px;
    margin: 2.4rem 0;
    font-style: italic;
    color: var(--text-body);
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* FAQ Accordion Styling (GEO Booster) */
.article-body details {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 1.5rem 0;
    transition: border-color var(--speed-fast) ease;
}

.article-body details[open] {
    border-color: var(--border-hover);
}

.article-body summary {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    color: var(--text-heading);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.article-body details p {
    margin-top: 14px;
    margin-bottom: 0;
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--text-body);
}

/* Clickable Images with Zoom Hint */
.article-body img {
    border-radius: 10px;
    cursor: zoom-in;
    transition: transform var(--speed-fast) ease, opacity var(--speed-fast) ease;
}

.article-body img:hover {
    opacity: 0.95;
    transform: scale(1.008);
}

/* Inline Code & High-end Code / Prompt Container */
.article-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background-color: var(--bg-code);
    color: var(--text-heading);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.code-prompt-wrapper {
    position: relative;
    margin: 2.4rem 0;
    background-color: var(--bg-code);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.code-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 9px 18px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.code-prompt-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    color: var(--text-body);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--speed-fast) ease;
}

.code-prompt-copy-btn:hover {
    color: var(--text-heading);
    border-color: var(--border-hover);
}

.code-prompt-copy-btn.copied {
    background-color: var(--accent-btn-bg);
    color: var(--accent-btn-text);
    border-color: var(--accent-btn-bg);
}

.article-body pre {
    padding: 20px 22px;
    margin: 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.68;
    background: transparent;
}

.article-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

/* Responsive Table Wrapper */
.responsive-table-scroller {
    width: 100%;
    overflow-x: auto;
    margin: 2.2rem 0;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.article-body th,
.article-body td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.article-body th {
    background-color: var(--bg-surface);
    font-weight: 600;
    color: var(--text-heading);
}

/* Interaction Strip & Share */
.article-interaction-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 44px 0 36px;
    padding: 20px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.strip-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.strip-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.interaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-body);
    font-size: 0.825rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--speed-fast) ease;
}

.interaction-btn:hover {
    color: var(--text-heading);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Tags */
.article-tags-zone {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 44px;
}

.tags-heading {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.tags-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Author Showcase Card (E-E-A-T) */
.author-showcase-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    gap: 22px;
    align-items: center;
    margin: 44px 0;
}

.author-showcase-img {
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
}

.author-kicker {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.author-full-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 2px 0 8px;
}

.author-bio-paragraph {
    font-size: 0.925rem;
    color: var(--text-body);
    line-height: 1.65;
}

/* Sequential Pager */
.article-pager-nav {
    margin: 48px 0;
}

.pager-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pager-card {
    display: block;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    transition: transform var(--speed-fast) ease, border-color var(--speed-fast) ease;
}

.pager-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.pager-arrow {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pager-title {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Related Recommendations */
.related-recommendations-zone {
    margin: 52px 0;
}

.related-section-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 22px;
    color: var(--text-heading);
}

.related-cards-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-mini-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    transition: border-color var(--speed-fast) ease;
}

.related-mini-card:hover {
    border-color: var(--border-hover);
}

.related-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.related-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.46;
}

.related-card-title a {
    color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   Floating Mobile Reading Action Pill
   -------------------------------------------------------------------------- */
.mobile-reading-pill {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    padding: 6px 14px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity var(--speed-normal) ease, transform var(--speed-normal) var(--ease-spring);
}

.mobile-reading-pill.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.reading-percent-num {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-heading);
}

.pill-top-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2px;
    transition: color var(--speed-fast) ease;
}

.pill-top-btn:hover {
    color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   Cookie Consent Banner (GDPR / PDPO Compliant)
   -------------------------------------------------------------------------- */
.cookie-consent-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 640px;
    margin: 0 auto;
    z-index: 2500;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow-hover);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.35s var(--ease-out-smooth), transform 0.35s var(--ease-out-smooth);
    display: none;
}

.cookie-consent-banner.banner-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.cookie-banner-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-info-text {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cookie-icon-svg {
    color: var(--text-heading);
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-message {
    font-size: 0.875rem;
    color: var(--text-body);
    line-height: 1.6;
    margin-bottom: 0;
}

.cookie-policy-anchor {
    color: var(--text-heading);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cookie-action-btn {
    border-radius: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: all var(--speed-fast) ease;
}

.btn-cookie-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.btn-cookie-secondary:hover {
    color: var(--text-heading);
    border-color: var(--border-hover);
}

.btn-cookie-primary {
    background-color: var(--accent-btn-bg);
    color: var(--accent-btn-text);
    border: 1px solid var(--accent-btn-bg);
}

.btn-cookie-primary:hover {
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Image Lightbox Modal
   -------------------------------------------------------------------------- */
.image-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.25s ease, opacity 0.25s ease;
}

.image-lightbox-modal.lightbox-active {
    visibility: visible;
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.lightbox-stage {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.lightbox-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-img-wrapper {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}

.lightbox-expanded-img {
    max-width: 88vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-image-caption {
    color: #a1a1aa;
    font-size: 0.85rem;
    margin-top: 12px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Comments Area
   -------------------------------------------------------------------------- */
.comments-block-area {
    margin-top: 60px;
    padding-top: 44px;
    border-top: 1px solid var(--border-subtle);
}

.comments-section-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 28px;
}

.comments-ordered-list {
    list-style: none;
    margin-bottom: 40px;
}

.comments-ordered-list .comment {
    border-bottom: 1px solid var(--border-subtle);
    padding: 22px 0;
}

.comment-author cite {
    font-weight: 600;
    font-style: normal;
}

.comment-meta a {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.comment-content {
    font-size: 0.96rem;
    margin: 12px 0;
}

.comment-form p {
    margin-bottom: 18px;
}

.comment-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-body);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-heading);
    font-family: var(--font-body);
    outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--bg-canvas);
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    padding: 56px 0 36px;
}

.footer-wrapper {
    max-width: var(--max-site-width);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-primary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-brand-box {
    max-width: 440px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
}

.footer-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.6;
}

.footer-links-grid {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links-grid li a {
    font-size: 0.9rem;
    color: var(--text-body);
}

.footer-links-grid li a:hover {
    color: var(--text-heading);
}

.footer-divider {
    height: 1px;
    background-color: var(--border-subtle);
    margin: 36px 0 24px;
}

.footer-secondary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.back-top-trigger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color var(--speed-fast) ease;
}

.back-top-trigger:hover {
    color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   Mobile Viewports & Ergonomics (< 1024px & < 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }

    .drawer-toggle-btn {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .header-inner-wrap {
        padding: 0 16px;
    }

    .content-canvas,
    .content-reading-canvas {
        padding: 0 16px;
    }

    .main-page-wrapper {
        padding: 36px 0 68px;
    }

    .dynamic-post-card {
        padding: 22px;
    }

    .card-cover-img {
        height: 210px;
    }

    .author-showcase-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }

    .pager-columns {
        grid-template-columns: 1fr;
    }

    .related-cards-layout {
        grid-template-columns: 1fr;
    }

    .footer-secondary-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-consent-banner {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 16px;
    }

    .cookie-btn-group {
        flex-direction: column;
    }

    .cookie-action-btn {
        width: 100%;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Print Stylesheet (@media print)
   -------------------------------------------------------------------------- */
@media print {
    *, *::before, *::after {
        background: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .site-header,
    .site-footer,
    .reading-progress-indicator,
    .mobile-reading-pill,
    .cookie-consent-banner,
    .image-lightbox-modal,
    .font-size-adjuster,
    .article-interaction-strip,
    .article-pager-nav,
    .comments-block-area,
    .mobile-nav-drawer,
    .search-dialog-modal {
        display: none !important;
    }

    .content-reading-canvas {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .article-body {
        font-size: 12pt !important;
        line-height: 1.6 !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555555;
    }
}

/* Accessibility Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}
