/*
Theme Name: Amir Teymoori
Theme URI: https://amirteymoori.com
Author: Amir Teymoori
Author URI: https://amirteymoori.com
Description: A modern, minimalist theme inspired by Neue design
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: amirteymoori
*/

/* CSS Variables - Light Mode */
:root {
    --color-base: #f4f4f5;
    --color-primary: #ffffff;
    --color-secondary: #f4f4f5;
    --color-tertiary: #e4e4e7;
    --color-accent: #09090b;
    --color-text: #09090b;
    --color-heading: #09090b;
    --color-border: #e4e4e7;
    --color-shadow: rgba(9, 9, 11, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(9, 9, 11, 0.1), 0 4px 6px -4px rgba(9, 9, 11, 0.1);

    --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

    --gh-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --gh-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --gh-font-heading-weight: 400;
    --font-body--family: var(--gh-font-body);
    --font-heading--family: var(--gh-font-heading);
    --font-heading--weight: var(--gh-font-heading-weight, 400);

    --radius: 0.6375rem;
    --container-width: 1346.4px;
    --spacing: 1.275rem;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-base);
    color: var(--color-text);
    font-family: var(--font-base);
    font-size: 15.99px;
    line-height: 1.5;
    font-weight: 400;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 85vh;
    max-height: 85dvh;
    background: linear-gradient(135deg,
        rgba(239, 176, 255, 0.4) 0%,
        rgba(255, 182, 193, 0.3) 25%,
        rgba(255, 218, 185, 0.2) 50%,
        rgba(173, 216, 230, 0.3) 75%,
        rgba(176, 196, 222, 0.4) 100%);
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 85vh;
    max-height: 85dvh;
    background: linear-gradient(to top,
        rgb(244, 244, 245) 50%,
        rgba(244, 244, 245, 0.1) 100%);
    z-index: -1;
    pointer-events: none;
}

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

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 440;
    line-height: 1.2;
    color: var(--color-heading);
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.275rem;
}

/* ==========================================================================
   Header & Navigation - Simple & Clean
   ========================================================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: 0.85rem;
    background: transparent;
}

/* Navbar Container - Clean White Design */
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8.5px);
    -webkit-backdrop-filter: blur(8.5px);
    color: var(--color-text);
    padding: 0.34rem 0.7225rem;
    border-radius: 8499.15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.navbar-inner:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Dual-Mode Progress Bar (Loading + Scroll) */
.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2.55px;
    background: var(--color-accent);
    width: 0%;
    opacity: 0;
    border-radius: 0 0 8499.15px 8499.15px;
    z-index: 1;
    /* Smooth transitions for both modes */
    transition: opacity 0.3s ease;
}

/* Loading mode: smooth animated transitions */
.scroll-progress[data-mode="loading"] {
    transition: opacity 0.3s ease, width 0.3s ease-out;
}

/* Scroll mode: quick responsive transitions */
.scroll-progress[data-mode="scroll"] {
    transition: opacity 0.3s ease, width 0.1s ease-out;
}

.scroll-progress.visible {
    opacity: 1;
}

/* Home Button */
.btn-home {
    display: flex;
    align-items: center;
    gap: 0.425rem;
    padding: 0.34rem 0.6375rem;
    border-radius: 8499.15px;
    transition: background-color 0.2s ease;
    color: var(--color-text);
    font-size: 0.9996rem;
    font-weight: 500;
}

.btn-home:hover {
    background-color: var(--color-secondary);
}

/* Navigation Links Container */
.main-nav {
    flex: 1;
    display: flex;
    padding: 0 0.85rem;
}

.main-nav ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.425rem;
    list-style: none;
    font-size: 0.9996rem;
    width: 100%;
}

.main-nav li {
    margin: 0;
}

/* Menu Item - Simple Clean Style */
.main-nav a {
    display: block;
    padding: 0.4675rem 0.8075rem;
    border-radius: 8499.15px;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: var(--color-text);
    font-weight: 500;
}

/* Hover State - Clean Background */
.main-nav a:hover {
    background-color: var(--color-secondary);
    color: var(--color-accent);
}

/* Active/Current Page Indicator */
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
    background-color: var(--color-accent);
    color: var(--color-primary);
    font-weight: 500;
}

/* Main Content */
main {
    padding: 2.55rem 0;
}

/* Author Header */
.author-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.7rem;
    max-width: none;
    margin-bottom: 2.55rem;
}

