/* Kuntotarkastusraportin esittely: sivu sivulta -selain (Kuntotarkastus-sivu) */
.rp { position: relative; padding: 136px 40px 128px; background: var(--surface-inverse); color: var(--on-inverse); overflow: hidden; }
.rp::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 520px at 78% 30%, rgba(237, 31, 36, 0.10), transparent 70%); pointer-events: none; }
.rp-wrap { position: relative; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 64px; }

.rp-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px 64px; align-items: end; }
.rp-kicker { margin: 0 0 18px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #ff5a5f; }
.rp-kicker::before { content: ""; width: 8px; height: 8px; background: var(--brand-red); transform: rotate(45deg); }
.rp-h { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 56px; line-height: 1.02; letter-spacing: -0.028em; text-wrap: balance; }
.rp-lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--on-inverse-muted); }

.rp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, 0.14); border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.rp-stat { display: flex; flex-direction: column; gap: 6px; padding: 26px 24px 26px 0; }
.rp-stat + .rp-stat { padding-left: 24px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.rp-stat strong { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rp-stat span { font-size: 14.5px; line-height: 1.45; color: var(--on-inverse-muted); }

.rp-viewer { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 72px; align-items: start; }

/* Lukujen lista */
.rp-chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rp-ch { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.rp-ch:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.rp-ch-btn { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; column-gap: 12px; align-items: baseline; padding: 18px 0; border: 0; background: none; color: var(--on-inverse-muted); font: inherit; text-align: left; cursor: pointer; transition: color 0.25s; }
.rp-ch-btn:hover { color: var(--on-inverse); }
.rp-ch-no { font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.rp-ch-t { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.25; }
.rp-ch-arrow { justify-self: end; font-size: 16px; opacity: 0; transform: translateX(-6px); transition: opacity 0.25s, transform 0.25s; }
.rp-ch-d { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.rp-ch-d > div { overflow: hidden; }
.rp-ch-d p { margin: 0; padding: 0 0 22px 56px; font-size: 16px; line-height: 1.6; color: var(--on-inverse-muted); max-width: 520px; }
.rp-ch-d b { color: var(--on-inverse); font-weight: 600; }
.rp-ch.is-on .rp-ch-btn { color: var(--on-inverse); }
.rp-ch.is-on .rp-ch-no { color: #ff5a5f; }
.rp-ch.is-on .rp-ch-arrow { opacity: 1; transform: none; color: #ff5a5f; }
.rp-ch.is-on .rp-ch-d { grid-template-rows: 1fr; }

/* Sivun näyttämö */
.rp-stage-col { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 22px; }
.rp-stage { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1241 / 1754; }
.rp-sheet { position: absolute; inset: 0; border-radius: 4px; background: #e9e6e2; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.rp-sheet.s1 { transform: translate(18px, 14px) rotate(2.6deg); opacity: 0.5; }
.rp-sheet.s2 { transform: translate(9px, 7px) rotate(1.2deg); opacity: 0.8; }
.rp-page { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: #fff; cursor: zoom-in; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 40px 80px rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transform: translateY(18px) rotate(-0.6deg) scale(0.985); transition: opacity 0.55s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.55s; }
.rp-page img { width: 100%; height: 100%; display: block; object-fit: cover; }
.rp-page.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.55s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s; z-index: 2; }
.rp-page:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 4px; }

.rp-note { position: absolute; z-index: 3; left: -36px; bottom: 44px; max-width: 280px; display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 10px; background: rgba(28, 26, 26, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); color: var(--on-inverse); font-size: 14px; line-height: 1.5; pointer-events: none; }
.rp-note::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; background: var(--brand-red); transform: rotate(45deg); }

.rp-controls { width: 100%; max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rp-count { font-size: 14px; color: var(--on-inverse-muted); font-variant-numeric: tabular-nums; }
.rp-count b { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--on-inverse); margin-right: 4px; }
.rp-nav { display: flex; gap: 10px; }
.rp-ibtn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: var(--on-inverse); cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
.rp-ibtn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }
.rp-ibtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rp-zoom { height: 48px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: var(--on-inverse); font: 500 14px/1 var(--font-body); cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
.rp-zoom:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }
.rp-zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rp-cap { margin: 0; text-align: center; font-size: 13px; color: var(--on-inverse-muted); }
.rp-now { display: none; }

.rp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.rp-foot p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--on-inverse-muted); max-width: 640px; }
.rp-foot p b { color: var(--on-inverse); font-weight: 600; }

/* Suurennus */
.rp-lb { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; gap: 20px; padding: 24px; background: rgba(14, 13, 13, 0.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: rp-fade 0.25s ease; }
.rp-lb-img { max-height: calc(100vh - 48px); max-width: min(900px, calc(100vw - 180px)); width: auto; height: auto; display: block; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); background: #fff; }
.rp-lb-close { position: absolute; top: 18px; right: 18px; }
.rp-lb .rp-ibtn { flex: none; background: rgba(28, 26, 26, 0.7); }
@keyframes rp-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1080px) {
  .rp-head { grid-template-columns: 1fr; }
  .rp-viewer { grid-template-columns: 1fr; gap: 40px; }
  .rp-stage-col { position: static; order: -1; }
  .rp-note { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
@media (max-width: 720px) {
  .rp { padding: 88px 20px 88px; }
  .rp-wrap { gap: 44px; }
  .rp-h { font-size: 36px; }
  .rp-lead { font-size: 16.5px; }
  .rp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-stat { padding: 20px 12px 20px 0; }
  .rp-stat + .rp-stat { padding-left: 16px; }
  .rp-stat:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .rp-stat:nth-child(4) { border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .rp-stat strong { font-size: 32px; }
  .rp-note { display: none; }
  .rp-now { display: block; margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--on-inverse-muted); }
  .rp-now b { display: block; margin-bottom: 4px; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--on-inverse); }
  .rp-chapters { display: none; }
  .rp-lb { padding: 12px; gap: 8px; flex-direction: column; }
  .rp-lb-img { max-width: calc(100vw - 24px); max-height: calc(100vh - 120px); }
  .rp-lb-prev, .rp-lb-next { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-page, .rp-page.is-on, .rp-ch-d, .rp-ch-arrow { transition: none; }
  .rp-lb { animation: none; }
}
