.hpdp {
  --hpdp-accent: var(--main-purple, #8a2be2);
  --hpdp-accent-hover: var(--purple-hover, #9b39ee);
  --hpdp-accent-dark: #5b199f;
  --hpdp-border: #eaeaea;
  --hpdp-border-purple: var(--main-purple-border, rgba(138, 43, 226, .3));
  --hpdp-muted: #6c757d;
  --hpdp-surface: #fff;
  --hpdp-soft: var(--main-purple-soft, rgba(138, 43, 226, .08));
  --hpdp-tint: var(--purple-tint, #efdeff);
  --hpdp-radius: 12px;
  --hpdp-shadow: 0 4px 12px rgba(0, 0, 0, .03);
  display: grid;
  gap: 2rem;
  margin: 0 0 2.5rem;
}

.hpdp-preview {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  align-items: center;
  padding: .65rem .9rem;
  border: 1px dashed var(--hpdp-accent);
  border-radius: var(--hpdp-radius);
  background: #fff8db;
  color: #584600;
  font-size: .78rem;
}

.hpdp-section {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hpdp-border);
  border-radius: var(--hpdp-radius);
  background: var(--hpdp-surface);
  box-shadow: var(--hpdp-shadow);
}

.hpdp-section__header {
  padding: 1.4rem 1.5rem 0;
}

.hpdp-section__title {
  margin: 0;
  color: #212529;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.65rem, 2.4vw, 2rem);
  font-weight: 400;
  letter-spacing: .012em;
  line-height: 1.02;
}

.hpdp-section__intro {
  margin-top: .8rem;
  max-width: 72ch;
}

.hpdp-section__intro,
.hpdp-section__baseline,
.hpdp-item__teaser,
.hpdp-item__baseline,
.hpdp-related__teaser {
  color: var(--hpdp-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.hpdp-section__intro > :last-child,
.hpdp-section__baseline > :last-child,
.hpdp-item__teaser > :last-child,
.hpdp-item__baseline > :last-child,
.hpdp-related__teaser > :last-child {
  margin-bottom: 0;
}

.hpdp-section__baseline {
  margin-top: 0;
  padding: .9rem 1.5rem 1rem;
  border-top: 1px solid var(--hpdp-border);
  background: #f8f9fa;
  font-size: .78rem;
}

.hpdp-item {
  min-width: 0;
}

.hpdp-item__eyebrow {
  margin: 0 0 .42rem;
  color: inherit;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hpdp-item__title {
  margin: 0;
  line-height: 1.2;
}

.hpdp-item__title a {
  color: inherit;
  text-decoration: none;
}

.hpdp-item__title a:hover,
.hpdp-item__title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: .14em;
}

.hpdp-item__subtitle {
  margin: .55rem 0 0;
  color: inherit;
  font-size: .82rem;
  opacity: .82;
}

.hpdp-item__teaser {
  margin-top: .72rem;
}

.hpdp-item__cta,
.hpdp-related__cta,
.hpdp-related__link {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  font-weight: 700;
  text-decoration: none;
}

.hpdp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .65rem;
}

.hpdp-badge {
  display: inline-flex;
  padding: .25rem .52rem;
  border-radius: 999px;
  background: var(--hpdp-soft);
  color: var(--hpdp-accent-dark);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
}

.hpdp-related {
  display: grid;
  gap: .7rem;
  margin-top: .9rem;
}

.hpdp-related__article {
  padding: .8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
}

.hpdp-related__article h4 {
  margin: 0;
  font-size: .95rem;
}

.hpdp-related__article a {
  color: inherit;
}

/* Hero: one leading story on the left, two or three compact stories on the right. */
.hpdp-hero {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hpdp-hero__layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  gap: 1rem;
  align-items: stretch;
}

.hpdp-hero__primary {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: var(--hpdp-radius);
  background: var(--hpdp-accent);
  box-shadow: var(--hpdp-shadow);
  color: #fff;
}

.hpdp-hero__primary::after {
  position: absolute;
  inset: auto -6rem -8rem auto;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  content: '';
  pointer-events: none;
}

.hpdp-hero__primary > * {
  position: relative;
  z-index: 1;
}

.hpdp-hero__primary .hpdp-section__header {
  padding: 0 0 1rem;
}

.hpdp-hero__primary .hpdp-section__title {
  color: #fff;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
}

.hpdp-hero__primary .hpdp-section__intro,
.hpdp-hero__primary .hpdp-section__baseline,
.hpdp-hero__primary .hpdp-item__teaser,
.hpdp-hero__primary .hpdp-item__baseline {
  color: rgba(255, 255, 255, .9);
}

.hpdp-item--hero-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, .25);
}

.hpdp-item--hero-main .hpdp-item__title {
  max-width: 18ch;
  font-size: clamp(1.9rem, 3.1vw, 2.35rem);
  line-height: 1;
}

.hpdp-item--hero-main .hpdp-item__teaser {
  max-width: 56ch;
}

.hpdp-item--hero-main .hpdp-item__cta {
  align-self: flex-start;
  margin-top: auto;
  padding: .62rem .9rem;
  border-radius: 999px;
  background: #fff;
  color: var(--hpdp-accent-dark);
  font-size: .82rem;
}

.hpdp-item--hero-main .hpdp-item__cta:hover,
.hpdp-item--hero-main .hpdp-item__cta:focus-visible {
  background: #f8f9fa;
  text-decoration: none;
}

.hpdp-hero__primary .hpdp-badge {
  background: rgba(255, 255, 255, .94);
}

.hpdp-hero__primary > .hpdp-section__baseline {
  margin-top: 1rem;
  padding: .85rem 0 0;
  border-top-color: rgba(255, 255, 255, .22);
  background: transparent;
}

.hpdp-hero__secondary {
  display: grid;
  min-width: 0;
  grid-auto-rows: 1fr;
  gap: 1rem;
}

.hpdp-item--hero-side {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--hpdp-border);
  border-left: 4px solid var(--hpdp-accent);
  border-radius: var(--hpdp-radius);
  background: #fff;
  box-shadow: var(--hpdp-shadow);
  transition: transform .2s, box-shadow .2s;
}

