/* ─────────────────────────────────────────────
   Custom Ad Manager v2 — Frontend
   ───────────────────────────────────────────── */

.cam-ad-unit {
  margin: 2em 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-family: inherit;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cam-ad-unit:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
  border-color: #d1d5db;
}

/* ── Link wrapper ── */
.cam-ad__link {
  display: flex;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  min-height: 140px;
  max-height: 250px;
  overflow: hidden;
}

/* ── Image — 50% ── */
.cam-ad__image {
  flex: 0 0 50%;
  max-width: 50%;
  overflow: hidden;
  background: #f3f4f6;
  position: relative;
}

.cam-ad__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  min-height: 140px;
  transition: transform 0.3s ease;
}

.cam-ad-unit:hover .cam-ad__image img {
  transform: scale(1.02);
}

.cam-ad__image--empty {
  background: #e5e7eb;
}

/* ── Text content — 50% ── */
.cam-ad__content {
  flex: 1;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 6px;
}

/* ── Badge label (above headline, not overlaid on image) ── */
.cam-ad__label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 2px;
}

/* ── Headline ── */
.cam-ad__headline {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}

/* ── Description ── */
.cam-ad__description {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

/* ── Arrow button — color set inline from ad settings ── */
.cam-ad__arrow {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 300;
  color: #fff;
  background-color: #1a5c3a; /* fallback; overridden by inline style */
  transition: filter 0.15s ease;
  border-left: none;
  line-height: 1;
  padding-bottom: 2px; /* optical center for › glyph */
}

.cam-ad__link:hover .cam-ad__arrow {
  filter: brightness(1.12);
}

/* ── Banner type ── */
.cam-ad-unit--banner .cam-ad__link {
  display: block;
  min-height: auto;
  max-height: none;
  overflow: hidden;
}

.cam-ad__banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cam-ad-unit--banner:hover .cam-ad__banner-img {
  transform: scale(1.02);
}

/* ── Placeholder (hidden until JS fills it) ── */
.cam-inline-placeholder:empty {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .cam-ad__link {
    flex-direction: column;
    min-height: auto;
  }

  .cam-ad__image,
  .cam-ad__image img {
    flex: none;
    max-width: 100%;
    width: 100%;
    height: 180px;
    min-height: auto;
  }

  .cam-ad__content {
    padding: 16px;
  }

  .cam-ad__arrow {
    display: none; /* arrow hidden on mobile — full row is tappable */
  }
}
