/* ================================================================
   CROAKER - MINIMALIST PORTFOLIO WEBSITE
   
   A clean, professional portfolio with blog functionality.
   Designed with accessibility and performance in mind.
   
   Author: Liam Hughes
   Version: 2.0
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Kalam:wght@300;400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties - Theme Variables */
:root {
    --bg: #0a0a0a;           /* Primary background colour */
    --fg: #ffffff;           /* Primary text colour */  
    --fg-light: #999999;     /* Secondary text colour */
    --font: 'JetBrains Mono', monospace; /* Monospace font for technical aesthetic */
    --accent: #ffffff;       /* Accent color for buttons */
    --accent-hover: #f0f0f0; /* Accent hover color */
    --border: rgba(255, 255, 255, 0.2); /* Border color */
}

body.light-mode {
    --bg: #ffffff;
    --fg: #000000;
    --fg-light: #333333;
    --accent: #000000;
    --accent-hover: #333333;
    --border: rgba(0, 0, 0, 0.2);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Fixed Sidebar Navigation - Right Side */
.nav-sidebar-fixed {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--fg-light);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.nav-header {
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--fg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
}

.nav-logo-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-logo-large:hover {
    animation: logoRock 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes logoRock {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(-6deg); }
    35% { transform: rotate(4deg); }
    55% { transform: rotate(-2deg); }
    75% { transform: rotate(1deg); }
    100% { transform: rotate(0deg); }
}

.nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--fg);
}

.nav-links {
    flex: 1;
    padding: 1rem 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 1.25rem 2rem;
    color: var(--fg-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
    font-size: 1rem;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    position: relative;
}

.nav-links a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(-90deg, transparent, rgba(255, 255, 255, 0.1));
    transition: width 0.3s ease;
}

.nav-links a:hover::before {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.08);
    border-right-color: var(--fg);
}

.nav-footer {
    padding: 2rem;
    border-top: 1px solid var(--fg-light);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--fg-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.7;
}

.admin-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.admin-link.active {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.theme-toggle-sidebar {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--fg-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-light);
    font-size: 0.9rem;
}

.theme-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--fg);
    color: var(--fg);
    transform: translateY(-1px);
}

.theme-toggle-sidebar .theme-icon {
    width: 20px;
    height: 20px;
    stroke: var(--fg-light);
    stroke-width: 2;
    fill: none;
}

.theme-toggle-sidebar:hover .theme-icon {
    stroke: var(--fg);
}

/* Adjust main content for right sidebar */
main {
    margin-right: 280px;
    margin-left: 0;
    min-height: 100vh;
    padding: 2rem;
    padding-right: 1rem;
}

/* Mobile Navigation Toggle Button */
.mobile-nav-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: var(--bg);
    border: 2px solid var(--fg);
    border-radius: 8px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-nav-toggle:hover {
    background: var(--fg);
    color: var(--bg);
    transform: scale(1.05);
}

.mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--fg);
    fill: none;
    stroke-width: 2;
    transition: stroke 0.3s ease;
}

.mobile-nav-toggle:hover svg {
    stroke: var(--bg);
}

/* Mobile Navigation Backdrop */
.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }
    
    .nav-sidebar-fixed {
        transform: translateX(100%);
        width: 280px;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
        /* Enable scrolling on mobile when content overflows */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-sidebar-fixed.mobile-open {
        transform: translateX(0);
    }
    
    main {
        margin-right: 0;
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem; /* Space for mobile nav button */
    }

    .nav-header {
        padding: 1.5rem;
    }

    .nav-links a {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }

    .nav-footer {
        padding: 1.5rem;
        /* Ensure footer stays at bottom but is always accessible */
        margin-top: auto;
        flex-shrink: 0;
    }
}