.author-avatar {
    width: 5.1rem;
    height: 5.1rem;
    border-radius: 8499.15px;
    background: var(--color-primary);
    padding: 0.2125rem;
    box-shadow: var(--shadow-lg);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 8499.15px;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-info > * + * {
    margin-top: 0.85rem;
}

.author-title {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.425rem;
    margin-bottom: 0.85rem;
}

.author-title h1 {
    font-size: 2.9988rem;
    font-weight: 440;
    line-height: 1;
}

.author-bio {
    font-size: 1.1245rem;
    line-height: 1.556;
    margin-bottom: 1.7rem;
    color: var(--color-text);
}

.author-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.275rem;
}

.author-location {
    display: inline-flex;
    align-items: center;
    gap: 0.425rem;
    background: var(--color-primary);
    padding: 0.2125rem 0.6375rem;
    border-radius: 8499.15px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9996rem;
    transition: opacity 0.3s;
}

.author-location:hover {
    opacity: 0.85;
}

.author-location svg {
    width: 0.7438rem;
    height: 0.7438rem;
}

.author-social {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 1.2495rem;
}

.author-social a {
    transition: opacity 0.3s;
}

.author-social a:hover {
    opacity: 0.85;
}

.author-social svg {
    width: 1.0625rem;
    height: 1.0625rem;
}

/* Post Grid */
.post-grid {
    display: grid;
    gap: 1.275rem;
    grid-template-columns: 1fr;
    margin-bottom: 4.25rem;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-primary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: background-color 0.15s;
    position: relative;
}

.post-card:hover .post-image {
    opacity: 0.85;
}

.post-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--color-tertiary);
    overflow: hidden;
    transition: opacity 0.15s;
    position: relative;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.425rem;
    padding: 0.34rem 0.85rem 0.7438rem;
}

.post-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card a {
    text-decoration: none !important;
}

.post-card-title {
    font-family: var(--font-heading--family);
    font-size: 1.2rem;
    font-weight: 405;
    margin-bottom: 0.3187rem;
    line-height: 1.4;
    max-height: 4.1055rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--color-heading);
    padding: 0.51rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-text p {
    font-size: 0.9371rem;
    color: var(--color-text);
    line-height: 1.5;
    padding: 0.51rem;
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.6375rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8499.15px;
    transition: opacity 0.15s;
    margin-left: 0.51rem;
}

.post-tag:hover {
    opacity: 0.85;
}

/* Corner Ribbon Widget */
.post-card {
    position: relative;
    overflow: hidden; /* Ensure ribbon stays within card bounds */
}

.post-ribbon {
    position: absolute;
    top: 0.75rem;
    right: -1.95rem;
    width: 7.5rem;
    padding: 0.34rem 0;
    text-align: center;
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0425em;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: rotate(45deg);
    transform-origin: center;
    z-index: 10;
    pointer-events: none;
}

