/**
 * Homepage-only polish: denser spacing, diploma cards with images,
 * premium central certificates showcase.
 * ALL rules scoped under .home-page — do not leak to other pages.
 */

.home-page {
  --home-section-y: clamp(0.85rem, 1.6vw, 1.25rem);
  --home-section-gap: clamp(0.65rem, 1.2vw, 0.95rem);
  --home-card-radius: 18px;
}

/* Kill legacy .home-sections gaps from app.css (margin-top:80px + padding:60–80px) */
.home-page .home-sections,
.home-page .home-sections.section-premium,
.home-page .home-sections.home-sections-swiper,
.home-page .home-sections:nth-child(even),
.home-page .home-sections:nth-child(odd),
.home-page .imt-section,
.home-page .premium-diploma-paths,
.home-page .premium-certificates-teaser,
.home-page .premium-features-section,
.home-page .premium-blog-section,
.home-page .premium-testimonials-section,
.home-page .premium-mock-testimonials-section,
.home-page .premium-trust-strip,
.home-page .premium-graduate-videos,
.home-page .premium-graduate-videos-section,
.home-page .premium-flagship-diploma,
.home-page .premium-conversion-banner,
.home-page .premium-home-conversion-banner,
.home-page .ads-system.home-sections,
.home-page section[class*="premium-"] {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: var(--home-section-y) !important;
  padding-bottom: var(--home-section-y) !important;
}

.home-page .premium-trust-strip,
.home-page .ads-system.home-sections {
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
}

.home-page .premium-home-hero-wrap,
.home-page .premium-hero-banner-mock--ref-layout {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Neutralize utility paddings that stack on top of section padding */
.home-page .py-20,
.home-page .py-25,
.home-page .py-30,
.home-page .py-35,
.home-page .py-40,
.home-page .py-45,
.home-page .py-50,
.home-page .py-lg-20,
.home-page .py-lg-25,
.home-page .py-lg-30,
.home-page .py-lg-35,
.home-page .py-lg-40,
.home-page .py-lg-45,
.home-page .py-lg-50,
.home-page .pb-20,
.home-page .pb-25,
.home-page .pb-30,
.home-page .pb-32,
.home-page .pb-35,
.home-page .pb-lg-20,
.home-page .pb-lg-25,
.home-page .pb-lg-30,
.home-page .pb-lg-32,
.home-page .pb-lg-35,
.home-page .pt-20,
.home-page .pt-25,
.home-page .pt-30,
.home-page .pt-35,
.home-page .pt-lg-20,
.home-page .pt-lg-25,
.home-page .pt-lg-30,
.home-page .pt-lg-35 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.home-page .home-diplomas-section__container,
.home-page .home-certificates-section__container,
.home-page .premium-features-section__contain,
.home-page .premium-diploma-paths__container,
.home-page .container.py-35,
.home-page .container.py-lg-35,
.home-page .container.py-lg-40 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.home-page .mb-25,
.home-page .mb-30,
.home-page .mb-35,
.home-page .mb-40,
.home-page .mb-lg-30,
.home-page .mb-lg-35 {
  margin-bottom: var(--home-section-gap) !important;
}

.home-page .mt-25,
.home-page .mt-30,
.home-page .mt-35,
.home-page .mt-lg-25,
.home-page .mt-lg-30,
.home-page .mt-lg-35 {
  margin-top: var(--home-section-gap) !important;
}

.home-page .mb-xl-0 {
  margin-bottom: 0 !important;
}

.home-page .home-diplomas-section__header,
.home-page .premium-diploma-paths__header {
  margin-bottom: var(--home-section-gap);
}

.home-page .premium-features-section__intro {
  margin-bottom: 0.75rem !important;
}

.home-page .premium-feature-glass {
  padding: 1.05rem 1.1rem;
}

.home-page .home-certificates-section__header {
  margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
}

.home-page .home-certificates-section__actions {
  margin-top: clamp(0.75rem, 1.5vw, 1rem);
}

@media (min-width: 1200px) {
  .home-page .mb-xl-0 {
    margin-bottom: 0 !important;
  }
}

@media (max-width: 767.98px) {
  .home-page {
    --home-section-y: clamp(0.7rem, 2.5vw, 1rem);
    --home-section-gap: 0.65rem;
  }
}

/* ---- Diploma cards with images ---- */
.home-page .home-diploma-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: var(--home-card-radius);
  background: var(--imt-white, #fff);
  border: 1px solid var(--imt-border, rgba(87, 134, 199, 0.14));
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.07);
  transition: transform var(--imt-motion, 220ms) var(--imt-ease, ease),
    box-shadow var(--imt-motion, 220ms) var(--imt-ease, ease);
}

