/* PhotoRobot Academy — preview stylesheet
 * Brand identity per https://brandmanual.photorobot.com:
 *   - Primary colors: orange #FF6000, black #000
 *   - Typography: Titillium Web (matches cpq.photorobot.io, dense functional UI + readable body)
 * Output to dist/assets/preview.css by tools/build-preview.mjs. */

@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap');

:root {
  --pr-orange: #FF6000;
  --pr-orange-soft: rgba(255, 96, 0, 0.10);
  --pr-orange-border: rgba(255, 96, 0, 0.35);
  --pr-black: #000;
  --pr-ink: #1a1a1a;
  --pr-ink-muted: #6b6b6b;
  --pr-rule: #e8e6e2;
  --pr-bg: #ffffff;
  --pr-bg-soft: #faf9f7;
  --pr-green: #1e7a4a;
  --pr-green-soft: rgba(71, 209, 140, 0.15);
  --font: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, Menlo, Consolas, 'Courier New', monospace;
  --max-width: 1080px;
  --content-width: 760px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--pr-ink);
  background: var(--pr-bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--pr-orange);
  text-decoration: none;
  transition: text-decoration 0.1s;
}
a:hover { text-decoration: underline; }

.muted { color: var(--pr-ink-muted); }

/* ─── Header / Nav ──────────────────────────────────────── */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--pr-rule);
  background: var(--pr-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
/* Brand block — canonical pattern matching cases.photorobot.io / support.photorobot.io
 * Logo | Tool name (bold uppercase) [Tag (thin uppercase, same size)]
 * The optional tag is unique to Academy preview (other .io sites don't have a build tag). */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand:hover .brand-logo { opacity: 0.85; }
.brand-logo {
  display: block;
  height: 28px;
  width: auto;
  flex-shrink: 0;
}
.brand-sep, .brand-tool, .brand-tag {
  line-height: 28px;            /* match logo height for vertical baseline alignment */
  display: inline-flex;
  align-items: center;
}
.brand-sep {
  color: var(--pr-ink-muted);
  font-weight: 300;
  font-size: 22px;
}
.brand-tool {
  font-weight: 700;
  color: var(--pr-ink);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand-tag {
  font-weight: 300;
  color: var(--pr-ink-muted);
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: 2px;
}

.site-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-switcher {
  display: flex;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding-right: 8px;
  border-right: 1px solid var(--pr-rule);
}
.lang-switcher a {
  color: var(--pr-ink-muted);
  text-decoration: none;
  font-weight: 600;
}
.lang-switcher a.active { color: var(--pr-orange); }
.lang-switcher a:hover { color: var(--pr-ink); }

.site-nav { display: flex; gap: 16px; font-size: 14px; }
.site-nav a {
  color: var(--pr-ink-muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav a:hover { color: var(--pr-ink); text-decoration: none; }
.site-nav a.active {
  color: var(--pr-orange);
  font-weight: 600;
  border-bottom-color: var(--pr-orange);
}

/* ─── Breadcrumbs ───────────────────────────────────────── */
/* Sticky pod headerem — student neztrácí orientaci v hierarchii při scrollu. */

.breadcrumbs-wrap {
  position: sticky;
  top: 57px;                    /* below sticky header (header ~56px + 1px border) */
  background: var(--pr-bg);
  border-bottom: 1px solid var(--pr-rule);
  z-index: 9;                   /* below header (z-index 10) */
}
.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 24px;
  font-size: 13px;
  color: var(--pr-ink-muted);
}
.breadcrumbs a { color: var(--pr-ink-muted); }
.breadcrumbs a:hover { color: var(--pr-orange); }
.breadcrumbs span { color: var(--pr-ink); font-weight: 500; }

/* ─── Main ──────────────────────────────────────────────── */

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ─── Content (textbook/workbook/arch docs) ─────────────── */

.content {
  max-width: var(--content-width);
  margin: 0 auto;
}
.content h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 8px 0 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.content h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 40px 0 12px;
  font-weight: 600;
  padding-top: 8px;
}
.content h2:first-of-type { margin-top: 24px; }
.content h3 {
  font-size: 17px;
  line-height: 1.3;
  margin: 28px 0 8px;
  font-weight: 600;
}
.content h4 {
  font-size: 14px;
  margin: 20px 0 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pr-ink-muted);
}
.content p, .content ul, .content ol { margin: 0 0 16px; }
.content li { margin-bottom: 4px; }
.content li > p { margin-bottom: 8px; }
.content blockquote {
  border-left: 3px solid var(--pr-orange);
  padding: 6px 18px;
  margin: 20px 0;
  background: var(--pr-bg-soft);
  color: var(--pr-ink);
  font-style: italic;
}
.content blockquote p { margin-bottom: 8px; }
.content blockquote p:last-child { margin-bottom: 0; }
.content code {
  background: var(--pr-bg-soft);
  padding: 2px 6px;
  font-size: 0.88em;
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--pr-ink);
}
.content pre {
  background: var(--pr-bg-soft);
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--pr-rule);
  margin: 16px 0;
}
.content pre code {
  background: transparent;
  padding: 0;
  font-size: 13px;
}
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.content th, .content td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--pr-rule);
  vertical-align: top;
}
.content th {
  background: var(--pr-bg-soft);
  font-weight: 600;
  border-bottom: 2px solid var(--pr-rule);
}
.content tr:last-child td { border-bottom: 0; }
.content hr {
  border: none;
  border-top: 1px solid var(--pr-rule);
  margin: 36px 0;
}
.content strong { font-weight: 600; }
.content em { font-style: italic; }
.content ul ul, .content ol ol, .content ul ol, .content ol ul { margin: 4px 0 4px 24px; }
.content img { max-width: 100%; height: auto; }

