/*
 * The course catalogue. Modelled on the HammondLessons courses page, in this
 * site's own colours and letters.
 *
 * Colours come from tokens.css only; tests/test-no-hardcoded-colors.php allows
 * hex nowhere else. Shadows use rgba(), which carries no hex and so is fine.
 */

.bp-c-heading {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  margin: 6px 0 10px;
  text-align: center;
  color: var(--bp-ink);
}

.bp-c-sub {
  max-width: 62ch;
  margin: 0 auto 26px;
  text-align: center;
  color: var(--bp-muted);
  line-height: 1.65;
}

/* ── Tier filter ─────────────────────────────────────────────────────── */

.bp-c-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  margin: 0 auto 12px;
  width: fit-content;
  background: var(--bp-page);
  border: 1px solid var(--bp-hair);
  border-radius: 999px;
}

.bp-c-tab {
  font-family: var(--bp-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bp-muted);
  cursor: pointer;
}

.bp-c-tab:hover { color: var(--bp-ink); }

.bp-c-tab.is-on {
  background: var(--bp-gold);
  color: var(--bp-dark);
}

.bp-c-note {
  margin: 0 auto 30px;
  text-align: center;
  font-size: 13px;
  color: var(--bp-muted);
}

/* ── Grid and cards ──────────────────────────────────────────────────── */

.bp-c-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.bp-c-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bp-page);
  border: 1px solid var(--bp-hair);
  border-radius: var(--bp-radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bp-c-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.09);
}

/* The cover sits at 16:9 whether it is a photograph or the drawn fallback,
   so a row of cards lines up even when only some have images. */
.bp-c-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bp-dark);
  text-decoration: none;
}

.bp-c-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.bp-c-card:hover .bp-c-thumb img { transform: scale(1.04); }

.bp-c-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--bp-dark-fg);
  text-align: center;
}

.bp-c-body {
  padding: 15px 17px 17px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bp-c-titlerow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.bp-c-title {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
  color: var(--bp-ink);
}

.bp-c-title a {
  color: inherit;
  text-decoration: none;
}

.bp-c-title a:hover { text-decoration: underline; }

/* ── Tier badge ──────────────────────────────────────────────────────── */

.bp-c-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bp-c-lock {
  width: 10px;
  height: 10px;
}

/*
 * Open and Free carry no padlock weight visually -- they are the way in, so
 * they read as an invitation. Basic and Student are the gold and the dark,
 * which is the same hierarchy the pricing table uses.
 */
.bp-c-badge--open,
.bp-c-badge--free {
  background: var(--bp-gold-tint);
  color: var(--bp-gold-deep);
}

.bp-c-badge--basic {
  background: var(--bp-gold);
  color: var(--bp-dark);
}

.bp-c-badge--student {
  background: var(--bp-dark);
  color: var(--bp-dark-fg);
}

.bp-c-text {
  margin: 0 0 14px;
  color: var(--bp-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.bp-c-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--bp-hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bp-c-lessons {
  font-size: 12.5px;
  color: var(--bp-muted);
}

.bp-c-view {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--bp-gold-deep);
  text-decoration: none;
  white-space: nowrap;
}

.bp-c-view:hover { text-decoration: underline; }

.bp-c-draft {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bp-dark);
  color: var(--bp-dark-fg);
}

/* Hidden by the filter. A class rather than an inline style so the script
   never has to remember what display value the card had. */
.bp-c-card.is-hidden { display: none; }

@media (max-width: 980px) {
  .bp-c-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .bp-c-grid { grid-template-columns: minmax(0, 1fr); }
  .bp-c-heading { font-size: 27px; }
  /* The pill row wraps to two lines on a phone; a full-width strip reads
     better there than a ragged pill. */
  .bp-c-tabs { width: 100%; border-radius: var(--bp-radius); }
  .bp-c-tab { flex: 1 1 auto; }
}

/* ── Dark opening ────────────────────────────────────────────────────── */

.bp-c-hero { text-align: center; }

.bp-c-hero-title {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.1;
  margin: 8px 0 12px;
  color: var(--bp-dark-fg);
}

.bp-c-hero-counts {
  margin: 0 0 24px;
  color: var(--bp-dark-dim);
  font-size: 15px;
}

/* The three things every course gives you. A list rather than three divs so
   it still reads as a list when the stylesheet does not arrive. */
.bp-c-pills {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.bp-c-pills li {
  padding: 7px 14px;
  border: 1px solid var(--bp-dark-hair);
  border-radius: 999px;
  font-size: 13px;
  color: var(--bp-dark-fg);
}

.bp-c-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0;
}

/* ── Upgrade band ────────────────────────────────────────────────────── */

.bp-c-upgrade { text-align: center; }

.bp-c-upgrade-title {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  margin: 8px 0 12px;
  color: var(--bp-dark-fg);
}

.bp-c-upgrade-lead {
  max-width: 60ch;
  margin: 0 auto 32px;
  color: var(--bp-dark-dim);
  line-height: 1.65;
}

.bp-c-upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  text-align: left;
}

.bp-c-upgrade-card {
  padding: 22px;
  border: 1px solid var(--bp-dark-hair);
  border-radius: var(--bp-radius);
}

.bp-c-upgrade-card h3 {
  font-family: var(--bp-display);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--bp-dark-fg);
}

.bp-c-upgrade-card p {
  margin: 0;
  color: var(--bp-dark-dim);
  font-size: 14.5px;
  line-height: 1.6;
}

.bp-c-upgrade-action { margin: 30px 0 0; }

/* ── Meet Frank ──────────────────────────────────────────────────────── */

.bp-c-teacher { text-align: center; }

.bp-c-teacher-split {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  max-width: 780px;
  margin: 22px auto 0;
  text-align: left;
}

.bp-c-teacher-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
}

.bp-c-teacher-text p {
  margin: 0 0 14px;
  color: var(--bp-muted);
  line-height: 1.7;
}

.bp-c-teacher-text p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .bp-c-hero-title { font-size: 32px; }
  .bp-c-upgrade-title { font-size: 27px; }
  .bp-c-upgrade-grid { grid-template-columns: minmax(0, 1fr); }
  /* The photograph goes above the words, and smaller: a 180px circle beside
     nothing looks stranded once the column collapses. */
  .bp-c-teacher-split { grid-template-columns: minmax(0, 1fr); gap: 20px; justify-items: center; }
  .bp-c-teacher-photo { width: 128px; height: 128px; }
  .bp-c-teacher-text { text-align: center; }
}

/* ── What is new ─────────────────────────────────────────────────────── */

/* The embedded Latest Additions brings its own section padding, so this one
   only carries the heading and the way out; without the reset the two paddings
   stack into a gap the size of an empty screen. */
.bp-c-latest { padding-bottom: 0; }

/* The embedded block is a page body, so it carries 96px of section padding at
   both ends. Left alone that opens a screen-height hole between this heading
   and the one row under it. */
.bp-c-latest .bp-page-body {
  padding-top: 0;
  padding-bottom: 8px;
}

.bp-c-latest-more { text-align: center; padding-top: 4px; }
