/*
 * GG Ad Manager slot (spec §7). Loaded only on pages with an eligible placement. No fonts, images or URLs: nothing
 * here makes a request. Colour comes from currentColor, so the same rules work on the night surfaces (Headliner,
 * Legend, History, Gear, archives) and on the News cream paper; ggam-ctx--* is only a hook. Selectors repeat the
 * class to outrank the theme's flow spacing (e.g. `.gp-prose > * + *`) without !important.
 */

.ggam-slot.ggam-slot.ggam-slot[hidden] { display: none; }

.ggam-slot.ggam-slot.ggam-slot {
  display: block;
  box-sizing: border-box;
  margin: 40px 0;
  padding: 10px 0 16px;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(128, 128, 128, 0.35);
  border-bottom: 1px solid rgba(128, 128, 128, 0.35);
  border-top-color: color-mix(in srgb, currentColor 20%, transparent);
  border-bottom-color: color-mix(in srgb, currentColor 20%, transparent);
  text-align: center;
  clear: both;
}

.ggam-slot .ggam-slot__label.ggam-slot__label {
  margin: 0 0 10px;
  padding: 0;
  font: 400 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  color: inherit;
  opacity: 0.78; /* >= 4.5:1 on the night (#0a0909) and cream (rgb(239 233 222)) surfaces; see README */
}

.ggam-slot .ggam-slot__creative {
  box-sizing: border-box;
  margin: 0 auto;
  width: 100%;
  min-height: 250px;
}

/* Reserved geometry once revealed (spec §4). */
.ggam-slot--banner .ggam-slot__creative { max-width: 970px; }
.ggam-slot--rect .ggam-slot__creative { max-width: 728px; }
.ggam-slot--tall .ggam-slot__creative { width: 300px; max-width: 100%; min-height: 600px; }
@media (max-width: 767.98px) {
  .ggam-slot--banner .ggam-slot__creative,
  .ggam-slot--rect .ggam-slot__creative { width: 300px; max-width: 100%; }
}

/* AdSense: the responsive unit takes the column's width; the reserved height keeps text from jumping when it fills. */
.ggam-slot.ggam-slot[data-ggam-provider="adsense"] .ggam-slot__creative.ggam-slot__creative { width: 100%; min-height: 280px; }
.ggam-slot--tall.ggam-slot[data-ggam-provider="adsense"] .ggam-slot__creative.ggam-slot__creative { width: 300px; max-width: 100%; min-height: 600px; }
/* Google's recommended collapse for a unit it could not fill. */
.ggam-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
/* Emptied while on screen: keep the space, drop the label and the rules, so nothing moves and no box is left. */
.ggam-slot.ggam-slot.ggam-slot--empty { border-color: transparent; }
.ggam-slot.ggam-slot--empty .ggam-slot__label.ggam-slot__label { visibility: hidden; }

/* Dummy provider: neutral hatch, dashed outline, small text. Decorative only (aria-hidden), nothing focusable. */
.ggam-dummy {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: inherit;
  height: 100%;
  outline: 1px dashed rgba(128, 128, 128, 0.5);
  outline-color: color-mix(in srgb, currentColor 40%, transparent);
  outline-offset: -1px;
  background-image: repeating-linear-gradient(135deg, rgba(128, 128, 128, 0.14) 0 1px, transparent 1px 9px);
  background-image: repeating-linear-gradient(135deg, color-mix(in srgb, currentColor 14%, transparent) 0 1px, transparent 1px 9px);
  font: 400 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
}
.ggam-dummy__title { font-weight: 600; opacity: 0.85; }
.ggam-dummy__meta { opacity: 0.78; font-variant-numeric: tabular-nums; }

/* Context hooks in the theme's own containers. */
.ggam-slot.ggam-slot.ggam-slot.ggam-slot--tall { margin: 12px 0 0; } /* + the side column's 28px gap = 40px */
.gp-side--ad .gp-side__inner.gp-side__inner { position: static; } /* neither the slot nor the side blocks are sticky */
.sp-grid > .ggam-slot.ggam-slot.ggam-slot { grid-column: 1 / -1; margin: 8px 0; } /* + the grid's own row gap (>= 32px) = >= 40px */
@media (max-width: 599px) {
  .sp-grid > .ggam-slot.ggam-slot.ggam-slot { margin: 40px 0; } /* the theme drops the grid gap to 0 below 600px */
}
.hl-adslot > .ggam-slot.ggam-slot.ggam-slot { margin: 0 auto; max-width: 970px; }
.hl-adslot:has(> .ggam-slot[hidden]) { display: none; } /* no empty band while the slot is hidden */

/* Cover Edition front: the right column and the long page space their own children with gap. */
body.gg-premium--front .ce-rrail > .ggam-slot.ggam-slot.ggam-slot,
body.gg-premium--front .ce-lpage > .ggam-slot.ggam-slot.ggam-slot { margin: 0; min-width: 0; }

@media print {
  .ggam-slot.ggam-slot.ggam-slot { display: none; }
}