/* Inline checkboxes from markdown — render as visible */
.content input[type="checkbox"] { margin-right: 8px; }

/* ─── Hero (landing) ────────────────────────────────────── */

.hero {
  margin-bottom: 48px;
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--pr-rule);
}
.hero h1 {
  font-size: 44px;
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-claim {
  font-size: 22px;
  color: var(--pr-orange);
  margin: 0 0 16px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.005em;
}
.hero-sub {
  font-size: 16px;
  color: var(--pr-ink-muted);
  margin: 0 0 16px;
  max-width: 640px;
}
.hero-sub strong { color: var(--pr-ink); }
.preview-banner {
  font-size: 14px;
  padding: 12px 16px;
  background: var(--pr-orange-soft);
  border-left: 3px solid var(--pr-orange);
  color: var(--pr-ink);
  margin-top: 16px;
}
.preview-banner a { color: var(--pr-orange); text-decoration: underline; }

/* ─── Module grid + cards ───────────────────────────────── */

.modules-section, .links-section { margin: 32px 0; }
.modules-section h2, .links-section h2 {
  font-size: 20px;
  margin: 0 0 8px;
  font-weight: 600;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.card {
  display: block;
  border: 1px solid var(--pr-rule);
  border-radius: 6px;
  padding: 16px;
  background: var(--pr-bg);
  color: var(--pr-ink);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--pr-orange);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(20, 20, 20, 0.06);
  text-decoration: none;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--pr-ink-muted);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.card-slug {
  font-family: var(--font-mono);
  text-transform: lowercase;
}
.card-status {
  padding: 2px 7px;
  background: var(--pr-bg-soft);
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 600;
}
.card.status-final .card-status { background: var(--pr-green-soft); color: var(--pr-green); }
.card.status-review .card-status { background: var(--pr-orange-soft); color: var(--pr-orange); }
.card.status-draft .card-status { background: var(--pr-bg-soft); }
.card-title {
  font-size: 17px;
  margin: 0 0 6px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--pr-ink);
}
.card-meta { font-size: 13px; color: var(--pr-ink-muted); margin: 0; }
.card-roles { font-size: 11px; color: var(--pr-ink-muted); margin: 6px 0 0; letter-spacing: 0.02em; }

.reference-links { padding-left: 20px; }
.reference-links li { margin: 6px 0; }

/* ─── Module overview page ──────────────────────────────── */

.module-overview .module-status {
  font-size: 13px;
  color: var(--pr-ink-muted);
  margin: 0 0 4px;
}
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--pr-bg-soft);
}
.status-pill.status-final { background: var(--pr-green-soft); color: var(--pr-green); }
.status-pill.status-review { background: var(--pr-orange-soft); color: var(--pr-orange); }

.module-overview .module-tagline {
  color: var(--pr-ink-muted);
  margin-top: -4px;
  margin-bottom: 16px;
}
.module-files {
  list-style: none;
  padding: 0;
}
.module-files li {
  margin: 8px 0;
}
.module-files a {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--pr-rule);
  border-radius: 4px;
  color: var(--pr-ink);
  background: var(--pr-bg);
  transition: border-color 0.15s, background 0.15s;
}
.module-files a:hover {
  border-color: var(--pr-orange);
  background: var(--pr-bg-soft);
  text-decoration: none;
}
.module-files .private-note {
  padding: 12px 16px;
  border: 1px dashed var(--pr-rule);
  border-radius: 4px;
  color: var(--pr-ink-muted);
  font-style: italic;
  font-size: 14px;
}
.module-overview dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  font-size: 14px;
  margin: 12px 0;
}
.module-overview dt { color: var(--pr-ink-muted); }
.module-overview dd { margin: 0; }

