/* Modern Photography Portfolio CSS */
/* Maintains original design while adding modern features */

/* Font Loading */
@font-face {
    font-family: 'CormorantGaramond';
    src: url('/font/CormorantGaramond-Light.ttf') format('truetype');
    font-display: swap;
    font-weight: 300;
}

/* CSS Custom Properties for easier maintenance */
:root {
    --primary-color: #000;
    --background-color: #F0F2EB;
    --border-color: #DADADA;
    --hover-bg: #e5e8de;
    --hover-overlay: rgba(255, 255, 255, 0.2);
    --font-primary: 'CormorantGaramond', Georgia, serif;
    --font-secondary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1280px;
    --spacing-xs: 4px;
    --spacing-sm: 4px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 45px;
}

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

body, input, textarea {
    color: var(--primary-color);
    font-family: var(--font-primary);
    padding: 0;
    margin: 0;
    background-color: var(--background-color);
    line-height: 1.6;
}

/* Links */
a {
    text-decoration: underline;
    color: var(--primary-color);
    transition: all 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout */
#wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.clear {
    clear: both;
}

/* Header */
#header {
    padding-top: var(--spacing-lg);
}

#title {
    font-family: var(--font-secondary);
    font-weight: bold;
    width: 100%;
    float: left;
    font-size: clamp(28px, 5vw, 45px);
    padding-left: 6px;
    margin: 0;
    color: #444444;
}

#title2 {
    width: 100%;
    float: left;
    font-size: clamp(28px, 5vw, 45px);
    padding-left: 6px;
    margin: 0;
    font-weight: 300;
    color: rgb(89, 89, 89);
}

/* Navigation */
#nav {
    width: 45%;
    float: right;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    color: var(--primary-color);
}

li {
    float: right;
}

li a, .dropbtn {
    display: inline-block;
    color: var(--primary-color);
    text-align: center;
    padding: 14px var(--spacing-md);
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

li a:hover, .dropdown:hover .dropbtn {
    background-color: var(--hover-bg);
}

li a.active {
    background-color: var(--hover-bg);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--background-color);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    right: 0;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--primary-color);
    padding: 12px var(--spacing-md);
    text-decoration: none;
    display: block;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: var(--hover-bg);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content.show {
    display: block;
}

/* Gallery Styles - True Masonry Layout */
.gallery-grid {
    column-count: 4;
    column-gap: var(--spacing-sm);
    padding: var(--spacing-xs);
    border-top: solid 1px var(--border-color);
    width: 100%; /* Ensure full width */
}

.gallery-item {
    break-inside: avoid;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
    width: 100%;
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-link {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.gallery-link img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;

}

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

.gallery-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hover-overlay);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-link:hover::after {
    opacity: 1;
}

/* Gallery Loading States */
.gallery-item img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item img.loaded {
    opacity: 1;
}

#gallery-info {
    border-top:solid 1px var(--border-color);
    color: #757575;
    padding: 6px;
}
/* Home Page */
.home {
    border-top: solid 1px var(--border-color);
    padding-top: var(--spacing-sm);
    margin-bottom: -41px;
    text-align: center;
}

.home img {
    max-width: 100%;
    height: auto;
}

.home-message {
    text-align: center;
    font-size: 24px;
    padding: var(--spacing-xl);
    border-top: solid 1px var(--border-color);
}

/* Details/Info Section */
#details {
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    margin-bottom: var(--spacing-md);
    backdrop-filter: blur(10px);
}

/* Error States */
.no-images {
    text-align: center;
    padding: var(--spacing-xl);
    font-size: 18px;
    color: #666;
    border-top: solid 1px var(--border-color);
}

/* Footer */
#footer {
    font-family: var(--font-secondary);
    font-size: 12px;
    text-align: right;
    margin-top: var(--spacing-xl);
    border-top: solid 1px var(--border-color);
    padding: 10px;
}

.fleft {
    float: left;
}

.fright {
    float: right;
}

/* PhotoSwipe Custom Styles */
.pswp {
    --pswp-bg: rgba(0, 0, 0, 0.9);
}

.pswp__custom-caption {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    font-family: var(--font-secondary);
    font-size: 14px;
    padding: 20px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1;
}

/* Override PhotoSwipe defaults to match portfolio style */
.pswp__button {
    color: white !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.pswp__button:hover {
    background: rgba(0, 0, 0, 0.5) !important;
}

.pswp__counter {
    font-family: var(--font-secondary) !important;
    font-size: 14px !important;
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* PhotoSwipe zoom cursor */
.pswp__img--placeholder {
    background: var(--background-color);
}

/* Custom loading indicator */
.pswp__preloader {
    color: white !important;
}

/* Mobile PhotoSwipe adjustments */
@media (max-width: 768px) {
    .pswp__custom-caption {
        font-size: 12px;
        padding: 15px;
    }
    
    .pswp__button {
        width: 44px !important;
        height: 44px !important;
    }
    
    .pswp__top-bar {
        padding: 10px !important;
    }
    #gallery-info {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 800px) {
    #nav {
        width: 100%;
        margin-top: var(--spacing-md);
    }
    
    #title, #title2 {
        width: 100%;
        padding-left: 15px;
        text-align: center;
        float: none;
    }
    
    li {
        float: none;
        display: inline-block;
    }
    
    ul {
        text-align: center;
    }
    
    .gallery-grid {
        column-count: 2;
    }
    
    #footer {
        text-align: center;
    }
    
    .fleft, .fright {
        float: none;
        display: block;
        margin-bottom: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        column-count: 1;
    }
    
    #title, #title2 {
        font-size: 24px;
    }
    
    li a {
        padding: 10px 12px;
        font-size: 16px;
    }
    #gallery-info {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery-link img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: optimize-contrast;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gallery-link:hover img {
        transform: none;
    }
    
    .gallery-item:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    #nav, #footer {
        display: none;
    }
    
    .gallery-grid {
        column-count: 2;
    }
    
    .gallery-item {
        page-break-inside: avoid;
        margin-bottom: var(--spacing-md);
    }
}

/* Dark mode support for devices that prefer it */
@media (prefers-color-scheme: dark) {
    .pswp {
        --pswp-bg: rgba(0, 0, 0, 0.95);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .gallery-link:hover img {
        transform: none;
    }
    
    .gallery-link::after {
        display: none;
    }
    
    .gallery-item {
        margin-bottom: var(--spacing-xs);
    }
}

/* Additional PhotoSwipe customizations for better integration */
.pswp__zoom-wrap {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure smooth transitions */
.pswp--open {
    transition: opacity 0.3s ease;
}

/* Loading state for PhotoSwipe */
.pswp__img {
    transition: opacity 0.2s ease;
}

.pswp__img--placeholder {
    background: var(--background-color);
    opacity: 0.6;
}

/* Caption styling (added to match template) */
.caption {
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 5px 0;
}