.home-page .home-diploma-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(87, 134, 199, 0.16);
}

.home-page .home-diploma-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(145deg, #eef4fc 0%, #dce9fa 100%);
}

.home-page .home-diploma-card__img,
.home-page .home-diploma-card__media img,
.home-page .home-diploma-card__media picture,
.home-page .home-diploma-card__media picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-page .home-diploma-card__media picture {
  position: absolute;
  inset: 0;
}

.home-page .home-diploma-card__media > img,
.home-page .home-diploma-card__media > .home-diploma-card__img {
  position: absolute;
  inset: 0;
}

.home-page .home-diploma-card__img--placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.75), transparent 45%),
    linear-gradient(145deg, #eef4fc 0%, #dce9fa 55%, #c5d8f2 100%);
}

.home-page .home-diploma-card__badge.premium-diploma-path-card__label {
  position: absolute;
  top: 0.7rem;
  inset-inline-start: 0.7rem;
  margin: 0;
  z-index: 2;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(15, 32, 68, 0.12);
}

.home-page .home-diploma-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 1rem 1.05rem 1.15rem;
  text-align: right;
}

.home-page .home-diploma-card__title {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.45;
  color: var(--imt-text, #1f2937);
  margin-bottom: 0.45rem;
}

.home-page .home-diploma-card__hint {
  color: var(--imt-muted, #64748b);
  font-size: 0.86rem;
  line-height: 1.65;
  margin-bottom: 0.95rem;
  flex-grow: 1;
}

.home-page .home-diploma-card__cta {
  align-self: flex-start;
  margin-top: auto;
  min-height: var(--imt-touch-min, 44px);
}

.home-page .home-diploma-card--compact .home-diploma-card__media {
  aspect-ratio: 16 / 9;
}

.home-page .home-diplomas-section__grid {
  gap: 1.05rem;
}

.home-page .home-diplomas-section__more {
  margin-top: 1.15rem;
}

.home-page .home-diplomas-section__more-grid {
  margin-top: 0.95rem;
  gap: 1rem;
}

/* ---- Certificates: central showcase ---- */
.home-page .home-certificates-section {
  position: relative;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgba(87, 134, 199, 0.12), transparent 70%),
    linear-gradient(180deg, #f8fafd 0%, #eef4fc 48%, #f8fafd 100%);
  overflow: hidden;
}

.home-page .home-certificates-section__header {
  max-width: 40rem;
  margin-inline: auto;
  margin-bottom: clamp(0.85rem, 1.8vw, 1.25rem);
}

.home-page .home-certificates-section__title {
  color: var(--imt-text, #1f2937);
}

.home-page .home-certificates-section__sub {
  color: var(--imt-muted, #64748b);
  font-size: var(--imt-text-base, 1rem);
  line-height: 1.75;
}

.home-page .home-certificates-showcase {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px) 1fr;
  gap: 0.85rem 1rem;
  align-items: center;
  max-width: 1100px;
  margin-inline: auto;
}

.home-page .home-certificates-showcase__hero {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 3;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.home-page .home-certificates-showcase__glow {
  position: absolute;
  inset: 12% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(87, 134, 199, 0.35) 0%, rgba(87, 134, 199, 0.08) 45%, transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.home-page .home-cert-mockup {
  position: relative;
  margin: 0;
  width: min(100%, 340px);
  padding: 0.85rem;
  border-radius: 22px;
  background: linear-gradient(160deg, #ffffff 0%, #f8fafd 55%, #eef4fc 100%);
  border: 1px solid rgba(87, 134, 199, 0.22);
  box-shadow:
    0 8px 24px rgba(87, 134, 199, 0.14),
    0 28px 64px rgba(31, 41, 55, 0.12);
}

.home-page .home-cert-mockup__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(87, 134, 199, 0.08);
}

.home-page .home-cert-mockup__seal {
  position: absolute;
  bottom: 0.55rem;
  inset-inline-start: 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.home-page .home-cert-mockup__seal-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(145deg, #5786c7 0%, #3d6aab 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 16px rgba(61, 106, 171, 0.35);
}

.home-page .home-cert-mockup__seal-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #4569a8;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.home-page .home-certificates-showcase__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: contents;
}

.home-page .home-cert-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(87, 134, 199, 0.16);
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.05);
  text-align: right;
}

.home-page .home-cert-card:nth-child(odd) {
  grid-column: 1;
}

.home-page .home-cert-card:nth-child(even) {
  grid-column: 3;
}

.home-page .home-cert-card:nth-child(1) { grid-row: 1; }
.home-page .home-cert-card:nth-child(2) { grid-row: 1; }
.home-page .home-cert-card:nth-child(3) { grid-row: 2; }
.home-page .home-cert-card:nth-child(4) { grid-row: 2; }
.home-page .home-cert-card:nth-child(5) { grid-row: 3; }
.home-page .home-cert-card:nth-child(6) { grid-row: 3; }

.home-page .home-cert-card__mark {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #5786c7, #3d6aab);
  box-shadow: 0 0 0 4px rgba(87, 134, 199, 0.16);
}

.home-page .home-cert-card__title {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--imt-text, #1f2937);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.home-page .home-cert-card__text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--imt-muted, #64748b);
}

.home-page .home-certificates-section__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: clamp(0.9rem, 2vw, 1.25rem);
}

.home-page .home-certificates-section__cta {
  min-height: var(--imt-touch-min, 44px);
}

/* Tablet: 2-col diploma already in base CSS; certificates stack */
@media (max-width: 991.98px) {
  .home-page .home-certificates-showcase {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .home-page .home-certificates-showcase__hero {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 0.35rem;
  }

  .home-page .home-cert-card:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .home-page .home-certificates-showcase__points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .home-page .home-cert-mockup {
    width: min(100%, 300px);
  }

  .home-page .home-certificates-showcase__points {
    grid-template-columns: 1fr;
  }

  .home-page .home-diploma-card__title {
    font-size: 0.98rem;
  }

  .home-page .home-certificates-section__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-page .home-certificates-section__cta {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .home-diploma-card {
    transition: none;
  }

  .home-page .home-diploma-card:hover {
    transform: none;
  }
}

/* Final density overrides (beat body.is-home-page rules from other CSS files) */
body.is-home-page .home-page .home-sections,
body.is-home-page .home-page .ads-system.home-sections,
body.is-home-page .home-page .premium-home-conversion-banner,
body.is-home-page .home-page section.home-sections.premium-home-conversion-banner {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.is-home-page .home-page .premium-home-conversion-banner {
  margin-top: 0.65rem !important;
  margin-bottom: 0.65rem !important;
}

body.is-home-page .home-page .ads-system--size-leaderboard .ads-banner__img,
body.is-home-page .home-page .ads-system--size-leaderboard img {
  max-height: 160px;
  width: auto;
  object-fit: contain;
}

body.is-home-page .home-page .ads-system.home-sections {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* Keep restored video section dense with the rest of the homepage */
.home-page .mmw-xp.home-sections,
.home-page #montessori-book-world,
.home-page .premium-instructors-section {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: var(--home-section-y, 1.25rem) !important;
  padding-bottom: var(--home-section-y, 1.25rem) !important;
}

