/* a4w_ads — front listing block */

.a4w-ad {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 369px;
  height: 100%;
  display: flex;
  align-items: stretch;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  background: #111;
}

.a4w-ad__link {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  text-decoration: none;
  color: inherit;
}
.a4w-ad__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* CSS Grid themes: wrapper spans 2 columns. */
[data-a4-injected][data-a4-span="2"] { grid-column: span 2; }
/* Flex fallback for non-grid themes. */
[data-a4-injected][data-a4-span="2"] { flex-grow: 2; }

.a4w-ad__picture { position: absolute; inset: 0; width: 100%; height: 100%; }
.a4w-ad__img    { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Overlay: all children (title / text / cta) inherit the same alignment. */
.a4w-ad__overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(0deg, var(--a4w-overlay, rgba(0, 0, 0, .45)), transparent);
  color: var(--a4w-text, #fff);
}
.a4w-ad--no-overlay .a4w-ad__overlay { background: transparent; }

/* Horizontal alignment — applies to title, text AND button together. */
.a4w-ad--align-left   .a4w-ad__overlay { text-align: left;   align-items: flex-start; }
.a4w-ad--align-center .a4w-ad__overlay { text-align: center; align-items: center; }
.a4w-ad--align-right  .a4w-ad__overlay { text-align: right;  align-items: flex-end; }

/* Title */
.a4w-ad__title {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: inherit;
}
.a4w-ad__title--sm { font-size: 1.05rem; }
.a4w-ad__title--md { font-size: 1.25rem; }
.a4w-ad__title--lg { font-size: 1.6rem; }
.a4w-ad__title--xl { font-size: 2.1rem; letter-spacing: -0.02em; }

/* Body text */
.a4w-ad__text {
  line-height: 1.5;
  max-width: 48ch;
  color: inherit;
}
.a4w-ad__text--sm { font-size: 0.85rem; }
.a4w-ad__text--md { font-size: 1rem; }
.a4w-ad__text--lg { font-size: 1.15rem; }

/* CTA button — two variants, theme-agnostic.
   Keep max-content width so alignment follows the overlay's align-items. */
.a4w-ad__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
  width: max-content;
  max-width: 100%;
}
.a4w-ad__cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
/* Primary = filled white on dark image, theme-agnostic contrast. */
.a4w-ad__cta--primary {
  background: #fff;
  color: #111;
  border: 1px solid #fff;
}
.a4w-ad__cta--primary:hover { background: #111; color: #fff; border-color: #fff; text-decoration: none; }

/* Secondary = outlined, transparent on image. */
.a4w-ad__cta--secondary {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
}
.a4w-ad__cta--secondary:hover { background: #fff; color: #111; text-decoration: none; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 767px) {
  .a4w-ad { min-height: 180px; }
  .a4w-ad__overlay { padding: 20px; gap: 10px; }
  .a4w-ad__title--xl { font-size: 1.6rem; }
  .a4w-ad__title--lg { font-size: 1.35rem; }
  .a4w-ad__title--md { font-size: 1.1rem; }
  .a4w-ad__text--lg  { font-size: 1rem; }
}
