/* Base styles - Reset, typography, and fundamental styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    /* Prevent mobile zoom and overflow issues */
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Theme variables - Dark mode (default) - WCAG AA compliant */
:root {
    --bg-color: #1a1a1a;
    --frame-bg: #2a2a2a;
    --accent-1: #888888;  /* Improved contrast for buttons */
    --accent-2: #bbbbbb;  /* Better contrast for secondary text */
    --accent-3: #888888;
    --border-strong: #888888;  /* Better visibility */
    --border-soft: #555555;    /* Better visibility */
    --text-color: #f5f5f5;     /* High contrast white */
    --text-muted: #cccccc;     /* Good contrast for secondary text */
    --text-light: #e8e8e8;     /* High contrast for light text */
    --text-dark: #1a1a1a;
    --header-color: #f5f5f5;   /* High contrast for headers */
    --link-color: #87ceeb;     /* Light blue for better contrast */
    --hover-color: #add8e6;    /* Lighter blue for hover */
    --button-text: #ffffff;    /* Pure white for buttons */
    --button-bg: #4a4a4a;      /* Darker background for better contrast */
    --button-hover: #6a6a6a;   /* Lighter hover state */
}

/* Light mode theme - WCAG AA compliant */
[data-theme="light"] {
    --bg-color: #f5f5f5;
    --frame-bg: #ffffff;
    --accent-1: #555555;      /* Better contrast for buttons */
    --accent-2: #777777;      /* Better contrast for secondary text */
    --accent-3: #555555;
    --border-strong: #555555; /* Better visibility */
    --border-soft: #999999;   /* Better visibility */
    --text-color: #1a1a1a;    /* High contrast black */
    --text-muted: #444444;    /* Good contrast for secondary text */
    --text-light: #333333;    /* High contrast for light text */
    --text-dark: #1a1a1a;
    --header-color: #1a1a1a;  /* High contrast for headers */
    --link-color: #0066cc;    /* Blue for better contrast */
    --hover-color: #004499;   /* Darker blue for hover */
    --button-text: #ffffff;   /* White text on dark buttons */
    --button-bg: #333333;     /* Dark background for buttons */
    --button-hover: #555555;  /* Lighter hover state */
}

/* Retro/Original mode theme - Classic Neocities colors from cometothevoid.neocities.org */
[data-theme="retro"] {
    --bg-color: #f7faf9;      /* Light blue-gray background */
    --frame-bg: #ffffff;      /* White frames */
    --accent-1: #7aa0c4;      /* Soft blue accent */
    --accent-2: #6bb1a5;      /* Teal accent */
    --accent-3: #f0ead6;      /* Cream accent */
    --border-strong: #7aa0c4; /* Blue borders */
    --border-soft: #cbd6e2;   /* Light blue-gray borders */
    --text-color: #2a2a2a;    /* Dark gray text */
    --text-muted: #4e5963;    /* Muted gray text */
    --text-light: #2a2a2a;    /* Dark gray text */
    --text-dark: #2a2a2a;
    --header-color: #2a2a2a;  /* Dark gray headers */
    --link-color: #1f4a6b;    /* Dark blue links */
    --hover-color: #6bb1a5;   /* Teal hover */
    --button-text: #ffffff;   /* White button text */
    --button-bg: #2980b9;     /* Blue button background */
    --button-hover: #6bb1a5;  /* Teal hover */
}

/* Layout styles - Grid, flexbox, and positioning */

/* Document sizing - removed sticky footer */
html, body {
    height: auto; /* Changed from 100% to auto */
}