/* Ribbon variants */
.post-ribbon.ribbon-project {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.post-ribbon.ribbon-featured {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.post-ribbon.ribbon-new {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.post-ribbon.ribbon-popular {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 2px 8px rgba(250, 112, 154, 0.3);
}

/* Load More */
.load-more {
    display: flex;
    justify-content: center;
    margin-top: 2.55rem;
}

.btn-load-more {
    background: var(--color-accent);
    color: #fff;
    padding: 0.6375rem 1.7rem;
    border-radius: 0.425rem;
    font-size: 0.9996rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-load-more:hover {
    opacity: 0.85;
}

.btn-load-more:disabled,
.btn-load-more.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-load-more.loading {
    position: relative;
}

/* Footer */
.footer {
    padding: 0.85rem 0;
}

.footer-copyright {
    text-align: center;
    font-size: 0.8747rem;
    color: var(--color-text);
    opacity: 0.7;
    margin: 0;
}

/* Single Post */
.post-single {
    padding-bottom: 4.25rem;
}

.container-narrow {
    max-width: 51rem; /* Increased from 40.8rem (25% wider for better readability) */
    margin: 0 auto;
    padding: 0 1.275rem;
}

.post-header {
    padding: 2.55rem 0 1.7rem;
}

.post-header-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0;
    padding: 0.1062rem 0.5312rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8499.15px;
    transition: opacity 0.15s;
    margin-bottom: 1.275rem;
}

.post-header-tag:hover {
    opacity: 0.85;
}

.post-title {
    font-size: 2.4991rem;
    font-weight: 440;
    line-height: 1.2; /* Better balance */
    letter-spacing: -0.0213em;
    margin-bottom: 1.4875rem;
    color: var(--color-heading);
    max-width: 100%; /* Ensure title doesn't overflow */
    word-wrap: break-word;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6375rem;
    font-size: 0.9371rem; /* Slightly larger for readability */
    color: var(--color-text);
    opacity: 0.85;
}

.post-separator {
    opacity: 0.5;
}

.post-author {
    font-weight: 500; /* Emphasize author name */
}

.post-date,
.post-reading-time {
    opacity: 0.9;
}

.post-featured-image {
    width: 100%;
    margin-bottom: 2.975rem;
    position: relative;
}

.post-featured-image .post-image {
    width: 100%;
    height: auto;
    aspect-ratio: unset;
    display: block;
    border-radius: var(--radius);
    background: transparent;
    box-shadow: 0 4px 12px rgba(9, 9, 11, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-featured-image .post-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(9, 9, 11, 0.12);
}

.post-featured-image .post-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius);
}

.post-content-wrapper {
    padding-bottom: 2.55rem;
}

.post-content {
    font-size: 1.1245rem; /* Increased from 0.85rem for better readability */
    line-height: 1.75; /* Increased from 1.5 for easier reading */
    color: var(--color-text);
    letter-spacing: -0.0093em; /* Subtle letter spacing for cleaner look */
}

.post-content > * + * {
    margin-top: 1.4875rem; /* Increased spacing between elements */
}

.post-content h2 {
    font-size: 1.9992rem;
    font-weight: 440;
    line-height: 1.2;
    letter-spacing: -0.0213em;
    margin-top: 2.975rem; /* More breathing room before headings */
    margin-bottom: 1.0625rem; /* More space after headings */
    color: var(--color-heading);
}

.post-content h3 {
    font-size: 1.4993rem;
    font-weight: 440;
    line-height: 1.3;
    letter-spacing: -0.017em;
    margin-top: 2.125rem; /* Increased spacing */
    margin-bottom: 0.85rem; /* Increased spacing */
    color: var(--color-heading);
}

.post-content h4 {
    font-size: 1.2495rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.0127em;
    margin-top: 1.7rem;
    margin-bottom: 0.6375rem;
    color: var(--color-heading);
}


.post-content ul,
.post-content ol {
    padding-left: 1.7rem;
    margin-bottom: 0.6rem; /* Consistent spacing */
    line-height: 1.75;
}

.post-content li {
    margin-bottom: 0.6375rem; /* Better list item spacing */
}

.post-content li:last-child {
    margin-bottom: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 2.125rem 0; /* More breathing room around images */
    display: block;
    box-shadow: 0 4px 12px rgba(9, 9, 11, 0.08); /* Subtle shadow for depth */
}

.post-content a {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 0.17em;
    transition: text-decoration-color 0.2s ease;
}

.post-content a:hover {
    text-decoration-color: var(--color-accent);
}

.post-content blockquote {
    border-left: 3.4px solid var(--color-accent);
    padding-left: 1.4875rem;
    margin: 2.125rem 0;
    font-style: italic;
    font-size: 1.1245rem;
    line-height: 1.75;
    color: var(--color-heading);
    opacity: 0.9;
}

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

/* Inline code (not in pre blocks) */
.post-content :not(pre) > code {
    background: var(--color-tertiary);
    padding: 0.17rem 0.425rem;
    border-radius: 0.3187rem;
    font-size: 0.8997em;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
    color: var(--color-accent);
}

/* Code blocks - let Prism.js handle all styling */
.post-content pre {
    margin: 2.125rem 0;
    border-radius: 0.5rem;
    overflow-x: auto;
}

/* Don't override Prism.js code styling inside pre - removed empty rule */

/* Override Prism.js font size to follow industry standards (13px instead of default 18px) */
.post-content pre[class*="language-"] code,
.post-content pre.line-numbers code {
    font-size: 13px !important;
    line-height: 1.5 !important;
}

/* Fix excessive left padding from line-numbers plugin (reduce from ~68px to ~45px) */
.post-content pre.line-numbers {
    padding-left: 45px !important;
}

/* Enable word wrapping to prevent horizontal scrolling on long lines */
.post-content pre[class*="language-"] code,
.post-content pre.line-numbers code {
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.125rem 0;
    font-size: 0.9371rem;
    box-shadow: 0 2px 8px rgba(9, 9, 11, 0.04);
    border-radius: var(--radius);
    overflow: hidden;
}

.post-content table thead {
    background: var(--color-tertiary);
}

.post-content table th {
    padding: 0.85rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-heading);
    border-bottom: 1.7px solid var(--color-border);
}

.post-content table td {
    padding: 0.7438rem 0.85rem;
    border-bottom: 0.85px solid var(--color-border);
}

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

.post-content table tbody tr:hover {
    background: var(--color-secondary);
}

/* Horizontal rule */
.post-content hr {
    border: none;
    border-top: 0.85px solid var(--color-border);
    margin: 2.55rem 0;
}

/* Figures and captions */
.post-content figure {
    margin: 2.125rem 0;
}

.post-content figcaption {
    margin-top: 0.6375rem;
    font-size: 0.8747rem;
    text-align: center;
    color: var(--color-text);
    opacity: 0.75;
    font-style: italic;
}

/* Video embeds */
.post-content iframe,
.post-content video {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 2.125rem 0;
    box-shadow: 0 4px 12px rgba(9, 9, 11, 0.08);
}

/* Tags and Share Section */
.tags-and-share {
    margin-top: 2.55rem;
    padding-top: 2.55rem;
}

.tags-share-grid {
    display: grid;
    gap: 2.55rem 1.275rem;
}

.section-title {
    display: block;
    font-size: 1.4993rem;
    font-weight: 500;
    letter-spacing: -0.0213em;
    color: var(--color-heading);
    margin-bottom: 0.85rem;
}

/* Tags Section */
.tags-section {
    display: flex;
    flex-direction: column;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5312rem;
}

.tag-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.625rem;
    text-transform: uppercase;
    line-height: 1.556;
    padding: 0.1062rem 0.5312rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8499.15px;
    transition: opacity 0.15s ease;
    color: var(--color-text);
}

