/* Feather's editorial case study.  Every rule is scoped to the Feather root
   so the shared Studio Luner chrome and other projects keep their styles. */
[data-rui-feather-case] {
  --rui-feather-base: #f0f2ed;
  --rui-feather-paper: #fafbf7;
  --rui-feather-charcoal: #293332;
  --rui-feather-sage: #4b6860;
  --rui-feather-accent: #3f6658;
  --rui-feather-line: rgba(41, 51, 50, .2);
  color: var(--rui-feather-charcoal);
  background: var(--rui-feather-base);
}

[data-rui-feather-case] .rui-feather-container {
  width: min(100%, 90rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4rem) clamp(1.25rem, calc((100vw - 84rem) / 2), 3rem);
}

[data-rui-feather-case] .rui-feather-at-a-glance {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(18rem, .95fr);
  gap: clamp(2rem, 6vw, 7rem);
  margin: 0 0 clamp(4.5rem, 9vw, 9rem);
  padding: clamp(2rem, 5vw, 5rem);
  border: 0;
  border-top: .45rem solid var(--rui-feather-accent);
  color: var(--rui-feather-charcoal);
  background: var(--rui-feather-paper);
}

[data-rui-feather-case] .rui-feather-kicker,
[data-rui-feather-case] .rui-feather-chapter-number {
  margin: 0 0 1rem;
  color: var(--rui-feather-accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

[data-rui-feather-case] .rui-feather-overview-copy h2 {
  margin: 0;
  color: var(--rui-feather-charcoal);
  font-family: "Alumni Sans", Arial, sans-serif;
  font-size: clamp(2.5rem, 5vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: .92;
  text-transform: none;
}

[data-rui-feather-case] .rui-feather-overview-copy .rui-case-impact {
  max-width: 28rem;
  margin: 1.5rem 0 0;
  color: var(--rui-feather-sage);
  font-family: "Alumni Sans", Arial, sans-serif;
  font-size: clamp(1.75rem, 3vw, 3.2rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.04;
}

[data-rui-feather-case] .rui-feather-overview-facts {
  display: grid;
  align-content: start;
  gap: 1.5rem;
  margin: 0;
}

[data-rui-feather-case] .rui-feather-overview-facts div {
  padding-top: 1rem;
  border-top: 1px solid var(--rui-feather-line);
}

[data-rui-feather-case] .rui-feather-overview-facts dt {
  margin: 0 0 .35rem;
  color: var(--rui-feather-accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

[data-rui-feather-case] .rui-feather-overview-facts dd {
  max-width: 38rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

[data-rui-feather-case] .rui-feather-story {
  border-top: 1px solid var(--rui-feather-line);
}

[data-rui-feather-case] .rui-feather-chapter {
  scroll-margin-top: 2rem;
  padding: clamp(4rem, 9vw, 9rem) 0;
  border-bottom: 1px solid var(--rui-feather-line);
}

[data-rui-feather-case] .rui-feather-story > .rui-feather-chapter:last-child {
  border-bottom: 0;
}

[data-rui-feather-case] .rui-feather-chapter-grid {
  display: grid;
  grid-template-columns: minmax(0, .4fr) minmax(0, .6fr);
  gap: clamp(2rem, 7vw, 8rem);
  align-items: start;
}

[data-rui-feather-case] .rui-feather-chapter--media-left .rui-feather-chapter-copy,
[data-rui-feather-case] .rui-feather-chapter--media-right .rui-feather-chapter-copy {
  grid-column: 1;
  grid-row: 1;
}

[data-rui-feather-case] .rui-feather-chapter--media-left .rui-feather-chapter-media,
[data-rui-feather-case] .rui-feather-chapter--media-right .rui-feather-chapter-media {
  grid-column: 2;
  grid-row: 1;
}

[data-rui-feather-case] .rui-feather-chapter-copy {
  max-width: 42rem;
}

[data-rui-feather-case] .rui-feather-chapter--text-only .rui-feather-chapter-header {
  grid-column: 1;
}

[data-rui-feather-case] .rui-feather-chapter--text-only .rui-feather-chapter-body {
  grid-column: 2;
}

[data-rui-feather-case] .rui-feather-chapter-copy,
[data-rui-feather-case] .rui-feather-chapter-header,
[data-rui-feather-case] .rui-feather-chapter-body {
  min-width: 0;
}

[data-rui-feather-case] .rui-feather-chapter-copy h2,
[data-rui-feather-case] .rui-feather-chapter-header h2 {
  margin: 0 0 1.5rem;
  color: var(--rui-feather-charcoal);
  font-family: "Alumni Sans", Arial, sans-serif;
  font-size: clamp(2.35rem, 4.2vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: .94;
  text-transform: none;
  text-wrap: balance;
}

[data-rui-feather-case] .rui-feather-chapter h2.rui-feather-title--two-lines {
  font-size: clamp(2.35rem, 4.2vw, 3.75rem);
}

[data-rui-feather-case] .rui-feather-title-line {
  display: block;
}

[data-rui-feather-case] .rui-feather-chapter-copy > p:not(.rui-feather-chapter-number):not(.rui-feather-note),
[data-rui-feather-case] .rui-feather-chapter-body > p:not(.rui-feather-note) {
  max-width: 59ch;
  margin: 0 0 1rem;
  font-size: 1.04rem;
  line-height: 1.68;
}

[data-rui-feather-case] .rui-feather-chapter-number {
  color: var(--rui-feather-sage);
}

[data-rui-feather-case] .rui-feather-note {
  max-width: 60ch;
  margin: 1.75rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rui-feather-line);
  color: color-mix(in srgb, var(--rui-feather-charcoal) 70%, transparent);
  font-size: .88rem;
  line-height: 1.55;
}

[data-rui-feather-case] .rui-feather-chapter-media,
[data-rui-feather-case] .rui-feather-chapter-media-supporting,
[data-rui-feather-case] .rui-feather-media {
  min-width: 0;
}

[data-rui-feather-case] .rui-feather-media {
  margin: 0;
}

[data-rui-feather-case] .rui-feather-media img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--rui-feather-paper);
}

[data-rui-feather-case] .rui-feather-media figcaption {
  width: 100%;
  max-width: none;
  margin-top: .75rem;
  text-align: left;
  color: color-mix(in srgb, var(--rui-feather-charcoal) 72%, transparent);
  font-size: .86rem;
  line-height: 1.5;
}

[data-rui-feather-case] .rui-feather-evidence {
  margin: clamp(2.5rem, 5vw, 5rem) 0 0;
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--rui-feather-line);
}

[data-rui-feather-case] .rui-feather-evidence-heading {
  max-width: 38rem;
  margin: 0 0 1.5rem;
}

[data-rui-feather-case] .rui-feather-evidence-kicker {
  margin: 0 0 .6rem;
  color: var(--rui-feather-accent);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

[data-rui-feather-case] .rui-feather-evidence-heading h3 {
  margin: 0 0 .75rem;
  color: var(--rui-feather-charcoal);
  font-family: "Alumni Sans", Arial, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: .98;
  text-wrap: balance;
}

[data-rui-feather-case] .rui-feather-evidence-heading > p:last-child {
  max-width: 58ch;
  margin: 0;
  color: color-mix(in srgb, var(--rui-feather-charcoal) 72%, transparent);
  font-size: .92rem;
  line-height: 1.55;
}

[data-rui-feather-case] .rui-feather-evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

[data-rui-feather-case] .rui-feather-evidence-figure {
  min-width: 0;
  margin: 0;
}

[data-rui-feather-case] .rui-feather-evidence-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

[data-rui-feather-case] .rui-feather-evidence-link:focus-visible {
  outline: 3px solid var(--rui-feather-accent);
  outline-offset: 5px;
}

[data-rui-feather-case] .rui-feather-evidence-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--rui-feather-paper);
}

[data-rui-feather-case] .rui-feather-evidence-frame--crop {
  aspect-ratio: 4 / 3;
}

[data-rui-feather-case] .rui-feather-evidence-frame--crop img {
  position: absolute;
  top: var(--rui-feather-evidence-crop-top, 0);
  left: var(--rui-feather-evidence-crop-left, 0);
  display: block;
  width: 300%;
  max-width: none;
  height: auto;
}

[data-rui-feather-case] .rui-feather-evidence-frame--full {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

[data-rui-feather-case] .rui-feather-evidence-frame--full img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

[data-rui-feather-case] .rui-feather-evidence-figure figcaption {
  margin-top: .65rem;
  color: color-mix(in srgb, var(--rui-feather-charcoal) 72%, transparent);
  font-size: .78rem;
  line-height: 1.45;
}

[data-rui-feather-case] .rui-feather-evidence--prototype .rui-feather-evidence-figure {
  max-width: 188px;
  margin-inline: auto;
}

[data-rui-feather-case] .rui-feather-evidence--prototype .rui-feather-evidence-frame--full {
  aspect-ratio: 188 / 406;
  background: #14211f;
}

[data-rui-feather-case] .rui-feather-evidence--prototype .rui-feather-evidence-frame--full img {
  width: 100%;
  height: auto;
  image-rendering: auto;
}

[data-rui-feather-case] .rui-feather-image-link,
[data-rui-feather-case] .rui-feather-holo-link {
  display: block;
  width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

[data-rui-feather-case] .rui-feather-image-link:focus-visible,
[data-rui-feather-case] .rui-feather-holo-link:focus-visible,
[data-rui-feather-case] .rui-feather-sources a:focus-visible {
  outline: 3px solid var(--rui-feather-accent);
  outline-offset: 5px;
}

/* The authored photo reserves the ratio while the optional card renderer
   loads into its sibling stage. */
[data-rui-feather-case] .rui-feather-holo {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  isolation: isolate;
}

[data-rui-feather-case] .rui-feather-holo-static {
  position: relative;
  z-index: 0;
}

[data-rui-feather-case] .rui-feather-holo-link img {
  display: block;
  width: 100%;
  height: auto;
}

[data-rui-feather-case] .rui-feather-holo-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: visible;
  visibility: hidden;
  pointer-events: none;
}

[data-rui-feather-case] .rui-feather-holo[data-rui-feather-holo-state="ready"] .rui-feather-holo-stage {
  visibility: visible;
  pointer-events: auto;
}

[data-rui-feather-case] .rui-feather-holo[data-rui-feather-holo-state="ready"] .rui-feather-holo-static {
  visibility: hidden;
  pointer-events: none;
}

[data-rui-feather-case] .rui-feather-holo[data-rui-feather-holo-state="error"] .rui-feather-holo-stage {
  display: none;
}

[data-rui-feather-case] .rui-feather-holo .lhc {
  width: 100%;
  max-width: none;
  touch-action: pan-y;
}

[data-rui-feather-case] .rui-feather-holo img.lhc-cutout {
  background: transparent;
}

[data-rui-feather-case] .rui-feather-holo-status {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  z-index: 2;
  max-width: min(90%, 22rem);
  margin: 0;
  padding: .5rem .7rem;
  border: 1px solid var(--rui-feather-line);
  color: var(--rui-feather-charcoal);
  background: color-mix(in srgb, var(--rui-feather-paper) 92%, transparent);
  font-size: .75rem;
  line-height: 1.35;
}

[data-rui-feather-case] .rui-feather-chapter-media--paired,
[data-rui-feather-case] .rui-feather-chapter-media-supporting {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
}

[data-rui-feather-case] .rui-feather-chapter-media--paired {
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
}

/* Chapter media can opt into a balanced gallery when each mockup needs its
   own host and caption.  The authored image ratio stays intact per card. */
[data-rui-feather-case] .rui-feather-chapter--mockup-grid .rui-feather-chapter-grid {
  display: block;
}

[data-rui-feather-case] .rui-feather-chapter--mockup-grid .rui-feather-chapter-copy {
  max-width: 60rem;
  margin-bottom: clamp(2.5rem, 5vw, 5rem);
}

[data-rui-feather-case] .rui-feather-chapter-media--mockup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.75vw, 3rem);
  align-items: start;
  width: 100%;
}

[data-rui-feather-case] .rui-feather-media--mockup {
  min-width: 0;
}

[data-rui-feather-case] .rui-feather-media--mockup img {
  height: auto;
  object-fit: contain;
}

[data-rui-feather-case] .rui-feather-chapter--media-sequence .rui-feather-chapter-media--lead {
  grid-column: 2;
  grid-row: 1;
}

[data-rui-feather-case] .rui-feather-chapter-media-supporting {
  grid-column: 1 / -1;
  grid-row: 2;
}

[data-rui-feather-case] .rui-feather-task-list {
  display: grid;
  gap: 0;
  max-width: 50rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: feather-task;
}

[data-rui-feather-case] .rui-feather-task-list li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: .75rem;
  padding: .75rem 0;
  border-top: 1px solid var(--rui-feather-line);
  counter-increment: feather-task;
  font-size: .98rem;
  line-height: 1.5;
}

[data-rui-feather-case] .rui-feather-task-list li::before {
  content: counter(feather-task, decimal-leading-zero);
  color: var(--rui-feather-accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.5;
}

[data-rui-feather-case] .rui-feather-sources {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin-top: 1.5rem;
}

[data-rui-feather-case] .rui-feather-sources a {
  color: var(--rui-feather-accent);
  font-size: .78rem;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: .25rem;
}

@media (max-width: 991px) {
  [data-rui-feather-case] .rui-feather-at-a-glance {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-rui-feather-case] .rui-feather-chapter-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  [data-rui-feather-case] .rui-feather-chapter--text-only .rui-feather-chapter-header,
  [data-rui-feather-case] .rui-feather-chapter--text-only .rui-feather-chapter-body {
    grid-column: 1;
  }

  [data-rui-feather-case] .rui-feather-chapter--media-left .rui-feather-chapter-copy,
  [data-rui-feather-case] .rui-feather-chapter--media-left .rui-feather-chapter-media,
  [data-rui-feather-case] .rui-feather-chapter--media-right .rui-feather-chapter-copy,
  [data-rui-feather-case] .rui-feather-chapter--media-right .rui-feather-chapter-media {
    grid-column: 1;
    grid-row: auto;
  }

  [data-rui-feather-case] .rui-feather-chapter-media-supporting {
    grid-column: 1;
    grid-row: auto;
    order: 3;
  }

  [data-rui-feather-case] .rui-feather-chapter-media--mockup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-rui-feather-case] .rui-feather-evidence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-rui-feather-case] .rui-feather-chapter--media-left .rui-feather-chapter-media,
  [data-rui-feather-case] .rui-feather-chapter--media-right .rui-feather-chapter-media {
    order: 2;
  }
}

@media (max-width: 767px) {
  [data-rui-feather-case] .rui-feather-container {
    padding-inline: 1rem;
  }

  [data-rui-feather-case] .rui-feather-at-a-glance {
    gap: 2.5rem;
    padding: 1.5rem;
  }

  [data-rui-feather-case] .rui-feather-chapter {
    padding: 4rem 0;
  }

  [data-rui-feather-case] .rui-feather-chapter-media--paired,
  [data-rui-feather-case] .rui-feather-chapter-media--sequence,
  [data-rui-feather-case] .rui-feather-chapter-media-supporting {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-rui-feather-case] .rui-feather-chapter-media--mockup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-rui-feather-case] .rui-feather-evidence-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-rui-feather-case] .rui-feather-chapter--media-sequence .rui-feather-chapter-media--lead {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-rui-feather-case] .rui-reveal {
    opacity: 1;
    transform: none;
  }
}