/* Even smaller mobile screens */
@media (max-width: 480px) {
    .mobile-nav-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .nav-sidebar-fixed {
        width: 100%;
        /* Better mobile scrolling and viewport handling */
        max-height: 100vh;
        max-height: 100dvh; /* Dynamic viewport height for better mobile support */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-header {
        padding: 1rem 1.5rem;
        flex-shrink: 0;
    }

    .nav-links {
        flex-grow: 1;
        /* Ensure nav links area can scroll if needed */
        overflow-y: auto;
        padding: 0.5rem 0;
    }

    .nav-links a {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .nav-footer {
        padding: 1rem 1.5rem;
        /* Ensure footer is always visible and accessible */
        margin-top: auto;
        flex-shrink: 0;
        background: var(--bg);
        border-top: 1px solid var(--fg-light);
    }

    .theme-toggle-sidebar {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .admin-link {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    main {
        padding: 0.75rem;
        padding-top: 4rem;
    }
}

/* iPhone 11 Pro Max and similar large mobile screens */
@media (max-width: 428px) and (max-height: 926px) {
    .nav-sidebar-fixed {
        /* Ensure perfect fit for iPhone 11 Pro Max viewport */
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height */
        display: flex;
        flex-direction: column;
    }

    .nav-header {
        flex-shrink: 0;
        padding: 1rem 1.25rem;
    }

    .nav-links {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0;
    }

    .nav-footer {
        flex-shrink: 0;
        padding: 1rem 1.25rem;
        background: rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(5px);
    }

    .theme-toggle-sidebar, .admin-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* PAGE TRANSITION */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-transition.active {
    transform: translateX(0);
}

.page-transition.exit {
    transform: translateX(100%);
}

/* Croaker logo animation - positioned and animated by GSAP */
.croaker-logo-transition {
    width: 140px;
    height: 140px;
    opacity: 0;
    transform: scale(0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -70px;
    margin-left: -70px;
    z-index: 10001;
    pointer-events: none;
}

body {
    opacity: 0;
    animation: pageLoad 0.3s ease-out 0.2s forwards;
}

@keyframes pageLoad {
    to {
        opacity: 1;
    }
}

/* MAIN */
main {
    flex: 1;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.2;
}

/* TITLE WITH LOGOS */
.title-logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    margin-left: -2rem;
    min-height: 120px;
    width: fit-content;
}

/* Homepage name and tagline */
.homepage-name {
    font-family: var(--font);
    font-weight: 700;
    font-size: 1.25rem; /* mobile-friendly base */
    margin: 0 0 0.25rem 0;
    letter-spacing: 0.5px;
    color: var(--fg); /* theme-aware: white in dark, black in light */
}
n@media (min-width: 900px) {
    .homepage-name {
        font-size: 2rem; /* larger on desktop */
    }
}

.homepage-tagline {
    margin: 0 0 0.5rem 0;
    color: var(--fg-light);
    font-size: 0.95rem;
}


.main-logo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    object-fit: contain;
}

.handwritten-title {
    height: 80px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(100%);
    transition: filter 0.3s ease;
}

.main-logo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    object-fit: contain;
}

.handwritten-title {
    height: 80px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(100%);
    transition: filter 0.3s ease;
}

.page-handwritten {
    height: 36px;
}

/* Smaller variant for CV title to avoid pixelation */
.page-handwritten-cv {
    height: 40px;
    image-rendering: auto;
}

.main-logo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.light-mode .handwritten-title,
.light-mode .page-handwritten,
.light-mode .page-handwritten-cv {
    filter: brightness(0) saturate(100%) invert(0%);
}

/* Cap handwritten title width to avoid oversized uploads pushing layout */
.title-logo-container .handwritten-title,
.handwritten-title {
    max-width: 420px !important;
    height: auto !important;
    max-height: 80px !important;
    width: auto !important;
    display: block;
}

/* Force smaller sizes for specific page handwritten images */
/* Use explicit class selector to ensure these target the blog and projects title images */
.title-logo-container .handwritten-title.page-handwritten[src$="blog.png"],
.title-logo-container img[src$="/blog.png"],
.handwritten-title[src$="blog.png"] {
    height: 48px !important;
    max-height: 48px !important;
    width: auto !important;
}

.title-logo-container .handwritten-title.page-handwritten[src$="projects.png"],
.title-logo-container img[src$="/projects.png"],
.handwritten-title[src$="projects.png"] {
    height: 48px !important;
    max-height: 48px !important;
    width: auto !important;
}

/* Fallback: keep previous page-handwritten rule if selector misses */
.page-handwritten {
    height: 36px;
}

/* Sticky photo (above homepage posts) */
.sticky-photo-container {
    margin-top: 0.5rem; /* sit under the section border */
    margin-bottom: 0.5rem;
    display: block;
}

.sticky-photo {
    height: 40px; /* half of previous 80px */
    width: auto;
    display: block;
    object-fit: cover;
    border-radius: 6px;
    margin-left: 0; /* left aligned with main content */
}

/* "Let's connect" image above social icons */
.lets-connect-container {
    margin-top: 0.25rem; /* move down slightly from text above */
    margin-bottom: 0rem; /* reduce gap to social icons below */
    display: block;
}

.lets-connect-img {
    height: 28px; /* slightly larger */
    width: auto;
    display: block;
    object-fit: contain;
    margin-left: 0; /* left aligned */
    margin-bottom: 0.125rem; /* small spacing below image */
}

/* Ensure dark/light inversion for these images if they are monochrome */
.sticky-photo,
.lets-connect-img {
    filter: none; /* leave color as-is by default */
}

/* Use .invert-on-dark to invert colors in dark mode */
.invert-on-dark {
    filter: brightness(0) saturate(100%) invert(100%);
    transition: filter 0.3s ease;
}

.light-mode .invert-on-dark {
    filter: brightness(0) saturate(100%) invert(0%);
}

/* If you want them to invert like handwritten titles, add .invert-on-dark */
.invert-on-dark {
    filter: brightness(0) saturate(100%) invert(100%);
    transition: filter 0.3s ease;
}

.light-mode .invert-on-dark {
    filter: brightness(0) saturate(100%) invert(0%);
}

h2 {
    font-size: 14px;
    font-weight: 400;
    color: var(--fg-light);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    color: var(--fg-light);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* SPOTLIGHT SECTION */
/* PROJECTS GRID */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
}

.project-image {
    height: 160px;
    background: #444;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.placeholder-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.placeholder-text {
    font-size: 0.9rem;
    opacity: 0.8;
    max-width: 80%;
}

.featured-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-complete {
    background: #22c55e;
    color: white;
}

.status-in-progress {
    background: #f59e0b;
    color: white;
}

.status-planning {
    background: #6366f1;
    color: white;
}

.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.project-title-row h3 {
    margin: 0;
    flex: 1;
}

.featured-badge-inline {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    margin-left: 0.5rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    border: 2px solid #ffd700;
    position: relative;
    transform: rotate(0deg);
    animation: featuredPulse 2s ease-in-out infinite;
}

.featured-badge-inline::before {
    content: '';
    margin-right: 0;
    font-size: 12px;
}

@keyframes featuredPulse {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }
    50% { 
        transform: rotate(0deg) scale(1.05);
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
    }
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0;
    line-height: 1.3;
}

.project-info p {
    font-size: 13px;
    color: var(--fg-light);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--fg);
}

.light-mode .project-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.light-mode .project-card:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode .project-image {
    background: #ddd;
    color: #333;
}

.light-mode .tech-tag {
    background: rgba(0, 0, 0, 0.08);
}

/* PROJECT MODAL */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-project-meta {
    font-size: 12px;
    color: var(--fg-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-project-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-light);
}

.modal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-link {
    padding: 0.5rem 1rem;
    background: var(--fg-light);
    color: var(--bg);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.project-link:hover {
    background: var(--fg);
    transform: translateY(-1px);
}

.modal-status {
    font-size: 12px;
    color: var(--fg-light);
    margin-left: auto;
}

.modal-project-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-featured-badge {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    border: 2px solid #ffd700;
    position: relative;
    transform: rotate(0deg);
}

.modal-featured-badge::before {
    content: '';
    margin-right: 0;
    font-size: 14px;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-info {
        padding: 1.25rem;
    }
    
    .modal-links {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-status {
        margin-left: 0;
        margin-top: 1rem;
    }
}

/* CV REDESIGN */
.cv-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
    height: 60vh;
    min-height: 400px;
}

.cv-panel {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.cv-panel:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
}

.panel-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 2rem 0;
    text-align: center;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

.panel-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.panel-info h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    text-align: left;
}

.panel-info h4 {
    font-size: 18px;
    font-weight: 500;
    color: var(--fg-light);
    margin-bottom: 0.75rem;
    text-align: left;
}

.panel-dates {
    font-size: 14px;
    color: var(--fg-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.panel-summary {
    font-size: 16px;
    color: var(--fg-light);
    line-height: 1.5;
    margin-bottom: 2rem;
    text-align: center;
}

.expand-hint {
    font-size: 14px;
    color: var(--fg-light);
    opacity: 0.7;
    font-style: italic;
    position: absolute;
    bottom: 2rem;
    right: 2rem;
}

/* CV MODAL */
.cv-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cv-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-cv-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modal-cv-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.modal-cv-details h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.modal-cv-details h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--fg-light);
    margin-bottom: 0.5rem;
}

.modal-dates {
    font-size: 13px;
    color: var(--fg-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#modal-cv-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--fg-light);
}

#modal-cv-content p {
    margin-bottom: 1.5rem;
}

#modal-cv-content ul {
    margin: 1rem 0 1.5rem 1.5rem;
}