/* ─── Quiz pool ─────────────────────────────────────────── */

.quiz-pool .preview-note-box {
  background: var(--pr-orange-soft);
  border: 1px solid var(--pr-orange-border);
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--pr-ink);
}

/* Quiz options rendered as markdown list items.
 * Convention v0.4.2+: each option = own list item, correct answer is bold + " ← CORRECT" suffix. */
.quiz-pool ul {
  list-style: none;
  padding-left: 0;
  margin: 12px 0 20px;
}
.quiz-pool ul li {
  padding: 8px 12px 8px 16px;
  margin: 4px 0;
  border-left: 3px solid var(--pr-rule);
  background: var(--pr-bg-soft);
  font-size: 15px;
  line-height: 1.5;
}
.quiz-pool ul li strong {
  font-weight: 600;
}
/* Correct option = bold + arrow; highlight with green left border */
.quiz-pool ul li:has(> strong:last-child) {
  border-left-color: var(--pr-green);
  background: var(--pr-green-soft);
}
/* Task-list items (true-false / multi-select) — visual checkboxes */
.quiz-pool ul li.task-list-item {
  list-style: none;
}
.quiz-pool ul li.task-list-item input[type="checkbox"] {
  margin-right: 10px;
  vertical-align: -1px;
  cursor: not-allowed;          /* preview render is non-interactive */
}
.quiz-pool ul li.task-list-item input[type="checkbox"]:checked + * {
  font-weight: 600;
}

/* Workbook task-list items (Exercise 6 checklist, exercises with checkboxes) */
.workbook ul li.task-list-item {
  list-style: none;
  padding: 4px 0;
}
.workbook ul li.task-list-item input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: -1px;
  cursor: not-allowed;
}

/* Source / Explanation labels in quiz */
.quiz-pool p strong:first-child {
  color: var(--pr-orange);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

/* ─── Footer ────────────────────────────────────────────── */

/* Footer pattern per cases.photorobot.io / CPQ canonical:
 * Single row (white-space: nowrap), build-info left, links right with ↗ suffix.
 * Mobile (<640px) stacks vertically. */
.site-footer {
  border-top: 1px solid var(--pr-rule);
  padding: 14px 24px 18px;
  margin-top: 64px;
  font-size: 12px;
  color: var(--pr-ink-muted);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
.footer-build {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.75;
  margin: 0;
  letter-spacing: 0.02em;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.footer-links a {
  color: var(--pr-ink-muted);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--pr-orange); }
.footer-sep { color: var(--pr-rule); }

/* External link arrow — ↗ unicode appended via ::after.
 * Match CPQ pattern (e.g., "photorobot.io ↗"). */
a.ext::after {
  content: " \2197";              /* ↗ NORTH EAST ARROW (U+2197) */
  font-size: 0.85em;
  opacity: 0.7;
  display: inline-block;
  margin-left: 1px;
}
a.ext:hover::after { opacity: 1; }

/* ─── Workbook — interactive fill-in fields (v0.4.4+) ────── */
/* Underscore patterns _____ in workbook markdown are post-processed by
 * tools/build-preview.mjs into <input class="wb-fill"> elements with
 * data-key attribute. Inline script handles localStorage persistence
 * + Reset button. Task-list checkboxes are enabled at runtime (the
 * markdown-it-task-lists plugin renders them disabled by default). */

.wb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 28px;
  background: var(--pr-bg-soft);
  border: 1px solid var(--pr-rule);
  border-radius: 4px;
  font-size: 13px;
  gap: 16px;
  flex-wrap: wrap;
}
.wb-notice {
  color: var(--pr-ink-muted);
  flex: 1 1 auto;
  min-width: 200px;
}
.wb-notice strong { color: var(--pr-ink); }
.wb-reset-btn {
  font-family: inherit;
  font-size: 11px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--pr-rule);
  border-radius: 3px;
  color: var(--pr-ink-muted);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.wb-reset-btn:hover {
  border-color: var(--pr-orange);
  color: var(--pr-orange);
  background: var(--pr-bg);
}
.wb-fill {
  display: inline-block;
  border: none;
  border-bottom: 1px solid var(--pr-ink-muted);
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  color: var(--pr-ink);
  padding: 2px 6px;
  margin: 0 2px;
  min-width: 140px;
  transition: border-color 0.15s, background 0.15s, border-bottom-width 0.05s;
}
.wb-fill:hover {
  background: var(--pr-bg-soft);
}
.wb-fill:focus {
  outline: none;
  border-bottom-color: var(--pr-orange);
  border-bottom-width: 2px;
  background: var(--pr-orange-soft);
}
/* In table cells, fill-in spans the cell width */
.workbook table .wb-fill {
  width: 100%;
  margin: 0;
  min-width: 0;
}
/* In blockquotes (Exercise 2 pattern: > Label: _____), wider input */
.workbook blockquote .wb-fill {
  min-width: 200px;
}
/* Workbook task-list checkboxes are interactive (Exercise 6 pre-flight checklist) */
.workbook .task-list-item input[type="checkbox"] {
  cursor: pointer;
  margin-right: 8px;
  vertical-align: -1px;
  accent-color: var(--pr-orange);
}
.workbook .task-list-item input[type="checkbox"]:hover {
  outline: 2px solid var(--pr-orange-soft);
  outline-offset: 2px;
}

/* ─── Scroll arrows — float right side of viewport ──────── */
/* Visible only when page is taller than 1.5× viewport. Up disabled
 * when at top, Down disabled when at bottom. JS in shell template. */

.scroll-arrows {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.scroll-arrows.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--pr-rule);
  background: var(--pr-bg);
  color: var(--pr-ink-muted);
  font-size: 18px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  line-height: 1;
  padding: 0;
}
.scroll-arrow:hover {
  border-color: var(--pr-orange);
  color: var(--pr-orange);
  background: var(--pr-bg-soft);
}
.scroll-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.scroll-arrow:disabled:hover {
  border-color: var(--pr-rule);
  color: var(--pr-ink-muted);
  background: var(--pr-bg);
}

