/* Color Palette Variables */
:root {
    --text-primary: #ffffdd;
    --text-accent: #CFAD86;     /* Muted earthy gold tone */
    --text-accent2: #f0e0df;     /* lighter */
    --text-muted: #cccccc;
    --text-caption: #aaaa88;
    --bg-overlay: rgba(0, 0, 0, 0.45);
    /* Lowered from 0.65 to 0.40 for more transparency */
    --bg-wrapper: rgba(0, 0, 0, 0.40); 
    --bg-preview: rgba(255, 248, 220, 0.05);
    /* Lighter semi-transparent brown background for the titles */
    --bg-title-container: rgba(141, 110, 89, 0.25); 
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Reenie Beanie', cursive;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0rem;
    /* Full-screen background image handling */
    background: linear-gradient(var(--bg-overlay), var(--bg-overlay)), url('propgifs/bg-med-tex-1.jpg') no-repeat center center fixed;
    background-size: cover;
}

a {
	font-family: 'Reenie Beanie', cursive;
    color: var(--text-accent2);
    text-decoration: none;
}

/* Typography Hierarchy Constraints */
h1, h2, h3 {
    font-family: 'Reenie Beanie', cursive;
}

p, h4, h5, h6, footer, .card-title {
    font-family: 'Just Another Hand', cursive;
}

/* Container to constrain content width and improve readability */
.wrapper {
    max-width: 900px;
    width: 100%;
    text-align: center;
    background: var(--bg-wrapper);
    padding: 3rem 2rem;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin: auto;
}

/* Header Styles */
header h1 {
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    color: var(--text-accent);
}

header p {
    font-size: 2.4rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 3rem;
    color: var(--text-muted);
}

/* Navigation / Gallery Links */
nav {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}
        
/* Gallery Container & Layout Structure */
.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    width: 100%;
    margin-bottom: 4rem;
}

/* Container for the gallery button to give it a lighter brown background */
.gallery-title-container {
    background: var(--bg-title-container);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.gallery-block {
    width: 100%;
}

/* Master Link Wrapper */
.gallery-main-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Button style adjustment to look good on top of images */
.nav-btn {
    display: inline-block;
    font-size: 3.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.2rem 2rem;
    border: 2px solid var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--bg-title-container);
    /* Adds a subtle dark inner shadow for a recessed effect */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4); 
}

.gallery-main-link:hover .nav-btn {
    background-color: var(--text-primary);
    color: #111111;
    /* Removes or minimizes the inner shadow on hover so the solid color pops */
    box-shadow: none; 
}

/* Horizontal Preview Bar */
.gallery-preview {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    background: var(--bg-preview);
    padding: 1rem;
    border-radius: 4px;
}

/* Individual Art Cards */
.art-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.art-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 0px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.gallery-main-link:hover .art-card img {
    transform: scale(1.03);
    border-color: var(--text-accent);
}

/* Captions under thumbnails */
.card-title {
    font-size: 1.6rem; /* Reduced from 2.2rem for a cleaner fit */
    margin-top: 0.3rem;
    letter-spacing: 1px;
    color: var(--text-caption);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.gallery-main-link:hover .card-title {
    color: var(--text-accent);
}

/* About Section & Artist Statement */
.about-section {
    text-align: left;
    max-width: 750px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 3rem;
}

.about-section h2 {
    font-size: 4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--text-accent);
    text-align: center;
}

.about-section p {
    font-size: 1.5rem;
    line-height: 1.4;
    letter-spacing: 0.8px;
    margin-bottom: 1.5rem;
    color: var(--text-accent2);
    text-align: justify;
}

/* Footer / Bot-protected Contact Link */
footer {
    margin-top: 3rem;
    font-size: 2.2rem;
    letter-spacing: 1px;
}

footer a {
    color: var(--text-accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--text-accent);
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--text-primary);
    border-bottom: 1px solid var(--text-primary);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    header h1 { font-size: 3.5rem; }
    header p { font-size: 1.8rem; }
    nav { flex-direction: column; gap: 1rem; }
    
    /* Shrinks the nav button font size on mobile to keep the text on a single line */
    .nav-btn { 
        width: 100%; 
        text-align: center; 
        font-size: 2.2rem; /* Reduced from 3.2rem to fit narrow screens */
        padding: 0.2rem 1rem; /* Slightly tighter horizontal padding */
    }
    
    .about-section p { text-align: left; }
    
    /* Forces the 4 horizontal items into a clean 2x2 grid on mobile */
    .gallery-preview {
        flex-wrap: wrap;
        gap: 1.5rem 1rem; 
    }

    /* Sets each card to take up roughly half the width minus the layout gap */
    .art-card {
        flex: 0 0 calc(50% - 0.5rem); 
    }

    /* Bumps font size back up slightly since the text container is now much wider */
    .card-title { 
        font-size: 1.5rem; 
    }
}

