/* احتواء — design-system components shared by the public pages
   (track homes, courses, trainers, forum). Every value comes from the
   tokens in base.css. Class prefix: ds- */

/* Icons (templates: {% icon "name" %} from apps/core/templatetags/ui_icons.py) */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon .accent {
  stroke: var(--gold-500);
}

[dir="ltr"] .icon--dir {
  transform: scaleX(-1);
}

.icon--xs {
  width: 14px;
  height: 14px;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 32px;
  height: 32px;
}

.icon--xl {
  width: 44px;
  height: 44px;
  stroke-width: 1.5;
}

/* Layout */
.ds-container {
  max-width: var(--max-width-page);
  margin: 0 auto;
  padding-inline: var(--space-6);
}

.ds-section {
  padding-block: var(--space-6);
}

.ds-section--alt {
  background: var(--surface-alt);
}

.ds-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.ds-section__head--center {
  flex-direction: column;
  text-align: center;
}

.ds-section__title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.ds-section__title--rule::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: var(--space-2) auto 0;
  border-radius: var(--radius-pill);
  background: var(--gold-500);
}

.ds-section__subtitle {
  margin: 0;
  color: var(--ink-muted);
}

.ds-gold {
  color: var(--gold-600);
}

/* Page hero (inner pages + care home) */
.ds-hero {
  position: relative;
  overflow: hidden;
  background: var(--sky-50);
}

.ds-hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width-page);
  margin: 0 auto;
  padding: var(--space-7) var(--space-6);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: var(--space-6);
  min-height: 320px;
}

.ds-hero__title {
  margin: 0 0 var(--space-3);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.ds-hero__lead {
  margin: 0 0 var(--space-2);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.ds-hero__text {
  margin: 0 0 var(--space-5);
  font-size: 16px;
  color: var(--ink-body);
  max-width: 560px;
}

.ds-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.ds-hero__media {
  position: relative;
  align-self: stretch;
  min-height: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sky-100);
}

.ds-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark (navy) hero — skills track and inner pages that want it. */
.ds-hero--navy {
  background: var(--navy-950);
}

.ds-hero--navy .ds-hero__title,
.ds-hero--navy .ds-hero__lead {
  color: var(--on-navy);
}

.ds-hero--navy .ds-hero__text {
  color: var(--color-text-on-dark);
}

.ds-hero--navy .ds-gold {
  color: var(--gold-300);
}

/* Full-bleed photo hero: image on one side fading into the ground */
.ds-hero--photo .ds-hero__inner {
  grid-template-columns: 1fr;
  min-height: 300px;
}

.ds-hero--photo .ds-hero__copy {
  max-width: 560px;
}

.ds-hero__photo {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 58%;
}

.ds-hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ds-hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, var(--sky-50) 0%, rgba(238, 245, 252, 0) 45%);
}

.ds-hero--navy .ds-hero__photo::after {
  background: linear-gradient(to left, var(--navy-950) 0%, rgba(1, 22, 54, 0.6) 30%, rgba(1, 22, 54, 0) 60%);
}

[dir="ltr"] .ds-hero__photo::after {
  background: linear-gradient(to right, var(--sky-50) 0%, rgba(238, 245, 252, 0) 45%);
}

[dir="ltr"] .ds-hero--navy .ds-hero__photo::after {
  background: linear-gradient(to right, var(--navy-950) 0%, rgba(1, 22, 54, 0.6) 30%, rgba(1, 22, 54, 0) 60%);
}

/* Small eyebrow above a hero title */
.ds-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  color: var(--gold-700);
  font-weight: 700;
  font-size: 15px;
}

.ds-eyebrow::before,
.ds-eyebrow::after {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--gold-500);
}

/* Big search bar under a hero */
.ds-searchbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 760px;
  height: 56px;
  margin: calc(var(--space-5) * -1) auto 0;
  padding-inline: var(--space-5) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.ds-searchbar--wide {
  max-width: none;
}

.ds-searchbar:focus-within {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px var(--sky-100);
}

.ds-searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 16px/1.5 var(--font-sans);
  color: var(--ink);
}

.ds-searchbar input::placeholder {
  color: var(--ink-muted);
}

.ds-searchbar button {
  display: inline-flex;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  padding: var(--space-2);
}

.ds-searchbar .icon {
  width: 22px;
  height: 22px;
}

