:root {
  --bg-color: #ffffff;
  --text-primary: #1a1a1a;
  /* Darker for more vibrant text */
  --text-secondary: #666666;
  /* Slightly darker secondary */
  --accent: #000000;
  --font-main: "Manrope", sans-serif;
  --header-height: 100px;
  --sidebar-width: 25%;
  /* Narrower sidebar like reference */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Header */
.navbar {
  display: flex;
  align-items: center;
  /* Vertically center */
  padding: 1.25rem 1.5rem 1rem 1.5rem;
  position: sticky;
  top: 0;
  background: white;
  z-index: 100;
}

.brand {
  font-family: Manrope, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 36px;
  color: rgb(59, 59, 59);
  margin-right: auto;
  /* Pushes nav-group to the right */
}

.nav-group {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  text-decoration: none;
  font-family: Manrope, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  color: rgb(59, 59, 59);
  opacity: 0.7;
  /* Default opacity */
  transition: opacity 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  font-weight: 600;
}

.lang-switch,
.mobile-lang-switch {
  display: none !important;
}

.lang-btn {
  cursor: pointer;
  transition: opacity 0.3s, font-weight 0.3s;
}

.lang-btn:hover {
  opacity: 1;
}

.lang-btn.active {
  font-weight: 700;
  opacity: 1;
}

/* Subheader */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-family: Manrope, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  z-index: 201;
  /* Above overlay */
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 200;
  padding: 0;
  /* Remove padding as we now have an internal header */
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  opacity: 0;
  visibility: hidden;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  margin-bottom: 3rem;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-family: Manrope, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
}

.mobile-menu-overlay.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1.5rem;
  /* Restore side padding for content */
  margin-bottom: 3rem;
}

.mobile-nav-links a {
  text-decoration: none;
  font-family: Manrope, sans-serif;
  font-size: 40px;
  font-weight: 500;
  /* Bolder as requested */
  color: #333;
  line-height: 1.2;
}

.mobile-lang-switch {
  font-family: Manrope, sans-serif;
  font-size: 16px;
  color: #000;
  font-weight: 500;
  margin-bottom: auto;
  padding: 0 1.5rem;
}

.mobile-contact-info {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1.5rem;
  margin: 0 1.5rem 1.5rem 1.5rem;
  /* Margin for separator */
}

.mobile-contact-info p {
  font-family: Manrope, sans-serif;
  font-size: 16px;
  /* Match reference ~16px */
  color: #333;
  margin-bottom: 0.5rem;
}

.mobile-social-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0 1.5rem 2rem 1.5rem;
}

.mobile-social-links a {
  text-decoration: none;
  color: #333;
  font-size: 16px;
}

.subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.search-icon-svg {
  opacity: 0.6;
  position: absolute;
  left: 0;
  pointer-events: none;
}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: Manrope, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  padding-left: 1.5rem;
  width: 200px;
  transition: width 0.3s ease;
}

.search-input::placeholder {
  color: #999;
  opacity: 0;
  transition: opacity 0.3s;
}

.search-input:focus::placeholder {
  opacity: 1;
}

.search-input:focus {
  width: 250px;
}

.filters {
  display: flex;
  gap: 1.5rem;
}

.filter-btn {
  background: none;
  border: none;
  font-family: Manrope, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: rgb(59, 59, 59);
  cursor: pointer;
  transition: color 0.3s;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  color: var(--text-primary);
}

/* Main Grid */
.gallery-container {
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  grid-column-gap: 10rem;
  grid-row-gap: 10rem;
  padding-right: 2.5rem;
  position: relative;
  min-height: calc(100vh - 140px);
}

/* Sidebar */
.sidebar {
  width: 100%;
  /* Full width of the grid cell */
  padding: 1.5rem 1rem 2rem 1rem;
  /* Tighter padding all around */
  height: calc(100vh - 140px);
  position: sticky;
  top: 140px;
  overflow-y: auto;
  direction: rtl;
  /* Reverse direction to put scrollbar on left */
  /* No border-right in the exact screenshot, just whitespace separation */
}

/* Reset text direction for content */
.sidebar > * {
  direction: ltr;
}

.category-group {
  margin-bottom: 3rem;
}

.category-title {
  font-family: Manrope, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;
  color: rgb(0, 0, 0);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  /* Tighter spacing */
  letter-spacing: 0.8px;
  /* More letter spacing */
}

