/* HDC Editorial Register System v1
   Shared architecture for visual and principle-led registers.
   Finishing & Embellishment = interactive visual variant.
   Homepage Quality = static principle variant.
*/

.hdc-editorial-register {
  --er-rule: color-mix(in srgb, currentColor 16%, transparent);
  --er-rule-strong: color-mix(in srgb, currentColor 26%, transparent);
  --er-muted: color-mix(in srgb, currentColor 62%, transparent);
  --er-gap: clamp(2rem, 5vw, 5.5rem);
  --er-block-min: clamp(34rem, 42vw, 42rem);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--er-gap);
  align-items: stretch;
  min-width: 0;
}

.hdc-editorial-register--four { --er-row-count: 4; }
.hdc-editorial-register--five { --er-row-count: 5; }

.hdc-editorial-register__feature,
.hdc-editorial-register__list {
  min-width: 0;
  min-height: var(--er-block-min);
}

.hdc-editorial-register__list {
  display: grid;
  grid-template-rows: repeat(var(--er-row-count), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--er-rule-strong);
  list-style: none;
}

.hdc-editorial-register__row {
  display: grid;
  width: 100%;
  grid-template-columns: 2.8rem minmax(0, 1fr) auto;
  gap: clamp(.75rem, 1.2vw, 1.2rem);
  align-items: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: clamp(.9rem, 1.35vw, 1.35rem) 0;
  border: 0;
  border-bottom: 1px solid var(--er-rule);
  background: transparent;
  color: inherit;
  text-align: left;
}

button.hdc-editorial-register__row {
  appearance: none;
  cursor: pointer;
}

.hdc-editorial-register__number {
  align-self: start;
  padding-top: .2rem;
  color: var(--er-muted);
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .11em;
  line-height: 1;
}

.hdc-editorial-register__label {
  display: grid;
  gap: .34rem;
  min-width: 0;
}

.hdc-editorial-register__label small {
  color: var(--er-muted);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hdc-editorial-register__label strong {
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 3.45rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .96;
}

.hdc-editorial-register__label em {
  max-width: 30rem;
  color: var(--er-muted);
  font-family: var(--sans);
  font-size: clamp(.82rem, .95vw, .98rem);
  font-style: normal;
  line-height: 1.45;
}

.hdc-editorial-register__mark {
  align-self: start;
  padding-top: .12rem;
  color: var(--er-muted);
  font-size: 1rem;
  line-height: 1;
}

.hdc-editorial-register__principle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: clamp(1rem, 2vw, 2.5rem);
}

.hdc-editorial-register__principle h2 {
  max-width: 7ch;
  margin-top: 1rem;
  font-size: clamp(4rem, 6.4vw, 7rem);
  line-height: .9;
  letter-spacing: -.055em;
}

.hdc-editorial-register__feature-note {
  max-width: 26rem;
  margin: clamp(1.5rem, 2.5vw, 2.5rem) 0 0;
  color: var(--er-muted);
  font-size: clamp(.9rem, 1vw, 1rem);
  line-height: 1.6;
}

/* Visual register variant: feature image and list occupy the same vertical envelope. */
.hdc-editorial-register--visual .hdc-editorial-register__feature {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  margin: 0;
}

.hdc-editorial-register--visual .fe-gallery__image-wrap {
  min-height: 0;
  aspect-ratio: auto;
}

.hdc-editorial-register--visual .fe-gallery__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hdc-editorial-register--visual .fe-gallery__visual {
  top: 7rem;
}

.hdc-editorial-register--visual .fe-gallery__visual figcaption {
  margin: 0;
}

/* Preserve Finishing interaction semantics while using the shared row anatomy. */
.hdc-editorial-register--visual .hdc-editorial-register__row:hover .hdc-editorial-register__label strong,
.hdc-editorial-register--visual .hdc-editorial-register__row:focus-visible .hdc-editorial-register__label strong,
.hdc-editorial-register--visual .hdc-editorial-register__row.is-active .hdc-editorial-register__label strong {
  color: var(--accent);
  transform: translateX(.28rem);
}

.hdc-editorial-register--visual .hdc-editorial-register__row:hover .hdc-editorial-register__mark,
.hdc-editorial-register--visual .hdc-editorial-register__row:focus-visible .hdc-editorial-register__mark,
.hdc-editorial-register--visual .hdc-editorial-register__row.is-active .hdc-editorial-register__mark {
  color: var(--accent);
  transform: rotate(0);
}

.hdc-editorial-register--visual .hdc-editorial-register__mark {
  transform: rotate(45deg);
  transition: color .2s ease, transform .25s ease;
}

.hdc-editorial-register--visual .hdc-editorial-register__label strong {
  transition: color .2s ease, transform .25s ease;
}

.hdc-editorial-register--visual .hdc-editorial-register__row:focus-visible {
  position: relative;
  z-index: 2;
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

/* Static Quality register: same chassis, no false active-state signal. */
.hdc-editorial-register--principle .hdc-editorial-register__row {
  cursor: default;
}

.hdc-editorial-register--principle .hdc-editorial-register__mark {
  transform: none;
}

.hdc-editorial-register__visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Compact desktop keeps the same 5/7 architecture with tighter scale. */
@media (min-width: 900px) and (max-width: 1199px) {
  .hdc-editorial-register {
    --er-gap: clamp(1.5rem, 3vw, 2.5rem);
    --er-block-min: clamp(31rem, 48vw, 36rem);
  }

  .hdc-editorial-register__principle h2 {
    font-size: clamp(3.5rem, 6vw, 5.25rem);
  }

  .hdc-editorial-register__label strong {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
  }
}

/* Mobile: context first, register second. */
@media (max-width: 899px) {
  .hdc-editorial-register {
    --er-block-min: 0;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 7vw, 3.5rem);
  }

  .hdc-editorial-register__feature,
  .hdc-editorial-register__list {
    min-height: 0;
  }

  .hdc-editorial-register__list {
    grid-template-rows: none;
  }

  .hdc-editorial-register__row {
    min-height: 0;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    padding: 1.15rem 0;
  }

  .hdc-editorial-register__principle {
    padding-right: 0;
  }

  .hdc-editorial-register__principle h2 {
    max-width: 7.5ch;
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .hdc-editorial-register--visual .hdc-editorial-register__feature {
    position: static;
    display: grid;
    grid-template-rows: auto auto;
  }

  .hdc-editorial-register--visual .fe-gallery__image-wrap {
    aspect-ratio: 4 / 3;
  }

  .hdc-editorial-register__label strong {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  .hdc-editorial-register__label em {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hdc-editorial-register__label strong,
  .hdc-editorial-register__mark {
    transition: none !important;
    transform: none !important;
  }
}