/* Category tiles */
.ds-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: var(--space-3);
}

.ds-cats--wide {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.ds-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 104px;
  padding: var(--space-3) var(--space-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-align: center;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ds-cat:hover,
.ds-cat.is-active {
  border-color: var(--gold-500);
  transform: translateY(-2px);
}

.ds-cat .icon {
  width: 34px;
  height: 34px;
  color: var(--navy-900);
}

.ds-cat__label {
  font: 700 13px/1.4 var(--font-sans);
}

.ds-cat__sub {
  font: 400 12px/1.5 var(--font-sans);
  color: var(--ink-muted);
}

/* Tags */
.ds-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-sm);
  font: 500 12px/1.7 var(--font-sans);
  background: var(--sky-100);
  color: var(--sky-700);
  white-space: nowrap;
}

.ds-tag .icon {
  width: 14px;
  height: 14px;
}

.ds-tag--gold {
  background: var(--gold-50);
  color: var(--gold-700);
  border: 1px solid #f1d9a6;
}

.ds-tag--success {
  background: var(--success-50);
  color: var(--success);
}

.ds-tag--navy {
  background: var(--navy-900);
  color: var(--on-navy);
}

.ds-tag--pill {
  border-radius: var(--radius-pill);
}

/* Horizontal carousel (scroll-snap, arrows from static/js/components.js) */
.ds-carousel {
  position: relative;
}

.ds-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4 * var(--space-4)) / 5);
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-block: var(--space-1) var(--space-3);
}

.ds-carousel__track::-webkit-scrollbar {
  display: none;
}

.ds-carousel__track > * {
  scroll-snap-align: start;
}

.ds-carousel__btn {
  position: absolute;
  top: 40%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.ds-carousel__btn--prev {
  inset-inline-start: -18px;
}

.ds-carousel__btn--next {
  inset-inline-end: -18px;
}

.ds-carousel__btn[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .ds-carousel__track {
    grid-auto-columns: calc((100% - 2 * var(--space-4)) / 3);
  }
}

@media (max-width: 720px) {
  .ds-carousel__track {
    grid-auto-columns: 72%;
  }

  .ds-carousel__btn {
    display: none;
  }
}

/* Course card */
.ds-course {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.ds-course:hover {
  box-shadow: var(--shadow-raised);
}

.ds-course__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--sky-50);
}

.ds-course__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ds-course__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--navy-900);
}

.ds-course__placeholder .icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.4;
}

.ds-course__mark {
  position: absolute;
  top: var(--space-2);
  inset-inline-end: var(--space-2);
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.ds-course__mark .icon {
  width: 14px;
  height: 14px;
}

.ds-course__media .ds-tag {
  position: absolute;
  top: var(--space-2);
  inset-inline-start: var(--space-2);
}

.ds-course__media .ds-course__level {
  top: auto;
  bottom: var(--space-2);
  inset-inline-start: auto;
  inset-inline-end: var(--space-2);
}

.ds-course__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex: 1;
}

.ds-course__title {
  margin: 0;
  font: 700 17px/1.5 var(--font-sans);
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
  text-align: center;
}

.ds-course__title a {
  color: inherit;
}

.ds-course__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ds-course--wide .ds-course__title {
  text-align: start;
  min-height: 0;
  font-size: 19px;
}

.ds-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
  font: 500 12px/1.6 var(--font-sans);
  color: var(--ink-muted);
}

.ds-meta--start {
  justify-content: flex-start;
}

.ds-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.ds-meta .icon {
  width: 14px;
  height: 14px;
}

.ds-meta__sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.ds-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font: 500 12px/1 var(--font-sans);
  color: var(--ink-muted);
}

.ds-stars {
  color: var(--gold-300);
  letter-spacing: 1px;
  font-size: 13px;
}

.ds-stars__off {
  color: var(--border);
}

.ds-instructor {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font: 500 13px/1.4 var(--font-sans);
  color: var(--ink-body);
}

.ds-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sky-100);
  color: var(--sky-700);
  font-weight: 700;
}

.ds-avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.ds-course__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
}

.ds-price {
  font: 800 19px/1.2 var(--font-sans);
  color: var(--ink);
}

.ds-price small {
  font-size: 12px;
  font-weight: 700;
}

.ds-price__old {
  margin-inline-start: var(--space-1);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: line-through;
}

