/* Case page (Figma: "Case - pagamentos", 189:288). Builds on ../styles.css tokens and components. */

.case > * + * { margin-top: 72px; }

/* ---------- Hero ---------- */
.case-back {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; margin: -12px 0 12px;
  font-size: 14px; font-weight: 600; color: var(--color-text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}
.case-back:hover { color: var(--color-text-primary); }
.case-hero__title { max-width: 910px; font-size: 48px; line-height: 58px; font-weight: 700; letter-spacing: -0.5px; text-wrap: balance; }
.case-hero__lead { max-width: 821px; margin-top: 24px !important; font-size: 18px; line-height: 32px; color: var(--color-text-secondary); }

.case-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 24px; }
.case-tags li {
  padding: 3px 10px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  font-size: 12px; line-height: 16px; font-weight: 600; color: var(--color-text-secondary);
}

.case-facts { display: grid; grid-template-columns: repeat(4, 216px); justify-content: space-between; margin: 72px 0 0; }
.case-facts dt { padding-bottom: 8px; border-bottom: 1px solid var(--color-border-default); font-size: 14px; line-height: 21px; color: var(--color-text-secondary); }
.case-facts dd { margin: 8px 0 0; font-size: 14px; line-height: 27px; font-weight: 600; }

.case-summary { display: flex; gap: 72px; align-items: center; margin-top: 128px; }
.case-summary__mockup { flex: none; width: 332px; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.case-summary__body { flex: 1 1 auto; min-width: 0; padding: 16px 0; }
.case-summary__intro { max-width: 624px; font-size: 16px; line-height: 27px; color: var(--color-text-secondary); }

.case-stats { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.case-stats li {
  padding: 24px;
  border: 1px solid var(--color-border-default); border-radius: var(--radius-sm);
  font-size: 16px; line-height: 32px; letter-spacing: -0.08px; color: var(--color-text-secondary);
}
.case-stats strong { display: block; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.12px; color: var(--color-text-primary); }

.case-note { margin-top: 16px !important; font-size: 12px; line-height: 16px; color: var(--color-text-secondary); }
.case-summary__mockup .case-note { margin-top: 0 !important; text-align: center; }

/* ---------- Sections: label (126) + content (732) ---------- */
.case-section { display: flex; gap: 180px; align-items: flex-start; }
.case-section__label { flex: none; width: 126px; white-space: nowrap; font-size: 18px; line-height: 22px; font-weight: 700; }
.case-section__content { flex: 1 1 auto; min-width: 0; max-width: 732px; font-size: 18px; line-height: 32px; color: var(--color-text-secondary); }
.case-section__content > * + * { margin-top: 32px; }
.case-section__content > p + p { margin-top: 32px; }
.case-section__content b { font-weight: 700; color: var(--color-text-primary); }

.case-h2 { font-size: 32px; line-height: 40px; font-weight: 800; color: var(--color-text-primary); text-wrap: balance; }
.case-h2 + * { margin-top: 24px !important; }
.case-h3, .case-h4 { font-size: 18px; line-height: 22px; font-weight: 700; color: var(--color-text-primary); }
.case-h3 + *, .case-h4 + * { margin-top: 24px !important; }

/* Full-width figures (1056) */
.case-figure { margin-left: auto; margin-right: auto; }
.case-figure img { width: 100%; height: auto; }
.case-figure .case-note { margin-top: 16px !important; }

/* Bulleted lists */
.case-list { padding-left: 24px; list-style: disc; }
.case-list li + li { margin-top: 24px; }
.case-list li::marker { color: var(--color-text-primary); }
.case-list--titled strong { display: block; font-weight: 700; color: var(--color-text-primary); }

/* Label/value table card (journey crop, test results, decisions, restrictions) */
.case-table { margin-inline: 0; margin-bottom: 0; padding: 32px; border: 1px solid var(--color-border-default); border-radius: 16px; background: var(--color-bg-page); }
.case-table:first-child { margin-top: 0; }
.case-table > div { display: flex; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--color-border-default); }
.case-table > div + div { padding-top: 24px; }
.case-table > div:last-child { padding-bottom: 0; border-bottom: 0; }
.case-table dt { flex: none; width: 160px; font-size: 14px; line-height: 27px; font-weight: 600; color: #000; }
.case-table dd { margin: 3px 0 0; flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 21px; color: var(--color-text-primary); }
.case-table dd span { display: block; }
.case-table dd span + span { margin-top: 8px; }
.case-table dd b { font-weight: 700; }
.case-table dd.is-quote { font-style: italic; }
.case-table--status dt { width: 112px; }
/* Hidden items: a blurred placeholder, never the real text */
.redacted { filter: blur(4px); opacity: 0.7; user-select: none; pointer-events: none; }

/* Payment status pills (dot + label) */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 21px; font-weight: 700; color: #131313; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status--late::before { background: #CC3333; }
.status--open::before { background: #FF9500; }
.status--paid::before { background: #0A9E5A; }

/* Heuristic cards */
.case-cards { display: flex; flex-direction: column; gap: 16px; }
.case-cards li { padding: 24px; border: 1px solid var(--color-border-default); border-radius: 16px; font-size: 16px; line-height: 27px; }
.case-cards__tag { display: block; margin-bottom: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: #000; }
.case-cards strong { display: block; margin-bottom: 4px; font-size: 18px; line-height: 32px; font-weight: 700; letter-spacing: -0.09px; color: var(--color-text-primary); }

/* Decisions */
.case-decision > * + * { margin-top: 24px; }
.case-decision > p + p { margin-top: 16px; }
.case-decision + .case-decision { margin-top: 72px; }
.case-highlight { color: var(--color-text-primary); }
.case-ui { display: block; width: 100%; height: auto; }
.case-ui--narrow { max-width: 516px; }
.case-ui-pair { display: flex; flex-direction: column; gap: 16px; }
.case-ui--offset { margin-left: auto; }

.case-back-btn { margin-top: 48px !important; }

/* ---------- Tablet + mobile (< 1100) ---------- */
@media (max-width: 1099px) {
  .case > * + * { margin-top: 48px; }
  .case-back { margin: -16px 0 8px; }
  .case-hero__title { font-size: clamp(30px, calc(18.4px + 3.1vw), 48px); line-height: 1.2; }
  .case-hero__lead { font-size: 17px; line-height: 29px; }
  .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
  .case-summary { flex-direction: column; align-items: stretch; gap: 32px; margin-top: 48px; }
  .case-summary__mockup { width: min(280px, 80%); align-self: center; }
  .case-summary__body { padding: 0; }
  .case-stats li { padding: 20px; }

  .case-section { flex-direction: column; gap: 16px; }
  .case-section__label { width: auto; font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
  .case-section__content { max-width: none; font-size: 16px; line-height: 27px; }
  .case-section__content > p + p { margin-top: 16px; }
  .case-h2 { font-size: 26px; line-height: 32px; }
  .case-list li + li { margin-top: 16px; }
  .case-decision + .case-decision { margin-top: 48px; }
  .case-ui--narrow { max-width: none; }
}
@media (max-width: 599px) {
  .case-table { padding: 20px; }
  .case-table > div { flex-direction: column; gap: 4px; }
  .case-table dt, .case-table--status dt { width: auto; }
  .case-table dd { margin-top: 0; }
  .case-cards li { padding: 20px; }
}


/* ---------- Reveal on scroll (same motion as the home; list kept in sync with REVEAL in payment-slip.html) ---------- */
.js-reveal :is(.case-back,
  .case-hero__title,
  .case-hero__lead,
  .case-tags,
  .case-facts > div,
  .case-summary__mockup,
  .case-summary__intro,
  .case-stats li,
  .case-summary__body > .case-note,
  .case-section__label,
  .case-section__content > :not(.case-decision),
  .case-decision > *,
  .case-figure,
  .footer__title,
  .footer__subtitle,
  .footer__links > li,
  .footer__brand):not(.reveal-done) {
  opacity: 0;
  translate: 0 var(--reveal-distance, 16px);
  transition: opacity var(--reveal-duration, 700ms) var(--reveal-ease, var(--ease-out)), translate var(--reveal-duration, 700ms) var(--reveal-ease, var(--ease-out));
  transition-delay: var(--reveal-delay, 0ms);
}
.js-reveal :is(.case-back,
  .case-hero__title,
  .case-hero__lead,
  .case-tags,
  .case-facts > div,
  .case-summary__mockup,
  .case-summary__intro,
  .case-stats li,
  .case-summary__body > .case-note,
  .case-section__label,
  .case-section__content > :not(.case-decision),
  .case-decision > *,
  .case-figure,
  .footer__title,
  .footer__subtitle,
  .footer__links > li,
  .footer__brand).is-revealed:not(.reveal-done) { opacity: 1; translate: 0 0; }
/* Hero comes down from above, like the home hero */
.case-back, .case-hero__title, .case-hero__lead, .case-tags { --reveal-distance: -16px; }

/* ---------- Mockup keeps its proportion ---------- */
.case-summary__mockup img { width: 100%; height: auto; }

/* ---------- Tap-to-zoom figures (active below 1100) ---------- */
.case-zoom { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: inherit; color: inherit; pointer-events: none; }
.case-zoom__hint { display: none; }
.case-lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--color-bg-page); color: var(--color-text-primary); }
.case-lightbox[open] { display: flex; flex-direction: column; }
.case-lightbox::backdrop { background: rgba(0, 0, 0, 0.5); }
.case-lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--color-border-default); }
.case-lightbox__tip { font-size: 14px; line-height: 21px; color: var(--color-text-secondary); }
.case-lightbox__scroller { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; display: flex; align-items: center; padding: 16px; }
.case-lightbox__scroller img { flex: none; height: 100%; max-height: 440px; width: auto; max-width: none; }

@media (max-width: 1099px) {
  .case-zoom { position: relative; pointer-events: auto; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
  .case-zoom:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 4px; border-radius: 16px; }
  .case-zoom__hint {
    position: absolute; right: 12px; bottom: 12px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: var(--radius-full);
    background: rgba(19, 19, 19, 0.8); color: #fff;
    font-size: 12px; line-height: 16px; font-weight: 600;
  }
}
@media (max-width: 599px) {
  .case-facts { grid-template-columns: 1fr; gap: 32px; }
}
