/*
Theme Name: Amir Teymoori
Theme URI: https://amirteymoori.net
Author: Amir Teymoori
Author URI: https://amirteymoori.net
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
*/

/* Font Face - General Sans (Self-hosted) */
@font-face {
    font-family: 'General Sans';
    src: url('assets/fonts/general-sans/GeneralSans-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'General Sans';
    src: url('assets/fonts/general-sans/GeneralSans-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'General Sans';
    src: url('assets/fonts/general-sans/GeneralSans-Medium.woff') format('woff');
    font-weight: 450;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'General Sans';
    src: url('assets/fonts/general-sans/GeneralSans-Regular.woff') format('woff');
    font-weight: 405;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'General Sans';
    src: url('assets/fonts/general-sans/GeneralSans-Semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* 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: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --gh-font-body: "General Sans", sans-serif;
    --gh-font-heading: "General Sans", sans-serif;
    --gh-font-heading-weight: 308;
    --font-body--family: var(--gh-font-body, "General Sans", sans-serif);
    --font-heading--family: var(--gh-font-heading, "General Sans", sans-serif);
    --font-heading--weight: var(--gh-font-heading-weight, 308);

    --radius: 0.75rem;
    --container-width: 1584px;
    --spacing: 1.5rem;
}

/* 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: 16px;
    line-height: 1.5;
    font-weight: 400;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    max-height: 100dvh;
    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: 100vh;
    max-height: 100dvh;
    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.5rem;
}

/* ==========================================================================
   Header & Navigation - Liquid Glass Effect
   ========================================================================== */

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

/* Liquid Glass Base - True Apple-Style Transparency */
.navbar-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.25) 100%
    );
    backdrop-filter: blur(40px) saturate(2) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(2) brightness(1.1);
    color: var(--color-text);
    padding: 0.425rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    contain: layout style paint;
    will-change: backdrop-filter;
}

/* Shimmer Animation Overlay - More Visible */
.navbar-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.7) 50%,
        transparent 100%
    );
    border-radius: inherit;
    animation: liquid-shimmer 4s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.6;
}

/* Specular Highlight (Optional Subtle Movement) */
.navbar-inner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 50%
    );
    border-radius: inherit;
    pointer-events: none;
    animation: specular-move 8s ease-in-out infinite;
}

/* Navbar Hover State - Enhanced Glass */
.navbar-inner:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0.35) 100%
    );
    backdrop-filter: blur(50px) saturate(2.2) brightness(1.15);
    -webkit-backdrop-filter: blur(50px) saturate(2.2) brightness(1.15);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.08);
}

.btn-home {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.425rem 0.85rem;
    border-radius: 9999px;
    transition: all 0.3s;
    color: var(--color-text);
    font-size: 1rem;
}

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

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

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

.main-nav li {
    margin: 0;
}

/* Menu Item - Liquid Glass Hover Bubble */
.main-nav a {
    position: relative;
    display: block;
    padding: 0.64rem 1.06rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-text);
    z-index: 1;
    will-change: transform;
}

/* Glass Bubble Effect (Hidden by Default) */
.main-nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: -1;
}

/* Hover State - Activate Glass Bubble with Strong Effect */
.main-nav a:hover {
    transform: translateY(-2px);
    color: var(--color-accent);
}

.main-nav a:hover::before {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px) saturate(1.5) brightness(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.5) brightness(1.2);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 1px rgba(255, 255, 255, 1),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    opacity: 1;
}

/* Glow Effect on Hover */
.main-nav a:hover::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.6) 0%,
        transparent 70%
    );
    border-radius: 14px;
    opacity: 0.5;
    z-index: -2;
    animation: menu-pulse 1.5s ease-in-out infinite;
}

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

.main-nav .current-menu-item > a::before,
.main-nav .current_page_item > a::before {
    background: rgba(9, 9, 11, 0.08);
    backdrop-filter: blur(20px) saturate(1.5) brightness(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.5) brightness(1.1);
    border-color: rgba(9, 9, 11, 0.15);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
    opacity: 1;
}

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

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

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

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

