/**
 * ============================================================================
 * Dorset Realty — Background Patterns
 * ============================================================================
 *
 * Reusable background pattern classes.
 * Add class to any section/container in Bricks Builder.
 *
 * Available patterns:
 *   .dr-pattern-grid-dots       — Dot grid, radial fade (light sections)
 *   .dr-pattern-grid-lines      — Line grid, radial fade (light sections)
 *   .dr-pattern-grid-lines-dark — Line grid, radial fade (dark sections)
 *
 * Uses Bricks Builder CSS variables (--gray-*, --white, --brand-*).
 * ============================================================================
 */


/* ==========================================================================
   1. GRID DOTS — light sections
   ========================================================================== */

.dr-pattern-grid-dots {
  position: relative;
}

.dr-pattern-grid-dots::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-image: radial-gradient(
    circle,
    var(--gray-300, #D5D7DA) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  background-position: 0 0;
  z-index: 1;
  pointer-events: none;
}

.dr-pattern-grid-dots::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-color: var(--white, #FFFFFF);
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, black 30%, transparent 100%);
  mask-image: linear-gradient(to top, black 30%, transparent 100%);
}

.dr-pattern-grid-dots > * {
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .dr-pattern-grid-dots::before {
    background-size: 32px 32px;
  }
  .dr-pattern-grid-dots::after {
    -webkit-mask-image: linear-gradient(to top, black 40%, transparent 100%);
    mask-image: linear-gradient(to top, black 40%, transparent 100%);
  }
}

@media (max-width: 480px) {
  .dr-pattern-grid-dots::before {
    background-size: 40px 40px;
  }
}


/* ==========================================================================
   2. GRID LINES — light sections
   ========================================================================== */

.dr-pattern-grid-lines {
  position: relative;
  overflow: hidden;
}

.dr-pattern-grid-lines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 95px,
      var(--gray-200, #E9EAEB) 95px,
      var(--gray-200, #E9EAEB) 96px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 95px,
      var(--gray-200, #E9EAEB) 95px,
      var(--gray-200, #E9EAEB) 96px
    );
  background-size: 96px 96px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(50% 100% at 50% 0%, #000 0%, transparent 95%);
  mask-image: radial-gradient(50% 100% at 50% 0%, #000 0%, transparent 95%);
  pointer-events: none;
  z-index: 1;
}

.dr-pattern-grid-lines > * {
  position: relative;
  z-index: 10;
}


/* ==========================================================================
   3. GRID LINES — dark sections
   ========================================================================== */

.dr-pattern-grid-lines-dark {
  position: relative;
  overflow: hidden;
}

.dr-pattern-grid-lines-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 95px,
      rgba(255, 255, 255, 0.06) 95px,
      rgba(255, 255, 255, 0.06) 96px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 95px,
      rgba(255, 255, 255, 0.06) 95px,
      rgba(255, 255, 255, 0.06) 96px
    );
  background-size: 96px 96px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(50% 100% at 50% 0%, #000 0%, transparent 95%);
  mask-image: radial-gradient(50% 100% at 50% 0%, #000 0%, transparent 95%);
  pointer-events: none;
  z-index: 1;
}

.dr-pattern-grid-lines-dark > * {
  position: relative;
  z-index: 10;
}


/* ==========================================================================
   PRINT — hide all patterns
   ========================================================================== */

@media print {
  .dr-pattern-grid-dots::before,
  .dr-pattern-grid-dots::after,
  .dr-pattern-grid-lines::before,
  .dr-pattern-grid-lines-dark::before {
    display: none;
  }
}
