/* AURUM Ads - front-end styles (dark/gold, matches style.css tokens) */

.aurum-ad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
  width: 100%;
  box-sizing: border-box;
}

.aurum-ad-item {
  position: relative;
  order: var(--aurum-ad-order-desktop, 0);
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-2, #1c1c1c);
  line-height: 0;
}

.aurum-ad-link {
  display: block;
  line-height: 0;
  outline: none;
}

.aurum-ad-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 10px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.aurum-ad-link:hover .aurum-ad-image,
.aurum-ad-link:focus-visible .aurum-ad-image {
  transform: scale(1.015);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0.96;
}

.aurum-ad-link:focus-visible {
  outline: 2px solid var(--gold, #d4af37);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Popup */
.aurum-ad-popup-open {
  overflow: hidden;
}

.aurum-ad-popup[hidden] {
  display: none;
}

.aurum-ad-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
}

.aurum-ad-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.aurum-ad-popup-dialog {
  position: relative;
  width: min(92vw, 760px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-2, #1c1c1c);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6);
  padding: 14px;
  box-sizing: border-box;
}

.aurum-ad-popup-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--gold, #d4af37);
  color: #1a1407;
  font-size: 22px;
  line-height: 32px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.aurum-ad-popup-close:hover,
.aurum-ad-popup-close:focus-visible {
  background: var(--gold-bright, #ffe08a);
  outline: none;
}

.aurum-ad-popup .aurum-ad-grid {
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}

.aurum-ad-popup .aurum-ad-image {
  border-radius: 8px;
}

/* Fixed left/right/bottom */
.aurum-ad-fixed[hidden] {
  display: none;
}

.aurum-ad-fixed {
  position: fixed;
  z-index: 9000;
  width: min(220px, 28vw);
  box-sizing: border-box;
}

.aurum-ad-fixed-left {
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
}

.aurum-ad-fixed-right {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.aurum-ad-fixed-bottom {
  left: 50%;
  bottom: 12px;
  width: min(680px, calc(100vw - 24px));
  transform: translateX(-50%);
}

.aurum-ad-fixed .aurum-ad-grid {
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.aurum-ad-fixed .aurum-ad-item {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.aurum-ad-fixed .aurum-ad-image {
  border-radius: 10px;
}

.aurum-ad-fixed-close {
  position: absolute;
  top: -12px;
  right: -10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--gold, #d4af37);
  color: #1a1407;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.aurum-ad-fixed-close:hover,
.aurum-ad-fixed-close:focus-visible {
  background: var(--gold-bright, #ffe08a);
  outline: none;
}

@media (max-width: 1024px) {
  .aurum-ad-item {
    order: var(--aurum-ad-order-tablet, var(--aurum-ad-order-desktop, 0));
  }
}

@media (max-width: 768px) {
  .aurum-ad-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 16px 0;
  }

  .aurum-ad-item {
    order: var(--aurum-ad-order-mobile, var(--aurum-ad-order-tablet, var(--aurum-ad-order-desktop, 0)));
  }

  .aurum-ad-popup {
    padding: 12px;
  }

  .aurum-ad-popup-dialog {
    width: 96vw;
    max-height: 86vh;
    padding: 10px;
  }

  /* Side rails would cover most of a phone viewport's usable width - drop them
     and keep only the bottom bar, matching the "don't block mobile UI" spec. */
  .aurum-ad-fixed-left,
  .aurum-ad-fixed-right {
    display: none;
  }

  .aurum-ad-fixed-bottom {
    width: min(420px, calc(100vw - 20px));
    bottom: 10px;
  }
}
