/* =====================================================================
   Advertisement design system - layered on top of client-theme.css.
   One .ad-card, four placement modifiers on .ad-slot.
   ===================================================================== */

.client-app .ad-slot {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.client-app .ad-slot--sidebar {
  position: sticky;
  top: 92px;
}

/* The Bootstrap .row is a flex container with the default align-items:
   stretch, so this column was always stretched to match the (much taller)
   results column next to it - once the sticky ad block above scrolled past
   its own height, the rest of that stretched column just sat there blank
   for the remainder of the page. align-self: start sizes it to its own
   content instead, so the ad scrolls fully out of view like normal content
   rather than leaving a tall empty gap behind it. */
.client-app .ad-sidebar-col {
  align-self: flex-start;
}

/* "Sponsored" divider used by inline / contextual / featured slots */
.client-app .ad-slot__rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 2px;
  color: var(--client-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.client-app .ad-slot__rule::before,
.client-app .ad-slot__rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--client-border);
}

/* ---- card -------------------------------------------------------- */
.client-app .ad-card {
  background: #fff;
  border: 1px solid var(--client-border);
  border-radius: var(--client-radius-md, 14px);
  overflow: hidden;
  box-shadow: var(--client-shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.client-app .ad-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
  border-color: #c7d2e5;
}
.client-app .ad-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.client-app .ad-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #eef1f6;
  overflow: hidden;
}
.client-app .ad-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.client-app .ad-card__discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--client-accent, #f97316);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.client-app .ad-card__discount small { font-weight: 700; font-size: 0.66rem; }

.client-app .ad-card__body {
  padding: 14px 15px 15px;
}
.client-app .ad-card__label {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--client-muted);
  margin-bottom: 6px;
}
.client-app .ad-card__title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--client-text, #0f172a);
  line-height: 1.3;
}
.client-app .ad-card__text {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--client-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.client-app .ad-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--client-muted);
}
.client-app .ad-card__offer {
  font-weight: 700;
  color: var(--client-primary);
}
.client-app .ad-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--client-primary);
}
.client-app .ad-card__link:hover .ad-card__cta { gap: 9px; }

/* ---- placement modifiers -------------------------------------- */

/* Featured: wide banner, capped height, not a full-page billboard */
.client-app .ad-slot--featured { max-width: 760px; margin-inline: auto; }
.client-app .ad-slot--featured .ad-card__media { aspect-ratio: 3 / 1; max-height: 220px; }
.client-app .ad-slot--featured .ad-card__title { font-size: 1.08rem; }

/* Inline + Sponsored (in the content column): horizontal on wide screens */
@media (min-width: 768px) {
  .client-app .ad-slot--inline .ad-card__link,
  .client-app .ad-slot--sponsored .ad-card__link { display: grid; grid-template-columns: 220px 1fr; }
  .client-app .ad-slot--inline .ad-card__media,
  .client-app .ad-slot--sponsored .ad-card__media { height: 100%; aspect-ratio: auto; }
  .client-app .ad-slot--inline .ad-card__body,
  .client-app .ad-slot--sponsored .ad-card__body { display: flex; flex-direction: column; justify-content: center; }
}

/* Sponsored: full-width band above the page content */
.client-app .ad-slot--sponsored { margin-bottom: 24px; }

/* Inline slots interleaved into the results list (one per 3 cards). */
.client-app .results-grid tr.results-ad > td { padding: 0; }
.client-app .results-grid tr.results-ad .ad-slot--inline { margin: 4px 0 20px; }

/* Pinned school card: a real result card promoted to the top. */
.client-app .result-card--pinned {
  position: relative;
  border-color: var(--client-accent, #2563eb);
  box-shadow: 0 0 0 1px var(--client-accent, #2563eb), var(--client-shadow-sm, 0 1px 3px rgba(0,0,0,.1));
}
.client-app .card-pin-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--client-accent, #2563eb);
  border-radius: 999px;
}
.client-app .card-pin-badge i { font-size: .62rem; }

/* Placeholder (no ad available for a prominent slot) */
.client-app .ad-card--placeholder { opacity: .75; }
.client-app .ad-card--placeholder:hover { transform: none; box-shadow: var(--client-shadow-sm); }

/* ---- ad landing page (/Common/Advertisement/Detail/{id}) --------- */
.client-app .ad-landing {
  display: grid;
  gap: 0;
  background: #fff;
  border: 1px solid var(--client-border, #e5e7eb);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--client-shadow-sm, 0 1px 3px rgba(0,0,0,.08));
}
@media (min-width: 860px) {
  .client-app .ad-landing { grid-template-columns: minmax(280px, 42%) 1fr; }
}
.client-app .ad-landing__media { position: relative; background: #f3f4f6; }
.client-app .ad-landing__media img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 16 / 10; }
.client-app .ad-landing__discount {
  position: absolute; top: 14px; left: 14px;
  background: #dc2626; color: #fff; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; font-size: 1rem;
}
.client-app .ad-landing__discount small { font-weight: 700; font-size: .68rem; }
.client-app .ad-landing__body { padding: 26px 28px; }
.client-app .ad-landing__label {
  display: inline-block; text-transform: uppercase; letter-spacing: .06em;
  font-size: .68rem; font-weight: 700; color: #6b7280;
  border: 1px solid var(--client-border, #e5e7eb); border-radius: 999px;
  padding: 2px 10px; margin-bottom: 12px;
}
.client-app .ad-landing__advertiser { font-weight: 700; color: #111827; }
.client-app .ad-landing__advertiser-type { color: #6b7280; font-weight: 500; margin-left: 6px; }
.client-app .ad-landing__headline { font-size: 1.5rem; line-height: 1.25; margin: 6px 0 12px; }
.client-app .ad-landing__text { color: #374151; margin-bottom: 16px; }
.client-app .ad-landing__offer {
  background: #f0f7ff; border: 1px solid #dbeafe; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 18px;
}
.client-app .ad-landing__offer-title { font-weight: 700; color: #1d4ed8; }
.client-app .ad-landing__offer-text { color: #374151; font-size: .95rem; margin-top: 2px; }
.client-app .ad-landing__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.client-app .ad-landing__contact { display: flex; flex-wrap: wrap; gap: 8px; }
.client-app .ad-landing__chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--client-border, #e5e7eb); border-radius: 999px;
  padding: 6px 12px; font-size: .88rem; color: #374151; text-decoration: none;
}
.client-app .ad-landing__chip:hover { background: #f9fafb; }
.client-app .ad-landing__location {
  display: flex; align-items: flex-start; gap: 6px;
  color: #4b5563; font-size: .88rem; line-height: 1.4;
  margin-bottom: 12px;
}
.client-app .ad-landing__location i { margin-top: 2px; flex: 0 0 auto; }
.client-app .ad-landing__disclaimer { margin-top: 14px; }

/* ---- responsive --------------------------------------------------- */
@media (max-width: 991.98px) {
  .client-app .ad-slot--sidebar { position: static; }
}