/* Header and Navigation */
header {
    background-color: var(--frame-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 2px solid var(--border-strong);
    transition: transform 0.3s ease-in-out;
    /* Ensure smooth hide/show animation */
    transform: translateY(0);
}

/* Main Content - removed flex layout */
body {
    min-height: 100vh;
    /* Removed display: flex and flex-direction: column */
}

/* Make primary content area normal flow */
main {
    margin-top: 70px;
    /* Removed flex: 1 */
}

/* Sections */
.section {
    padding: 80px 0;
    border: 2px solid var(--border-strong);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 20px 0;
    background-color: var(--frame-bg);
}

.section:nth-child(even) {
    background-color: var(--frame-bg);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flexbox Layouts */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.flex-column {
    display: flex;
    flex-direction: column;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .flex {
        flex-direction: column;
    }
    
    .section {
        padding: 60px 0;
    }
}

/* When using site-wrapper (homepage), normal flow */
.site-wrapper {
    /* Removed flex: 1 */
}

/* Component-specific styles */

/* Navigation Component */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--header-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--hover-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-1);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    color: var(--text-color);
    background-color: var(--frame-bg);
}

.theme-toggle:hover {
    background-color: var(--accent-1);
    border-color: var(--hover-color);
    transform: scale(1.1);
}

/* Mobile Navigation */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--accent-1);
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Footer Component */
footer {
    background-color: var(--frame-bg);
    color: var(--text-color);
    text-align: center;
    padding: 40px 0;
    border-top: 2px solid var(--border-strong);
    /* Ensure footer stays at bottom of page content, not screen */
    position: static;
    margin-top: 40px;
    width: 100%;
}

footer p {
    opacity: 0.8;
}

/* Ensure footer links are visible */
footer a {
    color: var(--link-color);
    text-decoration: underline;
}

.rss-link img {
    filter: none;
    vertical-align: middle;
    margin-left: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--frame-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }
}