.hpdp-item--hero-side:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}

.hpdp-item--hero-side .hpdp-badges {
  margin-bottom: .4rem;
}

.hpdp-item--hero-side .hpdp-item__eyebrow {
  color: var(--hpdp-accent-dark);
}

.hpdp-item--hero-side .hpdp-item__title {
  color: #212529;
  font-family: 'Open Sans', sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  font-weight: 700;
  line-height: 1.25;
}

.hpdp-item--hero-side .hpdp-item__subtitle {
  color: var(--hpdp-muted);
}

.hpdp-item--hero-side .hpdp-item__teaser {
  display: -webkit-box;
  overflow: hidden;
  margin-top: .55rem;
  color: var(--hpdp-muted);
  font-size: .82rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hpdp-hero-side__cta {
  display: inline-flex;
  gap: .6rem;
  align-items: center;
  justify-content: flex-end;
  color: var(--hpdp-accent);
  font-size: .75rem;
  font-weight: 700;
  text-align: right;
  text-decoration: none;
}

.hpdp-hero-side__cta-label {
  max-width: 8rem;
}

.hpdp-hero-side__cta-arrow {
  display: inline-grid;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 2.2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--hpdp-soft);
  font-size: 1rem;
}

.hpdp-hero-side__cta:hover,
.hpdp-hero-side__cta:focus-visible {
  color: var(--hpdp-accent-dark);
  text-decoration: none;
}

.hpdp-related--side {
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid var(--hpdp-border);
}

/* Existing three-card section, kept intentionally close to the first renderer. */
.hpdp-cards__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.hpdp-cards--two_columns .hpdp-cards__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hpdp-cards--four_columns .hpdp-cards__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hpdp-item--card {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  padding: 1.1rem;
  border: 1px solid var(--hpdp-border);
  border-radius: var(--hpdp-radius);
  background: #fff;
  box-shadow: var(--hpdp-shadow);
  transition: transform .2s, box-shadow .2s;
}