/* Full Gallery Page Layout Styles */
.full-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 across on desktop screens */
    gap: 2rem;
    width: 100%;
    margin: 3rem 0;
    padding: 1rem;
    .full-gallery-grid:has(.gallery-item-card:hover) .gallery-item-card:not(:hover) {
        opacity: 0.4;
        transition: opacity 0.3s ease;
    }
}

.gallery-item-card {
	position: relative; /* Keeps the container as the structural anchor point */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-preview);
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Viewport-Centered Large-Viewing Click Effect */
.gallery-item-card img {
    cursor: zoom-in;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
                box-shadow 0.3s ease;
}

/* HIGH PRIORITY: Activated State via JavaScript Class Toggle */
.gallery-item-card.active img {
    position: fixed !important;    
    width: 600px !important;       /* Explicitly locked to 600px */
    max-width: 90vw !important;    /* Safe mobile viewport boundaries */
    max-height: 85vh !important;   /* Shorter monitor height boundary safety */
    height: auto !important;
    aspect-ratio: auto !important; /* Restores the raw art aspect ratio */
    z-index: 100000 !important;    /* Elevated above everything */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    border: 2px solid var(--text-accent);
    cursor: zoom-out;
    
    /* Perfect screen-glass centering coordinates */
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Darkened overlay mask dynamically activated behind the popped image */
.gallery-item-card.active::before {
    content: '';
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 99999 !important; /* Sits directly beneath z-index 100000 image layer */
    cursor: pointer;
}

/* Full Gallery Grid Container Layout */
.full-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Clean 3-across desktop grid layout */
    gap: 2rem;
    width: 100%;
    margin: 3rem 0;
    padding: 1rem;
}

.gallery-item-card {
    position: relative; /* Anchor point for background overlay matching */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-preview);
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Base state for standard thumbnails */
.gallery-item-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    cursor: zoom-in;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease;
}

.gallery-item-card:hover img {
    transform: scale(1.02);
    border-color: var(--text-accent);
}

/* HIGH PRIORITY: Activated State via JavaScript Class Toggle */
.gallery-item-card.active img {
    position: fixed !important;    /* !important ensures layout constraints do not override layout breakout */
    width: 600px !important;       /* Explicitly locked to 600px */
    max-width: 90vw !important;    /* Safe mobile viewport boundaries */
    max-height: 85vh !important;   /* Shorter monitor height boundary safety */
    height: auto !important;
    aspect-ratio: auto !important; /* Restores the raw art aspect ratio */
    z-index: 10000;                /* Forces target above wrapper and background */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    border: 2px solid var(--text-accent);
    cursor: zoom-out;
    
    /* Perfect screen-glass centering coordinates */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Darkened overlay mask dynamically activated behind the popped image */
.gallery-item-card.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999; /* Sits directly beneath z-index 10000 image layer */
    cursor: pointer;
}

.item-title {
    font-family: 'Just Another Hand', cursive;
    font-size: 2rem;
    margin-top: 0.75rem;
    color: var(--text-caption);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.item-title2 {
    font-family: 'Just Another Hand', cursive;
    font-size: 1rem;
    margin-top: 0.75rem;
    color: var(--text-caption);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.gallery-item-card.active .item-title {
    position: relative;
    z-index: 1; /* Keeps text behind the 99999 backdrop layer */
}

/* Responsive media breakpoints */
@media (max-width: 768px) {
    .full-gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 across configuration on tablet viewports */
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    header h1 { font-size: 3.5rem; }
    header p { font-size: 1.8rem; }
    nav { flex-direction: column; gap: 1rem; }
    
    .nav-btn { 
        width: 100%; 
        text-align: center; 
        font-size: 2.2rem; 
        padding: 0.2rem 1rem; 
    }
    
    .about-section p { text-align: left; }
    
    .gallery-preview {
        flex-wrap: wrap;
        gap: 1.5rem 1rem; 
    }

    .art-card {
        flex: 0 0 calc(50% - 0.5rem); 
    }

    .card-title { 
        font-size: 1.5rem; 
    }
}

@media (max-width: 480px) {
    .item-title {
        font-size: 1.6rem; 
    }
}