#modal-cv-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

#modal-cv-content strong {
    color: var(--fg);
}

.light-mode .cv-panel {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.light-mode .cv-panel:hover {
    background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .cv-panels {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cv-panel {
        padding: 1.5rem;
    }
    
    .panel-header {
        align-items: center;
    }
    
    .panel-logo {
        width: 48px;
        height: 48px;
    }
    
    .modal-cv-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .modal-cv-logo {
        width: 56px;
        height: 56px;
    }
}

a {
    color: var(--fg);
    text-decoration: underline;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--fg-light);
}

/* SOCIAL LINKS */
.social-links {
    display: flex;
    justify-content: flex-start;
    gap: 2rem;
    /* reduced vertical margins to tighten spacing around lets-connect */
    margin: 0.125rem 0 1rem 0; /* slightly tighter to bring icons closer */
}

/* Reduce bottom margin of the intro paragraph when followed by the lets-connect image */
.title-logo-container + p {
    margin-bottom: 0.25rem;
}

.social-link {
    display: flex;
    align-items: center;
    color: var(--fg-light);
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-link:hover {
    color: var(--fg);
    transform: translateY(-2px);
}

.social-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Ensure PNG social images match SVG icon sizing and inherit color where possible */
.social-img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
    filter: none;
    vertical-align: middle; /* keep baseline alignment consistent */
}

/* Inline SVG social icons: fill with currentColor so they adapt to theme */
.social-svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible; /* allow strokes to extend beyond viewBox without clipping */
    vector-effect: non-scaling-stroke; /* keep stroke thickness consistent */
}

/* If you want the PNG to adapt to dark mode inversion like the SVGs, use .invert-on-dark on the <img> */
.invert-on-dark.social-img {
    filter: brightness(0) saturate(100%) invert(100%);
}

.light-mode .invert-on-dark.social-img {
    filter: brightness(0) saturate(100%) invert(0%);
}

/* HOME SOCIALS */
main > div {
    margin-top: 2rem;
    padding-top: 2rem;
}

main div p {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

/* HOMEPAGE POSTS SECTION */
.homepage-posts-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .homepage-posts-section {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.homepage-posts-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1.5rem;
    max-width: 1000px;
    padding: 1rem;
}

.post-section {
    display: block;
}

.post-container {
    border-radius: 0 0 8px 0;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 1.1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden; /* Change from visible to hidden to prevent size issues */
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.1);
    transform: rotate(-3deg);
    /* Ensure consistent pointer events */
    pointer-events: auto;
    user-select: none;
}

/* Handwritten font styling for sticky note content */
.post-container {
    font-family: 'Caveat', cursive;
    font-weight: 500;
}

.post-container .homepage-post-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 2rem;
}

.post-container .homepage-post-meta {
    font-family: 'Kalam', cursive;
    font-weight: 400;
    font-size: 0.75rem;
}

/* Description text handwriting */
.post-container p, 
.post-container div:not(.homepage-post-image):not(.homepage-post-badge) {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.4;
}