.author-info {
    flex: 1;
}

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

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

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

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

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

.author-location {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: var(--shadow-lg);
    font-size: 1rem;
    transition: opacity 0.3s;
}

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

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

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

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

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

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

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

.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.5rem;
    padding: 0.4rem 1rem 0.875rem;
}

.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.5rem;
    font-weight: 405;
    margin-bottom: 0.375rem;
    line-height: 1.4;
    max-height: 4.83rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--color-heading);
    padding: 0.6rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-text p {
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.5;
    max-height: 6.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0.6rem;
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    transition: opacity 0.15s;
    margin-left: 0.6rem;
}

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

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

.btn-load-more {
    background: var(--color-accent);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    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: 1rem 0;
}

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

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

.container-narrow {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.post-header {
    padding: 3rem 0 2rem;
}

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

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

.post-title {
    font-size: 2.25rem;
    font-weight: 440;
    line-height: 1.111;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    color: var(--color-heading);
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text);
}

.post-separator {
    opacity: 0.5;
}

.post-featured-image {
    width: 100%;
    margin-bottom: 3rem;
}

.post-featured-image .post-image {
    width: 100%;
    height: auto;
    aspect-ratio: unset;
    display: block;
    border-radius: var(--radius);
    background: transparent;
}

.post-featured-image .post-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    max-height: 600px;
}

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

.post-content {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
}

.post-content > * + * {
    margin-top: 1.5rem;
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 440;
    line-height: 1.2;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 440;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 2rem 0;
}

.post-content a {
    color: var(--color-text);
    text-decoration: underline;
    transition: opacity 0.3s;
}

.post-content a:hover {
    opacity: 0.85;
}

.post-content blockquote {
    border-left: 4px solid var(--color-border);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    opacity: 0.9;
}

.post-content code {
    background: var(--color-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: var(--color-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

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

.tags-share-grid {
    display: grid;
    gap: 3rem 1.5rem;
}

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

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

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

.tag-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    line-height: 1.556;
    padding: 0.125rem 0.625rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    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.625rem;
    font-size: 1.125rem;
}

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

.share-btn svg {
    width: 1em;
    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: 5rem 0;
    background: var(--color-secondary);
}

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

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

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

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

    .main-nav {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1.5rem;
        right: 1.5rem;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(24px);
        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.5rem;
        gap: 0;
    }

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

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

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

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

    .post-title {
        font-size: 1.75rem;
    }

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

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

    main {
        padding: 2rem 0;
    }

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

    /* Better touch targets */
    .btn-home {
        padding: 0.75rem 1rem;
    }

    .post-tag,
    .post-header-tag,
    .tag-link {
        padding: 0.5rem 1rem;
    }
}

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

    .author-header {
        flex-direction: row;
        gap: 2rem;
        max-width: 56rem;
    }

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

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

    .post-title {
        font-size: 3rem;
    }

    .post-header {
        padding: 5rem 0 3rem;
    }
}

@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: 3.5rem;
    }
}

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

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

.book-card {
    display: block;
    background: var(--color-primary);
    border-radius: 0.5rem;
    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.625rem;
}

.book-title {
    font-family: var(--font-heading--family);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 0.125rem;
    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;
}

.book-author {
    font-size: 0.6875rem;
    color: var(--color-text);
    opacity: 0.65;
    margin-bottom: 0.375rem;
    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.5rem;
    font-size: 0.625rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.375rem;
    margin-top: 0.375rem;
}

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

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

