/* CSS Reset and Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --sidebar-width: 250px;
    --gap-size: 40px;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-resizer {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: 6px;
    height: 100vh;
    background: transparent;
    cursor: col-resize;
    z-index: 101;
    transition: background 0.2s;
}

.sidebar-resizer::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: #eee;
}

.sidebar-resizer:hover,
.sidebar-resizer.resizing {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-resizer:hover::after,
.sidebar-resizer.resizing::after {
    background-color: #ccc;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

.brand a {
    text-decoration: none;
    color: inherit;
}

.intro-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.5;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 15px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: #999;
}

.nav-category {
    margin-top: 80px;
    margin-bottom: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-details {
    font-size: 14px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.contact-details p {
    margin-bottom: 5px;
}

.contact-details a {
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid #ccc;
    font-size: 14px;
}

.copyright {
    font-size: 12px;
    color: #ccc;
    margin-top: auto;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 60px 80px;
    /* Increased padding */
    width: calc(100% - var(--sidebar-width));
}

/* Limit max width for better readability on large screens */
.portfolio-grid,
.detail-grid,
.project-meta-container,
.content-section,
.project-title-large,
.section-label {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.content-section+.content-section {
    margin-top: 80px;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-size);
}

/* ... (unchanged parts) ... */

.project-item {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-thumbnail {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #f0f0f0;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Changed back to cover to fill the area */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-item:hover .project-thumbnail img {
    transform: scale(1.02);
    opacity: 0.9;
}


.project-number {
    font-size: 12px;
    font-weight: 400;
    color: #ccc;
    margin-bottom: 5px;
}

.project-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Detailed Project Page Styles */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    /* Tighter packing based on image width */
    justify-content: center;
    /* Center the grid block in container */
    gap: 15px;
    margin-bottom: 80px;
    /* Reduced bottom margin */
}

.detail-grid img {
    width: auto;
    /* Change from 100% to auto to respect height */
    max-width: 100%;
    /* Ensure it doesn't overflow cell */
    max-height: 40vh;
    /* Limit height to 40% of viewport */
    height: auto;
    display: block;
    margin: 0 auto;
    /* Center image in grid cell */
    background-color: #f5f5f5;
    object-fit: contain;
}

.project-meta-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 100px auto;
    padding: 0 20px;
}

/* ... */

.meta-row {
    margin-bottom: 30px;
}



.meta-label {
    font-size: 13px;
    /* Increased size slightly */
    font-weight: 700;
    /* Made Bold */
    color: #000;
    /* Made Black (Darker) */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.meta-value {
    font-size: 15px;
    /* Increased size for readability */
    color: #555;
    /* Slightly lighter than black to differentiate */
    line-height: 1.6;
    font-weight: 400;
}

.section-label {
    font-size: 13px;
    /* Match meta-label */
    font-weight: 700;
    /* Match meta-label */
    color: #000;
    /* Match meta-label */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-align: center;
}

.full-width-media {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    /* Center content */
    background-color: #fafafa;
    /* Optional background for letterboxing effect */
}

.full-width-media img {
    width: auto;
    /* Allow width to auto-adjust based on height */
    max-width: 100%;
    /* But don't overflow width */
    max-height: 40vh;
    /* Limit height to 60% of viewport height */
    height: auto;
    display: block;
    object-fit: contain;
    /* Ensure full image/video is visible */
}

.full-width-media video {
    width: auto;
    /* Allow width to auto-adjust based on height */
    max-width: 100%;
    /* But don't overflow width */
    max-height: 80vh;
    /* Limit height to 80% of viewport height */
    height: auto;
    display: block;
    object-fit: contain;
    /* Ensure full image/video is visible */
}

.full-width-media .video-container {
    width: 100%;
}