/* Widget Gallery Section Styles */
.widget-gallery-section {
  padding: 100px 5vw;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.widget-gallery-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 60px;
}

.gallery-grid {
  display: grid;
  /* Switching to 12-column grid system for precise control */
  grid-template-columns: repeat(12, 1fr);
  gap: 15px;
  grid-auto-flow: dense;

  /* Reduced Width Layout */
  width: 70%;
  margin: 0 auto;
}

/* Premium Card Style */
.gallery-item {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px; /* Softer corners */
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 120px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(0, 242, 234, 0.5); /* Accent color hint */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 234, 0.1);
  z-index: 10;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}

.gallery-item img {
  width: 100%;
  height: auto;
  flex-grow: 1;
  object-fit: fill; /* Required stretch */
  transition: transform 0.6s ease, filter 0.4s ease;
  padding: 0;
  filter: brightness(0.95) saturate(0.9); /* Slightly muted by default */
}

.gallery-item:hover img {
  transform: scale(1.03); /* Subtle zoom */
  filter: brightness(1.1) saturate(1.1); /* Vivid on hover */
}

/* Sizing Classes for "Mosaic" Feel (Legacy Mappings on 12-Col Grid) */
/* 
  12 Columns Total
  - Default (Small) = Span 3 (1/4 width)
  - Extra Small = Span 2 (1/6 width)
  - Wide = Span 6 (1/2 width)
  - Big = Span 6 (1/2) + 2x height
  - Extra Wide = Span 12 (Full width)
*/

.gallery-item {
  grid-column: span 3; /* Default: 1/4th width */
  grid-row: span 2; /* Default Height */
}

/* Extra Small: 2 cols (1/6) */
.gallery-item.extra-small {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item.wide {
  grid-column: span 6; /* 1/2 width */
}

.gallery-item.tall {
  grid-row: span 4;
}

.gallery-item.big {
  grid-column: span 6;
  grid-row: span 4;
}

.gallery-item.extra-wide {
  grid-column: span 12; /* Full width */
}

.gallery-item.extra-tall {
  grid-row: span 6;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(6, 1fr); /* Drop to 6 cols */
    width: 90%; /* Restore width on smaller screens */
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr); /* Drop to 4 cols */
    width: 95%; /* Almost full width on mobile */
  }
}

/* Elegant Title Bar */
.gallery-item-title {
  position: relative;
  width: 100%;
  padding: 12px 15px;
  background: rgba(10, 10, 10, 0.85); /* Deep dark */
  backdrop-filter: blur(8px); /* Frosted glass */
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  z-index: 2;
}

.gallery-item:hover .gallery-item-title {
  background: var(--c-accent); /* Vivid accent */
  color: #000; /* Contrast text */
  border-top-color: transparent;
  box-shadow: 0 -5px 15px rgba(0, 242, 234, 0.2);
}
