/* ==========================================================================
   GHSM – brand / promotion ad banners
   Loaded by wp-content/mu-plugins/ghsm-ad-banners.php ([ghsm_ad_banners])
   ========================================================================== */

/* 12-column grid; each banner spans 12 / 6 / 4 depending on its Width setting.
   Artwork keeps its own aspect ratio (these are finished creatives — cropping
   them would cut off the contact details), so items align to the top of the row. */
.ghsm-ads {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}

.ghsm-ad {
  grid-column: span 6;
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ghsm-line, #E1E3E8);
  border-radius: var(--ghsm-radius, 10px);
  background: var(--ghsm-band, #F5F5F7);
  line-height: 0;
}
.ghsm-ad--full  { grid-column: span 12; }
.ghsm-ad--half  { grid-column: span 6; }
.ghsm-ad--third { grid-column: span 4; }

.ghsm-ads .ghsm-ad img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
}

/* Only the linked banners react to the pointer. */
a.ghsm-ad {
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
a.ghsm-ad:hover,
a.ghsm-ad:focus-visible {
  border-color: var(--ghsm-blue, #2456C4);
  box-shadow: var(--ghsm-shadow-md, 0 6px 20px rgba(16, 24, 40, .10));
  transform: translateY(-2px);
}
a.ghsm-ad:focus-visible { outline: 2px solid var(--ghsm-blue, #2456C4); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  a.ghsm-ad { transition: none; }
  a.ghsm-ad:hover, a.ghsm-ad:focus-visible { transform: none; }
}

/* Hide the whole section (heading included) while there are no banners to show. */
.ghsm-ads-section:has(.ghsm-ads[data-count="0"]) { display: none; }

/* Thirds pair up before they stack. */
@media (max-width: 1024px) {
  .ghsm-ads { gap: 18px; }
  .ghsm-ads .ghsm-ad--third { grid-column: span 6; }
}

@media (max-width: 640px) {
  .ghsm-ads { gap: 14px; }
  .ghsm-ads .ghsm-ad,
  .ghsm-ads .ghsm-ad--full,
  .ghsm-ads .ghsm-ad--half,
  .ghsm-ads .ghsm-ad--third { grid-column: span 12; }
}
