/* --- 1. VARIABLES & THEME CONFIG --- */
:root {
    /* Light Mode (Default) */
    --bg-color: #fdf6e3;       /* Solarized Cream */
    --text-color: #333333;
    --accent: #268bd2;         /* Blue */
    --border-color: #333333;   /* Solid borders */
    --nav-border: #999999;     /* Dashed dividers */
    --quote-bg: rgba(0,0,0,0.05);
    --hover-bg: #eeeeee;       /* Light grey background for link hover */
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-color: #181818;       /* Dark Grey */
    --text-color: #e0e0e0;     /* Off-white */
    --accent: #8abeb7;         /* Soft Cyan (easier on eyes in dark) */
    --border-color: #e0e0e0;
    --nav-border: #555555;
    --quote-bg: rgba(255,255,255,0.1);
    --hover-bg: #333333;       /* Dark grey background for link hover */
}

/* --- 2. BASE STYLES --- */
* {
    box-sizing: border-box; /* Prevents padding from breaking layout */
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    /* Smooth transition for color swap */
    transition: background-color 0.3s ease, color 0.3s ease; 
}

a { 
    color: var(--accent); 
    text-decoration: none; 
    font-weight: bold; 
}

a:hover { 
    text-decoration: underline; 
    background: var(--hover-bg); /* Uses variable now */
}

ul { 
    list-style-type: square; 
    padding-left: 20px; 
}

img { 
    max-width: 100%; /* Prevents images from breaking the column width */
    height: auto; 
    border: 1px solid var(--border-color); 
    opacity: 0.9; 
}

/* --- 3. LAYOUT GRID --- */
.layout-container {
    display: grid;
    grid-template-columns: 200px 1fr 250px; /* Nav | Main | Sidebar */
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header#header {
    grid-column: 1 / -1;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .layout-container {
        grid-template-columns: 1fr; /* Stack everything in 1 column */
    }
    
    /* Hide sidebars on mobile or move them to bottom? 
       For now, we just stack them. */
    nav#nav, aside#aside {
        border: none;
        border-bottom: 1px dashed var(--nav-border);
        padding-bottom: 20px;
    }
}

/* --- 4. SECTIONS --- */
nav#nav { 
    border-right: 1px dashed var(--nav-border); 
    padding-right: 15px; 
}

aside#aside { 
    border-left: 1px dashed var(--nav-border); 
    padding-left: 15px; 
}

main#main { 
    padding: 0 15px; 
}

.sidebar-section { 
    margin-bottom: 2rem; 
}

.sidebar-section h4 { 
    /* Changed to variable so it turns white in dark mode */
    border-bottom: 2px solid var(--border-color); 
    display: inline-block; 
    margin-bottom: 10px;
}

/* --- 5. UTILITIES --- */
.row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
}

.w60 { 
    flex: 2; 
    min-width: 300px; 
}

.flex-grow { 
    flex: 1; 
    min-width: 200px; 
}

blockquote {
    border-left: 5px solid var(--accent);
    padding-left: 15px;
    margin-left: 0;
    font-style: italic;
    background: var(--quote-bg); /* Uses variable now */
    padding: 10px;
}

/* --- 6. THEME TOGGLE BUTTON --- */
#theme-toggle {
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 10px;
    font-family: inherit;
    margin-left: 10px;
    transition: all 0.2s ease;
}

#theme-toggle:hover {
    background: var(--text-color);
    color: var(--bg-color);
}


/* --- work --- */

/* --- RESUME / WORK PAGE STYLES --- */

/* The Header with the button */
.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
}

/* The Download Button */
.btn-download {
    background-color: var(--accent);
    color: var(--bg-color);
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    border: 1px solid var(--accent);
    transition: opacity 0.3s;
}
.btn-download:hover {
    opacity: 0.8;
    text-decoration: none;
    background-color: var(--text-color); /* Inverts on hover */
}

/* Work Entries (Timeline look) */
.work-entry {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 20px;
    border-left: 3px solid var(--nav-border);
}

.work-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent);
}

