/*
 * Reusable pieces: toggle, eyebrow, links, tags, section header, cards, slider.
 */

/* ---------- Toggle (section marker) ---------- */

.toggle {
  --tone: var(--c-blue);
  position: relative;
  display: inline-block;
  flex: none;
  width: 60px;
  height: 24px;
}
.toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--tone);
  opacity: 0.4;
  transition: background-color 0.3s;
}
.toggle__knob {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--tone);
  transition: transform 0.35s var(--ease), background-color 0.3s;
}
.toggle.is-on .toggle__knob {
  transform: translateX(36px);
}
.toggle--coral {
  --tone: var(--c-coral);
}
.toggle--green {
  --tone: var(--c-green);
}
.toggle--light {
  --tone: rgba(255, 255, 255, 0.3);
}

/* ---------- Eyebrow: toggle + uppercase label ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 29px;
  height: 70px;
  padding-left: 5px;
  color: var(--c-text-muted);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
}

/* ---------- Text link with round chevron ---------- */

.dot {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--c-black);
}
.dot::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--c-yellow);
  transition: transform 0.3s var(--ease);
}
.dot svg {
  position: relative;
  transition: transform 0.3s var(--ease);
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--c-black);
  font-size: var(--fs-link);
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
  white-space: nowrap;
}
.more--muted .more__label {
  color: var(--c-text-muted);
  transition: color 0.2s;
}
.more--muted .dot::before {
  opacity: 0.4;
}
.more--coral .dot::before {
  background: var(--c-coral);
}
.more--light {
  color: var(--c-white);
}
.more--light .dot::before {
  background: var(--c-white);
  opacity: 0.4;
}
a.more:hover .dot::before,
button.more:hover .dot::before,
a:hover .more .dot::before {
  transform: scale(1.2);
}
a.more:hover .dot svg,
button.more:hover .dot svg,
a:hover .more .dot svg {
  transform: translateX(2px);
}
a.more--muted:hover .more__label {
  color: var(--c-black);
}

/* ---------- Tag ---------- */

.tag {
  display: inline-block;
  padding: 8.4px 12px 7.2px;
  background: var(--c-red);
  color: var(--c-white);
  font-size: 13.2px;
  font-weight: 500;
  line-height: 18px;
  text-transform: uppercase;
}
.tag--sky {
  background: var(--c-sky);
  color: var(--c-black);
}
.tag--peach {
  background: var(--c-peach);
  color: var(--c-black);
}

/* ---------- Page header (inner pages): title + two-line subtitle ---------- */

.page-head {
  --page-head-gap: 71px;
  display: flex;
  flex-direction: column;
  gap: var(--page-head-gap);
  min-height: 407px;
  padding-top: 103px;
}
.page-head__title {
  font-size: var(--fs-h1);
  line-height: 1.1071;
}
.page-head__text {
  font-size: var(--fs-h3);
  line-height: 1.2857;
}

/* ---------- Filter pills ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding: 18px 0;
  border-block: 1px solid var(--c-line);
}
.filters__btn {
  padding: 11px 22px 9px;
  border: 1px solid var(--c-black);
  border-radius: 999px;
  background: var(--c-white);
  color: var(--c-black);
  font-size: var(--fs-link);
  font-weight: 500;
  line-height: 21px;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}
.filters__btn:hover,
.filters__btn.is-active,
.filters__btn[aria-pressed="true"] {
  background: var(--c-black);
  color: var(--c-white);
}

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

.section-head {
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.section-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.section-head__title {
  font-size: var(--fs-h1);
  line-height: 1.0714;
}
.section-head--aside .section-head__row {
  align-items: flex-start;
}
.section-head__aside {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 19px;
  width: 49.19%;
}
.section-head__aside p {
  font-size: var(--fs-body-l);
  line-height: 1.5;
}
.section-head--rule {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--c-line);
}

/* ---------- Method card (home) ---------- */

.method-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}

.method-card {
  position: relative;
  display: block;
  cursor: default;
  aspect-ratio: 610 / 700;
  overflow: hidden;
  background: var(--c-ink);
  color: var(--c-white);
}
a.method-card {
  cursor: pointer;
}
.method-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.method-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: background-color 0.4s;
}
.method-card__top,
.method-card__body {
  position: absolute;
  z-index: 1;
}
.method-card__top {
  top: 20px;
  left: 30px;
  right: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.method-card__label {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 24px;
  text-transform: uppercase;
  transition: color 0.3s;
}
.method-card__body {
  left: 8.2%;
  right: 8.2%;
  bottom: 40.5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.method-card__title {
  display: block;
  font-size: var(--fs-h1);
  line-height: 1.0714;
}
/* Description and service chips: collapsed by default, open on hover/focus (Figma variant "Group 5") */
.method-card__reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.45s var(--ease), opacity 0.3s;
}
.method-card__reveal-inner {
  display: block;
  min-height: 0;
  overflow: hidden;
}
.method-card__text {
  display: block;
  max-width: 510px;
  padding-top: 15px;
  font-size: var(--fs-body);
  line-height: 24px;
}
.method-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 510px;
  padding-top: 15px;
}
.method-card .more {
  margin-top: 15px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13.4px;
  border-radius: 33.5px;
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  font-weight: 600;
  line-height: 23px;
  text-transform: uppercase;
  white-space: nowrap;
}

