/**
 * Gallery Styles - Clean Image Viewer
 * Simplified from Instagram-style to focus on images
 * Created: 2025-12-05
 * Updated: 2025-12-05 - Added tab navigation system
 */

/* ====================
   TAB NAVIGATION WITH DROPDOWNS
   ==================== */

.gallery-nav-tabs {
  display: flex;
  gap: 0;
  justify-content: center;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 30px;
  flex-wrap: wrap;
  position: relative;
}

.gallery-nav-item {
  position: relative;
}

.gallery-nav-tab {
  padding: 12px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  display: block;
  cursor: pointer;
}

.gallery-nav-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.gallery-nav-tab.active {
  color: var(--text-primary);
  font-weight: 500;
  border-bottom-color: var(--hematite);
}

/* Dropdown indicator */
.gallery-nav-tab.has-dropdown::after {
  content: ' ▾';
  font-size: 12px;
  margin-left: 4px;
}

/* Dropdown menu */
.gallery-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 1000;
  margin-top: 2px;
}

.gallery-nav-item:hover .gallery-dropdown {
  display: block;
}

.gallery-dropdown a {
  display: block;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.gallery-dropdown a:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
  border-left-color: var(--hematite);
}

.gallery-dropdown a.active {
  color: var(--text-primary);
  font-weight: 500;
  background-color: var(--bg-subtle);
  border-left-color: var(--hematite);
}

@media screen and (max-width: 768px) {
  .gallery-nav-tabs {
    gap: 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-nav-tab {
    padding: 10px 16px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .gallery-dropdown {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    min-width: 100%;
    border-radius: 0;
    max-height: 50vh;
    overflow-y: auto;
  }
}

/* ====================
   INSTAGRAM-STYLE GRID
   ==================== */

.instagram-gallery {
  max-width: 935px;
  margin: 0 auto;
  padding: 20px;
}

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}

@media screen and (max-width: 768px) {
  .instagram-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media screen and (max-width: 480px) {
  .instagram-grid {
    grid-template-columns: 1fr;
  }
}

.instagram-post {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.3s;
  cursor: pointer;
}

.instagram-post:hover {
  transform: translateY(-5px);
}

.instagram-post img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}

.instagram-post-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 15px;
  transition: opacity 0.3s;
}

.instagram-post:hover .instagram-post-overlay {
  opacity: 1;
}

.instagram-post-caption {
  color: white;
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  margin: 0;
}

/* ====================
   MODAL - SIMPLIFIED, IMAGE-FOCUSED
   ==================== */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  padding: 60px 20px 20px;
  overflow: auto;
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.modal-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.modal-image img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

/* Remove the sidebar completely */
.modal-details {
  display: none;
}

/* ====================
   MODAL CONTROLS
   ==================== */

.close {
  position: fixed;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  z-index: 1001;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  transition: background 0.2s;
}

.nav:hover {
  background: rgba(0,0,0,0.8);
}

.prev {
  left: 30px;
}

.next {
  right: 30px;
}

@media screen and (max-width: 768px) {
  .close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 30px;
  }

  .nav {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .prev {
    left: 10px;
  }

  .next {
    right: 10px;
  }
}
