/* local_labpages shared stylesheet, template version v1.
   Self-contained: system fonts only, no external requests (required by the page CSP). */

:root {
  --lp-bg: #ffffff;
  --lp-surface: #f4f6f8;
  --lp-text: #1d2733;
  --lp-muted: #5a6877;
  --lp-accent: #1f5f8b;
  --lp-accent-text: #ffffff;
  --lp-border: #d9dfe5;
  --lp-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --lp-bg: #12181f;
    --lp-surface: #1b232c;
    --lp-text: #e6ebf0;
    --lp-muted: #9aa8b6;
    --lp-accent: #5aa7d6;
    --lp-accent-text: #0b1218;
    --lp-border: #2c3844;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--lp-bg);
  color: var(--lp-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.lp-wrap {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.lp-header {
  background: var(--lp-surface);
  border-bottom: 1px solid var(--lp-border);
  padding: 3rem 0 2.25rem;
}

.lp-title {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.lp-subtitle {
  margin: 0.75rem 0 0;
  color: var(--lp-muted);
  font-size: 1.15rem;
}

.lp-main { padding-top: 2rem; padding-bottom: 2rem; }

.lp-section { margin: 0 0 1.75rem; }

.lp-text h2, .lp-text h3 { line-height: 1.3; margin: 1.5rem 0 0.5rem; }
.lp-text h2 { font-size: 1.5rem; }
.lp-text h3 { font-size: 1.25rem; }
.lp-text p, .lp-text ul, .lp-text ol { margin: 0 0 1rem; }
.lp-text ul, .lp-text ol { padding-left: 1.5rem; }
.lp-text li { margin-bottom: 0.35rem; }
.lp-text > :first-child { margin-top: 0; }
.lp-text, .lp-text * { overflow-wrap: anywhere; }

a { color: var(--lp-accent); text-underline-offset: 0.15em; }
a:focus-visible, .lp-button:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 2px;
}

.lp-linkwrap { text-align: left; }

.lp-button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--lp-accent);
  color: var(--lp-accent-text);
  border-radius: var(--lp-radius);
  font-weight: 600;
  text-decoration: none;
}
.lp-button:hover { filter: brightness(1.08); }

.lp-footer {
  border-top: 1px solid var(--lp-border);
  color: var(--lp-muted);
  font-size: 0.9rem;
  padding: 1.25rem 0 2rem;
}
.lp-footer p { margin: 0; }

/* Layout rows: one slot = full width; two or three = columns that stack on phones. */
.lp-row {
  display: grid;
  gap: 1.25rem;
  margin: 0 0 1.75rem;
  align-items: start;
}
.lp-row > * { min-width: 0; }

@media (min-width: 40rem) {
  .lp-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.lp-figure { margin: 0; }
.lp-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--lp-radius);
  background: var(--lp-surface);
}

/* Button colours (a fixed palette; white text meets contrast requirements on each). */
.lp-button--blue { background: #1f5f8b; color: #ffffff; }
.lp-button--green { background: #1b7a43; color: #ffffff; }
.lp-button--orange { background: #b4530a; color: #ffffff; }
.lp-button--purple { background: #6b3fa0; color: #ffffff; }
.lp-button--dark { background: #2b3440; color: #ffffff; border: 2px solid #5b6877; }

/* Desktop: the page uses 80% of the window (up to 96rem) instead of a narrow column.
   Below 64rem (phones and most tablets) nothing changes. */
@media (min-width: 64rem) {
  .lp-wrap { width: 80%; max-width: 96rem; }

  body { font-size: 1.125rem; }
  .lp-header { padding: 3.5rem 0 2.75rem; }
  .lp-title { font-size: clamp(2.25rem, 3vw, 3rem); }
  .lp-subtitle { font-size: 1.3rem; }
  .lp-main { padding-top: 2.5rem; padding-bottom: 3rem; }

  .lp-row { gap: 1.75rem; margin-bottom: 2.25rem; }
  .lp-text h2 { font-size: 1.75rem; }
  .lp-text h3 { font-size: 1.4rem; }

  /* A full-width block of text would run far too long a line: keep a comfortable reading width. */
  .lp-cols-1 > .lp-text { max-width: 62rem; }

  /* A full-width banner must not grow taller than the window. */
  .lp-cols-1 > .lp-figure .lp-img { max-height: 70vh; object-fit: cover; }
}

/* Shown only on the draft preview inside Moodle, never on published pages. */
.lp-preview-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: #b4530a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

@media print {
  .lp-preview-banner { display: none; }
  .lp-header { background: none; border-bottom: 1px solid #999; }
  .lp-button { border: 1px solid #000; background: none; color: #000; }
}