/* ─── Mobile ────────────────────────────────────────────── */

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }
  .site-tools { flex-direction: column; gap: 8px; }
  .lang-switcher { border-right: none; padding-right: 0; }
  .site-nav { flex-wrap: wrap; justify-content: center; gap: 12px; }
  .breadcrumbs-wrap { top: 120px; }   /* taller header on mobile when stacked */
  .breadcrumbs { padding: 8px 16px; }
  .site-main { padding: 24px 16px 48px; }
  .hero h1 { font-size: 32px; }
  .hero-claim { font-size: 18px; }
  .content h1 { font-size: 26px; }
  .content h2 { font-size: 19px; }
  .module-overview dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .module-overview dt { font-weight: 600; margin-top: 8px; }
  .module-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; white-space: normal; }
  .footer-links { flex-wrap: wrap; }
  .scroll-arrows { right: 10px; }
  .scroll-arrow { width: 34px; height: 34px; font-size: 16px; }
  .wb-toolbar { padding: 10px 12px; }
}

/* ─── Print ─────────────────────────────────────────────── */
/* Goal v0.4.2: usable basic print for self-study / take-home.
 * Adaptive paper size (let browser print dialog choose A4 / US Letter via @page size:auto).
 * Pagination v0.6+ (Worker migration) will add: per-module workbook PDF download,
 * page-break-after on H2 section boundaries, header/footer with module slug + page N/M. */

@page {
  margin: 18mm 18mm 22mm 18mm;     /* generous bottom for footer */
}

@media print {
  .site-header, .site-nav, .site-footer, .breadcrumbs-wrap, .breadcrumbs, .preview-banner, .preview-note-box,
  .scroll-arrows, .wb-toolbar, .wb-reset-btn {
    display: none;
  }
  .site-main { padding: 0; max-width: 100%; }
  .content { max-width: 100%; }
  body { font-size: 10.5pt; color: black; }
  .content h1 { font-size: 20pt; page-break-after: avoid; }
  .content h2 { font-size: 14pt; page-break-after: avoid; margin-top: 24pt; }
  .content h3 { font-size: 12pt; page-break-after: avoid; }
  .content blockquote { page-break-inside: avoid; }
  .content table, .content pre { page-break-inside: avoid; }
  .content ul, .content ol { page-break-inside: avoid; }
  a { color: black; text-decoration: underline; }
  /* Quiz: print correct-answer highlight as bold + outline (no color reliance) */
  .quiz-pool ul li {
    background: transparent;
    border-left: 2px solid #ccc;
  }
  .quiz-pool ul li:has(> strong:last-child) {
    border-left: 2px solid black;
    border-left-width: 3px;
  }
  /* Workbook: ensure fill-in lines are visible (underscores in source render fine) */
  .workbook hr { border-top-color: #999; }
  /* Module overview meta dl: side-by-side stays */
  .module-overview dl { grid-template-columns: 160px 1fr; }
}