/* Realistic thumbtack in top right - cylindrical design */
.post-container::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 15px;
    width: 18px;
    height: 18px;
    background: 
        radial-gradient(ellipse at 30% 30%, 
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.3) 30%,
            #ef4444 40%,
            #dc2626 70%,
            #b91c1c 100%);
    border-radius: 50%;
    transform: rotate(-10deg);
    z-index: 5;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        0 2px 3px rgba(0, 0, 0, 0.6),
        inset -3px -3px 4px rgba(0, 0, 0, 0.3),
        inset 3px 3px 3px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Thumbtack needle - thicker and shorter for realism */
.post-container::before {
    content: '';
    position: absolute;
    top: 24px;
    right: 17px;
    width: 4px;
    height: 10px;
    background: 
        linear-gradient(90deg, 
            #52525b 0%,
            #71717a 30%,
            #a1a1aa 50%,
            #71717a 70%,
            #3f3f46 100%);
    transform: rotate(-10deg);
    z-index: 4;
    border-radius: 0 0 2px 2px;
    box-shadow: 
        2px 2px 3px rgba(0, 0, 0, 0.4),
        inset -0.5px 0 1px rgba(0, 0, 0, 0.3),
        inset 0.5px 0 1px rgba(255, 255, 255, 0.3);
}

/* Colored thumbtacks for each sticky note type */

/* Pinned blog - Red thumbtack */
.post-container.pinned::after {
    background: 
        radial-gradient(ellipse at 30% 30%, 
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.3) 30%,
            #ef4444 40%,
            #dc2626 70%,
            #b91c1c 100%);
}

/* Recent blog - Blue thumbtack */
.post-container.recent::after {
    background: 
        radial-gradient(ellipse at 30% 30%, 
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.3) 30%,
            #3b82f6 40%,
            #2563eb 70%,
            #1d4ed8 100%);
}

/* Featured project - Green thumbtack */
.post-container.featured-project::after {
    background: 
        radial-gradient(ellipse at 30% 30%, 
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.3) 30%,
            #22c55e 40%,
            #16a34a 70%,
            #15803d 100%);
}

/* Recent project - Purple thumbtack */
.post-container.recent-project::after {
    background: 
        radial-gradient(ellipse at 30% 30%, 
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.3) 30%,
            #a855f7 40%,
            #9333ea 70%,
            #7c3aed 100%);
}



.post-container.pinned {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

.post-container.recent {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 3px solid #3b82f6;
}

.post-container.featured-project {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
    border-left: 3px solid #22c55e;
}

.post-container.recent-project {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #9333ea;
    border-left: 3px solid #a855f7;
}

body.light-mode .post-container.pinned {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

body.light-mode .post-container.recent {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

body.light-mode .post-container.featured-project {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

body.light-mode .post-container.recent-project {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #9333ea;
}

.post-container:hover {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 12px 24px rgba(0, 0, 0, 0.15);
}

.post-container:nth-child(2) {
    transform: rotate(1deg);
}

.post-container:nth-child(2):hover {
    transform: rotate(0deg) translateY(-4px);
}

/* Sticky note tape effect */
.post-container::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 20px;
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transform: rotate(-10deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.post-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    transform: rotate(3deg); /* Counter-rotate to make badge straight */
}

.post-badge.pinned {
    color: #b45309;
    border: 1px solid rgba(180, 83, 9, 0.3);
}

.post-badge.recent {
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, 0.3);
}

.post-badge.featured-project {
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.post-badge.recent-project {
    color: #9333ea;
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.homepage-post-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    margin-top: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-container.pinned .homepage-post-title {
    color: #92400e;
}

.post-container.recent .homepage-post-title {
    color: #1e40af;
}

.post-container.featured-project .homepage-post-title {
    color: #16a34a;
}

.post-container.recent-project .homepage-post-title {
    color: #9333ea;
}

.homepage-post-meta {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    font-weight: 500;
}

.homepage-post-excerpt {
    font-size: 0.7rem;
    line-height: 1.3;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 8; /* Reduced from 10 to prevent overflow */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
    padding-right: 40px; /* Reduced from 110px to extend text width */
    padding-bottom: 5px; /* Reduced from 15px to show more text */
    word-wrap: break-word; /* Add word wrapping */
    word-break: break-word; /* Add word breaking for long words */
    hyphens: auto; /* Add automatic hyphenation */
}

.homepage-post-image {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 150px; /* Increased from 130px */
    height: 115px; /* Increased from 100px */
    background: #f8f8f8;
    border-radius: 2px;
    overflow: visible;
    border: 2px solid white;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transform: rotate(8deg);
    z-index: 3; /* Higher z-index to overlay text */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Ensure proper pointer events for image clicks */
    pointer-events: auto;
}

.homepage-post-image:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Cellotape effect */
.homepage-post-image::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-15deg);
    width: 30px;
    height: 15px;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(1px);
    z-index: 3;
}

/* Second piece of tape for more realistic look */
.homepage-post-image::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: -4px;
    transform: rotate(25deg);
    width: 25px;
    height: 12px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.5) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(1px);
    z-index: 3;
}

.homepage-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 1px;
}

.homepage-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-right: 90px; /* Make space for the photo */
}

.homepage-post-tag {
    font-size: 0.55rem;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    text-transform: lowercase;
}

.post-container.pinned .homepage-post-tag {
    color: #a16207;
}

.post-container.recent .homepage-post-tag {
    color: #1e40af;
}

.post-container.featured-project .homepage-post-tag {
    color: #16a34a;
}

.post-container.recent-project .homepage-post-tag {
    color: #9333ea;
}

/* View full post/project button */
.view-full-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    color: var(--fg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    text-transform: lowercase;
    font-family: inherit;
}

