/* ==========================================================================
   MURUGAN GALLERY MANAGER — LUXURY HERITAGE THEME
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Cinzel:wght@500;600;700;800&family=Outfit:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  --rlm-primary: #8A2212;
  --rlm-primary-dark: #631508;
  --rlm-primary-deep: #5B0C06;
  --rlm-primary-light: #F7EBE7;
  --rlm-order-red: #E23744;
  --rlm-order-red-dark: #C41C29;
  --rlm-brass: #C88321;
  --rlm-brass-hover: #AA6B15;
  --rlm-brass-light: #FDF6E9;
  --rlm-bg: #F4EBD8;
  --rlm-surface: rgba(254, 250, 242, 0.94);
  --rlm-surface-solid: #FEFAF2;
  --rlm-border: #E2D2B8;
  --rlm-border-gold: rgba(200, 131, 33, 0.4);
  --rlm-text-primary: #2C1810;
  --rlm-text-secondary: #5E4537;
  --rlm-text-muted: #876957;
  --rlm-font-heading: 'Bebas Neue', 'Cinzel', Impact, sans-serif;
  --rlm-font-serif: 'Playfair Display', Georgia, serif;
  --rlm-font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --rlm-radius-sm: 8px;
  --rlm-radius-md: 12px;
  --rlm-radius-lg: 18px;
  --rlm-shadow-sm: 0 4px 14px rgba(44, 24, 16, 0.06);
  --rlm-shadow-md: 0 10px 28px rgba(44, 24, 16, 0.12);
  --rlm-shadow-lg: 0 20px 48px rgba(44, 24, 16, 0.18);
}

/* Universal Container: 1190px max-width */
.mg-container {
  max-width: 1190px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Base Gallery Page Background */
.mg-gallery-page {
  background-image: url('../images/parchment-tile.jpg');
  background-repeat: repeat;
  background-attachment: fixed;
  background-color: var(--rlm-bg);
  min-height: 100vh;
  font-family: var(--rlm-font-sans);
  color: var(--rlm-text-primary);
}

/* ==========================================
   1. FULL-WIDTH LUXURY HERO BANNER
   ========================================== */
.mg-hero {
  position: relative;
  background-size: cover;
  background-position: right center;
  padding: 120px 0 85px;
  color: #FFFFFF;
  border-bottom: 3px solid var(--rlm-brass);
  overflow: hidden;
}

.mg-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(44, 24, 16, 0.92) 0%, rgba(99, 21, 8, 0.85) 60%, rgba(138, 34, 18, 0.75) 100%);
  z-index: 1;
}

.mg-hero-container {
  position: relative;
  z-index: 2;
}

.mg-hero-content {
  max-width: 800px;
}

.mg-gold-tag {
  font-family: var(--rlm-font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--rlm-brass);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 12px;
  background: rgba(200, 131, 33, 0.15);
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid rgba(200, 131, 33, 0.35);
}

.mg-title {
  font-family: var(--rlm-font-heading);
  font-size: 4.2rem;
  letter-spacing: 2px;
  color: #FFFDF9;
  margin: 0 0 10px 0;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.mg-hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #F8EFE4;
  margin: 0;
  max-width: 650px;
  opacity: 0.95;
}

/* Main Content Container */
.mg-main-container {
  padding: 50px 20px 80px;
}

/* ==========================================
   2. VARIATION SWATCH MULTI-STEP FILTER
   ========================================== */
.mg-swatch-filter-container {
  background: var(--rlm-surface);
  border: 1.5px solid var(--rlm-border-gold);
  padding: 24px 28px;
  border-radius: var(--rlm-radius-md);
  box-shadow: var(--rlm-shadow-md);
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.mg-swatch-row {
  margin-bottom: 20px;
}

.mg-swatch-row:last-child {
  margin-bottom: 0;
}

.mg-locality-swatch-row {
  border-top: 1.5px dashed var(--rlm-border);
  padding-top: 20px;
  margin-top: 20px;
}

.mg-swatch-row-header {
  margin-bottom: 12px;
}

.mg-swatch-label {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rlm-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mg-swatch-label .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  color: var(--rlm-brass);
}

.mg-swatch-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Individual Variation Swatch Button */
.mg-swatch-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 30px;
  font-family: var(--rlm-font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  border: 1.5px solid var(--rlm-border);
  background: #FFFDF9;
  color: var(--rlm-text-primary);
  box-shadow: 0 2px 6px rgba(44, 24, 16, 0.05);
  transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mg-swatch-btn:hover {
  border-color: var(--rlm-brass);
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 131, 33, 0.18);
  color: var(--rlm-primary);
}

.mg-swatch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rlm-brass);
  transition: all 0.2s ease;
}

.mg-swatch-name {
  letter-spacing: 0.3px;
}

.mg-swatch-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(200, 131, 33, 0.15);
  color: var(--rlm-primary);
  transition: all 0.2s ease;
}

/* Active City Swatch (Deep Crimson Luxury) */
.mg-city-swatch.is-active {
  background: linear-gradient(135deg, var(--rlm-primary) 0%, var(--rlm-primary-dark) 100%) !important;
  color: #FFFDF9 !important;
  border-color: var(--rlm-brass) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(138, 34, 18, 0.35) !important;
}