@media (max-width: 768px) {
  .category-title {
    font-size: 16px;
  }
}

.art-item {
  cursor: pointer;
  padding: 0.5rem 0;
  /* Slightly tighter */
  font-size: 0.88rem;
  color: var(--text-secondary);
  /* Lighter gray by default */
  transition: color 0.2s ease;
  line-height: 1.5;
  font-weight: 400;
}

.art-item:hover {
  color: #000;
  font-weight: 500;
}

.art-item.active {
  color: #000;
  font-weight: 600;
  /* Bold for active */
  text-decoration: underline;
  /* Assuming generic active state, or just bold */
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Display Area */
.display-area {
  /* flex: 1; removed */
  padding: 1.5rem 0 2rem 0;
  /* align with grid edge */
  position: relative;
  max-width: 100%;
  /* Fill the grid cell */
  /* width constraints handled by grid */
}

/* Content Header */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #000;
  /* Solid black line as seen in screenshot */
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
  /* More space below header */
  height: auto;
}

.content-category-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
}

.close-btn:hover {
  opacity: 1;
}

/* Artwork View */
.artwork-view {
  opacity: 0;
  animation: fadeIn 0.5s forwards;
  display: flex;
  flex-direction: column;
}

.image-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 1.5rem;
  /* Space before details */
  background: #f5f5f5;
  overflow: hidden;
  /* container for the cover image */
}

.art-image {
  width: 100%;
  height: 440px;
  /* max-height: 80vh; removed */
  /* Much smaller to show content below without scrolling */
  display: block;
  object-fit: cover;
  /* Fills horizontal space */
}

.expand-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  opacity: 1;
  /* opacity: 0; removed for always visible */
  transition: opacity 0.3s;
  z-index: 10;
  border-radius: 4px;
}

.expand-icon svg {
  stroke: white;
}

/* .image-wrapper:hover .expand-icon {
    opacity: 1;
} removed - always visible */

/* Cursor-following Navigation */
.cursor-nav {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.1s ease;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.6rem 1.1rem;
  border-radius: 24px;
  color: #333;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(4px);
}

.image-wrapper:hover .cursor-nav {
  opacity: 1;
}

.cursor-nav.prev {
  flex-direction: row-reverse;
}

.cursor-nav svg {
  transition: transform 0.3s ease;
}

.cursor-nav.prev svg {
  transform: rotate(180deg);
}

.cursor-nav .nav-text {
  transition: opacity 0.2s ease;
}

/* Clickable zones for navigation */
.image-wrapper {
  cursor: pointer;
}

.preview-mode .content-header,
.preview-mode .art-details,
.preview-mode .expand-icon {
  display: none !important;
}

.preview-mode .artwork-view {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60vh;
}

/* Mobile: make navigation hint/controls visible and usable (do not disturb desktop) */
@media (max-width: 900px) {
  /* On mobile, hide the cursor-following pill (desktop-only behavior causes overlap)
     and use left/right tap zones (image-wrapper click) with decorative arrows. */
  .cursor-nav {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .image-wrapper::before,
  .image-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.55);
    z-index: 18;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    /* Allow taps to pass through to the underlying image-wrapper click handler */
    pointer-events: none;
  }

  .image-wrapper::before {
    left: 12px;
    background-position: center;
    background-repeat: no-repeat;
  }

  .image-wrapper::after {
    right: 12px;
    background-position: center;
    background-repeat: no-repeat;
  }

  .image-wrapper::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 8 12'><polyline points='6 2 2 6 6 10' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  }

  .image-wrapper::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 8 12'><polyline points='2 2 6 6 2 10' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  }

  /* Slightly increase search input width on mobile to avoid overlap */
  .search-input {
    width: 160px;
  }
}

.preview-mode .image-wrapper {
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}

.preview-mode .art-image {
  width: auto;
  max-width: 35%;
  /* Smaller preview size to match reference */
  max-height: 35vh;
  aspect-ratio: auto;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 95%;
  max-height: 95vh;
  object-fit: contain;
  animation: zoomIn 0.3s;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* Hide cursor nav when hovering the expand button to prevent obstruction */
.expand-icon:hover ~ .cursor-nav {
  display: none !important;
  opacity: 0 !important;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile: Hide Filters and Search (Desktop Only) */
@media (max-width: 768px) {
  .filters,
  .search-container {
    display: none !important;
  }

  .subheader {
    justify-content: center;
    /* Center remaining content if any */
    padding-bottom: 0;
    border-bottom: none;
    /* efficient use of space */
  }
}

/* Details Footer */
.art-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 0;
  gap: 2rem;
  /* Space between title and metadata */
}

.art-title-block h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0;
  line-height: 1.4;
}