.view-full-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

body.light-mode .view-full-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

body.light-mode .view-full-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Modal action buttons */
.modal-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.modal-action-btn {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: lowercase;
}

.modal-action-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Responsive design for homepage posts */
@media (max-width: 768px) {
    .homepage-posts-container {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        max-width: 100%;
        padding: 0.5rem;
    }
    
    .post-container {
        aspect-ratio: 0.85;
        min-height: 180px;
        transform: rotate(0deg);
        padding: 1rem;
    }
    
    /* Hide tape effects on mobile */
    .post-container::before {
        display: none;
    }
    
    .homepage-post-image::before,
    .homepage-post-image::after {
        display: none;
    }
    
    /* Hide images completely on mobile sticky notes */
    .homepage-post-image {
        display: none;
    }
    
    /* Remove image space padding on mobile */
    .homepage-post-excerpt {
        padding-right: 0;
        padding-bottom: 5px;
    }
    
    .homepage-post-tags {
        padding-right: 0;
    }
    
    /* Smaller modals on mobile */
    .modal-content {
        width: 85% !important;
        max-width: 400px !important;
        max-height: 70vh !important;
        height: auto !important;
        top: 50% !important;
        transform: translate(-50%, -50%) scale(0.9) !important;
        overflow-y: auto !important;
    }
    
    .modal-content.active {
        transform: translate(-50%, -50%) scale(1) !important;
    }
    
    .modal-body {
        padding: 1.25rem !important;
        overflow: visible !important;
        max-height: none !important;
    }
    
    .modal-body h1 {
        font-size: 20px !important;
        margin-bottom: 1rem !important;
    }
    
    .modal-body #modal-content,
    .modal-body #modal-project-content,
    .modal-body #homepage-modal-content,
    .modal-body #homepage-project-modal-content {
        font-size: 14px !important;
        line-height: 1.5 !important;
        /* Allow full content on small screens with scroll if needed */
        max-height: calc(100vh - 160px) !important;
        display: block !important;
        overflow-y: auto !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        text-overflow: unset !important;
    }
    
    .modal-actions {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .modal-action-btn {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: auto !important;
        padding: 0.75rem 1.5rem !important;
        font-size: 14px !important;
        margin: 0 auto !important;
    }
    
    /* Fix modal backdrop on mobile only */
    .modal-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important; /* Dynamic viewport height for mobile */
        z-index: 999 !important;
    }
    
    .post-modal,
    .project-modal,
    .cv-modal,
    .image-popup-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important; /* Dynamic viewport height for mobile */
    }
    
    /* Smaller image popup on mobile */
    .image-popup-content {
        max-width: 80% !important;
        max-height: 50vh !important;
    }
    
    .image-popup-body img {
        max-height: 40vh !important;
    }
    
    .post-container:nth-child(2) {
        transform: rotate(0deg);
    }

    .homepage-post-title {
        font-size: 1.2rem;
        margin-top: 1.5rem;
        -webkit-line-clamp: 2;
    }

    .homepage-post-meta {
        font-size: 0.65rem;
        margin-bottom: 0.5rem;
    }

    .homepage-post-excerpt {
        font-size: 0.65rem;
        line-height: 1.2;
        -webkit-line-clamp: 8; /* Increased from 7 for mobile */
        text-overflow: ellipsis;
        padding-right: 10px;
        padding-bottom: 3px;
    }
}

    .post-badge {
        font-size: 0.55rem;
        padding: 0.2rem 0.4rem;
        top: 0.5rem;
        right: 0.5rem;
    }

    .homepage-post-image {
        width: 65px;
        height: 65px;
        bottom: 0.5rem;
        right: 0.5rem;
    }

    .homepage-post-image img {
        width: 65px;
        height: 65px;
    }
}

/* SEARCH CONTAINER */
.search-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
    font-family: var(--font);
    font-size: 14px;
    transition: all 0.2s ease;
}

body.light-mode #search-input {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.03);
}

#search-input::placeholder {
    color: var(--fg-light);
}

#search-input:focus {
    outline: none;
    border-color: var(--fg);
    background: rgba(255, 255, 255, 0.08);
}

body.light-mode #search-input:focus {
    background: rgba(0, 0, 0, 0.05);
}

.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: default;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    opacity: 0.7;
}

.search-icon,
.clear-icon {
    width: 16px;
    height: 16px;
    stroke: var(--fg-light);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* SORT INDICATOR */
.sort-indicator {
    margin-bottom: 2rem;
}

.sort-indicator span {
    font-size: 12px;
    color: var(--fg-light);
    font-weight: 500;
    border: 1px solid var(--fg-light);
    padding: 0.4rem 0.7rem;
    display: inline-block;
    border-radius: 4px;
}

/* MAIN CONTENT LAYOUT */
main {
    flex: 1;
    max-width: calc(100% - 280px);
    width: 100%;
    margin: 0;
    padding: 3rem 2rem;
    padding-right: 300px;
}

/* FILTERS SECTION - Thin horizontal layout */
.filters-section {
    margin: 2rem 0;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

body.light-mode .filters-section {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    align-items: start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 11px;
    color: var(--fg-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.filter-dot[data-color="blue"] {
    background-color: #60A5FA;
}

.filter-dot[data-color="orange"] {
    background-color: #FBBF24;
}

.filter-dot[data-color="green"] {
    background-color: #4ADE80;
}

.filter-dot[data-color="gray"] {
    background-color: #9CA3AF;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-option {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--fg-light);
    font-family: var(--font);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

body.light-mode .filter-option {
    border-color: rgba(0, 0, 0, 0.1);
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg);
    border-color: rgba(255, 255, 255, 0.2);
}

body.light-mode .filter-option:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

.filter-option.active {
    background: var(--fg);
    color: var(--bg);
    font-weight: 500;
    border-color: var(--fg);
}

.filter-option.active:hover {
    background: var(--fg);
    color: var(--bg);
}

/* BLOG POSTS */
#blog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.blog-post {
    position: relative;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    gap: 1rem;
}

body.light-mode .blog-post {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.03);
}

.blog-post:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

body.light-mode .blog-post:hover {
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.04);
}

.blog-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--fg);
    border-radius: 8px 0 0 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-post:hover::before {
    opacity: 1;
}