.tag-link:hover {
    opacity: 0.85;
}

/* Share Section */
.share-section {
    display: flex;
    flex-direction: column;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5312rem;
    font-size: 1.1245rem;
}

.share-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 1.7rem;
    padding: 0 0.85rem;
    background: var(--color-primary);
    border: none;
    border-radius: 8499.15px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: opacity 0.15s ease;
    color: var(--color-text);
}

.share-btn svg {
    width: 0.85em;
    height: auto;
}

.share-btn:hover {
    opacity: 0.85;
}

/* Copy Link Button States */
.copy-link-btn {
    position: relative;
}

.copy-link-btn .copied-icon {
    position: absolute;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.copy-link-btn .copy-icon {
    opacity: 1;
    transition: opacity 0.15s ease;
}

.copy-link-btn.copied .copied-icon {
    opacity: 1;
}

.copy-link-btn.copied .copy-icon {
    opacity: 0;
}

.related-posts {
    padding: 4.25rem 0;
    background: var(--color-secondary);
}

.related-posts-title {
    font-size: 1.4993rem;
    font-weight: 440;
    margin-bottom: 1.7rem;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    gap: 1.275rem;
    grid-template-columns: 1fr;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.425rem;
    color: var(--color-text);
}

/* Mobile Responsive */
@media (max-width: 639px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: calc(100% + 0.425rem);
        left: 1.275rem;
        right: 1.275rem;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20.4px);
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        display: none;
        z-index: 50;
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 0.425rem;
        gap: 0;
    }

    .main-nav li {
        width: 100%;
        border-bottom: 0.85px solid var(--color-border);
    }

    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: 0.85rem;
        font-size: 0.9996rem;
    }

    /* Mobile typography */
    .author-title h1 {
        font-size: 1.9992rem;
    }

    .post-title {
        font-size: 1.7493rem;
        line-height: 1.25;
    }

    .post-content {
        font-size: 0.9996rem; /* Slightly smaller on mobile */
        line-height: 1.7;
    }

    .post-content h2 {
        font-size: 1.4993rem;
        margin-top: 2.125rem;
    }

    .post-content h3 {
        font-size: 1.2495rem;
        margin-top: 1.7rem;
    }

    .post-content h4 {
        font-size: 1.1245rem;
        margin-top: 1.4875rem;
    }

    /* Mobile spacing */
    .container,
    .container-narrow {
        padding: 0 0.85rem;
    }

    .author-avatar {
        width: 3.825rem;
        height: 3.825rem;
    }

    main {
        padding: 1.7rem 0;
    }

    .author-header {
        margin-bottom: 1.7rem;
    }

    /* Better touch targets */
    .btn-home {
        padding: 0.5525rem 0.7225rem;
    }

    .post-tag,
    .post-header-tag,
    .tag-link {
        padding: 0.425rem 0.85rem;
    }
}

/* Responsive */
@media (min-width: 640px) {
    main {
        padding: 4.25rem 0;
    }

    .author-header {
        flex-direction: row;
        gap: 1.7rem;
        max-width: 47.6rem;
    }

    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-title {
        font-size: 2.4991rem;
        line-height: 1.15;
    }

    .post-content {
        font-size: 1.0621rem; /* Scale up slightly */
        line-height: 1.75;
    }

    .post-content h2 {
        font-size: 1.8743rem;
    }

    .post-content h3 {
        font-size: 1.3744rem;
    }

    .post-header {
        padding: 4.25rem 0 2.55rem;
    }
}

@media (min-width: 768px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tags-share-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .related-posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .post-title {
        font-size: 2.9988rem;
        line-height: 1.15;
    }

    .post-content {
        font-size: 1.1245rem; /* Full size on desktop */
        line-height: 1.75;
    }

    .post-content h2 {
        font-size: 1.9992rem;
    }

    .post-content h3 {
        font-size: 1.4993rem;
    }

    .container-narrow {
        padding: 0 1.7rem; /* More padding on large screens */
    }
}

