/**
 * Homepage advertising section — mobile-first responsive layout.
 * Featured sponsor + partner slot grid (1 / 2 / 3 columns).
 */

.advertising-section {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  padding-top: clamp(28px, 5vw, 40px);
  margin-top: clamp(28px, 5vw, 40px);
  background: rgba(229, 243, 247, 1);
  box-sizing: border-box;
}

.advertising-section__inner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.advertising-section__title {
  margin-bottom: clamp(20px, 3vw, 28px);
}

.advertising-section *,
.advertising-section *::before,
.advertising-section *::after {
  box-sizing: border-box;
  min-width: 0;
}

.advertising-section img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* —— Featured sponsor —— */
.advertising-section__featured {
  width: 100%;
  max-width: 100%;
  margin: 0 0 clamp(20px, 3vw, 28px);
}

.advertising-section #slotAdsFeatured .featured-ad.slot-card.ad-slot-filled {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: clamp(16px, 3vw, 24px);
  width: 100%;
  max-width: 100%;
  padding: clamp(16px, 4vw, 28px);
  border-radius: 16px;
  border: none;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  text-align: left;
  min-height: 0;
  cursor: default;
}

.advertising-section .featured-ad-center {
  flex: 1 1 auto;
  width: 100%;
  text-align: left;
  order: 1;
}

.advertising-section .featured-ad-left {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 140px;
  max-height: min(42vw, 200px);
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
  order: 2;
}

.advertising-section .featured-ad-left img {
  width: auto;
  max-width: 92%;
  max-height: 92%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.advertising-section .featured-ad-center h3 {
  margin: 12px 0 8px;
  font-size: clamp(1.25rem, 4vw + 0.5rem, 2rem);
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.advertising-section .featured-ad-center p {
  max-width: 100%;
  font-size: clamp(0.9rem, 0.5vw + 0.85rem, 1.0625rem);
  line-height: 1.55;
  color: #64748b;
  margin: 0;
}

.advertising-section .featured-badge {
  display: inline-block;
  background: #facc15;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
}

.advertising-section .featured-ad-right {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  order: 3;
}

.advertising-section .featured-ad-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: #0d7285;
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.advertising-section .featured-ad-btn:hover {
  background: #0b5f6f;
  color: #fff;
}

/* Placeholder featured card */
.advertising-section .ad-card.placeholder {
  width: 100%;
  max-width: 100%;
  padding: clamp(24px, 5vw, 40px);
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  background: #fff;
  text-align: center;
  color: #64748b;
}

/* —— Partner grid: 1 → 2 → 3 columns —— */
.advertising-section .ad-partner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 3vw, 24px);
  width: 100%;
  max-width: 100%;
  align-items: stretch;
}

.advertising-section .recommended-slot-column {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Partner / slot cards */
.advertising-section .ad-slot-card {
  width: 100%;
  max-width: 100%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.advertising-section .ad-slot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.advertising-section .slot-card.ad-slot-filled {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  height: auto;
  padding: clamp(14px, 3vw, 18px);
}

.advertising-section .slot-card.ad-slot-filled .tool-image.ad-image-wrapper {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 16 / 10;
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
}

.advertising-section .slot-card.ad-slot-filled .ad-image-main {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.advertising-section .ad-slot-filled-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.advertising-section .ad-slot-title {
  font-size: clamp(0.95rem, 0.5vw + 0.85rem, 1.05rem);
}

.advertising-section .ad-slot-desc {
  font-size: clamp(0.8rem, 0.4vw + 0.75rem, 0.875rem);
}

.advertising-section .ad-slot-view-btn {
  width: 100%;
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.advertising-section .slot-card.ad-slot.empty {
  width: 100%;
  min-height: 120px;
  height: auto;
}

.advertising-section .ad-slot-bg-logo {
  max-width: 72%;
}

/* Tablet: 2 partner columns */
@media (min-width: 768px) {
  .advertising-section .ad-partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advertising-section .featured-ad-left {
    max-height: min(32vw, 220px);
  }

  .advertising-section .featured-ad-btn {
    width: auto;
    min-width: 140px;
  }

  .advertising-section .featured-ad-right {
    width: auto;
    justify-content: flex-start;
  }

  .advertising-section .ad-slot-view-btn {
    width: auto;
    align-self: flex-start;
  }
}

/* Desktop: 3 partner columns + featured row */
@media (min-width: 1024px) {
  .advertising-section #slotAdsFeatured .featured-ad.slot-card.ad-slot-filled {
    flex-direction: row;
    align-items: center;
    gap: clamp(20px, 2.5vw, 32px);
    padding: clamp(24px, 3vw, 36px);
  }

  .advertising-section .featured-ad-center {
    order: 0;
    flex: 1 1 auto;
  }

  .advertising-section .featured-ad-left {
    order: 0;
    flex: 0 0 clamp(160px, 18vw, 240px);
    width: clamp(160px, 18vw, 240px);
    max-width: 240px;
    max-height: 200px;
    min-height: 160px;
    margin: 0;
  }

  .advertising-section .featured-ad-right {
    order: 0;
    flex: 0 0 auto;
    width: auto;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 1280px) {
  .advertising-section .ad-partner-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Short laptop viewports */
@media (max-height: 768px) and (min-width: 1024px) {
  .advertising-section .featured-ad-left {
    max-height: 180px;
    min-height: 140px;
  }
}

.advertising-section--preview {
  padding-top: 0;
  margin-top: 0;
  background: transparent;
  overflow-x: clip;
}

/* Advertise page preview mirror */
.ad-preview-featured-outer,
.ad-preview-slots-outer {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.ad-preview-featured-outer .advertising-section__featured,
.ad-preview-featured-outer #slotAdsFeatured {
  margin-bottom: 0;
}

.ad-preview-slots-outer .ad-partner-grid.ad-preview-single-slot {
  grid-template-columns: minmax(0, 1fr);
  max-width: 100%;
}