.blog-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: var(--fg-light);
    white-space: nowrap;
}

.new-post-badge {
    color: #3b82f6; /* Changed from green to blue */
    font-weight: bold;
    font-size: 14px;
}

.pinned-post-badge {
    color: #f59e0b; /* Yellow color for pinned posts */
    font-weight: bold;
    font-size: 14px;
    margin-right: 8px;
}

.blog-post-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-light);
}

.blog-post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--fg);
}

.blog-post-excerpt {
    font-size: 14px;
    color: var(--fg-light);
    line-height: 1.4;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Clamp preview to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    hyphens: auto;
}

.blog-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .blog-post-footer {
    border-top-color: rgba(0, 0, 0, 0.05);
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-tag {
    padding: 0.2rem 0.6rem;
    font-size: 11px;
    color: var(--fg-light);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

body.light-mode .blog-tag {
    background: rgba(0, 0, 0, 0.05);
}

/* Blue tags for years */
.blog-tag[data-color="blue"] {
    background: rgba(96, 165, 250, 0.2);
    color: #60A5FA;
}

body.light-mode .blog-tag[data-color="blue"] {
    background: rgba(96, 165, 250, 0.15);
    color: #2563EB;
}

/* Orange tags for languages */
.blog-tag[data-color="orange"] {
    background: rgba(251, 191, 36, 0.2);
    color: #FBBF24;
}

body.light-mode .blog-tag[data-color="orange"] {
    background: rgba(251, 191, 36, 0.15);
    color: #D97706;
}

/* Green tags for topics */
.blog-tag[data-color="green"] {
    background: rgba(74, 222, 128, 0.2);
    color: #4ADE80;
}

body.light-mode .blog-tag[data-color="green"] {
    background: rgba(74, 222, 128, 0.15);
    color: #16A34A;
}

/* Gray tags for misc/general */
.blog-tag[data-color="gray"] {
    background: rgba(156, 163, 175, 0.2);
    color: #9CA3AF;
}

body.light-mode .blog-tag[data-color="gray"] {
    background: rgba(156, 163, 175, 0.15);
    color: #6B7280;
}

.blog-post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
    color: var(--fg-light);
}

.admin-badge {
    padding: 0.1rem 0.4rem;
    font-size: 10px;
    font-weight: 600;
    background: var(--fg);
    color: var(--bg);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Blog post layout */
.blog-post-content {
    flex: 1;
    min-width: 0; /* Allow content to shrink within flex container to prevent overflow */
}

.blog-post-thumbnail {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: visible;
    background: none;
    position: relative;
}

body.light-mode .blog-post-thumbnail {
    background: none;
}

.blog-post-thumbnail img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.blog-post-thumbnail-placeholder {
    /* Invisible placeholder that maintains layout space */
    opacity: 0;
    pointer-events: none;
}

body.light-mode .blog-post-thumbnail img {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.04);
}

.blog-post:hover .blog-post-thumbnail img {
    transform: scale(1.08) rotate(1deg);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.light-mode .blog-post:hover .blog-post-thumbnail img {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--fg-light);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.5;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
}

/* POST MODAL */
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.post-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

body.light-mode .modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease;
    z-index: 2001;
}

body.light-mode .modal-content {
    border-color: rgba(0, 0, 0, 0.2);
}

.post-modal.active .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

body.modal-open {
    overflow: hidden;
}

.modal-header {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.close-modal-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-modal-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: 85vh;
}

.modal-post-meta {
    font-size: 16px;
    color: var(--fg-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.modal-date-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-post-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-light);
}

.modal-body h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.2;
    color: var(--fg);
}

.modal-body #modal-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--fg-light);
    margin-bottom: 2rem;
    /* Always limit modal content to encourage view full usage */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Apply same truncation to all modal content types */
.modal-body #homepage-modal-content,
.modal-body #homepage-project-modal-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--fg-light);
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.modal-body #modal-content p {
    margin-bottom: 0.5rem;
}

.modal-body #modal-content p:last-child {
    margin-bottom: 0;
}

.modal-body #modal-project-content p {
    margin-bottom: 0.5rem;
}

.modal-body #modal-project-content p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .modal-footer {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-left: auto;
}

.modal-tags .blog-tag {
    font-size: 13px;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    /* Remove the generic background and color so the specific tag colors work */
}

.modal-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
    color: var(--fg-light);
}

