/* Unified learning discovery. Loaded last so the new public hierarchy is
 * isolated from the legacy catalogue and account/checkout styles. */

body:not(.wp-admin) { background: #f7f8fa; }

.cd-header { background: rgba(255,255,255,.97); box-shadow: 0 2px 16px rgba(11,18,32,.035); }
.cd-header > .wp-block-group.cd-header-row { min-height: 68px; padding-block: .55rem !important; }
.cd-browse-menu > summary { background: #f0f3f7; }
.cd-header-search { background: #f5f6f8; }

.home .cd-hero { padding-top: .7rem; }
.home .cd-hero__scene { min-height: 410px; }
.home .cd-hero__content { min-height: 345px; padding: 2.7rem clamp(1.5rem, 4vw, 4.4rem) 4.3rem; }
.home .cd-hero__content h1.cd-hero__title--long { font-size: clamp(2.35rem, 4vw, 3.6rem); line-height: 1.04; max-width: 800px; }
.home .cd-hero__lead { margin-top: .9rem; }
.home .cd-hero__actions { margin-top: 1.15rem; }
.home .cd-hero__metrics > span { padding: .6rem 1.1rem; }
.home .cd-hero__metrics > a { display: block; padding: .6rem 1.1rem; border-right: 1px solid rgba(255,255,255,.15); text-decoration: none; }
.home .cd-hero__metrics > a:last-child { border-right: 0; }
.home .cd-hero__metrics > a:hover { background: rgba(255,255,255,.12); }
.home .cd-hero__metrics > a strong,
.home .cd-hero__metrics > a em { display: block; }
.home .cd-hero__metrics > a strong { color: #fff; font-size: .78rem; }
.home .cd-hero__metrics > a em { color: #cbd7e3; font-size: .68rem; font-style: normal; }

.cd-home-discovery.cd-section { padding: clamp(1.4rem, 3vw, 2.7rem) var(--cd-page-gutter) clamp(1.6rem, 3vw, 2.8rem); }
.home .cd-home-discovery + .cd-section { padding-top: clamp(2rem, 4vw, 3.8rem); }
.home .cd-section { padding-top: clamp(2.1rem, 4vw, 3.7rem); padding-bottom: clamp(2.1rem, 4vw, 3.7rem); }
.home .cd-home-discovery { padding-top: clamp(1.4rem, 3vw, 2.7rem); }
.home .cd-final-section { padding-block: clamp(2rem, 4vw, 3.6rem); }

.cd-course-archive-page main.cd-section,
body.post-type-archive-courses main.cd-section { padding: clamp(.7rem, 1.6vw, 1.35rem) var(--cd-page-gutter) 3rem; }

.cd-discovery { width: 100%; max-width: 1500px; margin-inline: auto; }
.cd-discovery__heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.1rem; padding: 1.35rem 1.55rem; border: 1px solid #dce3ea; border-radius: 14px; background: #fff; }
.cd-discovery__eyebrow { display: inline-block; margin-bottom: .45rem; color: #2455f5; font-size: .69rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.cd-discovery__heading h1,
.cd-discovery__heading h2 { margin: 0; color: #111b2b; font-family: var(--wp--preset--font-family--heading); font-size: clamp(1.9rem, 3.2vw, 3.1rem); line-height: 1.08; letter-spacing: -.035em; }
.cd-discovery__heading p { max-width: 62ch; margin: .55rem 0 0; color: #58677a; font-size: .95rem; line-height: 1.5; }
.cd-discovery__all { flex: none; color: #1743d9; font-size: .84rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.cd-discovery__all:hover { text-decoration: underline; }
.cd-discovery__footer { display: flex; justify-content: center; margin-top: 1.35rem; }
.cd-discovery--compact .cd-discovery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cd-discovery-tabs { display: flex; align-items: stretch; gap: clamp(.9rem, 2.1vw, 2rem); width: 100%; margin-bottom: 1rem; border-bottom: 1px solid #cfd7e2; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.cd-discovery-tabs a { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 44px; margin-bottom: -1px; padding: .35rem .1rem .55rem; border-bottom: 2px solid transparent; color: #667286; font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: color .12s ease, border-color .12s ease; }
.cd-discovery-tabs a:hover { color: #172339; }
.cd-discovery-tabs a[aria-current="page"] { border-color: #172339; color: #172339; font-weight: 800; }
.cd-discovery-tabs a:focus-visible { outline: 2px solid #2455f5; outline-offset: -3px; }

.cd-discovery-search { display: flex; align-items: end; gap: .7rem; margin: 0 0 .7rem; }
.cd-discovery-search label { flex: none; padding-bottom: .65rem; color: #293849; font-size: .78rem; font-weight: 800; }
.cd-discovery-search > div { display: flex; width: min(100%, 550px); border: 1px solid #d1dae4; border-radius: 8px; background: #fff; overflow: hidden; }
.cd-discovery-search input[type="search"] { flex: 1; min-width: 0; min-height: 42px; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.cd-discovery-search button { padding: .55rem 1.1rem; border: 0; background: #2455f5; color: #fff; font-size: .8rem; font-weight: 800; cursor: pointer; }
.cd-discovery-search button:hover { background: #173cc2; }
.cd-discovery__count { margin: 0 0 .85rem; color: #6c7786; font-size: .76rem; font-weight: 700; }

.cd-discovery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.8rem, 1.5vw, 1.25rem); }
.cd-discovery-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #dce3ea; border-radius: 11px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.cd-discovery-card:hover { border-color: #a9b9cf; box-shadow: 0 13px 32px rgba(17,33,56,.11); transform: translateY(-3px); }
.cd-discovery-card__image { position: relative; display: block; aspect-ratio: 1.65; overflow: hidden; background: #dce7ec; }
.cd-discovery-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.cd-discovery-card:hover .cd-discovery-card__image img { transform: scale(1.04); }
.cd-discovery-card__image > span { position: absolute; top: .65rem; left: .65rem; padding: .36rem .58rem; border-radius: 4px; background: #fff; color: #192536; font-size: .64rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.cd-discovery-card--live .cd-discovery-card__image > span { color: #075f70; }
.cd-discovery-card--in-person .cd-discovery-card__image > span { color: #9c4934; }
.cd-discovery-card__body { display: flex; flex: 1; flex-direction: column; padding: .9rem .95rem .8rem; }
.cd-discovery-card__detail { min-height: 1.25rem; margin: 0 0 .38rem; color: #2455f5; font-size: .7rem; font-weight: 800; letter-spacing: .01em; }
.cd-discovery-card h3 { margin: 0; color: #121d2d; font-family: var(--wp--preset--font-family--body); font-size: clamp(.9rem, 1.2vw, 1.02rem); line-height: 1.35; font-weight: 800; }
.cd-discovery-card h3 a { color: inherit; text-decoration: none; }
.cd-discovery-card h3 a:hover { color: #2455f5; }
.cd-discovery-card__teacher { margin: .34rem 0 0; color: #546378; font-size: .75rem; font-weight: 650; }
.cd-discovery-card__description { display: -webkit-box; overflow: hidden; margin: .52rem 0 .7rem; color: #687586; font-size: .76rem; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cd-discovery-card__bottom { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: auto; padding-top: .66rem; border-top: 1px solid #e6ebf0; font-size: .76rem; }
.cd-discovery-card__bottom strong { color: #111b2b; font-size: .84rem; }
.cd-discovery-card__bottom a { color: #2048d4; font-weight: 800; text-decoration: none; white-space: nowrap; }
.cd-discovery-card__bottom a:hover { text-decoration: underline; }
.cd-discovery-empty { padding: 2.3rem; border: 1px dashed #cbd6e2; border-radius: 10px; background: #fff; text-align: center; }
.cd-discovery-empty[hidden], .cd-discovery-pagination[hidden] { display: none; }
.cd-discovery-empty h2 { margin: 0; font-size: 1.4rem; }
.cd-discovery-empty p { color: #5a6877; }
.cd-discovery-empty a { color: #2048d4; font-weight: 800; }
.cd-discovery-pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 1.4rem; }
.cd-discovery-pagination a { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #dce3ea; border-radius: 6px; background: #fff; color: #162438; font-size: .8rem; text-decoration: none; }
.cd-discovery-pagination a[aria-current="page"] { background: #101827; color: #fff; }

/* Carry the tighter discovery rhythm through the three existing detail flows. */
.cd-custom-course-overview-page main.cd-section,
.cd-event-detail-page main.cd-section,
.cd-live-class-detail-page main.cd-section { padding-top: .75rem; }
.cd-course-overview-hero { padding: clamp(1rem, 2vw, 1.6rem); }
.cd-course-overview-hero h1 { font-size: clamp(2.1rem, 3.4vw, 3.35rem); line-height: 1.04; }
.cd-course-overview-hero__media { max-height: 17rem; }
.cd-event-detail__hero { min-height: 365px; gap: 2rem; padding: clamp(1.5rem, 3vw, 2.4rem); }
.cd-event-detail__copy h1 { font-size: clamp(2.25rem, 3.7vw, 3.3rem); line-height: 1.03; }
.cd-event-detail__grid { gap: 1.25rem; padding: 1.4rem 0 2rem; }
.cd-event-detail__main { padding: 1.5rem; }
.cd-event-detail__main > h2 { font-size: clamp(1.45rem, 2.3vw, 1.9rem); }

@media (max-width: 1100px) {
  .cd-discovery-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .cd-discovery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cd-discovery--compact .cd-discovery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cd-discovery__heading { align-items: start; flex-direction: column; gap: .7rem; padding: 1.15rem; }
  .cd-discovery-search { align-items: stretch; flex-direction: column; gap: .2rem; }
  .cd-discovery-search label { padding-bottom: 0; }
  .cd-discovery-tabs { gap: 1.2rem; }
  .home .cd-hero__scene { min-height: 0; }
  .home .cd-hero__content { min-height: 420px; padding: 2rem 1.3rem 3rem; }
  .home .cd-hero__metrics > a { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.15); }
  .cd-event-detail__hero { min-height: 0; padding: 1.3rem; }
  .cd-event-detail__grid { padding-top: 1rem; }
}
@media (max-width: 520px) {
  .cd-discovery-grid { grid-template-columns: minmax(0,1fr); }
  .cd-discovery--compact .cd-discovery-grid { grid-template-columns: minmax(0,1fr); }
  .cd-discovery-card { display: grid; grid-template-columns: 38% minmax(0,1fr); }
  .cd-discovery-card__image { height: 100%; min-height: 180px; aspect-ratio: auto; }
  .cd-discovery-card__image > span { top: .4rem; left: .4rem; font-size: .56rem; }
  .cd-discovery-card__body { padding: .7rem; }
  .cd-discovery-card__description { display: none; }
  .cd-discovery-card__bottom { margin-top: .6rem; }
  .cd-discovery-card__bottom a { font-size: .7rem; }
  .home .cd-hero__content h1.cd-hero__title--long { font-size: clamp(2rem, 8.4vw, 2.65rem); }
  .home .cd-hero__metrics > span { min-height: 43px; padding-block: .45rem; }
  .home .cd-hero__metrics > a { display: flex; align-items: center; justify-content: space-between; min-height: 43px; padding-block: .45rem; }
}
