/* ============================================================
   digtiali-core: Banners bento grid [digtiali_banners_grid]
   5-slot layout: 2 wide cards on top, 3 equal cards below
============================================================ */

.dbg-wrap {
  direction: rtl;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dbg-wrap *,
.dbg-wrap *::before,
.dbg-wrap *::after {
  box-sizing: border-box;
}

/* ── Row 1: wide left + narrow right — equal height cards ── */
.dbg-row--top {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.dbg-row--top .dbg-slot {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.dbg-row--top .dbg-slot__link {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-height: 0;
}

.dbg-row--top .dbg-slot > .dbg-slot-img {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.dbg-row--top .dbg-slot img,
.dbg-row--top .dbg-slot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: none;
  border-radius: 0;
}

.dbg-row--top .dbg-slot:only-child {
  grid-column: 1 / -1;
}

/* ── Row 2: three equal columns ── */
.dbg-row--bottom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto;
  grid-auto-flow: row;
  gap: 1.25rem;
  align-items: start;
}

.dbg-row--bottom .dbg-slot:only-child {
  grid-column: 1 / -1;
  max-width: 420px;
  justify-self: center;
}

/* Guard against wpautop inserting stray <p> tags inside rows */
.dbg-row > p {
  display: contents;
  margin: 0;
}

/* ── Individual card ── */
.dbg-slot {
  display: block;
  line-height: 0;
  border-radius: 20px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(155, 45, 212, 0.06) inset,
    0 12px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.dbg-slot:hover,
.dbg-slot:has(.dbg-slot__link:hover) {
  transform: translateY(-3px);
  border-color: rgba(155, 45, 212, 0.35);
  box-shadow:
    0 0 0 1px rgba(155, 45, 212, 0.12) inset,
    0 16px 48px rgba(74, 14, 115, 0.45);
}

.dbg-slot__link {
  display: block;
  line-height: 0;
  color: inherit;
  text-decoration: none;
}

.dbg-slot img,
.dbg-slot-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Tablet: 481px – 900px ── */
@media (max-width: 900px) and (min-width: 481px) {
  .dbg-row--top {
    grid-template-columns: 1fr 1fr;
  }

  .dbg-row--bottom {
    grid-template-columns: 1fr 1fr;
  }

  .dbg-row--bottom .dbg-slot:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 420px;
    justify-self: center;
  }
}

/* ── Mobile: ≤ 480px ── */
@media (max-width: 480px) {
  .dbg-wrap {
    gap: 0.875rem;
  }

  .dbg-row--top,
  .dbg-row--bottom {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
  }

  .dbg-row--top .dbg-slot {
    display: block;
    height: auto;
  }

  .dbg-row--top .dbg-slot img,
  .dbg-row--top .dbg-slot-img {
    height: auto;
  }

  .dbg-row--bottom .dbg-slot:only-child {
    max-width: none;
  }

  .dbg-slot {
    padding: 8px;
    border-radius: 16px;
  }

  .dbg-slot img,
  .dbg-slot-img {
    border-radius: 10px;
  }
}
