:root {
  --paper: #f8f3e9;
  --ink: #243a3d;
  --terra: #90452e;
  --line: #d6cabb;
  --muted: #5f5c52;
  --panel: #f0e8da;
  --gutter: clamp(16px, 5vw, 72px);
}

* { min-width: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: auto; scroll-padding-top: 76px; }
body { font-size: 17px; line-height: 1.55; }

a { text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .14em; }
button, .primary { min-height: 44px; font: inherit; line-height: 1.25; }
button { border-color: #b5aa9b; }
button:disabled { opacity: .55; cursor: default; }
button:disabled:hover { background: transparent; color: inherit; }
.primary { display: inline-flex; align-items: center; gap: 0; padding: 12px 20px; }
.primary:hover { background: #355355; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 12px; background: white; transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }

.site-header {
  min-height: 64px;
  padding: 8px var(--gutter);
  justify-content: space-between;
  gap: 12px;
  background: #f8f3e9;
}
.site-header .brand {
  margin: 0;
  font-family: Georgia, serif;
  letter-spacing: 0;
  font-weight: normal;
  font-size: 1.35rem;
  line-height: 1;
  white-space: nowrap;
  gap: 10px;
}
.site-header .mark { color: var(--terra); font-size: 2rem; line-height: 1; }
.header-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.header-actions a, .header-actions button { font-size: .92rem; }
.header-topics { display: inline-flex; align-items: center; min-height: 44px; padding: 0 9px; }

#sakums { max-width: 1520px; }
.course-hero {
  display: grid;
  align-items: center;
  grid-template-columns: .92fr 1.08fr;
  gap: clamp(28px, 5vw, 74px);
  padding: clamp(34px, 6vw, 78px) var(--gutter) clamp(32px, 5vw, 58px);
}
.course-hero .tag, .stage-context, .pair-options .tag {
  color: var(--terra);
  font-size: .85rem;
  letter-spacing: .035em;
  font-weight: 700;
  margin: 0 0 12px;
}
.course-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.75rem, 5.45vw, 5.65rem);
  line-height: 1;
  letter-spacing: -.046em;
}
.course-hero em { display: block; }
.course-hero .lead {
  max-width: 35ch;
  margin: 0 0 18px;
  color: #475455;
  font: inherit;
  font-size: 1.16em;
}
.course-cover { background: #253b3d; color: var(--paper); }
.course-cover img { display: block; width: 100%; height: clamp(255px, 31vw, 490px); object-fit: cover; object-position: 55% center; }
.course-cover figcaption { padding: 12px 16px; font-size: .88rem; }
.home-topics { padding: 25px var(--gutter) 52px; border-top: 1px solid var(--line); }
.home-topics h2 { margin: 0 0 16px; }
#home-lessons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
#home-lessons a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 17px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-top: 3px solid #8c5140;
  background: #fffaf1;
}
#home-lessons strong { font-family: Georgia, serif; font-weight: normal; font-size: 1.24em; line-height: 1.22; }
#home-lessons span { color: var(--muted); font-size: .93em; }
#home-lessons a:hover { background: var(--panel); }

.course-navigation { padding: 18px var(--gutter) 0; }
#course-lessons, #course-stages { display: flex; flex-wrap: wrap; gap: 8px; }
#course-lessons a, #course-stages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  text-decoration: none;
  line-height: 1.25;
}
#course-lessons a { flex: 1 1 auto; }
#course-lessons a:hover, #course-stages a:hover { background: var(--panel); }
#course-lessons a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
#course-stages { padding: 13px 0 0; }
#course-stages a[aria-current] { color: #803a24; background: #f2e2d5; border-color: #a05539; font-weight: 700; }

