/* Modern Minimalistic Photo Gallery Styles */

:root {
  --primary-color: #000;
  --secondary-color: #666;
  --accent-color: #333;
  --bg-color: #fff;
  --text-color: #333;
  --border-color: #e0e0e0;
  --hover-color: #f5f5f5;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
  --spacing-xl: 64px;
  --portrait-row-span: 2; /* Default, can be overridden by JavaScript */
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Header */
.nav-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: var(--spacing-md) 0;
}

.nav-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: 'Lato', sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--secondary-color);
  text-decoration: none;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link i {
  font-size: 18px;
}

/* Filter Container */
.filter-container {
  max-width: 1400px;
  margin: var(--spacing-xl) auto var(--spacing-lg);
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: center;
}

.filter-wrapper {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 8px 4px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ccc;
  position: relative;
}

.filter-btn:hover {
  color: var(--secondary-color);
}

.filter-btn.active {
  color: var(--primary-color);
  font-weight: 400;
}

.filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  height: 1px;
  background: var(--primary-color);
}

/* Gallery Container */
.gallery-container {
  max-width: 1400px;
  margin: 0 auto var(--spacing-xl);
  padding: 0 var(--spacing-lg);
  flex: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-md);
  grid-auto-flow: dense;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  background: #f9f9f9;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* Disable image protection temporarily for better UX */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Masonry layout adjustments */
.gallery-item.vertical {
  grid-row: span var(--portrait-row-span);
}

.gallery-item.horizontal {
  grid-column: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.5s ease, transform 0.3s ease;
  /* Disable right-click and drag */
  pointer-events: none;
}

.gallery-item:hover img {
  transform: scale(1.02);
}

.gallery-item img.loading {
  opacity: 0;
}

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

.gallery-item-overlay {
  display: none;
}

.gallery-item-category {
  display: none;
}

/* Section Headers */
section {
  margin-bottom: var(--spacing-xl);
}

h3 {
  font-family: 'Lato', sans-serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: var(--spacing-lg);
  color: var(--secondary-color);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}

/* Loading Indicator */
.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 9999;
}

.loading.hidden {
  display: none;
}

.loading-spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--spacing-md);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 10001;
}

.lightbox-close:hover {
  color: #ccc;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  animation: zoomIn 0.3s;
  /* Disable right-click */
  pointer-events: none;
  user-select: none;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-caption {
  display: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.9);
  color: black;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

/* Footer */
.footer {
  background: var(--hover-color);
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  color: var(--secondary-color);
  font-size: 14px;
  margin-top: auto;
}

/* Image Protection */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Disable context menu on images */
.gallery-item,
.lightbox-content {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .gallery-grid {
    /* Column width controlled by JavaScript for responsiveness */
  }
  
  .gallery-item.horizontal {
    grid-column: span 1;
  }
  
  .gallery-container {
    padding: 0 var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .site-title {
    font-size: 22px;
  }
  
  .nav-content {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .filter-container {
    margin: var(--spacing-lg) auto;
    padding: 0 var(--spacing-md);
  }
  
  .filter-wrapper {
    width: 100%;
    justify-content: center;
  }
  
  .filter-btn {
    padding: 8px 14px;
    font-size: 10px;
  }
  
  .gallery-grid {
    /* Column width controlled by JavaScript for responsiveness */
    gap: 10px;
  }
  
  .gallery-container {
    padding: 0 10px;
    margin-bottom: var(--spacing-lg);
  }
  
  .gallery-item.vertical {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  /* Allow landscape photos to span 2 columns on tablet for better presentation */
  .gallery-item.horizontal {
    grid-column: span 2;
    grid-row: span 1;
  }
  
  .lightbox-nav {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  
  .lightbox-prev {
    left: 15px;
  }
  
  .lightbox-next {
    right: 15px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    /* Multiple columns with reduced size, controlled by JavaScript */
    gap: 10px;
  }
  
  .gallery-container {
    padding: 0 10px;
  }
  
  .nav-content {
    padding: 0 var(--spacing-md);
  }
  
  .nav-link span {
    display: none;
  }
  
  .filter-container {
    padding: 0 10px;
  }
  
  .filter-btn {
    padding: 6px 10px;
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  
  /* Portrait photos don't span multiple rows on very small screens */
  .gallery-item.vertical {
    grid-row: span 1;
  }
  
  /* Landscape photos span 2 columns for better viewing on mobile */
  .gallery-item.horizontal {
    grid-column: span 2;
  }
}
