/* ==================== 1. Variables & Base ==================== */

:root {
    --color-green: #22c55e;
    --color-green-light: #4ade80;
    --color-blue: #2563eb;
    --color-dark-bg: #1e1e1e;
    --color-dark-card: #252526;
    --color-dark-border: #333;
    --color-dark-text: #dcddde;
    --color-dark-text-muted: #b8b8b8;
    --color-text: #333;
    --color-text-light: #666;
    --color-text-muted: #888;
    --color-border: #e0e0e0;
    --color-border-light: #eee;
    --gradient-main: linear-gradient(135deg, #4ade80 0%, #2563eb 100%);
    --shadow-button: 0 4px 14px rgba(37, 99, 235, 0.3);
    --shadow-card: 0 12px 48px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius-card: 24px;
    --radius-pill: 20px;
    --font-main: 'Inter', sans-serif;
}

/* Font */
* {
    font-family: var(--font-main);
}

/* Background */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -50px;
    left: 16px;
    background: var(--color-blue);
    color: #fff;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

/* Focus-visible outlines for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

.btn-back:focus-visible,
.dot:focus-visible,
.btn-collapse-sidebar:focus-visible,
.btn-expand-sidebar:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.5);
}

.btn-font-decrease:focus-visible,
.btn-font-increase:focus-visible,
.btn-back-to-top:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.5);
}

/* Hidden tab pages */
.tab-page-hidden {
    display: none;
}

/* ==================== 2. Page Wrapper & Card ==================== */

/* Page Wrapper - Centers the card */
.page-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.page-wrapper::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* Card */
.profile-card {
    width: 100%;
    max-width: 68vw;
    height: 68vh;
    background: var(--gradient-main);
    border: none;
    padding: 1px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.profile-card .card-body {
    height: 100%;
    background: #ffffff;
    border-radius: 23px;
    overflow: hidden;
}

.profile-card .row {
    height: 100%;
    position: relative;
}

/* macOS Dots */
.macos-dots {
    position: absolute;
    top: 14px;
    left: 16px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    position: relative;
}

.dot::after {
    font-size: 10px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.macos-dots:hover .dot::after {
    opacity: 1;
}

.dot-red { background-color: #ff5f57; }
.dot-red::after { content: "\00d7"; font-size: 14px; }

.dot-yellow { background-color: #febc2e; }
.dot-yellow::after { content: "\2013"; font-size: 11px; }

.dot-green { background-color: #28c840; }
.dot-green::after { content: ""; display: block; width: 8px; height: 8px; border: none; opacity: 0; }

.macos-dots:hover .dot-green::after {
    opacity: 1;
    background: transparent;
    border-top: 2px solid rgba(0, 0, 0, 0.25);
    border-right: 2px solid rgba(0, 0, 0, 0.25);
    border-bottom: 2px solid rgba(0, 0, 0, 0.25);
    border-left: 2px solid rgba(0, 0, 0, 0.25);
    width: 7px;
    height: 7px;
    border-radius: 1px;
}

/* Card Animations */
.profile-card {
    transition: max-width 0.4s ease, height 0.4s ease, border-radius 0.4s ease;
}

/* Close animation */
.card-close {
    animation: closeCard 0.4s ease forwards;
}

@keyframes closeCard {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

/* Minimize animation */
.card-minimize {
    animation: minimizeCard 0.4s ease forwards;
}

@keyframes minimizeCard {
    0% { transform: scale(1) translateY(0); opacity: 1; }
    100% { transform: scale(0.05) translateY(80vh); opacity: 0; }
}

/* Restore animation */
.card-restore {
    animation: restoreCard 0.4s ease forwards;
}

@keyframes restoreCard {
    0% { transform: scale(0.05) translateY(80vh); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Fullscreen */
.card-fullscreen {
    max-width: 100vw !important;
    height: calc(100vh - 40px) !important;
    border-radius: var(--radius-card) !important;
}

.card-fullscreen .card-body {
    border-radius: 23px !important;
}

/* Dock Icon */
.dock-icon {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
}

.dock-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dock-icon.dock-show {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.dock-icon:hover {
    transform: translateX(-50%) scale(1.15);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}

/* ==================== 3. Sidebar & Profile ==================== */

/* Profile Sidebar */
.profile-sidebar {
    background: var(--gradient-main);
    color: #fff;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    transition: max-width 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* Collapse sidebar button - top right of sidebar */
.btn-collapse-sidebar {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    z-index: 5;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-collapse-sidebar:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* Expand sidebar button - shown when collapsed */
.btn-expand-sidebar {
    display: none;
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: #fff;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-expand-sidebar:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-button);
}

/* Sidebar collapsed state */
.sidebar-collapsed .profile-sidebar {
    max-width: 0 !important;
    padding: 0 !important;
    opacity: 0;
    flex: 0 !important;
    overflow: hidden;
}

.sidebar-collapsed .content-area {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 50px;
}

.sidebar-collapsed .btn-expand-sidebar {
    display: inline-flex;
}

.sidebar-collapsed .btn-collapse-sidebar {
    display: none !important;
}

/* Show collapse button on desktop */
@media (min-width: 992px) {
    .btn-collapse-sidebar {
        display: inline-flex;
    }
}

.profile-sidebar .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-sidebar address {
    font-style: normal;
    color: rgba(255, 255, 255, 0.85);
}

/* Profile Image */
.profile-img-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile Info */
.profile-name {
    font-weight: 700;
    margin: 5px 0 10px;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.divider {
    width: 60px;
    margin: 15px auto;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 5px;
}

.social-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: #fff;
    transform: translateY(-3px);
}

/* Skill Tags */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.skill-tags .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 400;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Profile toggle (mobile only) */
.btn-toggle-profile {
    display: none;
}

.profile-name-collapsed {
    display: none;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 5px 0;
}

#profile-details {
    transition: all 0.3s ease;
    overflow: hidden;
}

.profile-hidden {
    max-height: 0 !important;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.profile-collapsed-show {
    display: block !important;
}

/* ==================== 4. Navigation ==================== */

/* Nav Pills */
.nav-pills {
    gap: 5px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 12px;
    margin-top: 18px;
}

.nav-pills .nav-link {
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 25px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    color: var(--color-green);
    background: rgba(34, 197, 94, 0.1);
}

.nav-pills .nav-link.active {
    color: #fff;
    background: var(--gradient-main);
    font-weight: 500;
}

.nav-pills .nav-link i {
    margin-right: 3px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    vertical-align: -3px;
    margin-right: 3px;
}

/* Tab Content */
.tab-content {
    padding: 20px 5px;
    text-align: justify;
    transition: opacity 0.15s ease;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-green) transparent;
}

.tab-content.fade-out {
    opacity: 0;
}

.tab-content.fade-in {
    opacity: 1;
}

/* Section headers */
.tab-content h6 {
    color: var(--color-green);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 1.5px;
}

/* Experience entries hover effect */
.tab-content .mb-3 {
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-content .mb-3:hover {
    background: rgba(34, 197, 94, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ==================== 5. Content Area ==================== */

/* Content Area */
.content-area {
    padding: 25px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: flex 0.4s ease, max-width 0.4s ease;
}

/* Open Tool button (pill gradient style) */
.btn-open-tool {
    display: inline-block;
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    background: var(--gradient-main);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-open-tool:hover {
    color: #fff;
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* ==================== 6. Post Layout ==================== */

/* Expanded card - no sidebar, fullscreen size */
.post-card {
    max-width: 100vw;
    height: calc(100vh - 40px);
}

.post-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Post header with back button */
.post-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 40px 14px;
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.post-header-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.post-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.post-header-actions .btn-back {
    border: none;
    cursor: pointer;
}

.btn-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-back:hover {
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-back i {
    margin-left: -1px;
}

.btn-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
    display: block;
}

.font-btn-icon {
    width: 16px;
    height: 16px;
    fill: #fff;
    display: block;
}

.meta-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    vertical-align: -2px;
}

/* Section header icons (CV tabs) */
.section-icon {
    width: 1.4rem;
    height: 1.4rem;
    vertical-align: -4px;
    filter: brightness(0) saturate(100%) invert(55%) sepia(52%) saturate(5765%) hue-rotate(118deg) brightness(97%) contrast(80%);
}

/* Breadcrumb navigation */
.post-breadcrumb {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    overflow: hidden;
}

.post-breadcrumb a {
    color: var(--color-blue);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.post-breadcrumb a:hover {
    color: var(--color-green);
}

.breadcrumb-sep {
    color: #bbb;
    font-weight: 400;
    flex-shrink: 0;
}

.breadcrumb-topic {
    color: #444;
    font-weight: 500;
    white-space: nowrap;
}

.breadcrumb-current {
    color: var(--color-text-light);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sticky title bar (appears on scroll, between header and body) */
.post-sticky-title {
    background: #fff;
    border-bottom: 1px solid var(--color-border-light);
    padding: 10px 40px;
    flex-shrink: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.post-sticky-title.visible {
    max-height: 50px;
    opacity: 1;
    padding-top: 10px;
    padding-bottom: 10px;
}

.post-sticky-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sticky-actions {
    display: none;
}

.post-sticky-title-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
    display: block;
    max-width: 720px;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Font size pill */
.btn-font-size {
    position: fixed;
    bottom: max(32px, env(safe-area-inset-bottom, 0px));
    left: 32px;
    z-index: 200;
    display: flex;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-button);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
}

.btn-font-size.visible {
    opacity: 1;
    visibility: visible;
}

.btn-font-decrease,
.btn-font-increase {
    border: none;
    background: linear-gradient(135deg, #4ade80, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: filter 0.2s ease;
}

.btn-font-decrease {
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-font-decrease:hover,
.btn-font-increase:hover {
    filter: brightness(1.15);
}

/* Back to top button */
.btn-back-to-top {
    position: fixed;
    bottom: max(32px, env(safe-area-inset-bottom, 0px));
    right: 32px;
    z-index: 200;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4ade80, #2563eb);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-button);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.btn-back-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.post-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-green) transparent;
}

/* Desktop scrollbar — gradient */
.post-body::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
    width: 5px;
}
.post-body::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
    background: transparent;
}
.post-body::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
    background: var(--gradient-main);
    border-radius: 4px;
}

/* Copy link toast notification */
.copy-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--gradient-main);
    color: #fff;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    white-space: nowrap;
}

.copy-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== 7. Blog Content ==================== */

/* Blog content area */
.blog-content {
    text-align: left;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
}

.blog-content h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--color-green);
    margin-top: 32px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--color-green);
}

.blog-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #444;
    margin-top: 20px;
    margin-bottom: 8px;
}

.blog-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
    margin-top: 18px;
    margin-bottom: 6px;
}

.blog-content p {
    line-height: 1.7;
    color: #444;
    margin-bottom: 1em;
}

.blog-content ul, .blog-content ol {
    color: #444;
    line-height: 1.7;
}

.blog-content li {
    margin-bottom: 6px;
}

/* Blog blockquotes */
.blog-content blockquote {
    border-left: 3px solid var(--color-green);
    background: rgba(34, 197, 94, 0.05);
    padding: 12px 20px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    color: #555;
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Blog table wrapper (injected by JS for horizontal scroll + rounded corners) */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    margin: 12px 0;
}

/* Blog tables */
.blog-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    margin: 0;
    border: none;
    border-radius: 0;
}

.blog-content table th,
.blog-content table td {
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    padding: 8px 12px;
    text-align: left;
}

.blog-content table th:last-child,
.blog-content table td:last-child {
    border-right: none;
}

.blog-content table tr:last-child td {
    border-bottom: none;
}

.blog-content table th {
    background: rgba(34, 197, 94, 0.08);
    font-weight: 600;
    color: var(--color-text);
}

/* Blog images */
.blog-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
}

.blog-content .img-caption {
    display: block;
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: -4px;
    margin-bottom: 16px;
}

/* Code blocks - syntax highlighting */
.blog-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
}

.blog-content code:not([class]) {
    background: rgba(37, 99, 235, 0.08);
    color: #d63384;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.blog-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: var(--radius-pill);
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid #313244;
}

.blog-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.6;
}

/* Code copy button — hidden by default, appears on hover (like GitHub) */
.blog-content pre {
    position: relative;
}

.btn-copy-code {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 2;
    font-family: var(--font-main);
    opacity: 0;
    pointer-events: none;
}

.blog-content pre:hover .btn-copy-code {
    opacity: 1;
    pointer-events: auto;
}

.btn-copy-code:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.3);
}

/* Rouge syntax highlighting (Monokai-inspired) */
.highlight .k, .highlight .kd, .highlight .kn,
.highlight .kp, .highlight .kr, .highlight .kt { color: #cba6f7; }
.highlight .s, .highlight .s1, .highlight .s2,
.highlight .sb, .highlight .sc, .highlight .sd,
.highlight .sh, .highlight .sx { color: #a6e3a1; }
.highlight .c, .highlight .c1, .highlight .cm,
.highlight .cs, .highlight .cp { color: #6c7086; font-style: italic; }
.highlight .nf, .highlight .nb { color: #89b4fa; }
.highlight .nn, .highlight .nc { color: #f9e2af; }
.highlight .mi, .highlight .mf, .highlight .mh,
.highlight .mo, .highlight .il { color: #fab387; }
.highlight .o, .highlight .ow { color: #89dceb; }
.highlight .p { color: #cdd6f4; }
.highlight .na { color: #a6e3a1; }
.highlight .no { color: #fab387; }
.highlight .ni { color: #cdd6f4; }
.highlight .ne { color: #f38ba8; }
.highlight .err { color: #f38ba8; }

/* ==================== 8. Blog Cards & Language Switcher ==================== */

/* Blog card links */
.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card {
    border: 1px solid var(--color-border-light);
    cursor: pointer;
}

.blog-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
}

/* Blog post metadata */
.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.blog-post-meta i {
    margin-right: 3px;
}

/* Blog tag badges */
.blog-post-tags {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
}

.badge.blog-tag {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(37, 99, 235, 0.15));
    color: var(--color-blue);
    font-weight: 500;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Blog excerpt */
.blog-excerpt {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* Blog post title */
.blog-post-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Language switcher pills */
.lang-switcher {
    display: inline-flex;
    gap: 0;
    margin-top: 8px;
    border-radius: 18px;
    background: linear-gradient(135deg, #4ade80, #2563eb);
    padding: 1px;
    width: fit-content;
}

.lang-pill {
    padding: 4px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text-light);
    background: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-pill:first-child {
    border-radius: 17px 0 0 17px;
}

.lang-pill:last-child {
    border-radius: 0 17px 17px 0;
}

.lang-pill:hover {
    color: var(--color-text);
    background: rgba(245, 245, 245, 1);
}

.lang-pill-active {
    color: #fff;
    background: linear-gradient(135deg, #4ade80, #2563eb);
}

.lang-pill-active:hover {
    color: #fff;
    background: linear-gradient(135deg, #4ade80, #2563eb);
    filter: brightness(1.1);
}

.lang-pill-disabled {
    color: #ccc;
    cursor: default;
    pointer-events: none;
}

/* ==================== 9. Calculation Page ==================== */

.calc-content {
    padding-bottom: 40px;
}

.calc-container {
    max-width: 1200px;
    margin: 0 auto;
}

.calc-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 4px;
}

.calc-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    font-size: 0.92rem;
}

.calc-section-title {
    color: var(--color-green);
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 8px;
    margin-bottom: 16px;
}

/* Pill-shaped buttons inside calc cards */
.calc-content .btn {
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Calculator cards */
.calc-card {
    border: 1px solid #e8e8e8;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.calc-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.calc-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Result areas */
.calc-result {
    min-height: 3rem;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 0.82rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.calc-result-tall {
    min-height: 4rem;
}

/* ==================== 10. Responsive (Mobile & Tablet) ==================== */

@media (max-width: 991px) {

    /* -- Base & Wrapper -- */

    /* Restore scrolling on mobile */
    html, body {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--color-green) transparent;
    }

    /* Webkit scrollbar (Safari, older Chrome) */
    ::-webkit-scrollbar {
        width: 4px;
    }
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    ::-webkit-scrollbar-thumb {
        background: var(--color-green);
        border-radius: 4px;
    }

    /* Remove background wallpaper */
    .page-wrapper {
        padding: 0;
        align-items: stretch;
        height: auto;
        min-height: 100vh;
        overflow: visible;
        background: #fff;
    }

    .page-wrapper::before {
        display: none;
    }

    /* Remove card chrome */
    .profile-card {
        max-width: 100%;
        height: auto;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: none;
    }

    .profile-card .card-body {
        border-radius: 0;
        overflow: visible;
    }

    .profile-card .row {
        height: auto;
        flex-direction: column;
    }

    /* Hide macOS dots and dock */
    .macos-dots,
    .dock-icon {
        display: none !important;
    }

    /* Hide sidebar collapse/expand buttons */
    .btn-collapse-sidebar,
    .btn-expand-sidebar {
        display: none !important;
    }

    /* Reset sidebar collapsed state on mobile */
    .sidebar-collapsed .profile-sidebar {
        max-width: 100% !important;
        padding: 20px 15px 12px !important;
        opacity: 1;
        flex: unset !important;
    }

    .sidebar-collapsed .content-area {
        padding-left: 16px;
    }

    /* -- Sidebar -- */

    /* Compact profile header */
    .profile-sidebar {
        height: auto;
        padding: 20px 15px 12px;
        border-radius: 0;
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        text-align: left;
    }

    #profile-details {
        display: flex;
        align-items: center;
        gap: 14px;
        max-height: none;
        transition: none;
    }

    #profile-details > h3 {
        display: none;
    }

    .profile-img-wrapper {
        width: 50px;
        height: 50px;
        margin: 0;
        flex-shrink: 0;
        border-width: 2px;
        border-radius: 50%;
        overflow: hidden;
        box-shadow: none;
    }

    .profile-info {
        text-align: left;
    }

    .profile-info > small:first-child,
    .profile-info > p,
    .profile-info > .divider,
    .profile-info > address,
    .profile-info > .social-links,
    .profile-info > .skill-tags,
    .profile-info > small:last-child {
        display: none !important;
    }

    .profile-name {
        font-size: 0.95rem;
        margin: 0;
    }

    /* Hide mobile toggle & collapsed name (not needed) */
    .btn-toggle-profile,
    .profile-name-collapsed {
        display: none !important;
    }

    /* -- Navigation -- */

    /* Content area - clean newspaper style */
    .content-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0 16px;
        padding-bottom: 70px;
    }

    /* Nav pills as sticky bottom navbar */
    .nav-pills {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: #fff;
        border-bottom: none;
        border-top: 1px solid var(--color-border-light);
        margin-top: 0;
        padding: 8px 6px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        display: flex;
        justify-content: space-around;
        gap: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    }

    .nav-pills .nav-item {
        flex: 1;
        text-align: center;
    }

    .nav-pills .nav-link {
        padding: 6px 4px;
        font-size: 0.65rem;
        white-space: nowrap;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .nav-pills .nav-link i {
        display: block;
        font-size: 1.15rem;
        margin-right: 0;
    }

    .nav-icon {
        display: block;
        width: 22px;
        height: 22px;
        margin: 0 auto;
    }

    .nav-pills .nav-link.active {
        background: none;
        color: var(--color-green);
        font-weight: 600;
    }

    .nav-pills .nav-link:hover {
        background: none;
    }

    /* Tab content */
    .tab-content {
        padding: 16px 0;
        max-height: none;
        font-size: 0.9rem;
        flex: 1;
    }

    .tab-content h6 {
        font-size: 0.95rem;
    }

    .tab-content .mb-3 {
        padding: 8px 8px;
    }

    .tab-content .float-end {
        float: none !important;
        display: block;
        margin-top: 2px;
    }

    /* -- Post -- */

    .post-card {
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: none;
        height: auto;
        max-width: 100%;
        width: 100%;
    }

    .post-card .card-body {
        border-radius: 0;
    }

    .post-layout {
        width: 100%;
        min-width: 0;
    }

    .post-header {
        padding: 12px 16px 10px;
        gap: 8px;
        transition: opacity 0.25s ease, max-height 0.25s ease;
        overflow: hidden;
    }

    .post-header-buttons {
        gap: 6px;
    }

    .post-header-buttons .btn-back,
    .post-header-actions .btn-back {
        width: 30px;
        height: 30px;
    }

    .post-header-buttons .btn-icon,
    .post-header-actions .btn-icon {
        width: 16px;
        height: 16px;
    }

    .post-header-actions {
        gap: 6px;
    }

    .post-header.scrolled-away {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .post-breadcrumb {
        flex-wrap: wrap;
        min-width: 0;
    }

    /* Hide title from breadcrumb — the post title is already visible below */
    .breadcrumb-current {
        display: none;
    }

    /* Hide "Home" breadcrumb — home icon button already visible */
    .breadcrumb-home,
    .breadcrumb-home-sep {
        display: none;
    }

    /* Hide the separator before the title (last .breadcrumb-sep) */
    .post-breadcrumb .breadcrumb-sep:last-of-type {
        display: none;
    }

    .post-body {
        padding: 16px;
        min-width: 0;
        overflow-x: hidden;
    }

    .post-sticky-title {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        padding: 0 16px;
        background: #fff;
        border-bottom: 1px solid var(--color-border-light);
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    .post-sticky-title.visible {
        max-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .post-sticky-title-text {
        font-size: 0.82rem;
        max-width: 100%;
        flex: 1;
        min-width: 0;
    }

    .sticky-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
        margin-left: 8px;
    }

    .btn-sticky {
        border: none;
        background: none;
        cursor: pointer;
        padding: 4px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s ease;
    }

    .btn-sticky:hover {
        background: rgba(0, 0, 0, 0.08);
    }

    .btn-sticky-icon {
        width: 18px;
        height: 18px;
        fill: #888;
        transition: fill 0.2s ease;
    }

    .btn-sticky:hover .btn-sticky-icon {
        fill: #333;
    }

    .blog-post-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    /* -- Blog Content -- */

    .blog-content {
        max-width: 100%;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        padding-bottom: 20px;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Every direct child must stay within bounds */
    .blog-content > * {
        max-width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Code blocks: stretch wider than content */
    .blog-content pre,
    .blog-content .highlight {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.75rem;
        padding: 16px;
        margin-left: -10px;
        margin-right: -10px;
        border-radius: var(--radius-pill);
        width: calc(100% + 20px);
        max-width: calc(100% + 20px) !important;
    }

    /* Tables: horizontal scroll within container */
    .blog-content .table-wrapper {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
        max-width: calc(100% + 20px) !important;
    }

    .blog-content table {
        font-size: 0.75rem;
    }

    .blog-content table th,
    .blog-content table td {
        padding: 6px 8px;
        white-space: nowrap;
    }

    /* Images: full width within content padding */
    .blog-content img {
        width: 100%;
        max-width: 100% !important;
        border-radius: 16px;
    }

    /* Inline code: allow breaking on long hashes/URLs */
    .blog-content code:not([class]) {
        word-break: break-all;
        font-size: 0.75rem;
    }

    /* Paragraphs and lists */
    .blog-content p,
    .blog-content li {
        overflow-wrap: break-word;
        word-break: break-word;
        font-size: 1rem;
    }

    .blog-content h2 {
        font-size: 1.4rem;
    }

    .blog-content h3 {
        font-size: 1.2rem;
    }

    .blog-content h4 {
        font-size: 1.05rem;
    }

    /* -- Calculation -- */

    .calc-container {
        padding: 0;
    }

    .calc-title {
        font-size: 1.3rem;
    }

    .calc-content .btn {
        font-size: 0.8rem;
    }

    .calc-card {
        border-radius: 12px;
    }
}

/* ==================== 11. Dark Mode ==================== */

body.dark-mode .btn-open-tool {
    background: var(--gradient-main);
    color: #fff;
}

body.dark-mode .btn-open-tool:hover {
    filter: brightness(1.15);
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
}

body.dark-mode .post-card,
body.dark-mode .post-card .card-body {
    background: #1e1e1e;
}

body.dark-mode .post-header {
    background: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .post-breadcrumb a {
    color: #7aa2f7;
}

body.dark-mode .breadcrumb-current {
    color: #999;
}

body.dark-mode .breadcrumb-sep,
body.dark-mode .breadcrumb-topic {
    color: #666;
}

body.dark-mode .post-sticky-title {
    background: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .post-sticky-title-text {
    color: #dcddde;
}

body.dark-mode .btn-sticky-icon {
    fill: #888;
}

body.dark-mode .btn-sticky:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .btn-sticky:hover .btn-sticky-icon {
    fill: #dcddde;
}

body.dark-mode .post-body {
    background: #262626;
}

body.dark-mode .blog-post-title {
    color: #dcddde;
}

body.dark-mode .blog-post-meta {
    color: #777;
}

body.dark-mode .blog-content p,
body.dark-mode .blog-content li,
body.dark-mode .blog-content ul,
body.dark-mode .blog-content ol {
    color: #b8b8b8;
}

body.dark-mode .blog-content h2 {
    color: #4ade80;
    border-bottom-color: #4ade80;
}

body.dark-mode .blog-content h3,
body.dark-mode .blog-content h4 {
    color: #cdcdcd;
}

body.dark-mode .blog-content hr {
    border-color: #383838;
}

body.dark-mode .blog-content a {
    color: #7aa2f7;
}

/* Dark mode tables */
body.dark-mode .table-wrapper {
    border-color: #383838;
}

body.dark-mode .blog-content table {
    border-color: #383838;
}

body.dark-mode .blog-content table th,
body.dark-mode .blog-content table td {
    border-color: #383838;
    color: #b8b8b8;
}

body.dark-mode .blog-content table th {
    background: rgba(74, 222, 128, 0.1);
    color: #dcddde;
}

/* Dark mode images */
body.dark-mode .blog-content img {
    border-color: #383838;
}

/* Dark mode code */
body.dark-mode .blog-content code:not([class]) {
    background: rgba(122, 162, 247, 0.15);
    color: #f7768e;
}

body.dark-mode .blog-content pre {
    background: #161616;
    border-color: #2a2a2a;
}

body.dark-mode .blog-content blockquote {
    border-left-color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    color: #b8b8b8;
}

/* Dark mode badges */
body.dark-mode .badge.blog-tag {
    background: rgba(74, 222, 128, 0.1);
    color: #7aa2f7;
    border-color: rgba(122, 162, 247, 0.3);
}

/* Dark mode back-to-top */
body.dark-mode .btn-font-size {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

body.dark-mode .btn-back-to-top {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* Dark mode copy toast */
body.dark-mode .copy-toast {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Dark mode lang-switcher */
body.dark-mode .lang-switcher {
    background: linear-gradient(135deg, #4ade80, #2563eb);
}

body.dark-mode .lang-pill {
    color: #999;
    background: #262626;
}

body.dark-mode .lang-pill:hover {
    color: #dcddde;
    background: #333;
}

body.dark-mode .lang-pill-active {
    color: #fff;
    background: linear-gradient(135deg, #4ade80, #2563eb);
}

body.dark-mode .lang-pill-disabled {
    color: #555;
}

/* Dark mode for calc page */
body.dark-mode .calc-title {
    color: #dcddde;
}

body.dark-mode .calc-subtitle {
    color: #777;
}

body.dark-mode .calc-section-title {
    color: #4ade80;
}

body.dark-mode .calc-card {
    background: #262626;
    border-color: #383838;
}

body.dark-mode .calc-card:hover {
    border-color: rgba(74, 222, 128, 0.3);
}

body.dark-mode .calc-card .card-title {
    color: #dcddde;
}

body.dark-mode .calc-card h6 {
    color: #b8b8b8;
}

body.dark-mode .calc-content .form-label {
    color: #b8b8b8;
}

body.dark-mode .calc-content .form-control {
    background: #1e1e1e;
    border-color: #383838;
    color: #dcddde;
}

body.dark-mode .calc-content .form-control::placeholder {
    color: #666;
}

body.dark-mode .calc-content .form-check-label {
    color: #b8b8b8;
}

body.dark-mode .calc-result {
    background: #1e1e1e;
    border-color: #383838;
    color: #b8b8b8;
}

body.dark-mode .calc-content .text-muted {
    color: #777 !important;
}

body.dark-mode .calc-content hr {
    border-color: #383838;
}

body.dark-mode .calc-card .small,
body.dark-mode .calc-card .small p,
body.dark-mode .calc-card .small strong {
    color: #b8b8b8;
}

body.dark-mode .calc-content details summary {
    color: #777;
}

body.dark-mode .calc-content details .small {
    color: #999;
}

/* Dark mode mobile - full screen background */
@media (max-width: 991px) {
    body.dark-mode,
    body.dark-mode .page-wrapper {
        background: #1e1e1e;
    }

    body.dark-mode .profile-card,
    body.dark-mode .profile-card .card-body {
        background: #1e1e1e;
    }

    body.dark-mode .post-header {
        background: #1e1e1e;
    }

    body.dark-mode .post-body {
        background: #1e1e1e;
    }

    body.dark-mode .post-sticky-title {
        background: #1e1e1e;
    }

    body.dark-mode .nav-pills {
        background: #1e1e1e;
        border-top-color: #333;
    }

    body.dark-mode .calc-content {
        background: #1e1e1e;
    }
}

/* ==================== 12. Print Styles ==================== */

/* Print-only header - hidden on screen */
.print-header {
    display: none;
}

@page {
    margin: 1.8cm 2cm;
}

@media print {
    /* ---- Force light mode ---- */
    body, body.dark-mode {
        background: #fff !important;
        color: #1a1a1a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ---- Print header ---- */
    .print-header {
        display: block;
        margin-bottom: 20px;
    }

    .print-header-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: #000;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .print-header-author {
        font-size: 0.85rem;
        color: #333;
        margin-bottom: 2px;
    }

    .print-header-meta {
        font-size: 0.8rem;
        color: #555;
        margin-bottom: 2px;
    }

    .print-header-url {
        font-size: 0.7rem;
        color: #999;
    }

    .print-header-line {
        border: none;
        border-top: 1px solid #ddd;
        margin: 12px 0 0;
    }

    /* ---- Hide all UI chrome ---- */
    .page-wrapper::before,
    .post-header,
    .post-sticky-title,
    .dock-icon,
    .btn-font-size,
    .btn-back-to-top,
    .skip-link,
    .copy-toast,
    .blog-post-title,
    .blog-post-meta,
    .lang-switcher,
    .page-transition,
    .nav-pills,
    .btn-copy-code,
    .lightbox-overlay {
        display: none !important;
    }

    .blog-post hr:first-of-type {
        display: none;
    }

    /* ---- Layout reset ---- */
    .page-wrapper {
        padding: 0;
        display: block;
        background: none !important;
    }

    .profile-card,
    .profile-card.post-card {
        max-width: 100%;
        height: auto;
        background: #fff !important;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .profile-card .card-body {
        border-radius: 0;
        background: #fff !important;
    }

    .post-layout {
        height: auto;
        display: block;
    }

    .post-body {
        overflow: visible;
        padding: 0;
        background: #fff !important;
    }

    .blog-content {
        max-width: 100%;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10.5pt !important;
        line-height: 1.6 !important;
        color: #1a1a1a !important;
    }

    .blog-content > * {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: auto !important;
    }

    /* ---- Typography ---- */
    .blog-content p,
    .blog-content li,
    .blog-content blockquote {
        color: #1a1a1a !important;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
        break-after: avoid;
    }

    .blog-content h2 {
        font-size: 1.3em !important;
        margin-top: 1.2em !important;
        margin-bottom: 0.4em !important;
        border-bottom: 1px solid #ddd;
        padding-bottom: 4px;
    }

    .blog-content h3 {
        font-size: 1.1em !important;
        margin-top: 1em !important;
        margin-bottom: 0.3em !important;
    }

    /* ---- Links: show URL inline ---- */
    .blog-content a {
        color: #1a1a1a !important;
        text-decoration: underline;
    }

    /* ---- Code blocks ---- */
    .blog-content pre,
    .blog-content .highlight {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #f6f8fa !important;
        color: #24292e !important;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px 12px;
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow: visible;
        margin-top: 8px;
        margin-bottom: 8px;
        box-sizing: border-box;
        font-size: 0.8em;
    }

    .blog-content pre code {
        background: none !important;
        color: #24292e !important;
        font-size: 0.85em;
        line-height: 1.45;
    }

    .highlight span {
        color: #24292e !important;
    }

    .blog-content code {
        background: #f0f0f0 !important;
        color: #1a1a1a !important;
        border: none;
    }

    /* ---- Tables ---- */
    .blog-content .table-wrapper {
        overflow: visible;
        border: none;
        border-radius: 0;
        margin: 8px 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .blog-content table {
        width: 100%;
        border-collapse: collapse;
        border: 1px solid #ddd;
        font-size: 0.8em;
        margin: 0;
        border-radius: 0;
        table-layout: fixed;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .blog-content table th,
    .blog-content table td {
        border: 1px solid #ddd;
        padding: 4px 6px;
        text-align: left;
        color: #1a1a1a !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .blog-content table code {
        word-break: break-all;
        font-size: 0.9em;
    }

    .blog-content table th {
        background: #f6f8fa !important;
        font-weight: 600;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ---- Images ---- */
    .blog-content img {
        max-width: 80% !important;
        height: auto !important;
        border: none;
        margin: 8px 0;
        display: block;
    }

    .img-caption {
        color: #666 !important;
        font-size: 0.85em !important;
        margin-top: -4px !important;
    }

    /* ---- Page break rules ---- */
    /* Allow paragraphs to break across pages — prevents excessive whitespace */
    p, li {
        page-break-inside: auto;
        break-inside: auto;
        orphans: 2;
        widows: 2;
    }

    pre, blockquote, .highlight {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    table {
        page-break-inside: auto;
        break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    img, figure {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* ---- Blockquotes ---- */
    .blog-content blockquote {
        border-left: 3px solid #ccc !important;
        background: #f9f9f9 !important;
        padding: 8px 14px !important;
        margin: 8px 0 !important;
        color: #333 !important;
    }

    /* ---- Lists ---- */
    .blog-content ul,
    .blog-content ol {
        padding-left: 20px !important;
        margin: 6px 0 !important;
    }

    /* ---- Horizontal rules ---- */
    .blog-content hr {
        border: none;
        border-top: 1px solid #ddd;
        margin: 16px 0;
    }
}

/* ==================== 13. Image Lightbox (Desktop Only) ==================== */

@media (min-width: 992px) {
    .blog-content img {
        cursor: zoom-in;
        pointer-events: auto;
        position: relative;
        z-index: 1;
    }

    .lightbox-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

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

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

    .lightbox-img-wrapper {
        position: relative;
        z-index: 1;
        max-width: 90vw;
        max-height: 85vh;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: auto;
    }

    .lightbox-img {
        max-width: 100%;
        max-height: 85vh;
        object-fit: contain;
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        transition: transform 0.2s ease;
        transform-origin: center center;
    }

    .lightbox-controls {
        position: fixed;
        bottom: 28px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 2;
        display: flex;
        gap: 16px;
        padding: 0;
    }

    .lightbox-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border: none;
        border-radius: 50%;
        background: var(--gradient-main);
        color: #fff;
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    }

    .lightbox-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    }

    .lightbox-btn:active {
        transform: scale(0.95);
    }

    .lightbox-btn svg {
        width: 22px;
        height: 22px;
        fill: #fff;
    }
}
