<style>

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212; /* Dark elegant theme for photography */
    color: #ffffff;
    padding: 2rem 5%;
}

/* Category Navigation */
.portfolio-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.portfolio-nav a {
    color: #888888;
    text-decoration: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    padding-bottom: 0.5rem;
}

.portfolio-nav a:hover, 
.portfolio-nav a.active {
    color: #ffffff;
    border-bottom: 2px solid #ffffff;
}

/* Header Section */
.portfolio-header {
    text-align: center;
    margin-bottom: 4rem;
}

.portfolio-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.portfolio-header p {
    color: #aaa;
    font-size: 1rem;
}

/* ==========================================================================
   NEW ADDITION: Safe, Isolated Text Area (Overrides Global White Text)
   ========================================================================== */
.portfolio-intro-box {
    max-width: 800px;
    margin: 0 auto 3.5rem auto; /* Centers block & pushes grid container down */
    text-align: center;
    padding: 0 1rem;
}

.portfolio-intro-box h2 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: 1px;
    color: #000000 !important; /* Explicitly forces heading text to solid black */
    margin-bottom: 0.75rem;
}

.portfolio-intro-box p {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #000000 !important; /* Explicitly forces body paragraph to solid black */
    font-weight: 400;
}

/* Responsive Grid Mechanics */
.portfolio-container {
    display: grid;
    /* Auto-fit dynamically adjusts the number of columns based on screen width */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Individual Portfolio Items */
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: #1a1a1a;
    /* Forces images to share the same square proportions regardless of source */
    aspect-ratio: 1 / 1; 
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crops image cleanly without stretching it */
    
    /* FIX: Prioritizes the top of your portrait images during square cropping */
    object-position: top; 
    
    transition: transform 0.5s ease;
}

/* Hover Zoom Effect */
.portfolio-item:hover img {
    /* FIX: Reduced from 1.05 to 1.03 to minimize extra edge clipping on zoom */
    transform: scale(1.03); 
}


/* Smooth Fade-in Text Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* FIXED OVERLAY HOVER FUNCTIONALITY */
.portfolio-item:hover .image-overlay {
    opacity: 1;
}

.image-overlay h3 {
    font-weight: 400;
    letter-spacing: 1px;
    font-size: 1.25rem;
    border-bottom: 1px solid #fff;
    padding-bottom: 0.5rem;
}

/* Lightbox Backdrop Cover */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Make Lightbox Visible via Class Toggle */
.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* Optimized Container to prevent layout shifting between Portrait & Landscape */
.lightbox-content {
    position: relative;
    width: 85vw;
    height: 80vh; /* Locks a fixed presentation zone */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers short landscape files vertically */
    align-items: center;
}

/* Constrained Lightbox Image */
.lightbox-content img {
    max-width: 100%;
    max-height: calc(80vh - 40px); /* Reserves exactly 40px at the bottom for the text */
    object-fit: contain; 
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content img {
    transform: scale(1);
}

/* Dynamic Image Caption */
#lightbox-caption {
    margin-top: 1rem;
    color: #cccccc;
    font-size: 1rem;
    letter-spacing: 1px;
    text-align: center;
}

/* Close Button Position */
.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

/* Navigation Control Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #ffffff;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, opacity 0.2s;
    z-index: 1010;
    border-radius: 4px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-left { left: 2rem; }
.nav-right { right: 2rem; }

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .lightbox-nav {
        padding: 0.5rem 1rem;
        font-size: 1.5rem;
    }
    .nav-left { left: 0.5rem; }
    .nav-right { right: 0.5rem; }
    .lightbox-close { top: 1rem; right: 1rem; }
}
/* Text Box Styling - Above the Grid */
div.portfolio-text-top {
    max-width: 800px;
    margin: 0 auto 3rem auto; /* Centers the text box and adds space below it */
    padding: 0 1rem;
    text-align: center;
}

/* Force headings to black by matching the exact tag architecture */
div.portfolio-text-top h2 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 1.75rem !important;
    font-weight: 400 !important;
    letter-spacing: 1px !important;
    color: #000000 !important; /* Pure solid black override */
    margin-bottom: 0.75rem !important;
}

/* Force paragraphs to black by matching the exact tag architecture */
div.portfolio-text-top p {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    color: #000000 !important; /* Pure solid black override */
    font-weight: 400 !important;
}

/* Text Box Styling - Below the Grid */
div.portfolio-text-bottom {
    max-width: 800px;
    margin: 4rem auto 0 auto; /* Adds a clean 4rem gap directly above the text box */
    padding: 0 1rem;
    text-align: center;
}

/* Force bottom headings to solid black */
div.portfolio-text-bottom h2 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 1.75rem !important;
    font-weight: 400 !important;
    letter-spacing: 1px !important;
    color: #000000 !important;
    margin-bottom: 0.75rem !important;
}

/* Force bottom paragraphs to solid black */
div.portfolio-text-bottom p {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    color: #000000 !important;
    font-weight: 400 !important;
}

/* Strict 1-column layout capped at 1200px maximum width */
.portfolio-container.landscape-grid {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto; /* Centers the gallery on wide screens */
}

/* Flexbox/Item wrapper */
.landscape-grid .portfolio-item {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Image maintains perfect proportions on all screen sizes */
.landscape-grid .portfolio-item img {
    width: 100%;
    height: auto; /* Ensures it never stretches or crops */
    display: block;
}

/* Structural Spacing between galleries */
.portfolio-page-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.portfolio-section {
    width: 100%;
}
/* Remove black box overhang specifically for the landscape items */
.landscape-grid .portfolio-item {
    height: auto !important;       /* Destroys any global fixed height rules */
    aspect-ratio: auto !important; /* Forces layout to match the real image size */
    background: transparent !important; /* Erases the background box color entirely */
}

/* Ensure overlay stays perfectly locked to the text size */
.landscape-grid .image-overlay {
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
}
/* Removes the 1200px cap so both sections expand fully across the screen */
.portfolio-container, 
.portfolio-container.landscape-grid {
    max-width: 100% !important;
    width: 100% !important;
}

/* Because the landscape image expands completely, ensure it scales beautifully */
.landscape-grid .portfolio-item img {
    width: 100%;
    height: auto;
}



 </style>