/* Phonics hub pages (/phonics/, /phonics/<slug>/) and the resource → hub strip.
 *
 * Variant A "Shelf" from the prototype review (docs/HUB_UI_PLAN.md §6,
 * docs/HUB_PROTOTYPE_PLAN.md §4): grid-first, type-only header, stepper strip,
 * a wide lead card then compact cards, prose in the blog longform measure.
 *
 * Decision 10: dedicated hub styles — deliberately not `resource-card`.
 * Tokens follow the homepage refresh: Outfit display headings, warm panel
 * #faf4ef, accent #8b3a2a, 0.75rem radii, soft shadows.
 *
 * Loaded from {% block extra_css %}, i.e. *before* Bootstrap (base.html line
 * 68). Keep selectors class-based so nothing equal-specificity silently loses.
 */

/* --- header ------------------------------------------------------------- */

.hub {
  padding-bottom: 3rem;
}

.hub-preview {
  margin-top: 1.5rem;
}

.hub-head {
  padding: 1.75rem 0 1.25rem;
}

.hub-overline {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
}

.hub-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.hub-display {
  font-family: "Outfit", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

.hub-h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.12;
  margin: 0.35rem 0 0.75rem;
  color: #212529;
}

.hub-def {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #444;
  max-width: 44rem;
}

.hub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.hub-chip {
  font-family: "Andika", "Comic Neue", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fbeceb;
  color: #8b3a2a;
}

/* --- credits callout (decision 6) -------------------------------------- */

.hub-credits {
  background: #faf4ef;
  border-radius: 0.75rem;
  padding: 1.25rem 1.35rem;
}

.hub-credits strong {
  font-size: 1.15rem;
  display: block;
  margin-bottom: 0.25rem;
}

/* --- set-order stepper strip (decision 5) ------------------------------ */

/* The strip scrolls sideways until the widest Bootstrap container fits all five
 * pills (xl, 1200px). Below that, a soft fade at the right edge is the cue that
 * there is more to the right; scroll snapping keeps the pills aligned instead
 * of stopping mid-pill. */
.hub-steps-wrap {
  position: relative;
}

@media (max-width: 1199.98px) {
  .hub-steps-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2rem;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff);
    pointer-events: none;
  }
}

.hub-steps {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  overflow-x: auto;
  padding: 0.75rem 0 0.75rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.hub-step {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--step, #dee2e6);
  color: #212529;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  line-height: 1.15;
  text-decoration: none;
  background: #fff;
  scroll-snap-align: start;
}

.hub-step small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
}

.hub-step__sounds {
  font-family: "Andika", "Comic Neue", sans-serif;
  font-weight: 700;
}

.hub-step.is-current {
  background: var(--step, #6c757d);
  border-color: var(--step, #6c757d);
  color: var(--step-ink, #fff);
}

.hub-step.is-current small {
  color: var(--step-ink, #fff);
  opacity: 0.85;
}

.hub-step.is-soon {
  border-style: dashed;
  color: #6c757d;
}

.hub-step-arrow {
  color: #bbb;
  flex: 0 0 auto;
}

/* --- section heading and empty state ----------------------------------- */

.hub-section-title {
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  margin: 0 0 1rem;
}

.hub-empty {
  background: #faf4ef;
  border-radius: 0.75rem;
  padding: 1.25rem 1.35rem;
  color: #444;
  margin-bottom: 1.5rem;
}

/* --- lead card --------------------------------------------------------- */

.hub-lead {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0.35rem 1rem rgba(44, 36, 28, 0.08);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.hub-lead__img {
  background: #f4f1ec;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hub-lead__img img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.hub-lead__body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
}

.hub-tag {
  display: inline-block;
  align-self: flex-start;
  background: #8b3a2a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.6rem;
}

/* --- cards ------------------------------------------------------------- */

.hub-format {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  background: #f1f1f1;
  border-radius: 0.35rem;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.5rem;
}

.hub-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0.35rem 1rem rgba(44, 36, 28, 0.08);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.6rem 1.4rem rgba(44, 36, 28, 0.12);
}

.hub-card__img {
  aspect-ratio: 4 / 3;
  background: #f4f1ec;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.hub-card__img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hub-card__noimg {
  color: #6c757d;
  font-size: 0.9rem;
}

.hub-card__body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hub-card h3,
.hub-lead h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.hub-lead h3 {
  font-size: 1.4rem;
}

.hub-card h3 a,
.hub-lead h3 a {
  color: #212529;
  text-decoration: none;
}

.hub-action {
  font-size: 0.92rem;
  color: #444;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.hub-lead .hub-action {
  -webkit-line-clamp: 4;
  font-size: 1rem;
}

.hub-ages {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.75rem;
}

.hub-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hub-price {
  font-weight: 700;
}

.hub-price span {
  font-weight: 400;
  color: #6c757d;
}

/* --- prose and buying questions ---------------------------------------- */

.hub-prose {
  margin: 3rem auto 0;
}

.hub-qa {
  max-width: 48rem;
  margin: 2rem auto 0;
}

.hub-set-order {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hub-set-order .hub-steps-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.hub-set-order .hub-steps {
  margin-bottom: 0;
}

.hub-all-sets {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .hub-set-order {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- resource page: "Part of our …" strip ------------------------------ */

.hub-link-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
  padding: 1.1rem 1.35rem;
  background: #faf4ef;
  border-radius: 0.75rem;
}

.hub-link-strip__title {
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 0;
}

.hub-link-strip__title a {
  color: #8b3a2a;
  text-decoration: none;
}

.hub-link-strip__thumbs {
  list-style: none;
  display: flex;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
}

.hub-link-strip__thumbs img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.2rem;
}

.hub-link-strip__more {
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
  color: #8b3a2a;
}

@media (max-width: 767px) {
  .hub-lead {
    grid-template-columns: 1fr;
  }

  .hub-lead__img img {
    max-height: 260px;
  }
}

@media (max-width: 575px) {
  .hub-link-strip__more {
    margin-left: 0;
  }

  .hub-link-strip__thumbs img {
    width: 3.5rem;
    height: 3.5rem;
  }
}