/* Extra large screens - optimal reading width */
@media (min-width: 1280px) {
    .post-title {
        font-size: 3.2487rem;
    }
}

/* ==========================================================================
   Books Grid - Compact & Elegant Design
   ========================================================================== */

.books-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 2.125rem;
}

.book-card {
    display: block;
    background: var(--color-primary);
    border-radius: 0.425rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(9, 9, 11, 0.03),
                0 6px 8px -4px rgba(9, 9, 11, 0.02);
}

.book-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--color-secondary);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.book-card:hover .book-cover img {
    opacity: 0.9;
}

.book-info {
    padding: 0.5312rem;
}

.book-title {
    font-family: var(--font-heading--family);
    font-size: 0.7497rem;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 0.1062rem;
    color: var(--color-heading);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    /* Fixed height for 2 lines to keep all cards consistent */
    min-height: 1.875rem; /* 0.7497rem * 1.25 * 2 lines */
}

.book-author {
    font-size: 0.6872rem;
    color: var(--color-text);
    opacity: 0.65;
    margin-bottom: 0.3187rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.425rem;
    font-size: 0.6247rem;
    border-top: 0.85px solid var(--color-border);
    padding-top: 0.3187rem;
    margin-top: 0.3187rem;
}

.book-rating {
    font-size: 0.6247rem;
    line-height: 1;
}

.book-date {
    color: var(--color-text);
    opacity: 0.5;
    font-size: 0.6247rem;
}

/* Responsive Books Grid - 10% wider cards */
@media (min-width: 640px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (min-width: 1280px) {
    .books-grid {
        grid-template-columns: repeat(9, 1fr);
    }
}

/* ==========================================================================
   Image Lightbox
   ========================================================================== */

.image-lightbox {
    max-width: 80.75vw;
    max-height: 80.75vh;
    padding: 0;
    border: none;
    background: transparent;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.image-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(17px);
}

.lightbox-image {
    max-width: 80.75vw;
    max-height: 80.75vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 3.4px;
}

.lightbox-close {
    position: absolute;
    top: -40.8px;
    right: 0;
    background: var(--color-primary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    width: 30.6px;
    height: 30.6px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 27.99px;
    line-height: 1;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lightbox-close:hover {
    transform: scale(1.1);
    background: var(--color-secondary);
}

.lightbox-close:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 1.7px;
}

/* Make post content images and featured images clickable */
.post-content img:not([role="presentation"]),
.post-featured-image img:not([role="presentation"]) {
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    border-radius: 3.4px;
}

.post-content img:not([role="presentation"]):hover,
.post-featured-image img:not([role="presentation"]):hover {
    opacity: 0.9;
    transform: scale(1.01);
}

/* Prevent lightbox on linked images */
.post-content a img {
    cursor: default;
}

.post-content a img:hover {
    opacity: 1;
    transform: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .lightbox-close {
        top: 13.6px;
        right: 13.6px;
        width: 37.4px;
        height: 37.4px;
        font-size: 31.99px;
    }

    .lightbox-image {
        max-width: 78.2vw;
        max-height: 78.2vh;
    }
}

/* ==========================================================================
   CV/Resume Page Styles
   ========================================================================== */

.cv-page {
    padding-bottom: 4.25rem;
}

/* CV Hero Section */
.cv-hero {
    text-align: center;
    padding: 3.4rem 0 2.55rem;
}

.cv-hero-name {
    font-size: 3.4987rem;
    font-weight: 440;
    line-height: 1;
    margin-bottom: 0.85rem;
    color: var(--color-heading);
}

.cv-hero-title {
    font-size: 1.4993rem;
    font-weight: 405;
    line-height: 1.4;
    color: var(--color-text);
    opacity: 0.7;
    margin-bottom: 1.7rem;
}

.cv-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.275rem;
    font-size: 0.9371rem;
}

.cv-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.425rem;
    transition: opacity 0.3s;
}

.cv-meta-item:hover {
    opacity: 0.7;
}

.cv-meta-item svg {
    width: 0.85rem;
    height: 0.85rem;
}

/* CV Section */
.cv-section {
    padding: 2.55rem 0;
}

.cv-section-title {
    font-size: 1.7493rem;
    font-weight: 440;
    margin-bottom: 1.7rem;
    color: var(--color-heading);
}

/* CV Summary Grid */
.cv-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.7rem;
}

.cv-summary-text p {
    font-size: 0.9996rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
    color: var(--color-text);
}

.cv-summary-text p:last-child {
    margin-bottom: 0;
}