/* 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: 95vw;
    max-height: 95vh;
    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(20px);
}

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

.lightbox-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: var(--color-primary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    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: 2px;
}

/* 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: 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: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 32px;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

.cv-summary-text p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    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: 1rem;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.cv-timeline-date {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.75rem;
    background: var(--color-tertiary);
    border-radius: 9999px;
    margin-bottom: 1rem;
    color: var(--color-text);
}

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

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

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

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

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

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

.cv-job-description ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

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

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

.cv-tech-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.625rem;
    background: var(--color-tertiary);
    border-radius: 9999px;
    color: var(--color-text);
}

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

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

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

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

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

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

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

.cv-education-date {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.75rem;
    background: var(--color-tertiary);
    border-radius: 9999px;
    color: var(--color-text);
}

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

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

.cv-certificate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

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

.cv-certificate-date {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.75rem;
    background: var(--color-tertiary);
    border-radius: 9999px;
    color: var(--color-text);
}

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

.cv-project-card {
    background: var(--color-primary);
    padding: 2rem;
    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.125rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--color-heading);
}

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

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

.cv-project-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.625rem;
    background: var(--color-tertiary);
    border-radius: 9999px;
    color: var(--color-text);
}

.cv-project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    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: 1rem;
}

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

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

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

.cv-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 500;
    transition: opacity 0.3s;
}

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

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

/* ==========================================================================
   Liquid Glass Animations - Keyframes
   ========================================================================== */

/* Shimmer Animation - Light Sweep Across Navbar */
@keyframes liquid-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Specular Highlight Movement - Subtle Organic Motion */
@keyframes specular-move {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(10%, -5%);
    }
    66% {
        transform: translate(-10%, 5%);
    }
}

/* Menu Item Pulse Glow - Breathing Effect on Hover */
@keyframes menu-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* ==========================================================================
   Accessibility & Performance Optimizations
   ========================================================================== */

/* Reduced Motion - Disable Animations for Accessibility */
@media (prefers-reduced-motion: reduce) {
    .navbar-inner::before,
    .navbar-inner::after,
    .main-nav a:hover::after {
        animation: none;
    }

    .navbar-inner,
    .main-nav a,
    .main-nav a::before {
        transition-duration: 0.01s;
    }
}

/* Mobile Performance - Reduce Effects on Small Screens */
@media (max-width: 768px) {
    .navbar-inner {
        backdrop-filter: blur(20px) saturate(1.5);
        -webkit-backdrop-filter: blur(20px) saturate(1.5);
    }

    /* Disable animations on mobile for better performance */
    .navbar-inner::before,
    .navbar-inner::after {
        animation: none;
    }
}

/* Fallback for Browsers Without backdrop-filter Support */
@supports not (backdrop-filter: blur(30px)) {
    .navbar-inner {
        background: rgba(255, 255, 255, 0.98);
    }

    .main-nav a:hover::before {
        background: rgba(255, 255, 255, 0.85);
    }
}

/* Dark Mode Support (Optional - Future Enhancement) */
@media (prefers-color-scheme: dark) {
    .navbar-inner {
        background: linear-gradient(
            135deg,
            rgba(18, 18, 18, 0.85) 0%,
            rgba(18, 18, 18, 0.95) 50%,
            rgba(18, 18, 18, 0.85) 100%
        );
        border-color: rgba(255, 255, 255, 0.1);
    }

    .main-nav a:hover::before {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* ==========================================================================
   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: 2rem;
    }

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

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

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

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

    .cv-hero-meta {
        gap: 1rem;
        font-size: 0.875rem;
    }

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

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

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

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

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

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

    .cv-contact-card {
        padding: 2rem 1.5rem;
    }
}

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

    .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: 4rem;
    }

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

    .cv-section {
        padding: 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: 5rem;
}

/* Tech Hero Section */
.tech-hero {
    text-align: center;
    padding: 4rem 0 3rem;
    max-width: 48rem;
    margin: 0 auto;
}

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

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

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

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

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

.tech-card {
    background: var(--color-primary);
    padding: 2rem;
    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: 1rem;
    margin-bottom: 1rem;
}

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

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

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

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

.tech-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.625rem;
    background: var(--color-tertiary);
    border-radius: 9999px;
    color: var(--color-text);
}

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

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

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

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

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

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

/* 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: 4rem;
    }

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

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