.method-card:hover .method-card__img,
.method-card:focus-visible .method-card__img {
  transform: scale(1.04);
}
.method-card:hover .method-card__reveal,
.method-card:focus-visible .method-card__reveal {
  grid-template-rows: 1fr;
  opacity: 1;
}
.method-card:hover .method-card__label,
.method-card:focus-visible .method-card__label {
  color: var(--c-yellow);
}
.method-card:hover .toggle,
.method-card:focus-visible .toggle {
  --tone: var(--c-yellow);
}
.method-card:hover .toggle__knob,
.method-card:focus-visible .toggle__knob {
  transform: translateX(36px);
}
.method-card:hover .dot::before,
.method-card:focus-visible .dot::before {
  background: var(--c-yellow);
  opacity: 1;
}

/* ---------- Article card ---------- */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.article-card__link {
  display: block;
}
.article-card__media {
  aspect-ratio: 400 / 298;
  overflow: hidden;
  background: #ddd;
}
/* News images stay black and white until hovered, whatever the editors upload */
.article-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 0.6s var(--ease), filter 0.4s;
}
.article-card__link:hover .article-card__media img,
.article-card__link:focus-visible .article-card__media img {
  filter: grayscale(0);
  transform: scale(1.04);
}
.article-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 19px;
  padding: 18px 0;
  border-bottom: 1px solid var(--c-line-strong);
  color: var(--c-text-meta);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: 20px;
  text-transform: uppercase;
}
.article-card__title {
  max-width: 94%;
  margin-top: 16px;
  font-size: var(--fs-body-l);
  line-height: 1.3333;
}

/* ---------- Works mosaic (home) ---------- */

.mosaic {
  display: grid;
  grid-template-columns: 724.18fr 499.43fr;
  grid-template-rows: 1fr 1fr;
  gap: 19.2px;
  aspect-ratio: 1240 / 631;
}
.mosaic__item {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--c-ink);
  color: var(--c-white);
}
.mosaic__item--lead {
  grid-row: 1 / 3;
}
.mosaic__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.mosaic__item:hover img {
  transform: scale(1.04);
}
.mosaic__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.78) 100%);
}
.mosaic__body {
  position: absolute;
  z-index: 1;
  left: 33.6px;
  right: 33.6px;
  bottom: 31px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.mosaic__title {
  display: block;
  margin-top: 18px;
  font-size: 28.8px;
  line-height: 35px;
}
.mosaic__item--lead .mosaic__title {
  font-size: 36px;
  line-height: 42px;
}
.mosaic__link {
  margin-top: 23.4px;
  font-size: 14.4px;
  font-weight: 600;
  line-height: 22px;
  text-transform: uppercase;
}
.mosaic__item:hover .mosaic__link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Podcast card ---------- */

.podcast-card__link {
  display: block;
}
.podcast-card__cover {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 30px;
  background: #ddd;
}
.podcast-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.podcast-card__link:hover .podcast-card__cover img {
  transform: scale(1.04);
}
.podcast-card__platforms {
  position: absolute;
  top: 21px;
  right: 29.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-white);
}
.podcast-card__platforms svg {
  width: 24px;
  height: 24px;
}
.podcast-card__platforms svg:last-child {
  width: 21px;
  height: 15px;
  margin-inline: 1.5px;
}
.podcast-card__meta,
.podcast-card__text {
  max-width: 396.5px;
}
.podcast-card__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--c-line-strong);
  color: var(--c-text-meta);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  text-transform: uppercase;
}
.podcast-card__title {
  max-width: 324px;
  padding: 20px 0 10px;
  font-size: var(--fs-lead);
  line-height: 1.2778;
}
.podcast-card__text {
  font-size: var(--fs-body);
  line-height: 24px;
}
.podcast-card .more {
  margin-top: 24px;
  line-height: 21px;
}

/* ---------- Slider ---------- */

.slider {
  position: relative;
  /* room for the arrows, which sit 276.8px under the 400px covers */
  min-height: 719.2px;
}
.slider__track {
  display: flex;
  gap: 16.5px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* let cards run off the right edge of the page */
  margin-right: calc(-1 * (100vw - 100%) / 2);
  padding-right: calc((100vw - 100%) / 2);
}
.slider__track::-webkit-scrollbar {
  display: none;
}
.slider__track > * {
  flex: none;
  width: 400px;
  max-width: 82vw;
  scroll-snap-align: start;
}
.slider__nav {
  position: absolute;
  right: 8.8px;
  top: 676.8px;
  display: flex;
  gap: 17.6px;
}
.slider__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42.4px;
  height: 42.4px;
  border-radius: 50%;
  color: var(--c-black);
}
.slider__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c-ochre);
  opacity: 0.4;
  transition: opacity 0.2s;
}
.slider__btn svg {
  position: relative;
}
.slider__btn:hover::before {
  opacity: 0.8;
}

/* ---------- Provisional small-screen rules (no mobile mockup yet) ---------- */

@media (max-width: 1000px) {
  .section-head--aside .section-head__row {
    flex-direction: column;
    gap: 24px;
  }
  .section-head__aside {
    width: 100%;
  }
  .mosaic {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    aspect-ratio: auto;
  }
  .mosaic__item {
    aspect-ratio: 5 / 3;
  }
  .mosaic__item--lead {
    grid-row: auto;
    aspect-ratio: 1;
  }
  .slider {
    min-height: 0;
  }
  .slider__nav {
    position: static;
    justify-content: flex-end;
    margin-top: 24px;
  }
}

@media (max-width: 760px) {
  /* Hand-set line breaks are for the desktop measure */
  .page-head__text br {
    display: none;
  }
  .method-cards,
  .article-grid {
    grid-template-columns: 1fr;
  }
  .article-grid {
    row-gap: 48px;
  }
  .section-head__row {
    flex-wrap: wrap;
    gap: 16px;
  }
  .mosaic__item--lead .mosaic__title {
    font-size: 28.8px;
    line-height: 35px;
  }
}