.art-meta-block {
  text-align: right;
  font-size: 0.8rem;
  color: #aaa;
  /* Lighter grey */
  line-height: 1.6;
  font-weight: 400;
}

.art-meta-block p {
  margin: 0;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Category Overview Styles */
.category-view {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.5s forwards;
  width: 100%;
}

.cat-image-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 2.5rem;
  /* Increased spacing */
  background: #f5f5f5;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cat-image-wrapper:hover .cat-image {
  transform: scale(1.02);
}

.view-gallery-text {
  position: absolute;
  color: white;
  font-family: Manrope, sans-serif;
  font-size: 16px;
  font-weight: 500;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cat-image {
  width: 100%;
  height: 240px;
  /* Smaller height to match design */
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.cat-image-wrapper .expand-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  z-index: 20;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.cat-image-wrapper:hover .expand-icon {
  opacity: 1;
}

.cat-content-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  /* Wider text column like reference */
  gap: 4rem;
  /* Large gap */
  align-items: start;
  /* Top align everything */
}

.cat-description {
  font-family: Manrope, sans-serif;
  font-size: 16px;
  /* Specific size */
  line-height: 1.6;
  color: #333;
  margin-bottom: 1.5rem;
  /* Reduced to bring links closer */
  max-width: 95%;
}

.cat-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cat-link-row {
  font-size: 15px;
  color: #333;
  margin: 0;
}

.cat-link-row a {
  color: #333;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cat-link-row a:hover {
  opacity: 0.7;
}

.cat-year {
  margin-top: 2rem;
  /* Space before year */
  font-weight: 400;
  font-size: 15px;
  color: #333;
}

.see-artworks-btn {
  background: none;
  border: none;
  font-family: Manrope, sans-serif;
  font-size: 16px;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  transition: opacity 0.2s;
  justify-content: flex-end;
  /* Align right */
  width: 100%;
  margin-top: 0.2rem;
  /* Align with top text line visually */
}

.see-artworks-btn:hover {
  opacity: 0.7;
}

@media (max-width: 900px) {
  .cat-content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .see-artworks-btn {
    margin-left: auto;
    /* Push to right */
    margin-top: 1rem;
    justify-content: flex-end;
    /* Right align on mobile as per screenshot */
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .gallery-container {
    grid-column-gap: 5rem;
  }
}

@media (max-width: 900px) {
  .gallery-container {
    display: flex;
    /* Fallback to flex or single col grid */
    flex-direction: column;
    grid-template-columns: 1fr;
    grid-gap: 0;
    padding-right: 0;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
  }

  .display-area {
    width: 100%;
    height: auto;
    padding: 2rem;
  }

  .art-details {
    flex-direction: column;
    gap: 1rem;
  }

  .art-meta-block {
    text-align: left;
  }

  .navbar {
    flex-direction: row;
    /* Match reference: Brand left, Menu right */
    justify-content: space-between;
    align-items: center;
    gap: 0;
    padding: 1.5rem;
  }

  .brand {
    margin-bottom: 0;
  }

  .desktop-only {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  /* Mobile Detail View Behavior - STRICT OVERRIDE */
  body.mobile-view-active .sidebar {
    display: none !important;
  }

  body.mobile-view-active .navbar {
    display: none !important;
    /* Hide header for full screen */
  }

  body.mobile-view-active .display-area {
    display: block !important;
    width: 100% !important;
    padding: 1.5rem !important;
    min-height: 100vh;
    z-index: 100;
    background: white;
    position: fixed;
    /* Fix content to top */
    top: 0;
    left: 0;
    overflow-y: auto;
    /* Allow scrolling inside */
  }

  /* Adjust main layout for mobile list view reference */
  .sidebar {
    border: none;
    padding: 1rem 1.5rem;
  }

  .category-title {
    font-size: 16px;
    /* Larger on mobile */
    font-weight: 700;
    /* Bolder */
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
  }

  /* Simulate 'Open' text on mobile categories if needed, or just keep simple list */

  .art-item {
    font-size: 16px;
    /* Larger readable size on mobile */
    padding: 0.8rem 0;
    /* More spacing */
    border-bottom: 1px solid #f5f5f5;
    /* Subtle separation */
    color: #666;
  }
}

/* Heading-only sidebar styles (used when sidebar shows only headings + subtitle) */
.category-heading {
  font-family: Manrope, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #000;
  position: relative;
  cursor: pointer;
  padding: 0.25rem 0;
  padding-right: 4rem; /* space for "Open" label */
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

/* "Open" label on hover/active */
.category-heading::after {
  /* Use the element's data-open attribute so JS can localize this label */
  content: attr(data-open);
  position: absolute;
  right: 0;
  top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #1a1a1a;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-heading:hover,
.category-heading.active {
  border-bottom-color: #000;
}

.category-heading:hover::after,
.category-heading.active::after {
  opacity: 1;
}

.category-subtitle {
  color: #9b9b9b;
  font-size: 0.95rem;
  line-height: 1.3;
}

@media (max-width: 768px) {
  /* On mobile, always show "Open" like the reference list */
  .category-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-right: 0;
    border-bottom-color: #eaeaea;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .category-heading::after {
    position: static;
    opacity: 1;
    font-size: 0.95rem;
    color: #3b3b3b;
  }

  .category-heading.active {
    border-bottom-color: #000;
  }
}

/* Mobile modal slider nav (Artworks page) */
.mobile-image-container {
  position: relative;
}

/* New mobile overlay controls (arrows + gallery icon) - Hidden to prevent duplicate arrows */
.mobile-slider-overlay {
  display: none !important;
}

.mobile-slider-arrow,
.mobile-gallery-btn {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(225, 225, 225, 0.92);
  backdrop-filter: blur(4px);
  color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-slider-arrow.prev {
  left: 14px;
}

.mobile-slider-arrow.next {
  right: 14px;
}

.mobile-gallery-btn {
  top: 16px;
  right: 16px;
  transform: none;
  width: 44px;
  height: 44px;
  z-index: 35;
}

.mobile-slider-arrow:active,
.mobile-gallery-btn:active {
  opacity: 0.7;
}

.mobile-slider-counter {
  pointer-events: none;
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  background: rgba(225, 225, 225, 0.92);
  backdrop-filter: blur(4px);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  min-width: 64px;
  text-align: center;
}

/* Full-screen gallery view (grid) */
.mobile-gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500000000;
  padding: 16px;
}

.mobile-gallery-shell {
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Old duplicate mobile gallery styles removed - using styles below for gallery slider modal (lines 1208+) */

.mobile-gallery-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-gallery-thumb {
  border: 0;
  padding: 0;
  background: #f3f3f3;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.mobile-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile Gallery Slider Modal (Full View) */
.mobile-gallery-slider-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  background: #000;
  z-index: 9999999999;
  overflow: hidden;
}

.mobile-gallery-slider-content {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.mobile-gallery-header {
  position: relative;
  padding: 1rem 3.5rem 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  min-height: 50px;
  box-sizing: border-box;
}

.mobile-gallery-title {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  padding: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 60px); /* Ensure space for close button */
}

.mobile-gallery-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  flex-shrink: 0;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 101;
  width: 32px;
  height: 32px;
}

.mobile-gallery-slider-wrapper {
  position: relative;
  flex: 1;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden !important;
  display: block;
  height: calc(100% - 50px);
  box-sizing: border-box;
}

.mobile-gallery-slider-track {
  display: flex;
  flex-direction: row;
  height: 100%;
  transition: transform 0.3s ease;
  will-change: transform;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-gallery-slider-track > div {
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
}

.mobile-gallery-slider-track img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.mobile-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.3s;
}

.mobile-gallery-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.mobile-gallery-prev {
  left: 1rem;
}

.mobile-gallery-next {
  right: 1rem;
}

.mobile-gallery-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 100;
}

/* Mobile View: Fixed 75vh height and full width for images */
@media (max-width: 768px) {
  .mobile-image-container {
    height: 75vh !important;
    width: 100% !important;
  }

  .mobile-modal-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .mobile-nav-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-prev {
    left: 1rem;
    bottom: 1.5rem;
  }

  .mobile-nav-next {
    right: 1rem;
    bottom: 1.5rem;
  }

  .mobile-fullview-btn {
    display: flex !important;
  }
}