.mg-city-swatch.is-active .mg-swatch-dot {
  background: #FFD580;
  box-shadow: 0 0 8px #FFD580;
}

.mg-city-swatch.is-active .mg-swatch-count {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

/* Active Locality Swatch (Warm Brass Gold Luxury) */
.mg-locality-swatch.is-active {
  background: linear-gradient(135deg, var(--rlm-brass) 0%, var(--rlm-brass-hover) 100%) !important;
  color: #FFFFFF !important;
  border-color: var(--rlm-primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(200, 131, 33, 0.38) !important;
}

.mg-locality-swatch.is-active .mg-swatch-count {
  background: rgba(44, 24, 16, 0.25);
  color: #FFFFFF;
}

/* Results Count Bar */
.mg-results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rlm-text-secondary);
  letter-spacing: 0.5px;
}

.mg-mode-regular .mg-results-info {
  margin-top: 4px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--rlm-border);
}

.mg-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(200, 131, 33, 0.25);
  border-top-color: var(--rlm-primary);
  border-radius: 50%;
  animation: mg-spin 0.8s linear infinite;
}

@keyframes mg-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================
   3. GALLERY PHOTO GRID & CARDS
   ========================================== */
.mg-grid {
  display: grid;
  gap: 24px;
  transition: opacity 0.3s ease;
}

.mg-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.mg-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mg-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Photo Card */
.mg-card {
  position: relative;
  background: var(--rlm-surface);
  border: 1.5px solid var(--rlm-border);
  border-radius: var(--rlm-radius-md);
  overflow: hidden;
  box-shadow: var(--rlm-shadow-sm);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.mg-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--rlm-shadow-lg);
  border-color: var(--rlm-brass);
}

.mg-card-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Aspect Ratios */
.mg-aspect-square .mg-card-inner {
  padding-top: 100%;
}

.mg-aspect-landscape .mg-card-inner {
  padding-top: 75%;
}

.mg-aspect-wide .mg-card-inner {
  padding-top: 56.25%;
}

.mg-photo-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mg-card:hover .mg-photo-img {
  transform: scale(1.08);
}

/* Hover Overlay */
.mg-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(44, 24, 16, 0.2) 0%, rgba(99, 21, 8, 0.85) 100%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  box-sizing: border-box;
  text-decoration: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.mg-card:hover .mg-card-overlay {
  opacity: 1;
}

.mg-overlay-icon {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rlm-brass);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-10px);
  transition: transform 0.3s ease, background-color 0.2s ease;
}

.mg-card:hover .mg-overlay-icon {
  transform: translateY(0);
}

.mg-overlay-icon .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.mg-overlay-caption {
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.mg-card:hover .mg-overlay-caption {
  transform: translateY(0);
}

.mg-caption-title {
  color: #FFFDF9;
  font-family: var(--rlm-font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  display: block;
}

/* ==========================================
   4. FULL-SCREEN LUXURY LIGHTBOX MODAL
   ========================================= */
.mg-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 10, 6, 0.94);
  backdrop-filter: blur(12px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: mg-fade-in 0.25s forwards;
  user-select: none;
}

@keyframes mg-fade-in {
  to { opacity: 1; }
}

.mg-lightbox-stage {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mg-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 2px var(--rlm-border-gold);
  animation: mg-zoom-in 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes mg-zoom-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.mg-lightbox-caption-bar {
  margin-top: 14px;
  color: #FDF6E9;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  max-width: 700px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

.mg-lightbox-counter {
  color: var(--rlm-brass);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* Lightbox Controls */
.mg-lb-btn {
  position: absolute;
  background: rgba(44, 24, 16, 0.85);
  border: 1px solid var(--rlm-border-gold);
  color: #FFFDF9;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
  z-index: 10;
}

.mg-lb-btn:hover {
  background: var(--rlm-primary);
  transform: scale(1.1);
  color: #FFFFFF;
}

.mg-lb-close {
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.mg-lb-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 24px;
}

.mg-lb-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.mg-lb-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 24px;
}

.mg-lb-next:hover {
  transform: translateY(-50%) scale(1.1);
}

/* ==========================================
   5. RESPONSIVE BREAKPOINTS
   ========================================== */
@media (max-width: 1024px) {
  .mg-title {
    font-size: 3.4rem;
  }
  .mg-cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .mg-hero {
    padding: 90px 0 60px;
  }
  .mg-title {
    font-size: 2.8rem;
  }
  .mg-filter-bar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }
  .mg-cols-3, .mg-cols-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .mg-lb-prev {
    left: 10px;
    width: 42px;
    height: 42px;
  }
  .mg-lb-next {
    right: 10px;
    width: 42px;
    height: 42px;
  }
  .mg-lb-close {
    top: 14px;
    right: 14px;
  }
}

@media (max-width: 480px) {
  .mg-title {
    font-size: 2.2rem;
  }
  .mg-cols-2, .mg-cols-3, .mg-cols-4 {
    grid-template-columns: 1fr;
  }
}