.ds-price--free {
  color: var(--success);
}

/* Trainer card */
.ds-trainer {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.ds-trainer__photo {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--sky-50);
  margin: var(--space-2) var(--space-2) 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ds-trainer__photo img,
.ds-trainer__photo span {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  color: var(--navy-900);
}

.ds-trainer__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-4);
  text-align: center;
  flex: 1;
}

.ds-trainer__name {
  margin: 0;
  font: 800 19px/1.4 var(--font-sans);
  color: var(--ink);
}

.ds-trainer__bio {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-body);
}

.ds-trainer__facts {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  font: 500 12px/1.6 var(--font-sans);
  color: var(--ink-body);
}

.ds-trainer__facts span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.ds-trainer__facts .icon {
  width: 15px;
  height: 15px;
  color: var(--navy-900);
}

.ds-trainer__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-1);
  width: 100%;
  margin-top: auto;
}

.ds-trainer__actions .btn-link {
  justify-content: center;
}

/* Stats band */
.ds-stats {
  background: var(--navy-900);
  color: var(--on-navy);
}

.ds-stats__grid {
  max-width: var(--max-width-page);
  margin: 0 auto;
  padding: var(--space-5) var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ds-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
}

.ds-stat + .ds-stat {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.16);
}

.ds-stat .icon {
  width: 40px;
  height: 40px;
  stroke-width: 1.4;
  color: var(--on-navy);
}

.ds-stat .icon .accent {
  stroke: var(--gold-300);
}

.ds-stat__num {
  font: 800 26px/1.2 var(--font-sans);
  color: var(--on-navy);
}

.ds-stat__label {
  font: 500 13px/1.5 var(--font-sans);
  color: var(--color-text-on-dark);
}

@media (max-width: 720px) {
  .ds-stats__grid {
    grid-template-columns: 1fr 1fr;
    padding-inline: var(--space-4);
  }

  .ds-stat {
    justify-content: flex-start;
    padding: var(--space-3) var(--space-2);
  }

  .ds-stat + .ds-stat {
    border-inline-start: 0;
  }
}

/* Navy call-to-action banner */
.ds-cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  min-height: 150px;
  border-radius: var(--radius-lg);
  background: var(--navy-900);
  color: var(--on-navy);
}

.ds-cta__body {
  position: relative;
  z-index: 1;
  padding: var(--space-5) var(--space-6);
}

.ds-cta__title {
  margin: 0 0 var(--space-1);
  font-size: 28px;
  font-weight: 800;
  color: var(--on-navy);
}

.ds-cta__text {
  margin: 0 0 var(--space-4);
  color: var(--color-text-on-dark);
}

.ds-cta__media {
  align-self: stretch;
  position: relative;
  min-height: 150px;
}

.ds-cta__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ds-cta__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, var(--navy-900), rgba(3, 37, 92, 0) 55%);
}

.ds-cta__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  color: var(--gold-300);
}

/* Promo panels (care home: consultations / forum / library) */
.ds-promos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.ds-promo {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--sky-50);
}

.ds-promo--gold {
  background: var(--gold-50);
  border-color: #f1d9a6;
}

.ds-promo__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.ds-promo__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.ds-promo__head .icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.4;
  color: var(--navy-900);
}

.ds-promo__sub {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.ds-checklist {
  list-style: none;
  margin: var(--space-2) 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ds-checklist li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-body);
}

.ds-checklist .icon {
  width: 20px;
  height: 20px;
  color: var(--gold-500);
}

.ds-promo .btn {
  margin-top: auto;
}

/* Feature items (why-us, how-to) */
.ds-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.ds-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ds-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--navy-900);
  color: var(--on-navy);
}

.ds-feature__icon .icon {
  width: 28px;
  height: 28px;
}

.ds-feature__icon .icon .accent {
  stroke: var(--gold-300);
}

.ds-feature__icon--soft {
  background: var(--gold-50);
  color: var(--gold-700);
}

.ds-feature__icon--soft .icon .accent {
  stroke: var(--gold-500);
}

.ds-feature__title {
  margin: 0;
  font: 700 16px/1.5 var(--font-sans);
  color: var(--ink);
}

.ds-feature__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-muted);
}

/* Testimonials */
.ds-quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.ds-quote {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ds-quote .ds-avatar {
  width: 56px;
  height: 56px;
}

.ds-quote__text {
  margin: 0 0 var(--space-1);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-body);
}

