/* Base Styles */
:root {
    --black: #000000;
    --white: #ffffff;
    --gray-50: #f9f9f9;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-sans {
    font-family: 'Inter', sans-serif;
}

.font-geist-mono {
    font-family: 'Geist Mono', monospace;
}

/* Gallery Grid Layouts */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 24px;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 10px;
    grid-gap: 24px;
}

.masonry-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.masonry-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Image hover and transition effects */
.image-hover {
    overflow: hidden;
    position: relative;
}

.image-hover img,
.hover-scale {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-hover:hover img,
.hover-scale:hover {
    transform: scale(1.05);
}

.image-hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-hover:hover::after {
    opacity: 1;
}

/* Detail page styles */
.detail-page-image {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
}

.detail-page-image:hover {
    transform: scale(1.02);
}

.image-info {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.image-info.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Modal styles for gallery lightbox */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    cursor: pointer;
    z-index: 1001;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.modal-nav:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    padding: 0 20px;
    font-family: 'Playfair Display', serif;
}

/* Page transition animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-grid,
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        grid-gap: 16px;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
    }
}

/* Utility classes */
.aspect-ratio {
    position: relative;
    padding-bottom: 125%; /* 4:5 aspect ratio */
}

.aspect-ratio img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