/* Mobile-specific fixes for zoom and overflow issues */
@media (max-width: 480px) {
    /* Prevent horizontal scrolling and zoom issues */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Ensure all containers respect viewport width */
    .site-wrapper,
    .content,
    .sidebar,
    .right-sidebar {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Fix text that might cause horizontal overflow */
    .commit-title,
    .status-text,
    .sidebar-card {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Ensure buttons and interactive elements fit */
    .button-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .button88 {
        width: 100%;
        min-width: 80px;
    }
    
    /* Ensure content is visible and properly spaced */
    .content {
        min-height: 200px; /* Ensure content has minimum height */
        margin-bottom: 20px; /* Space between content and sidebars */
    }
    
    /* Make sidebars more compact on very small screens */
    .sidebar,
    .right-sidebar {
        margin-bottom: 10px;
    }
    
    .sidebar-inner {
        padding: 8px;
    }
}

/* Sidebar Component and Retro Styles */
.site-wrapper {
    display: grid;
    grid-template-columns: 260px minmax(520px, 720px) 240px; /* left sidebar, content, right sidebar */
    gap: 16px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px;
    /* Prevent header overlap (header height is ~70px) */
    margin-top: 70px;
    /* Prevent horizontal overflow on mobile */
    width: 100%;
    box-sizing: border-box;
}

.sidebar {
    background: var(--frame-bg);
    border: 2px solid var(--border-strong);
}

.sidebar-inner {
    padding: 16px;
}

.site-title {
    font-family: "Trebuchet MS", Tahoma, Verdana, Arial, sans-serif;
    margin: 0 0 8px 0;
    color: var(--accent-2);
}

.site-tagline {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.sidebar .nav-link {
    display: block;
    background: var(--frame-bg);
    border: 1px solid var(--border-strong);
    padding: 8px 10px;
    color: var(--link-color);
    text-decoration: none;
}

.sidebar .nav-link:hover {
    background: var(--accent-1);
    color: var(--text-color);
}

.sidebar-card {
    background: var(--frame-bg);
    border: 1px solid var(--border-soft);
    padding: 10px;
    overflow: hidden;
}

/* Smaller status cards */
.sidebar-card h3 {
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
}

.sidebar-card[data-json] {
    padding: 8px;
}

.sidebar-card[data-json] h3 {
    font-size: 0.85rem;
    margin: 0 0 0.4rem 0;
}

/* Status widget styling */
.status-content {
    font-size: 0.8rem;
    line-height: 1.3;
}

.status-text {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.status-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-mood {
    font-weight: 500;
}

.status-activity {
    background: var(--accent-1);
    color: var(--text-color);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

.status-time {
    font-size: 0.7rem;
}

.status-updated {
    font-size: 0.7rem;
    font-style: italic;
}

/* Deploy meta widget */
.deploy-meta { font-size: 0.85rem; overflow: hidden; }
.deploy-meta .deploy-header { 
  color: var(--text-muted); 
  margin-bottom: 0.5rem; 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
}
.commit-icon { 
  color: var(--text-muted); 
  opacity: 0.8; 
}
.commit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.commit-body { min-width: 0; }
.commit-title { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; }
.commit-desc { color: var(--text-muted); margin-top: 0.25rem; overflow: hidden; }
.commit-desc-text { display: block; }
.commit-more-btn { background: none; border: 1px solid var(--border-soft); color: var(--link-color); padding: 2px 6px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; margin-left: 4px; }
.commit-more-btn:hover { background: var(--accent-1); color: var(--text-color); }

/* Tooltip styles */
.commit-tooltip { position: fixed; z-index: 1000; background: var(--frame-bg); border: 1px solid var(--border-strong); box-shadow: 0 6px 20px rgba(0,0,0,0.25); border-radius: 6px; max-width: 300px; }
.commit-tooltip-content { padding: 8px; position: relative; }
.commit-tooltip-text { white-space: pre-wrap; font-size: 0.9rem; }
.commit-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; color: var(--text-muted); font-size: 0.85rem; }
.commit-hash { background: rgba(255,255,255,0.06); padding: 0 0.25rem; border-radius: 4px; }
.deploy-meta.single .commit { align-items: start; }

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 6px;
}

.button88 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 31px;
    background: var(--button-bg);
    color: var(--button-text);
    text-decoration: none;
    font-size: 12px;
    border: 1px solid var(--border-strong);
}

.content {
    background: var(--frame-bg);
    border: 1px solid var(--border-soft);
    padding: 16px;
}

.right-sidebar {
    background: var(--frame-bg);
    border: 1px solid var(--border-strong);
}

.banner {
    background: var(--frame-bg);
    border: 1px solid var(--border-soft);
    padding: 12px;
    margin-bottom: 16px;
}

.bg-tile {
    background-image: url(../../assets/images/tile.6ced36a6dd3833f1e41a.svg);
    background-repeat: repeat;
}

/* Theme-specific tile patterns */
[data-theme="retro"] .bg-tile {
    background-image: url(../../assets/images/tile-retro.866f7d124339ec85828e.svg);
}

/* Theme-specific sidebar styles */
[data-theme="retro"] .sidebar .nav-link {
    background: #e8f4ff;
    border: 1px solid var(--border-strong);
    color: #1f4a6b;
}

@media (max-width: 900px) {
    .site-wrapper {
        grid-template-columns: 1fr;
        padding: 12px;
        /* Ensure no horizontal overflow on mobile */
        min-width: 0;
        overflow-x: hidden;
        /* Ensure content shows properly */
        display: block;
    }
    .sidebar {
        /* Hide left sidebar on mobile */
        display: none;
    }
    .content {
        order: 1; /* Show content first */
        padding: 12px;
        /* Ensure content doesn't overflow */
        min-width: 0;
        overflow-x: hidden;
        /* Make sure content is visible */
        display: block;
        margin-bottom: 12px;
    }
    .sidebar-inner { 
        padding: 12px; 
        /* Prevent inner content from overflowing */
        min-width: 0;
        overflow-x: hidden;
    }
    .sidebar .nav-link { padding: 10px 12px; font-size: 16px; }
    .button-grid { grid-template-columns: repeat(2, 88px); }
    .right-sidebar { 
        order: 2; /* Show right sidebar second */
        /* Prevent right sidebar from causing overflow */
        min-width: 0;
        overflow-x: hidden;
        /* Make sure right sidebar is visible */
        display: block;
        margin-bottom: 12px;
    }
}
/* Page-specific styles */

/* Status Section */
.status-section {
    background: transparent;
    padding: 4rem 0;
}

.status-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.status-card {
    background: var(--frame-bg);
    border: 1px solid var(--border-soft);
    padding: 2rem;
}

.status-card:hover {
}

.status-card h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0.5rem;
}

.status-content {
    min-height: 120px;
}

.status-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.status-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-mood {
    font-size: 1.2rem;
}

.status-activity {
    background: var(--frame-bg);
    border: 1px solid var(--border-soft);
    padding: 0.2rem 0.6rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-time {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Loading state for status */
.status-content p {
    color: var(--text-muted);
    font-style: italic;
}

/* Home Page */
.hero {
    background: var(--frame-bg);
    color: var(--text-color);
    border: 1px solid var(--border-soft);
    padding: 32px 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 10px 18px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--button-hover);
}

/* About Page */
.about-hero {
    background-color: var(--frame-bg);
    padding: 80px 0;
    text-align: center;
}

.about-content {
    padding: 60px 0;
}

/* Projects Page */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--frame-bg);
    border: 1px solid var(--border-soft);
    padding: 2rem;
}