.ds-quote__name {
  display: block;
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
}

.ds-quote__role {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Article card */
.ds-articles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
}

.ds-article {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.ds-article__media {
  aspect-ratio: 16 / 10;
  background: var(--sky-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
}

.ds-article__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ds-article__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex: 1;
}

.ds-article__title {
  margin: 0;
  font: 700 15px/1.6 var(--font-sans);
  color: var(--ink);
}

.ds-article__date {
  font-size: 12px;
  color: var(--ink-muted);
}

.ds-article .btn-link {
  margin-top: auto;
  font-size: 13px;
  justify-content: flex-start;
}

/* Filters sidebar */
.ds-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}

.ds-filters__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.ds-filters__group {
  padding-block: var(--space-4);
  border-top: 1px solid var(--border);
}

.ds-filters__group h3 {
  margin: 0 0 var(--space-2);
  font-size: 16px;
  font-weight: 800;
}

.ds-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 0;
  font-size: 15px;
  color: var(--ink-body);
  cursor: pointer;
}

.ds-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy-900);
}

.ds-filters .btn {
  width: 100%;
}

/* Select-style filter bar (courses) */
.ds-filterbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.ds-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 48px;
  padding-inline: var(--space-4) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink);
}

.ds-select .icon {
  color: var(--navy-900);
}

.ds-select select,
.ds-select input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 15px/1.5 var(--font-sans);
  color: var(--ink);
  cursor: pointer;
}

.ds-select:focus-within {
  border-color: var(--navy-700);
}

.ds-filterbar > * {
  min-width: 0;
}

@media (max-width: 900px) {
  .ds-filterbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .ds-filterbar {
    grid-template-columns: 1fr;
  }
}

/* Pagination */
.ds-pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.ds-pagination a,
.ds-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  color: var(--ink);
}

.ds-pagination .is-current {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--on-gold);
}

.ds-pagination .icon {
  width: 16px;
  height: 16px;
}

.ds-empty {
  padding: var(--space-7) var(--space-5);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  background: var(--surface);
}

.ds-empty .icon {
  width: 44px;
  height: 44px;
  color: var(--navy-900);
  margin-bottom: var(--space-2);
}