/* Quick Stats */
.cv-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.cv-stat-item {
    background: var(--color-primary);
    padding: 1.275rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.cv-stat-number {
    font-size: 2.4991rem;
    font-weight: 440;
    line-height: 1;
    color: var(--color-heading);
    margin-bottom: 0.425rem;
}

.cv-stat-label {
    font-size: 0.8747rem;
    color: var(--color-text);
    opacity: 0.7;
}

/* Skills Grid */
.cv-skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.7rem;
}

.cv-skill-category {
    background: var(--color-primary);
    padding: 1.7rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.cv-skill-category-title {
    font-size: 1.1245rem;
    font-weight: 500;
    margin-bottom: 0.85rem;
    color: var(--color-heading);
}

.cv-skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.425rem;
}

.cv-skill-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.7497rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.6375rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8499.15px;
    color: var(--color-text);
}

/* Timeline */
.cv-timeline {
    position: relative;
    padding-left: 1.7rem;
}

.cv-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    bottom: 0.85rem;
    width: 1.7px;
    background: var(--color-border);
}

.cv-timeline-item {
    position: relative;
    margin-bottom: 2.55rem;
}

.cv-timeline-item:last-child {
    margin-bottom: 0;
}

.cv-timeline-marker {
    position: absolute;
    left: -1.7rem;
    top: 1.275rem;
    width: 11.9px;
    height: 11.9px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid var(--color-base);
    z-index: 1;
}

.cv-timeline-content {
    background: var(--color-primary);
    padding: 1.7rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.cv-timeline-date {
    display: inline-block;
    font-size: 0.7497rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.6375rem;
    background: var(--color-tertiary);
    border-radius: 8499.15px;
    margin-bottom: 0.85rem;
    color: var(--color-text);
}

.cv-company {
    font-size: 1.2495rem;
    font-weight: 500;
    margin-bottom: 0.2125rem;
    color: var(--color-heading);
}

.cv-role {
    font-size: 0.9996rem;
    color: var(--color-text);
    opacity: 0.7;
    margin-bottom: 0.2125rem;
}

.cv-location {
    font-size: 0.8747rem;
    color: var(--color-text);
    opacity: 0.6;
    margin-bottom: 0.85rem;
}

.cv-job-description {
    margin-top: 0.85rem;
}

.cv-project-name {
    font-size: 0.9996rem;
    font-weight: 500;
    margin-bottom: 0.425rem;
    color: var(--color-heading);
}

.cv-job-description p {
    font-size: 0.9371rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 0.6375rem;
}

.cv-job-description ul {
    margin-left: 1.0625rem;
    margin-bottom: 0.85rem;
}

.cv-job-description li {
    font-size: 0.9371rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 0.425rem;
}

.cv-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.425rem;
    margin-top: 0.85rem;
}

.cv-tech-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.6872rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.5312rem;
    background: var(--color-tertiary);
    border-radius: 8499.15px;
    color: var(--color-text);
}

/* Education Grid */
.cv-education-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.275rem;
}

.cv-education-card {
    background: var(--color-primary);
    padding: 1.7rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.cv-education-icon {
    width: 40.8px;
    height: 40.8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-tertiary);
    border-radius: 50%;
    margin-bottom: 0.85rem;
}

.cv-education-icon svg {
    width: 20.4px;
    height: 20.4px;
}

.cv-education-degree {
    font-size: 1.1245rem;
    font-weight: 500;
    margin-bottom: 0.425rem;
    color: var(--color-heading);
}

.cv-education-school {
    font-size: 0.9996rem;
    color: var(--color-text);
    margin-bottom: 0.2125rem;
}

.cv-education-location {
    font-size: 0.8747rem;
    color: var(--color-text);
    opacity: 0.6;
    margin-bottom: 0.6375rem;
}

.cv-education-date {
    display: inline-block;
    font-size: 0.7497rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.6375rem;
    background: var(--color-tertiary);
    border-radius: 8499.15px;
    color: var(--color-text);
}

/* Certificates Grid */
.cv-certificates-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.275rem;
}

.cv-certificate-card {
    background: var(--color-primary);
    padding: 1.7rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.cv-certificate-icon {
    font-size: 2.9988rem;
    margin-bottom: 0.85rem;
}

.cv-certificate-name {
    font-size: 1.1245rem;
    font-weight: 500;
    margin-bottom: 0.425rem;
    color: var(--color-heading);
}

.cv-certificate-issuer {
    font-size: 0.9371rem;
    color: var(--color-text);
    opacity: 0.7;
    margin-bottom: 0.6375rem;
}

.cv-certificate-date {
    display: inline-block;
    font-size: 0.7497rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.6375rem;
    background: var(--color-tertiary);
    border-radius: 8499.15px;
    color: var(--color-text);
}

/* Projects Grid */
.cv-projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.275rem;
}

