/* Shared print styles for gAIant Language Assessment manuals */
:root {
  --brand: #a36e22;
  --brand-soft: #f4cd62;
  --brand-mid: #c4953c;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --surface: #fafaf9;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html { font-size: 15px; }

body {
  margin: 0;
  color: var(--ink);
  background: #eceae7;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

.page {
  max-width: 820px;
  margin: 24px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(28, 25, 23, 0.08);
}

.cover {
  padding: 40px 44px 32px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-soft) 35%, white), white 55%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 45%);
  border-bottom: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-row img.mark { width: 56px; height: auto; }
.brand-row img.type { height: 36px; width: auto; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 40%, white);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, white);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 14px;
}

.cover h1 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cover .lead {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.92rem;
  color: var(--muted);
}

.meta strong { color: var(--ink); }

.content { padding: 28px 44px 48px; }

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  color: var(--brand);
  border-bottom: 2px solid color-mix(in srgb, var(--brand) 25%, white);
  padding-bottom: 6px;
}

h3 {
  margin: 1.35rem 0 0.45rem;
  font-size: 1.05rem;
}

p, li { color: var(--ink); }
p { margin: 0.55rem 0; }

ul, ol { margin: 0.4rem 0 0.8rem; padding-left: 1.25rem; }
li { margin: 0.28rem 0; }

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 1.5rem;
}

.toc ol { margin: 0.4rem 0 0; }
.toc a { color: var(--brand); text-decoration: none; font-weight: 600; }
.toc a:hover { text-decoration: underline; }

.callout {
  border-left: 4px solid var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 22%, white);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  margin: 1rem 0;
}

.callout strong { color: var(--brand); }

.screen {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px 18px;
  margin: 0.75rem 0 1.25rem;
}

.screen-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0.85rem 0 0.35rem;
}

.screen > .screen-title:first-child {
  margin-top: 0;
}

.screen h3 {
  margin-top: 1rem;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 1rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 12px 14px 12px 52px;
  margin: 0.5rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0.8rem 0 1rem;
}

.menu-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--card);
}

.menu-item strong {
  display: block;
  color: var(--brand);
  margin-bottom: 4px;
}

.menu-item span { font-size: 0.92rem; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 0.8rem 0 1.2rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: color-mix(in srgb, var(--brand-soft) 28%, white);
  color: var(--ink);
  font-weight: 700;
}

tr:nth-child(even) td { background: var(--surface); }

.kbd {
  display: inline-block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0.8rem 0 1.2rem;
}

.figure-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.figure img,
.figure video {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #111;
}

.figure.tall img,
.figure.tall video {
  height: 280px;
  object-fit: contain;
  background: #0c0b12;
}

.figure figcaption {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--card);
  border-top: 1px solid var(--line);
}

html.theme-studio {
  --brand: #6d5ef0;
  --brand-soft: #d4c8ff;
  --brand-mid: #8b7cf6;
}

html.theme-studio .print-bar button,
html.theme-studio .print-bar a,
html.theme-studio .page,
html.theme-studio .cover,
html.theme-studio .toc,
html.theme-studio .screen,
html.theme-studio .menu-item,
html.theme-studio .steps li,
html.theme-studio .figure {
  border-radius: 8px;
}

html.theme-studio .steps li::before {
  border-radius: 6px;
}

.footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.print-bar {
  max-width: 820px;
  margin: 16px auto 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.print-bar button {
  border: none;
  background: var(--brand);
  color: white;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}

.print-bar a {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
}

@media print {
  body { background: white; }
  .print-bar { display: none !important; }
  .page {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
  }
  .cover, .content { padding-left: 0; padding-right: 0; }
  a { color: inherit; text-decoration: none; }
  .steps li, .menu-item, .callout, .screen, .figure, .figure-grid { break-inside: avoid; }
  h2 { break-after: avoid; }
}

@media (max-width: 640px) {
  .cover, .content { padding: 22px 18px; }
  .menu-grid, .figure-grid, .figure-grid.cols-3 { grid-template-columns: 1fr; }
  .cover h1 { font-size: 1.55rem; }
}