.project-card:hover {
}


/* Contact Page */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--frame-bg);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-soft);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-1);
}

/* Welcome Page Specific Styles */
.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.about-content ul {
    list-style: none;
    padding: 0;
}

.about-content li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.about-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-2);
    font-weight: bold;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--frame-bg);
    border-radius: 8px;
    color: var(--text-color);
}

.stat-item h4 {
    font-size: 2rem;
    color: var(--accent-1);
    margin-bottom: 0.5rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-item {
    background: var(--frame-bg);
    padding: 2rem;
    border: 1px solid var(--border-soft);
    text-align: center;
}

.tech-item:hover {
}

.tech-item h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

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

    .flex-between {
        flex-direction: column;
        gap: 2rem;
    }

    .about-stats {
        flex-direction: row;
        justify-content: space-around;
    }

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

    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* Utility styles - Animations, transitions, and helper classes */

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Animation classes */
.fade-in-up {
    animation: fadeInUp 1s ease-out;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Transitions */
.transition {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* Hover effects */
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-fade:hover {
    opacity: 0.8;
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.btn-primary:hover {
    background-color: var(--button-hover);
    color: var(--button-text);
}

.btn-secondary {
    background-color: var(--accent-1);
    color: var(--button-text);
}

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-strong);
    color: var(--link-color);
}

.btn-outline:hover {
    background-color: var(--button-bg);
    color: var(--button-text);
}

/* Card styles */
.card {
    background: var(--frame-bg);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-soft);
    border-top: 3px solid var(--accent-1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Component loading error styles */
.component-error {
    background-color: var(--frame-bg);
    color: var(--text-color);
    padding: 1rem;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    margin: 1rem 0;
    text-align: center;
}

/* Blog Page Specific Styles */

.blog-page {
    padding-top: 40px; /* tighten spacing below fixed navigation */
}

/* Remove excessive top spacing for the blog section */
.blog-page .section {
    padding-top: 16px;
    margin-top: 0;
}

.blog-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* H1 left, filter right */
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.blog-title h1 {
    margin: 0;
}

.blog-title p {
    margin-top: 0.2rem; /* close to H1 inside header */
    margin-bottom: 0; /* no extra gap below header */
}

.post {
    background: var(--frame-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    min-height: 150px; /* Prevent layout shift */
    display: flex; /* Ensure equal height layout inside grid */
    flex-direction: column;
}

/* Loading state to prevent movement */
[data-json] {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-json] p {
    color: var(--text-muted);
    font-style: italic;
}

/* Loading skeleton */
.loading-skeleton {
    width: 100%;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-header {
    height: 2rem;
    background: var(--border-soft);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-content {
    height: 1rem;
    background: var(--border-soft);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-content:last-of-type {
    width: 60%;
}

.skeleton-footer {
    height: 1.5rem;
    background: var(--border-soft);
    border-radius: 4px;
    margin-top: 1rem;
    width: 40%;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.post:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.post-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 1rem;
}

.post-title {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.post-excerpt {
    font-style: italic;
    color: #34495e;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.4;
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.post-content {
    color: #2c3e50;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.post-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    margin-top: auto; /* Stick footer to bottom of equal-height card */
    margin-bottom: 0; /* remove extra space under footer */
    padding-bottom: 0;
}

.post-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tag {
    background: #3498db;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.tag:hover {
    background: #2980b9;
}

/* Posts grid for horizontal equal-height cards */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(640px, 1fr));
    gap: 1rem;
    align-items: stretch;
    justify-content: center; /* center the overall grid within container */
}

/* Make headings and content play nicely in card */
.posts-grid .post h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.posts-grid .post .post-meta {
    margin-top: 0.25rem;
}

/* Center individual cards and set a comfortable max width */
.posts-grid .post {
    width: 100%;
    max-width: 980px; /* allow longer horizontal cards */
    justify-self: center; /* center each card in its grid cell */
}

/* Softer excerpt styling for list view */
.posts-grid .post-excerpt {
    font-style: normal;
    color: var(--text);
    background: transparent;
    padding: 0;
    border-radius: 0;
    border-left: 0;
    margin-bottom: 0.5rem;
}

/* Tag filter bar */
.tag-filter-bar {
    display: flex;
    flex-direction: row; /* inline with minimal height */
    align-items: center;
    justify-content: flex-end; /* push to the right inside header */
    gap: 0.5rem;
    margin: 0 0 0.5rem 0; /* reduce vertical space */
}

.posts-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.5rem 0; /* smaller heading spacing */
}

.tag-filter-active {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.clear-filter {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}

.clear-filter:hover {
    background: var(--border-soft);
}

/* Tag dropdown */
.tag-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: var(--frame-bg);
    color: var(--text);
    margin: 0; /* no extra margin */
}

/* Contact Page Styles */
.contact-page {
    padding-top: 0;
    background: transparent;
}

.contact-page h1 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.contact-page .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    font-style: italic;
}

.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--frame-bg);
    padding: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-soft);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--frame-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-strong);
    background: var(--frame-bg);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Placeholder text styling for dark/light mode */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.form-group input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed var(--border-soft);
    background: var(--frame-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: var(--accent-1);
    background: var(--frame-bg);
}

.image-preview {
    margin-top: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-soft);
    border-radius: 8px;
    background: var(--frame-bg);
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.remove-image-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent-1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.remove-image-btn:hover {
    background: var(--hover-color);
}

.submit-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-strong);
    padding: 0.8rem 1.6rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.submit-btn:hover {
    background: var(--button-hover);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loading {
    display: inline;
}

.message-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.message-status.success {
    background: var(--frame-bg);
    color: var(--text-color);
    border: 1px solid var(--border-soft);
}

.message-status.error {
    background: var(--frame-bg);
    color: var(--text-color);
    border: 1px solid var(--border-soft);
}

/* Responsive Design */
@media (max-width: 768px) {
    .contact-form-container {
        margin: 0 1rem;
        padding: 1.5rem;
    }
    
    .contact-page h1 {
        font-size: 2rem;
    }
    
    .contact-page .subtitle {
        font-size: 1rem;
    }
}

/* Animation for form submission */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.submit-btn.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Main CSS File - Imports all stylesheets */

/* Base styles - Reset, typography, and fundamental styles */

/* Layout styles - Grid, flexbox, and positioning */

/* Component-specific styles */

/* Page-specific styles */

/* Utility styles - Animations, transitions, and helper classes */

/* Blog styles */

/* Contact form styles */

