/* /case-study/representation/: the full SS18 representation, both volumes, in Evidently's design.
   The text, tables and figures come unchanged from representation/volume-1.html and volume-2.html. */

.rep-page { max-width: 1760px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 96px; }

/* Hero */
.rep-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: start; padding: 56px 0 56px; border-bottom: 1px solid #D9D5CA; }
.rep-hero-text { display: flex; flex-direction: column; gap: 22px; }
.rep-eyebrow { margin: 0; font-family: 'IBM Plex Mono', monospace; font-size: 16px; letter-spacing: 0.1em; color: #A4461F; }
.rep-hero h1 { margin: 0; font-family: 'Newsreader', Georgia, serif; font-weight: 500; font-size: clamp(40px, 5.2vw, 72px); line-height: 1.04; letter-spacing: -0.02em; color: #16191D; }
.rep-sub { margin: 0; font-family: 'Newsreader', Georgia, serif; font-size: clamp(22px, 2vw, 28px); line-height: 1.3; color: #16191D; max-width: 34em; }
.rep-lead { margin: 0; font-size: 19px; line-height: 1.6; color: #3E444A; max-width: 62ch; }
.rep-downloads { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.rep-btn { display: inline-flex; align-items: center; min-height: 52px; padding: 10px 22px; border-radius: 6px; font-size: 16px; font-weight: 500; line-height: 1.3; text-decoration: none; }
.rep-btn.primary { background: #1F4E5F; color: #FFFFFF; }
.rep-btn.primary:hover { background: #143642; color: #FFFFFF; }
.rep-btn.secondary { border: 1px solid #16191D; color: #16191D; }
.rep-btn.secondary:hover { background: #E9E6DD; color: #16191D; }
.rep-stats { display: flex; flex-direction: column; gap: 18px; padding: 28px; background: #FFFFFF; border: 1px solid #D9D5CA; border-radius: 12px; }
.rep-stats dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 28px; margin: 0; }
.rep-stats dl > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding-top: 14px; border-top: 2px solid #16191D; }
.rep-stats dt { font-size: 15px; line-height: 1.45; color: #3E444A; }
.rep-stats dd { margin: 0; font-family: 'Newsreader', Georgia, serif; font-size: clamp(36px, 3.4vw, 48px); line-height: 1; color: #1F4E5F; }
.rep-stats-note { margin: 0; padding-top: 16px; border-top: 1px solid #E2DED4; font-size: 15px; line-height: 1.55; color: #5A6067; }

/* Body and contents */
.rep-layout { display: grid; grid-template-columns: minmax(0, 1fr) 25rem; gap: 3.5rem; align-items: start; padding-top: 48px; }
.rep-toc { position: sticky; top: 112px; max-height: calc(100vh - 136px); overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 18px; background: #FFFFFF; border: 1px solid #D9D5CA; border-radius: 12px; font-size: 15px; line-height: 1.4; }
.rep-toc-title { margin: 0 0 12px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: 0.1em; color: #A4461F; }
.rep-toc .rep-toc-vol { display: block; margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid #E2DED4; font-family: 'Newsreader', Georgia, serif; font-size: 19px; font-weight: 600; color: #16191D; text-decoration: none; }
.rep-toc .rep-toc-vol:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.rep-toc .rep-toc-vol:hover { color: #1F4E5F; text-decoration: underline; }
.rep-toc ul { list-style: none; margin: 0; padding: 0; }
.rep-toc li { margin: 0; padding: 0; }
.rep-toc a { display: block; padding: 4px 0; color: #16191D; text-decoration: none; }
.rep-toc a:hover { color: #1F4E5F; text-decoration: underline; text-underline-offset: 3px; }
.rep-toc > ul > li > a { font-weight: 600; }
.rep-toc ul ul { padding-left: 14px; margin: 2px 0 6px; border-left: 1px solid #E2DED4; }
.rep-toc ul ul a { font-weight: 400; color: #3E444A; padding: 3px 0; }

.rep-body { min-width: 0; font-size: 17px; line-height: 1.65; color: #3E444A; }
.rep-body p, .rep-body li { max-width: 85ch; }
.rep-body p, .rep-body li, .rep-body h2, .rep-body h3, .rep-body h4, .rep-figure figcaption { overflow-wrap: break-word; } /* long document URLs in Appendix A */
.rep-body p { margin: 0 0 14px; }
.rep-body ul, .rep-body ol { padding-left: 1.4em; margin: 0 0 16px; }
.rep-body li { margin: 0 0 6px; }
.rep-body strong { color: #16191D; }
.rep-body a { color: #1F4E5F; text-underline-offset: 2px; }
.rep-body h2, .rep-body h3, .rep-body h4 { color: #16191D; }
.rep-body h2 { margin: 64px 0 18px; font-family: 'Newsreader', Georgia, serif; font-weight: 500; font-size: clamp(30px, 2.6vw, 40px); line-height: 1.12; }
.rep-body h3 { margin: 44px 0 14px; font-family: 'Newsreader', Georgia, serif; font-weight: 500; font-size: clamp(24px, 1.9vw, 29px); line-height: 1.2; }
.rep-body h4 { margin: 32px 0 10px; font-size: 18px; font-weight: 600; line-height: 1.35; }
.rep-body > :first-child { margin-top: 0; }
.rep-body #volume-1-the-representation, .rep-body #volume-2-supporting-schedules-and-analyses { margin-top: 0; padding: 0 0 16px; border-bottom: 2px solid #16191D; font-size: clamp(36px, 3.4vw, 52px); }
.rep-body #volume-2-supporting-schedules-and-analyses { margin-top: 96px; }

/* Tables: full body width, scroll sideways on small screens */
.rep-body .rep-caption { max-width: none; margin: 32px 0 8px; font-size: 15px; font-weight: 600; line-height: 1.4; color: #16191D; }
.rep-table-wrap { overflow-x: auto; margin: 0 0 32px; background: #FFFFFF; border: 1px solid #D9D5CA; border-radius: 8px; -webkit-overflow-scrolling: touch; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.rep-table th, .rep-table td { padding: 10px 12px; border: 1px solid #E2DED4; text-align: left; vertical-align: top; }
.rep-table tr > :first-child { border-left: 0; }
.rep-table tr > :last-child { border-right: 0; }
.rep-table thead tr:first-child > *, .rep-table > tr:first-child > *, .rep-table tbody:first-child tr:first-child > * { border-top: 0; }
.rep-table tr:last-child > * { border-bottom: 0; }
.rep-table th, .rep-table thead td { background: #E9E6DD; color: #16191D; font-weight: 600; }
.rep-table p, .rep-table li { max-width: none; }
.rep-table p { margin: 0 0 6px; }
.rep-table td > :first-child, .rep-table th > :first-child { margin-top: 0; }
.rep-table td > :last-child, .rep-table th > :last-child { margin-bottom: 0; }

/* Figures and photographs */
.rep-figure { margin: 32px 0 44px; }
.rep-figure-link { display: block; }
/* Full body width; the width and height attributes reserve the space before a lazy image loads, so anchor jumps land true. */
.rep-figure img { display: block; width: 100%; height: auto; background: #FFFFFF; border: 1px solid #D9D5CA; border-radius: 6px; }
.rep-figure img.rep-tall { max-width: 640px; }
.rep-figure figcaption { max-width: 85ch; margin-top: 10px; font-size: 14px; line-height: 1.55; color: #5A6067; }

/* Appendix F: one defect clearly separate from the next */
.rep-body .rep-defect { margin: 18px 0 0; padding: 2px 0 2px 16px; border-left: 3px solid #D9D5CA; }

/* Landing on an anchor: sit below the header and flash the target */
.rep-body [id] { scroll-margin-top: 16px; }
@keyframes rep-flash { 0%, 30% { background-color: #F3DFB8; } 100% { background-color: transparent; } }
.rep-body :target, .rep-body .rep-flash { animation: rep-flash 2.5s ease-out; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .rep-body :target, .rep-body .rep-flash { animation: none; background-color: #F3DFB8; } }

.rep-back { margin: 72px 0 0; padding-top: 24px; border-top: 1px solid #D9D5CA; font-size: 17px; }

@media (max-width: 1150px) { .rep-layout { grid-template-columns: minmax(0, 1fr) 21rem; gap: 2.5rem; } }
@media (max-width: 959px) {
  .rep-hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 36px 0 40px; }
  .rep-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; }
  .rep-toc { order: -1; position: static; max-height: none; overflow: visible; }
  .rep-body { font-size: 16px; }
  .rep-body h2 { margin-top: 48px; }
  .rep-body #volume-2-supporting-schedules-and-analyses { margin-top: 64px; }
}
@media (max-width: 560px) {
  .rep-stats { padding: 20px; }
  .rep-stats dl { gap: 18px 18px; }
  .rep-btn { width: 100%; }
  .rep-table { font-size: 14px; }
  .rep-table th, .rep-table td { padding: 8px 10px; }
}

/* Supplementary representations (SS18 and SS03): one document, a short contents list, a compact numbered source list */
.rep-related { margin: 4px 0 0; font-size: 16px; line-height: 1.5; }
.rep-related a { color: #1F4E5F; text-underline-offset: 2px; }
.rep-note { padding: 14px 18px; background: #E9E6DD; border-radius: 8px; font-size: 16px; line-height: 1.55; color: #3E444A; }
.rep-body .rep-refs { padding-left: 2.4em; font-size: 15px; line-height: 1.5; }
.rep-body .rep-refs li { margin: 0 0 10px; max-width: none; overflow-wrap: anywhere; }
.rep-body .rep-form { margin: 0 0 32px; padding: 20px 24px; background: #FFFFFF; border: 1px solid #D9D5CA; border-radius: 10px; }
.rep-body .rep-form p { margin: 0 0 8px; }
.rep-body h4[id^="ref-"] { margin: 18px 0 2px; font-size: 16px; line-height: 1.4; }
.rep-body h4[id^="ref-"] + p { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