/* Main layout adjustments - centered with more width */
main {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    main {
        max-width: 900px;
    }
    
    .filters-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1.5rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        margin-bottom: 1.5rem;
    }
    
    .search-input-wrapper {
        max-width: none;
    }
    
    .search-input {
        width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem 1rem;
    }
    
    .sort-indicator {
        text-align: left;
        margin-bottom: 1rem;
        font-size: 12px;
    }
    
    .title-logo-container {
        gap: 1rem;
        margin-bottom: 1.5rem;
        min-height: 80px;
        margin-left: -1rem;
    }
    
    .main-logo {
        width: 80px;
        height: 80px;
    }
    
    .handwritten-title {
        height: 60px;
    }
    
    .filters-section {
        margin: 1.5rem 0;
        padding: 0.75rem 1.5rem;
    }
    
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .filter-group {
        gap: 0.4rem;
    }
    
    .filter-label {
        font-size: 10px;
        margin-bottom: 0.2rem;
    }
    
    .filter-dot {
        width: 5px;
        height: 5px;
    }
    
    .filter-options {
        gap: 0.25rem;
    }
    
    .filter-option {
        padding: 0.25rem 0.5rem;
        font-size: 10px;
    }
    
    #blog-list {
        margin-top: 1rem;
    }
    
    .blog-post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .blog-post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 2.5% auto;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-body h1 {
        font-size: 26px;
    }
    
    .modal-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal-tags {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .modal-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .nav-sidebar {
        width: 280px;
    }
    
    .nav-header {
        padding: 1.5rem;
    }
    
    .nav-links a {
        padding: 0.75rem 1.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    nav { 
        flex-direction: column; 
        gap: 1rem; 
        padding: 1rem; 
    }
    
    nav div { 
        gap: 1rem; 
        justify-content: center;
    }
    
    main { 
        padding: 1rem; 
    }
    
    h1 { 
        font-size: 18px; 
        margin-bottom: 1rem; 
    }
    
    #theme-toggle { 
        top: 1rem; 
        left: 1rem; 
        width: 44px;
        height: 44px;
        padding: 0.5rem;
    }

    #theme-toggle svg {
        width: 20px;
        height: 20px;
    }

    .nav-toggle {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }

    .nav-toggle svg {
        width: 20px;
        height: 20px;
    }

    .nav-sidebar {
        width: 280px;
        right: -280px;
    }
    
    .search-container {
        margin-bottom: 1rem;
    }
    
    .search-input {
        font-size: 16px;
        padding: 0.6rem 0.8rem;
    }
    
    .filters-section {
        padding: 0.75rem 1rem;
    }
    
    .filters-grid {
        gap: 1.5rem;
    }
    
    .filter-label {
        font-size: 9px;
        gap: 0.3rem;
    }
    
    .filter-dot {
        width: 4px;
        height: 4px;
    }
    
    .filter-options {
        gap: 0.2rem;
    }
    
    .filter-option {
        padding: 0.2rem 0.4rem;
        font-size: 9px;
    }
    
    .blog-post {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .blog-post-title {
        font-size: 16px;
        margin-bottom: 0.5rem;
    }
    
    .blog-post-excerpt {
        font-size: 14px;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }
    
    .blog-post-meta {
        font-size: 13px;
    }
    
    .new-post-badge {
        font-size: 12px;
    }
    
    .pinned-post-badge {
        font-size: 12px;
    }
    
    .blog-tag {
        font-size: 9px;
        padding: 0.15rem 0.4rem;
    }
    
    .blog-post-author {
        font-size: 10px;
    }
    
    .admin-badge {
        font-size: 8px;
        padding: 0.05rem 0.2rem;
    }
    
    .modal-content {
        width: 98%;
        max-height: 95vh;
        margin: 1% auto;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

/* Light mode nav styles */
.light-mode .nav-sidebar {
    background: var(--bg);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .nav-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .nav-links a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode .nav-links a.active {
    background: rgba(0, 0, 0, 0.08);
}

.light-mode .nav-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

.light-mode .nav-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.3);
}
    
    .modal-body h1 {
        font-size: 22px;
        margin-bottom: 1rem;
    }
    
    .modal-body #modal-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .sort-indicator {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.75rem;
    }
    
    .filters-section {
        padding: 0.5rem;
    }
    
    .filters-grid {
        gap: 0.5rem;
    }
    
    .filter-label {
        font-size: 9px;
    }
    
    .filter-dot {
        width: 4px;
        height: 4px;
    }
    
    .filter-option {
        padding: 0.2rem 0.4rem;
        font-size: 9px;
    }
    
    .blog-post {
        padding: 0.75rem;
        margin-bottom: 1.25rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .blog-post-thumbnail {
        width: 100%;
        height: 140px;
        order: -1;
        overflow: visible;
        background: none;
    }
    
    .blog-post-thumbnail img {
        width: 100%;
        height: 140px;
        object-fit: cover;
        border-radius: 12px;
    }
    
    .blog-post-title {
        font-size: 15px;
    }
    
    .blog-post-excerpt {
        font-size: 13px;
    }
    
    .blog-tag {
        font-size: 8px;
        padding: 0.1rem 0.3rem;
    }
}


/* Blog post images in modal */
.blog-post-image {
  width: 100%;
  max-width: 450px;
  margin: 0 auto 1.5rem auto;
  display: block;
}

.blog-post-image img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

/* ADMIN PANEL STYLING */
.admin-container {
    background: var(--bg);
    min-height: 100vh;
    padding: 2rem;
}

.admin-header {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 2rem;
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--fg-light);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: lowercase;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg);
}

.tab-button.current {
    background: var(--fg-light);
    color: var(--bg);
    font-weight: 600;
}