.lesson-stage { padding: 28px var(--gutter) 35px; }
.lesson-stage h2 { max-width: 27ch; margin: 0 0 14px; font-size: clamp(2rem, 4vw, 3.4rem); }
.lesson-stage h3 { margin: 0 0 12px; }
.lesson-stage > p, .lesson-stage .outcome { max-width: 72ch; }
.lesson-stage h2:focus, .lesson-stage h3:focus, #topics-heading:focus, .course-hero h1:focus { outline: none; }
.lesson-stage article { padding: 0; }
.lesson-stage .block { margin: 24px 0; scroll-margin-top: 6px; }
.lesson-stage > .block:nth-child(2) { margin-top: 0; }
.lesson-stage p { margin-top: 0; }
.lesson-stage .block > :last-child { margin-bottom: 0; }
.lesson-stage .panel { padding: clamp(15px, 2.1vw, 27px); }
.lesson-stage details { padding: 12px 15px; }
.lesson-stage details p, .lesson-stage summary { font-size: 1em; }
.lesson-stage summary { min-height: 38px; padding: 7px 0; line-height: 1.35; }
.lesson-stage details[open] > summary { margin-bottom: 10px; }
.lesson-stage details > details { margin-top: 8px; }
.lesson-stage .caption { color: var(--muted); font-size: .85em; line-height: 1.45; }
.lesson-stage figure > img { max-width: 100%; }
.lesson-stage figure figcaption { margin-top: 6px; }
.lesson-stage .two { gap: clamp(10px, 2.2vw, 28px); }
.lesson-stage .map { display: block; height: auto; }
.lesson-stage .map + p { margin-top: 8px; }
.lesson-stage .map text { font-size: 17px; }
.lesson-stage .hero-cell { font-weight: bold; }
.resource-drawer { background: #fffaf1; }
.lesson-stage details .block { margin: 12px 0 0; }
.lesson-stage .fresco-card h4 { font-size: 1.15em; }
.lesson-stage .fresco-card button { display: block; }
.lesson-stage .fresco-card button:hover, .lesson-stage .object-image:hover { background: #e9dfce; }
.lesson-stage .fresco-card img { object-fit: contain; }

.study-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 4vw, 48px); align-items: start; }
.object-image { width: 100%; padding: 0; background: #eee6d8; border: 1px solid var(--line); display: block; }
.object-image img { display: block; width: 100%; height: clamp(230px, 35vw, 470px); object-fit: contain; }
.terms { padding: 0; margin: 14px 0; }
.terms div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.terms dt { font-weight: bold; }
.terms dd { margin: 3px 0 0; }
.museum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.museum-grid .panel h3 { font-size: 1.3em; line-height: 1.18; }
.museum-grid .panel p { margin: 0; }

.assessment { max-width: 60rem; }
.course-quiz { max-width: 60rem; }
.question { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; margin: 0 0 12px; }
.question legend { display: block; padding: 0 0 6px; font-weight: 700; }
.options { gap: 8px; }
.options label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 1em; line-height: 1.3; }
.options input { width: 1.08em; height: 1.08em; flex: 0 0 auto; margin: 0; }
.question .feedback { margin: 8px 0 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions .primary { margin: 0; }
.quiz-score { font-weight: bold; margin: 12px 0 0; }
.quiz-score:empty { display: none; }

.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.stage-footer a { padding: 10px 14px; min-height: 44px; margin: 0; }
.course-footer { padding: 20px var(--gutter); font-size: .9rem; letter-spacing: 0; }
#viewer { max-height: 92dvh; }
#viewer img { display: block; }
#viewer h2 { clear: both; font-size: 1.55rem; margin-bottom: 10px; }

.present { font-size: 1.3rem; }
.present .lesson-stage .caption { font-size: .85em; }
.present .header-actions { font-size: 1rem; }
.present .options label, .present #course-stages a { min-height: 48px; }

@media (max-width: 900px) {
  #home-lessons, .museum-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 8px; }
  .site-header { position: static; flex-wrap: wrap; }
  .site-header .brand { font-size: 1.18rem; }
  .header-actions { flex-wrap: wrap; justify-content: start; }
  .header-actions button, .header-topics { padding-inline: 9px; }
  .course-hero, .lesson-stage .two, .study-split { grid-template-columns: 1fr; }
  .course-hero { gap: 20px; }
  .course-cover img { height: auto; }
  .course-navigation { padding-top: 12px; }
  #course-lessons a, #course-stages a { padding-inline: 9px; font-size: .95rem; text-align: center; }
  #course-lessons { display: grid; grid-template-columns: 1fr 1fr; }
  #course-stages { display: grid; grid-template-columns: repeat(3, 1fr); }
  .lesson-stage { padding-top: 20px; }
  .lesson-stage .block { margin-block: 18px; }
  .lesson-stage .caption { font-size: .84em; }
}
@media (max-width: 380px) {
  .museum-grid, #home-lessons { grid-template-columns: 1fr; }
  .course-hero h1 { font-size: 2.45rem; }
}
@media print {
  .site-header, .course-navigation, .course-footer, .stage-footer { display: none; }
  .lesson-stage { padding: 0; }
}

.capital-study .object-image img { height: auto; }
.teacher-menu { position: relative; border: 0; padding: 0; }
.teacher-menu > summary { font: inherit; font-size: .82rem; color: var(--muted); min-height: 44px; padding: 12px 8px; }
.teacher-menu-panel { position: absolute; z-index: 20; right: 0; top: 100%; width: min(300px, 85vw); padding: 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 6px 20px #243a3d22; }
.teacher-menu-panel p { margin: 10px 0 0; font-size: .9rem; line-height: 1.45; }
.glossary-button { position: fixed; z-index: 5; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); padding: 12px 20px; box-shadow: 0 3px 12px #243a3d33; }
#glossary { width: min(720px, 92vw); max-height: 85dvh; overflow-y: auto; }
#glossary h2 { clear: both; font-size: 1.7em; }
#glossary .terms { line-height: 1.55; }
body { padding-bottom: 76px; }
@media print { .glossary-button, .teacher-menu, #glossary { display: none; } body { padding-bottom: 0; } }

/* Papildu mākslas uzdevumi un kultūras mantojums. */
.image-inquiry { margin-top: 16px; border-top: 2px solid var(--terra); padding-top: 14px; }
.image-inquiry h5 { margin: 0 0 10px; font-size: 1.08em; }
[data-stage="telnieciba"] h4, [data-stage="mantojums"] h4 { font-size: 1.15em; line-height: 1.35; }
.image-inquiry ol, .lesson-stage ol { padding-left: 1.5em; }
.image-inquiry li, .resource-list > li { margin-bottom: 12px; }
.image-inquiry p { font-style: italic; }
.lesson-stage details + details { margin-top: 12px; }
.acropolis-plan { margin-block: 20px; }
.acropolis-overview .object-image img { height: auto; max-height: 75vh; object-fit: contain; }
.acropolis-plan svg { display: block; width: 100%; max-height: 420px; }
.heritage-cases { align-items: start; }
.heritage-cases .panel p { margin-block: 10px; }
.heritage-answer { max-width: 70ch; }
.heritage-answer p:last-child { margin-bottom: 0; }
.lesson-stage .subnav { margin-block: 16px 24px; }
.lesson-stage .subnav a { min-height: 44px; display: inline-flex; align-items: center; font-size: 1em; }
.present [data-stage="telnieciba"] .two, .present .heritage-cases { grid-template-columns: 1fr; }
.present [data-stage="telnieciba"] .object-image img { height: clamp(350px, 52vh, 650px); }
.present .image-inquiry { max-width: 70ch; }
.present [data-stage="telnieciba"] h3, .present [data-stage="mantojums"] h3 { font-size: 1.5em; }
@media (max-width: 700px) { .heritage-cases { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