.cv-project-card {
    background: var(--color-primary);
    padding: 1.7rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cv-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(9, 9, 11, 0.15), 0 6px 8px -4px rgba(9, 9, 11, 0.1);
}

.cv-project-title {
    font-size: 1.1245rem;
    font-weight: 500;
    margin-bottom: 0.6375rem;
    color: var(--color-heading);
}

.cv-project-description {
    font-size: 0.9371rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 0.85rem;
}

.cv-project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.425rem;
    margin-bottom: 0.85rem;
}

.cv-project-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.6872rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.5312rem;
    background: var(--color-tertiary);
    border-radius: 8499.15px;
    color: var(--color-text);
}

.cv-project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.425rem;
    font-size: 0.8747rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: underline;
    transition: opacity 0.3s;
}

.cv-project-link:hover {
    opacity: 0.7;
}

.cv-project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

/* Contact Card */
.cv-contact-card {
    background: var(--color-primary);
    padding: 2.55rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.cv-contact-text {
    font-size: 0.9996rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 1.7rem;
    max-width: 35.7rem;
    margin-left: auto;
    margin-right: auto;
}

.cv-contact-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.cv-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.425rem;
    padding: 0.6375rem 1.275rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: 8499.15px;
    font-size: 0.9996rem;
    font-weight: 500;
    transition: opacity 0.3s;
}

.cv-contact-btn:hover {
    opacity: 0.85;
}

