/* Demo "kursplan": the "Skolverkets original" dialog (kursplan-source.css) and the entrance of the Kursplan overview (anchored-popover.css). */

/* The overview popover (AnchoredPopover fades in 4 px up); the kit's .rp-cov draws it and its content, as kursplan-coverage.css (PR #229) */
.kursplan-cov:not([hidden]) { animation: kursplan-cov-in var(--rp-dur) var(--rp-ease); }
@keyframes kursplan-cov-in { from { opacity: 0; translate: 0 -4px; } }

.kursplan-d-head { gap: 20px; padding: 20px 24px 16px; border-bottom: 0; }
.kursplan-d-head .rp-dialog-title { letter-spacing: normal; }
.kursplan-d-head .rp-dialog-sub { margin-top: 5px; font-size: 14px; }
.kursplan-d-head .rp-btn { flex: none; }
.kursplan-d-summary { flex: none; padding: 0 24px 12px; }
.kursplan-d-meta { margin: 0 0 10px; font-size: 12px; color: var(--rp-text-3); line-height: 1.5; }
.kursplan-d-summary blockquote { max-width: 75ch; margin: 0; font-size: 15px; line-height: 1.55; }
.kursplan-d-linkrow { flex: none; padding: 0 24px 18px; }
.kursplan-d-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--rp-accent); text-decoration: underline; text-underline-offset: 3px; }
.kursplan-d-tools { display: flex; align-items: center; flex: none; min-height: 44px; padding: 6px 20px; border-block: 1px solid var(--rp-line); }

/* The PDF: the app's pages (.pdf-pages, .pdf-sheet) on the desk; Skolverket's own page, drawn by pdf.js */
.kursplan-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--rp-desk); }
.kursplan-scroller {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; container: kps / size;
  --kp-pad: 28px; --kp-w: min(979.2px, calc(100cqw - 56px));
}
.kursplan-pages { display: flex; flex-direction: column; align-items: center; min-width: min-content; padding: var(--kp-pad) 28px 28px; gap: 24px; }
.kursplan-sheet {
  position: relative; flex: none; width: var(--kp-w); aspect-ratio: 612 / 792; border-radius: 2px; background: #fff; line-height: 0;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 2px 4px rgba(0, 0, 0, 0.06), 0 14px 34px rgba(0, 0, 0, 0.12);
}
.kursplan-sheet img { display: block; width: 100%; height: 100%; border-radius: 2px; }
.kursplan-mark { position: absolute; z-index: 1; pointer-events: none; background: rgb(255 208 0 / 0.28); outline: 1px solid rgb(158 111 0 / 0.65); }
.kursplan-mark-1 { left: 11.7647%; top: 30.5063%; width: 79.1529%; height: 1.697%; }
.kursplan-mark-2 { left: 11.7647%; top: 32.3106%; width: 16.8824%; height: 1.697%; }
/* As PdfPreview.tsx: the point's lines sit in the middle of the view (the scroller's end mark and the scroll margin) */
.kursplan-focus { position: absolute; left: 0; top: 32.257%; width: 0; height: 0; scroll-margin-top: 50cqh; }
.kursplan-empty { position: absolute; inset: 0; display: grid; place-content: center; padding: 32px; text-align: center; font-size: 14px; }
.kursplan-empty p { margin: 0; }

.kursplan-modal.is-loading .kursplan-d-tools { display: none; }
.kursplan-modal.is-loading .kursplan-pages { visibility: hidden; }
.kursplan-modal:not(.is-loading) .kursplan-empty { display: none; }
.kursplan-modal:not(.is-loading) .kursplan-sheet { animation: kursplan-sheet-in 0.3s var(--rp-ease); }
@keyframes kursplan-sheet-in { from { opacity: 0.55; } to { opacity: 1; } }

/* Phone (kursplan-source.css, max-width: 600px): the dialog fills the screen, the page stays at "Bredd"; the app's strip of page 4 is empty desk here (--kp-pad) */
@container rp (max-width: 600px) {
  .kursplan-d-head { padding: 16px 16px 12px; gap: 12px; }
  .kursplan-d-head .rp-dialog-title { font-size: 18px; }
  .kursplan-d-head .rp-dialog-sub { font-size: 13px; }
  .kursplan-d-summary { padding: 0 16px 12px; max-height: calc(var(--rp-vh) * 0.3); overflow: hidden; }
  .kursplan-d-summary blockquote { font-size: 14px; line-height: 1.5; }
  .kursplan-d-linkrow { padding: 0 16px 14px; }
  .kursplan-d-tools { padding-inline: 12px; }
  .kursplan-d-tools .rp-page-label, .kursplan-d-tools .rp-divider { display: none; }
  .kursplan-scroller { --kp-pad: 16px; }
  .kursplan-pages { padding-inline: 12px; padding-bottom: 28px; }
}