.content-area {
    display: none;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.content-area.current {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.input-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.box-title {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 14px;
    text-transform: lowercase;
    color: var(--fg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.box-content {
    padding: 1.5rem;
}

.input-field {
    margin-bottom: 1.25rem;
}

.input-field label {
    display: block;
    color: var(--fg-light);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: lowercase;
}

.input-field input,
.input-field textarea,
.input-field select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--fg);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.input-field input:focus,
.input-field textarea:focus,
.input-field select:focus {
    outline: none;
    border-color: var(--fg-light);
    background: rgba(255, 255, 255, 0.08);
}

.input-field textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.input-with-help {
    display: flex;
    gap: 0.75rem;
    align-items: end;
}

.input-with-help input {
    flex: 1;
}

.help-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--fg-light);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.help-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--fg);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-text {
    font-size: 14px;
    color: var(--fg-light);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.save-button,
.update-button,
.clear-button {
    background: var(--fg-light);
    color: var(--bg);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: lowercase;
}

.save-button:hover,
.update-button:hover {
    background: var(--fg);
    transform: translateY(-1px);
}

.clear-button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg-light);
}

.clear-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--fg);
}

.post-item,
.project-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.post-item:hover,
.project-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.post-title {
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0.25rem;
    font-size: 15px;
}

.post-meta {
    color: var(--fg-light);
    font-size: 12px;
    margin-bottom: 0.5rem;
}

.post-excerpt {
    color: var(--fg-light);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn,
.delete-btn,
.pin-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--fg-light);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: lowercase;
}

.edit-btn:hover {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.3);
    color: rgb(74, 222, 128);
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: rgb(239, 68, 68);
}

.pin-btn:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.3);
    color: rgb(251, 191, 36);
}

.pin-btn.pinned {
    background: rgba(251, 191, 36, 0.15);
    color: rgb(251, 191, 36);
    border-color: rgba(251, 191, 36, 0.2);
}

.empty-state,
.loading-state {
    text-align: center;
    color: var(--fg-light);
    font-style: italic;
    padding: 2rem;
    font-size: 14px;
}

/* Help Modal */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.help-modal-content {
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px 12px 0 0;
}

.help-modal-header h3 {
    margin: 0;
    color: var(--fg);
    font-size: 18px;
    font-weight: 600;
}

.help-modal-close {
    background: none;
    border: none;
    color: var(--fg-light);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg);
}

.help-modal-body {
    padding: 2rem;
    line-height: 1.6;
}

.help-modal-body h4 {
    color: var(--fg);
    margin: 1.5rem 0 0.75rem 0;
    font-size: 16px;
    font-weight: 600;
}

.help-modal-body h4:first-child {
    margin-top: 0;
}

.help-modal-body ol {
    margin: 0.75rem 0 1.5rem 0;
    padding-left: 1.5rem;
}

.help-modal-body li {
    color: var(--fg-light);
    margin-bottom: 0.5rem;
    font-size: 14px;
}

.help-modal-body p {
    color: var(--fg-light);
    margin: 1rem 0;
    font-size: 14px;
}

.code-block {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--fg);
    word-wrap: break-word;
    overflow-x: auto;
}

/* Light Mode Admin Styles */
.light-mode .admin-header {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-mode .admin-tabs {
    background: rgba(0, 0, 0, 0.02);
}

.light-mode .tab-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode .content-area {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-mode .input-box {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.light-mode .box-title {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-mode .input-field input,
.light-mode .input-field textarea,
.light-mode .input-field select {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .input-field input:focus,
.light-mode .input-field textarea:focus,
.light-mode .input-field select:focus {
    background: rgba(0, 0, 0, 0.08);
}

.light-mode .help-button {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
}

.light-mode .help-button:hover {
    background: rgba(0, 0, 0, 0.15);
}

.light-mode .post-item,
.light-mode .project-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-mode .post-item:hover,
.light-mode .project-item:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .help-modal-content {
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .help-modal-header {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-mode .code-block {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Responsive Admin Panel */
@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
    }
    
    .content-area.current {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 13px;
    }
    
    .help-modal-content {
        width: 95%;
        margin: 2.5% auto;
    }
    
    .help-modal-body {
        padding: 1.5rem;
    }
    
    .input-with-help {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .help-button {
        align-self: stretch;
    }
}

/* Image Popup Modal */
.image-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-popup-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-popup-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.image-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.image-popup-header span {
    font-weight: 600;
    color: var(--fg);
    font-size: 1rem;
}

.image-popup-body {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-popup-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.homepage-post-image img {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.homepage-post-image img:hover {
    transform: scale(1.05);
}

/* Desktop modal backdrop fix */
@media (min-width: 769px) {
    .modal-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.7) !important;
        cursor: pointer !important;
    }
    
    .post-modal,
    .project-modal,
    .cv-modal,
    .image-popup-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Ensure view full buttons are always visible on desktop */
    .modal-actions {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
        text-align: center !important;
        border-top: 1px solid var(--border) !important;
    }
    
    .modal-action-btn {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 0.75rem 2rem !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        background: var(--accent) !important;
        color: var(--bg) !important;
        border: none !important;
        border-radius: 6px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        font-family: inherit !important;
        text-transform: lowercase !important;
    }
    
    .modal-action-btn:hover {
        background: var(--accent-hover) !important;
        transform: translateY(-1px) !important;
    }
    
    /* Limit modal content to 3 lines on desktop */
    .modal-body #modal-content,
    .modal-body #modal-project-content,
    .modal-body #homepage-modal-content,
    .modal-body #homepage-project-modal-content {
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1.5 !important;
    }
    
    /* Desktop sticky notes with proper ellipsis */
    .homepage-post-excerpt {
        display: -webkit-box !important;
        -webkit-line-clamp: 10 !important; /* Increased from 8 to match base rule */
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}