.work-meta {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 10px;
    font-style: italic;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.skills-grid div {
    background: var(--quote-bg);
    padding: 15px;
    border: 1px solid var(--nav-border);
}


/* --- BLOG LIST STYLES --- */
.blog-list {
    list-style: none;
    padding: 0;
}

.blog-item {
    margin-bottom: 12px;
    font-family: 'Courier New', Courier, monospace;
}

.blog-date {
    color: var(--text-color);
    opacity: 0.7;
    margin-right: 10px;
    font-size: 0.9rem;
}

.blog-link {
    font-weight: bold;
    border-bottom: 1px dotted var(--accent);
}

.blog-link:hover {
    border-bottom: 1px solid var(--accent);
    background: var(--quote-bg);
}

/* --- MUSIC PAGE STYLES --- */

/* Intro Text */
.music-intro {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    font-style: italic;
}

/* Grid for Spotify Embeds */
.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.music-card {
    background: var(--bg-color);
    border: 1px solid var(--nav-border);
    padding: 5px;
    border-radius: 15px; /* Matches Spotify rounded corners */
    box-shadow: 5px 5px 0px var(--quote-bg);
}

/* Track List Styling */
.track-list {
    list-style: none;
    padding: 0;
    columns: 2; /* Split list into 2 columns */
}

.track-list li {
    margin-bottom: 10px;
    padding: 5px 10px;
    border-bottom: 1px dashed var(--nav-border);
    transition: background 0.2s;
}

.track-list li:hover {
    background-color: var(--quote-bg);
    padding-left: 15px; /* Slight indented movement on hover */
}

.track-list a {
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
}

.track-list a:hover {
    color: var(--accent);
}

/* Mobile Adjustment */
@media (max-width: 600px) {
    .track-list {
        columns: 1;
    }
}

/* Add to static/style.css */

.soundcloud-container {
    margin-bottom: 40px;
    border: 2px solid var(--nav-border);
    padding: 10px;
    background: var(--bg-color);
    box-shadow: 8px 8px 0px var(--accent); /* Stronger shadow for emphasis */
}

.soundcloud-container iframe {
    display: block; /* Removes tiny gap at bottom of iframes */
}

/* --- CONTACT PAGE STYLES --- */

.contact-intro {
    font-size: 1.1rem;
    margin-bottom: 40px;
    border-left: 4px solid var(--accent);
    padding-left: 20px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.contact-card {
    border: 2px solid var(--nav-border);
    padding: 20px;
    background: var(--bg-color);
    transition: transform 0.2s ease;
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 5px 5px 0px var(--quote-bg);
}

.contact-card h3 {
    margin-top: 0;
    border-bottom: 1px dashed var(--nav-border);
    padding-bottom: 10px;
}

/* Social List Styling */
.social-list {
    list-style: none;
    padding: 0;
}

.social-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dotted var(--nav-border);
}

.social-list a {
    font-weight: bold;
    font-size: 1.1rem;
}

.social-list small {
    color: var(--text-color);
    opacity: 0.6;
}

/* PGP Block Styling */
.pgp-block {
    background: var(--quote-bg);
    padding: 15px;
    border: 1px solid var(--nav-border);
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--text-color);
    max-height: 200px; /* Scrollable if too long */
}


/* --- MOVIE PAGE STYLES (Letterboxd Style) --- */

.movie-intro {
    border: 2px solid var(--accent);
    background: var(--quote-bg);
    padding: 20px;
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

.movie-grid {
    display: grid;
    /* Responsive grid: Cards are approx 200px wide */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 20px;
    row-gap: 40px; /* More space between rows */
}

.movie-card {
    border: 1px solid var(--nav-border);
    background: var(--bg-color);
    position: relative;
    padding: 0; /* REMOVED PADDING so image touches edges */
    overflow: hidden; /* Keeps image inside rounded corners if you add radius */
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 5px 5px 0px var(--quote-bg);
}

/* The Poster Image */
.movie-poster {
    width: 100%;
    aspect-ratio: 2/3; /* Standard Movie Poster Ratio */
    object-fit: cover;
    border-bottom: 1px solid var(--nav-border);
    background-color: #000; /* Fallback color while loading */
}

/* The Text Container */
.movie-details {
    padding: 15px;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.movie-card h3 {
    margin: 5px 0;
    font-size: 1rem;
    line-height: 1.2;
}

.movie-card small {
    color: var(--text-color);
    opacity: 0.7;
    font-style: italic;
    font-size: 0.85rem;
}

.movie-year {
    font-size: 0.75rem;
    background: var(--quote-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    align-self: flex-start; /* Aligns year to left */
    margin-bottom: 5px;
    color: var(--accent);
}

/* --- GALLERY / PICS PAGE STYLES --- */

.gallery-grid {
    /* CSS Columns approach for true Masonry layout */
    column-count: 3;
    column-gap: 20px;
}

.gallery-item {
    break-inside: avoid; /* Prevents images from being cut in half */
    margin-bottom: 20px;
    border: 1px solid var(--nav-border);
    background: var(--bg-color);
    padding: 5px;
    transition: transform 0.2s ease;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: none; /* Remove default border if set elsewhere */
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--accent);
    box-shadow: 5px 5px 0px var(--quote-bg);
}

/* Responsive Columns */
@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        column-count: 1;
    }
}