.cv-contact-btn svg {
    width: 15.3px;
    height: 15.3px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .navbar-inner,
    .main-nav a {
        transition-duration: 0.01s;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

/* CV Print Styles */
@media print {
    .navbar,
    .footer,
    .cv-contact-card {
        display: none;
    }

    body::before,
    body::after {
        display: none;
    }

    .cv-section {
        page-break-inside: avoid;
    }

    .cv-timeline-item {
        page-break-inside: avoid;
    }

    * {
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .cv-hero-name {
        font-size: 1.9992rem;
    }

    .cv-hero-title {
        font-size: 0.9996rem;
    }
}

/* CV Mobile Responsive */
@media (max-width: 639px) {
    .cv-hero {
        padding: 1.7rem 0;
    }

    .cv-hero-name {
        font-size: 1.9992rem;
    }

    .cv-hero-title {
        font-size: 1.1245rem;
    }

    .cv-hero-meta {
        gap: 0.85rem;
        font-size: 0.8747rem;
    }

    .cv-section {
        padding: 1.7rem 0;
    }

    .cv-section-title {
        font-size: 1.4993rem;
    }

    .cv-timeline {
        padding-left: 1.275rem;
    }

    .cv-timeline-marker {
        left: -1.3812rem;
    }

    .cv-timeline-content {
        padding: 1.275rem;
    }

    .cv-stat-number {
        font-size: 1.9992rem;
    }

    .cv-contact-card {
        padding: 1.7rem 1.275rem;
    }
}

/* CV Tablet Responsive */
@media (min-width: 640px) {
    .cv-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.55rem;
    }

    .cv-education-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cv-certificates-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cv-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cv-quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* CV Desktop Responsive */
@media (min-width: 768px) {
    .cv-skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cv-certificates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .cv-hero-name {
        font-size: 3.9984rem;
    }

    .cv-hero-title {
        font-size: 1.7493rem;
    }

    .cv-section {
        padding: 3.4rem 0;
    }

    .cv-projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .cv-projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   Tech Stack Page Styles
   ========================================================================== */

.tech-stack-page {
    padding-bottom: 4.25rem;
}

/* Tech Hero Section */
.tech-hero {
    text-align: center;
    padding: 3.4rem 0 2.55rem;
    max-width: 40.8rem;
    margin: 0 auto;
}

.tech-hero-title {
    font-size: 3.4987rem;
    font-weight: 440;
    line-height: 1;
    margin-bottom: 0.85rem;
    color: var(--color-heading);
}

.tech-hero-subtitle {
    font-size: 1.1245rem;
    line-height: 1.6;
    color: var(--color-text);
    opacity: 0.7;
}

/* Tech Section */
.tech-section {
    padding: 2.55rem 0;
}

.tech-section-title {
    font-size: 1.7493rem;
    font-weight: 440;
    margin-bottom: 1.7rem;
    color: var(--color-heading);
}

/* Tech Grid */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.275rem;
}

.tech-card {
    background: var(--color-primary);
    padding: 1.7rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tech-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(9, 9, 11, 0.15), 0 6px 8px -4px rgba(9, 9, 11, 0.1);
}

.tech-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.tech-icon {
    font-size: 2.4991rem;
    line-height: 1;
    width: 2.55rem;
    height: 2.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-tertiary);
    border-radius: 0.425rem;
}

.tech-card-title {
    font-size: 1.2495rem;
    font-weight: 500;
    color: var(--color-heading);
    line-height: 1.2;
}

.tech-card-description {
    font-size: 0.9371rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 0.85rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.425rem;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.6872rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0213em;
    padding: 0.2125rem 0.5312rem;
    background: var(--color-tertiary);
    border-radius: 8499.15px;
    color: var(--color-text);
}

/* Tech Mobile Responsive */
@media (max-width: 639px) {
    .tech-hero {
        padding: 1.7rem 0;
    }

    .tech-hero-title {
        font-size: 1.9992rem;
    }

    .tech-hero-subtitle {
        font-size: 0.9996rem;
    }

    .tech-section {
        padding: 1.7rem 0;
    }

    .tech-section-title {
        font-size: 1.4993rem;
    }

    .tech-card {
        padding: 1.275rem;
    }
}

/* Tech Tablet Responsive */
@media (min-width: 640px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tech Desktop Responsive */
@media (min-width: 1024px) {
    .tech-hero-title {
        font-size: 3.9984rem;
    }

    .tech-section {
        padding: 3.4rem 0;
    }

    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   Accessibility & Focus States
   ========================================================================== */

/* Improved focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
.share-btn:focus-visible,
.btn-home:focus-visible,
.main-nav a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 1.7px;
    border-radius: 3.4px;
}

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -34px;
    left: 0;
    background: var(--color-accent);
    color: var(--color-primary);
    padding: 6.8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ==========================================================================
   Print Styles - Optimized for Printing Articles
   ========================================================================== */

@media print {
    /* Reset for print */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Hide unnecessary elements */
    .navbar,
    .mobile-menu-toggle,
    .related-posts,
    .share-section,
    .footer,
    nav,
    button {
        display: none !important;
    }

    /* Page setup */
    body {
        font-size: 14.11pt;
        line-height: 1.5;
    }

    /* Content layout */
    .container-narrow {
        max-width: 100%;
        padding: 0;
    }

    /* Typography for print */
    .post-title {
        font-size: 28.22pt;
        margin-bottom: 12pt;
        page-break-after: avoid;
    }

    .post-header {
        padding: 0 0 12pt 0;
        border-bottom: 0.85px solid #000;
        margin-bottom: 24pt;
    }

    .post-meta {
        font-size: 11.76pt;
    }

    .post-content {
        font-size: 14.11pt;
        line-height: 1.6;
    }

    .post-content h2,
    .post-content h3,
    .post-content h4 {
        page-break-after: avoid;
        page-break-inside: avoid;
        margin-top: 18pt;
    }

    .post-content h2 {
        font-size: 21.17pt;
    }

    .post-content h3 {
        font-size: 16.46pt;
    }

    .post-content h4 {
        font-size: 14.11pt;
    }

    /* Images */
    .post-featured-image,
    .post-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    /* Links - show URLs */
    .post-content a[href]:after {
        content: " (" attr(href) ")";
        font-size: 11.76pt;
        color: #666;
    }

    /* Code blocks */
    .post-content pre,
    .post-content code {
        border: 1px solid #999;
        page-break-inside: avoid;
        font-size: 11.76pt;
    }

    /* Tables */
    .post-content table {
        border-collapse: collapse;
        page-break-inside: avoid;
    }

    .post-content table th,
    .post-content table td {
        border: 1px solid #000;
        padding: 8pt;
    }

    /* Blockquotes */
    .post-content blockquote {
        border-left: 2.55px solid #000;
        page-break-inside: avoid;
    }

    /* Page breaks */
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    /* Tags section */
    .tags-section {
        border-top: 0.85px solid #000;
        padding-top: 12pt;
        margin-top: 24pt;
    }

    .section-title {
        font-size: 12.94pt;
        font-weight: bold;
    }

    .tag-link {
        border: 1px solid #000;
        padding: 2pt 6pt;
        display: inline-block;
        margin: 2pt;
    }
}

/* ==========================================================================
   Books Page - Loading States
   ========================================================================== */

/* Loading state container */
.books-loading {
    text-align: center;
    padding: 4rem 0;
}

/* Loading spinner animation */
.loading-spinner {
    width: 42.5px;
    height: 42.5px;
    margin: 0 auto 0.85rem;
    border: 3.4px solid var(--color-border);
    border-top: 3.4px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Spinner rotation animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading text styling */
.books-loading p {
    color: var(--color-text);
    font-size: 0.935rem;
    opacity: 0.7;
}

/* Error state container */
.books-error {
    text-align: center;
    padding: 4rem 0;
    color: var(--color-text);
}

/* Error message link */
.books-error a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.books-error a:hover {
    opacity: 0.8;
}
