/* ============================================
   12-COLUMN RESPONSIVE GRID OVERLAY SYSTEM
   ============================================
   
   Golden Ratio Based Scaling (Base: 1440px)
   - Mobile: 375px - 767px (12 columns, 12px gutter, 24px margins)
   - Tablet: 768px - 1439px (12 columns, 16px gutter, 24px margins)
   - Laptop/Desktop: 1025px - 1919px (12 columns, 24px gutter, variable margins)
   - Wide Desktop: 1920px+ (12 columns, 32px gutter, variable margins)
   
   Toggle with: Ctrl/Cmd + G or by calling window.toggleGridOverlay()
   ============================================ */

/* Default (Mobile fallback) */
:root {
  --grid-columns: 12;
  --grid-gutter: 12px;
  --grid-margin: 16px;
  --grid-breakpoint: 'Mobile';
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet: 768px - 1439px */
@media (min-width: 768px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 16px;
    --grid-margin: 24px;
    --grid-breakpoint: 'Tablet';
  }
}

/* Laptop/Desktop: 1025px - 1439px */
@media (min-width: 1025px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 24px;
    --grid-margin: 24px;
    --grid-breakpoint: 'Laptop/Desktop';
  }
}

/* Desktop 1440px: 1440px - 1920px */
@media (min-width: 1440px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 24px;
    --grid-margin: calc(80px + (100vw - 1440px) * 0.0583333333);
    --grid-breakpoint: 'Desktop 1440px';
  }
}

/* Desktop 1920px - 2460px */
@media (min-width: 1921px) and (max-width: 2460px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 32px;
    --grid-margin: calc(108px + (100vw - 1920px) * 0.3925925926);
    --grid-breakpoint: 'Desktop 1920px';
  }
}

/* Desktop 2461px+ (Ultra-wide) */
@media (min-width: 2461px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 32px;
    --grid-margin: 320px;
    --grid-breakpoint: 'Desktop 2560px';
  }
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.grid-overlay.active {
  opacity: 1;
  visibility: visible;
}

.grid-overlay__container {
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gutter);
  box-sizing: border-box;
  /* Apply margins using padding instead of padding-left/right */
  padding: 0 var(--grid-margin);
}

.grid-overlay__column {
  background: rgba(207, 85, 65, 0.15);
  border-left: 1px solid rgba(207, 85, 65, 0.3);
  border-right: 1px solid rgba(207, 85, 65, 0.3);
  height: 100%;
  position: relative;
}

.grid-overlay__column::before {
  content: attr(data-column);
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: bold;
  color: rgba(207, 85, 65, 0.8);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Grid Info Label */
.grid-overlay__info {
  position: fixed;
  bottom: 20px;
  right: max(20px, var(--grid-margin));
  background: rgba(207, 85, 65, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10000;
}

.grid-overlay__info-title {
  font-weight: bold;
  margin-bottom: 6px;
  font-size: 13px;
}

.grid-overlay__info-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.grid-overlay__info-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.2s;
}

.grid-overlay__info-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile: 375px - 767px */
@media (max-width: 767px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 12px;
    --grid-margin: 16px;
    --grid-breakpoint: 'Mobile';
  }
}

/* Tablet: 768px - 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 16px;
    --grid-margin: 24px;
    --grid-breakpoint: 'Tablet';
  }
}

/* Laptop/Desktop: 1025px - 1439px */
@media (min-width: 1025px) and (max-width: 1439px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 24px;
    --grid-margin: 24px;
    --grid-breakpoint: 'Laptop/Desktop';
  }
}

/* Desktop 1440px: 1440px - 1920px */
@media (min-width: 1440px) and (max-width: 1920px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 24px;
    --grid-margin: calc(80px + (100vw - 1440px) * 0.0583333333);
    --grid-breakpoint: 'Desktop 1440px';
  }
}

/* Desktop 1920px - 2460px */
@media (min-width: 1921px) and (max-width: 2460px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 32px;
    --grid-margin: calc(108px + (100vw - 1920px) * 0.3925925926);
    --grid-breakpoint: 'Desktop 1920px';
  }
}

/* Desktop 2461px+ (Ultra-wide) */
@media (min-width: 2461px) {
  :root {
    --grid-columns: 12;
    --grid-gutter: 32px;
    --grid-margin: 320px;
    --grid-breakpoint: 'Desktop 2560px';
  }
}

/* ============================================
   RESPONSIVE COLUMN VISIBILITY
   (All 12 columns visible on all breakpoints)
   ============================================ */
.grid-overlay__column {
  display: block;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.grid-overlay--pink {
  --grid-color: rgba(252, 231, 228, 0.5);
  --grid-border: rgba(207, 85, 65, 0.4);
}

.grid-overlay--red {
  --grid-color: rgba(207, 85, 65, 0.15);
  --grid-border: rgba(207, 85, 65, 0.3);
}

.grid-overlay--blue {
  --grid-color: rgba(59, 130, 246, 0.1);
  --grid-border: rgba(59, 130, 246, 0.3);
}

/* Toggle Button */
.grid-overlay__toggle {
  position: fixed;
  bottom: 20px;
  left: max(20px, var(--grid-margin));
  background: rgba(207, 85, 65, 0.95);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.grid-overlay__toggle:hover {
  background: rgba(207, 85, 65, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.grid-overlay__toggle.active {
  background: rgba(40, 40, 40, 0.95);
}