.ds-note {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Responsive collapse for the shared grids */
@media (max-width: 1100px) {
  .ds-articles {
    grid-template-columns: repeat(3, 1fr);
  }

  .ds-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .ds-hero__inner {
    grid-template-columns: 1fr;
    padding-block: var(--space-6);
  }

  .ds-hero__title {
    font-size: 36px;
  }

  .ds-hero__photo {
    position: relative;
    width: 100%;
    height: 220px;
  }

  .ds-hero--photo {
    display: flex;
    flex-direction: column-reverse;
  }

  [dir] .ds-hero__photo::after {
    background: linear-gradient(to top, var(--sky-50), rgba(238, 245, 252, 0) 50%);
  }

  [dir] .ds-hero--navy .ds-hero__photo::after {
    background: linear-gradient(to top, var(--navy-950), rgba(1, 22, 54, 0) 60%);
  }

  .ds-promos,
  .ds-quotes {
    grid-template-columns: 1fr;
  }

  .ds-cta {
    grid-template-columns: 1fr;
  }

  .ds-cta__media {
    display: none;
  }
}

@media (max-width: 720px) {
  .ds-container {
    padding-inline: var(--space-4);
  }

  .ds-section {
    padding-block: var(--space-5);
  }

  .ds-section__title {
    font-size: 22px;
  }

  .ds-hero__inner {
    padding-inline: var(--space-4);
  }

  .ds-hero__title {
    font-size: 30px;
  }

  .ds-hero__lead {
    font-size: 17px;
  }

  .ds-articles {
    grid-template-columns: 1fr 1fr;
  }

  .ds-features {
    grid-template-columns: 1fr;
  }

  .ds-cats {
    grid-auto-flow: column;
    grid-auto-columns: 112px;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scrollbar-width: none;
  }

  .ds-cta__body {
    padding: var(--space-5) var(--space-4);
  }

  .ds-cta__title {
    font-size: 22px;
  }
}

/* ---------- Picture icons (cut from the design) ---------- */
.picon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.ds-cat .picon {
  width: 42px;
  height: 42px;
}

/* All tiles on one row (scrolls sideways on small screens) */
.ds-cats--row {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(84px, 1fr);
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 4px;
}

.ds-cats--row::-webkit-scrollbar {
  display: none;
}

.ds-cats--row .ds-cat {
  min-height: 96px;
  padding-inline: 6px;
  box-shadow: none;
  background: var(--surface);
}

.ds-cats--row .ds-cat__label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

/* Promo panel with a photo filling its end side */
.ds-promo--photo {
  position: relative;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  min-height: 236px;
}

.ds-promo--photo .ds-promo__copy {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  padding-inline-start: var(--space-4);
}

.ds-promo--photo .ds-checklist {
  margin: var(--space-1) 0 var(--space-3);
  gap: 6px;
}

.ds-promo--photo .ds-promo__title {
  font-size: 20px;
}

.ds-promo__img {
  flex: 0 0 36%;
  width: 36%;
  object-fit: cover;
  object-position: center top;
  min-height: 100%;
}

@media (max-width: 1100px) {
  .ds-promo__img {
    flex-basis: 30%;
    width: 30%;
  }
}

@media (max-width: 560px) {
  .ds-promo--photo .ds-promo__copy {
    padding: var(--space-4);
  }
}

.ds-carousel--quotes .ds-carousel__track {
  grid-auto-columns: calc((100% - 2 * var(--space-4)) / 3);
}

.ds-carousel--quotes .ds-quote .ds-avatar {
  width: 64px;
  height: 64px;
}

@media (max-width: 900px) {
  .ds-carousel--quotes .ds-carousel__track {
    grid-auto-columns: 88%;
  }
}

.ds-cta--photo .ds-cta__body {
  text-align: center;
}

.ds-cta--photo .ds-cta__media::after {
  background: linear-gradient(to left, var(--navy-900), rgba(3, 37, 92, 0) 45%);
}

[dir="ltr"] .ds-cta--photo .ds-cta__media::after {
  background: linear-gradient(to right, var(--navy-900), rgba(3, 37, 92, 0) 45%);
}

.ds-feature__icon--cream {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: #fbf1df;
  color: var(--gold-600, #b8862f);
}

.ds-feature__icon--cream .icon {
  width: 34px;
  height: 34px;
}

/* Light inner-page hero: photo on the end side fading into white */
.page-hero--light {
  background: #f7faff;
}

.page-hero--light .ds-hero__photo {
  width: 60%;
}

.page-hero--light .ds-hero__photo::after {
  background: linear-gradient(to left, #f7faff 0%, rgba(247, 250, 255, 0.75) 18%, rgba(247, 250, 255, 0) 45%);
}

[dir="ltr"] .page-hero--light .ds-hero__photo::after {
  background: linear-gradient(to right, #f7faff 0%, rgba(247, 250, 255, 0.75) 18%, rgba(247, 250, 255, 0) 45%);
}

.ds-cats--wide .ds-cat .picon {
  width: 50px;
  height: 50px;
}

.ds-cats--wide .ds-cat__label {
  font-size: 16px;
  font-weight: 800;
}

.ds-cta--photo {
  grid-template-columns: 1fr 36%;
}

a.ds-promo {
  color: inherit;
  text-decoration: none;
}

.ds-cat__sub {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}

.ds-trainer__chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  width: 100%;
}

.ds-trainer__chips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  font-size: 12px;
  color: var(--ink-body);
  white-space: nowrap;
}

.ds-trainer__chips .icon {
  width: 15px;
  height: 15px;
  color: var(--navy-900);
}

.ds-select--sm {
  height: 40px;
  min-width: 170px;
}

@media (max-width: 900px) {
  .ds-hero.ds-hero--photo {
    flex-direction: column;
  }

  .ds-hero.ds-hero--photo .ds-hero__photo {
    width: 100%;
    height: 220px;
  }

  [dir] .ds-hero.ds-hero--photo .ds-hero__photo::after {
    background: linear-gradient(to bottom, rgba(247, 250, 255, 0) 55%, #f7faff);
  }

  [dir] .ds-hero.ds-hero--navy .ds-hero__photo::after {
    background: linear-gradient(to bottom, rgba(1, 22, 54, 0) 55%, var(--navy-950));
  }

  .ds-hero.ds-hero--photo .ds-hero__inner {
    padding-block: var(--space-4) var(--space-7);
  }
}