.hpdp-item--card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}

.hpdp-item--card .hpdp-item__title {
  color: #212529;
  font-size: 1.02rem;
  font-weight: 700;
}

.hpdp-item--card .hpdp-item__cta {
  align-self: flex-start;
  margin-top: auto;
  padding-top: .9rem;
  color: var(--hpdp-accent);
  font-size: .8rem;
}

.hpdp-related--compact {
  padding-top: .7rem;
  border-top: 1px solid var(--hpdp-border);
}

.hpdp-related__link {
  color: var(--hpdp-accent-dark);
  font-size: .8rem;
}

/* Four league panels reusing the homepage five-result module. */
.hpdp-league-results__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.hpdp-league-results__panel {
  min-width: 0;
  margin: 0 !important;
  padding: 1rem !important;
  border: 1px solid var(--hpdp-border);
  border-radius: var(--hpdp-radius);
  box-shadow: var(--hpdp-shadow);
}

.hpdp .hpdp-league-results__panel h2 {
  margin: 0 0 1rem !important;
  line-height: 1;
}

.hpdp .hpdp-league-results__panel h2 .fs-2 {
  font-size: clamp(1.25rem, 1.8vw, 1.55rem) !important;
  line-height: 1;
}

.hpdp .hpdp-league-results__panel h2 small {
  margin-top: .15rem;
  font-size: .82rem;
  line-height: 1.2;
}

.hpdp .hpdp-league-results__panel .list-group-item {
  padding-right: .25rem;
  padding-left: .25rem;
  background: #fff;
}

.hpdp .hpdp-league-results__panel .list-group-item:hover {
  background: var(--hpdp-tint);
}

.hpdp .hpdp-league-results__panel .list-group-item .p-2 {
  padding: .55rem !important;
}

.hpdp .hpdp-league-results__panel .list-group-item small {
  font-size: .7rem;
}

@media (max-width: 991.98px) {
  .hpdp-cards__grid,
  .hpdp-cards--three_columns .hpdp-cards__grid,
  .hpdp-cards--four_columns .hpdp-cards__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hpdp-league-results__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .hpdp {
    gap: 1.5rem;
  }

  .hpdp-section__header,
  .hpdp-cards__grid,
  .hpdp-league-results__grid,
  .hpdp-section__baseline {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .hpdp-hero__primary {
    padding: 1.2rem;
  }

  .hpdp-item--hero-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .hpdp-hero-side__cta {
    justify-content: flex-start;
    text-align: left;
  }

  .hpdp-cards__grid,
  .hpdp-cards--two_columns .hpdp-cards__grid,
  .hpdp-cards--three_columns .hpdp-cards__grid,
  .hpdp-cards--four_columns .hpdp-cards__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .hpdp-hero-side__cta-label {
    max-width: none;
  }

  .hpdp .hpdp-league-results__panel {
    padding: .75rem !important;
  }

  .hpdp .hpdp-league-results__panel .list-group-item .row {
    --bs-gutter-x: .5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hpdp-item--card,
  .hpdp-item--hero-side {
    transition: none;
  }

  .hpdp-item--card:hover,
  .hpdp-item--hero-side:hover {
    transform: none;
  }
}

@media print {
  .hpdp-preview {
    display: none;
  }

  .hpdp-section,
  .hpdp-hero__primary,
  .hpdp-item--hero-side,
  .hpdp-item--card,
  .hpdp-league-results__panel {
    box-shadow: none;
  }

  .hpdp-hero__primary {
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
  }

  .hpdp-hero__primary .hpdp-section__title,
  .hpdp-hero__primary .hpdp-section__intro,
  .hpdp-hero__primary .hpdp-section__baseline,
  .hpdp-hero__primary .hpdp-item__teaser,
  .hpdp-hero__primary .hpdp-item__baseline {
    color: #000;
  }
}
