/* Reflective Report Writing Tutor
   Part of the AI Personal Tutor Toolkit family.
   Same calm paper frame; a contemplative indigo accent marks it as its own tool.

   Design rules:
   - Every page uses the same outer site width and the same nav frame.
   - The homepage may have a larger hero and visual cards, but it sits in the same frame.
   - Standard pages use a document layout inside that frame: readable text measure, left aligned.
   - Menu pages keep a two-column scan layout inside the same frame.
   - Tools/examples pages can use wider tables or examples without changing the outer frame.
*/

:root {
  --bg: #f8f6f1;
  --paper: #fffefa;
  --panel: #ffffff;
  --ink: #24292f;
  --muted: #59636e;
  --line: #e3ddd2;
  --line-strong: #d2c8b8;
  --accent: #3b4d8f;
  --accent2: #8a5a7a;
  --soft: #eef0f8;
  --warn: #fff7e5;
  --shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
  --radius: 16px;
  --site-width: 1120px;
  --measure: 700px;
  --page-gutter: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.68;
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* One universal site frame. Header, homepage, menu pages, standard pages and footer all use this. */
.container,
.reading {
  width: min(var(--site-width), calc(100% - (var(--page-gutter) * 2)));
  max-width: var(--site-width);
  margin-left: auto;
  margin-right: auto;
}

a {
  color: var(--accent);
  font-weight: 620;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}
a:not(.button) { text-decoration: underline; }
a:hover,
a:focus { text-decoration-thickness: 0.12em; }
a:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(59, 77, 143, 0.32);
  outline-offset: 3px;
}

/* Site header and nav: identical frame on every page. */
header:not(.page-intro) {
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-weight: 760;
  letter-spacing: -0.015em;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand small {
  color: var(--muted);
  font-weight: 520;
  letter-spacing: 0;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px 15px;
  margin: 0;
  padding: 0;
}
nav a {
  color: var(--ink);
  font-weight: 650;
  font-size: 0.94rem;
  text-decoration: none;
}

/* Default documentation layout. The page frame is wide and consistent; prose has a readable measure. */
main { padding: 0; }

.reading {
  padding: 24px 0 48px;
}

.reading > *,
.page-intro > *,
.reading section > * {
  max-width: var(--measure);
}

/* Allow genuinely wide content to use the full common site frame. */
.reading table,
.reading .table-wrap,
.reading .wide,
.reading .grid,
.reading .btn-row,
.reading .button-row,
.reading .actions,
.reading pre {
  max-width: 100%;
}

.page-intro {
  padding: 0 0 16px;
  margin: 0 0 22px;
  border: 0;
  position: static;
  background: transparent;
  backdrop-filter: none;
}
.page-intro h1 { margin-top: 0; }
.page-intro .lead { margin-bottom: 0; }

.reading section { margin: 0 0 24px; }
.reading section + section { margin-top: 24px; }

h1, h2, h3 { color: #1f252b; }

h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.16;
  margin: 0 0 8px;
  letter-spacing: -0.025em;
  font-weight: 720;
}

h2 {
  font-size: clamp(1.08rem, 1.35vw, 1.18rem);
  line-height: 1.35;
  margin: 28px 0 7px;
  letter-spacing: -0.004em;
  font-weight: 650;
}

h3 {
  font-size: 1.01rem;
  line-height: 1.36;
  margin: 20px 0 5px;
  font-weight: 650;
}

p {
  margin: 0 0 0.9rem;
  max-width: var(--measure);
}
li { margin: 0.25rem 0; }
ul, ol {
  margin: 0.45rem 0 1rem;
  padding-left: 1.35rem;
}
.lead {
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--muted);
  max-width: 66ch;
}
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent2);
  font-weight: 720;
  font-size: 0.73rem;
  margin-bottom: 5px;
}
.tag,
.guide-label {
  display: inline-block;
  width: fit-content;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent2);
  font-weight: 720;
  font-size: 0.73rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

/* Old visual block classes become plain by default. */
.panel,
.card,
.example-note {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 20px;
}
.card { display: block; }
.card h3,
.resource-item h3 { margin-top: 0; }
.card p,
.small,
.small-note,
.table-note { color: var(--muted); }
.grid,
.grid.two { display: block; }

/* Editorial callouts: visible, but not card-heavy. */
.notice,
.warning {
  background: var(--warn);
  border: 0;
  border-left: 4px solid #d7aa4e;
  border-radius: 0;
  box-shadow: none;
  padding: 0.75rem 0.95rem;
  margin: 1.1rem 0 1.35rem;
  max-width: var(--measure);
}
.notice p:last-child,
.warning p:last-child { margin-bottom: 0; }

/* Contents/subnav blocks. */
.toc,
.subnav,
.on-this-page {
  border-left: 3px solid var(--line-strong);
  padding: 0.25rem 0 0.25rem 0.9rem;
  margin: 1rem 0 1.45rem;
  background: transparent;
  max-width: var(--measure);
}
.toc ul,
.subnav ul,
.on-this-page ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

blockquote,
.sample-output {
  margin: 1rem 0;
  padding: 0.75rem 0.95rem;
  background: rgba(255, 255, 255, 0.5);
  border: 0;
  border-left: 4px solid var(--accent);
  border-radius: 0;
  color: #374151;
  max-width: var(--measure);
}
.sample-output { border-left-color: var(--accent2); }

/* Buttons */
.btn-row,
.button-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 680;
  border: 1px solid var(--accent);
  text-decoration: none;
  line-height: 1.25;
}
.button:hover { text-decoration: none; filter: brightness(0.97); }
.button.secondary { background: #fff; color: var(--accent); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }

hr { border: 0; margin: 1.2rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}
th,
td {
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { background: #f0ede6; font-weight: 680; }
tr:last-child td { border-bottom: 0; }

code {
  background: #eee7dc;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 0.94em;
}
pre {
  background: #19202a;
  color: #f8fafc;
  padding: 15px;
  border-radius: 9px;
  overflow: auto;
}

.footer {
  padding: 34px 0 50px;
  color: var(--muted);
}
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--accent); }

.list-clean { padding-left: 1.2rem; }
.steps li { margin-bottom: 0.65rem; }
.checklist { columns: 2; column-gap: 2rem; }
.panel table a { white-space: nowrap; }
.card ul { margin-top: 0; }
.example-label {
  font-weight: 700;
  color: var(--accent);
  margin-top: 12px;
}
.muted { color: var(--muted); font-weight: 600; }
.resource-item { padding-top: 10px; margin-top: 10px; }

/* Compact hero for internal pages that still use the old hero pattern. Same container width as everything else. */
.hero { padding: 24px 0 12px; }
.hero-grid { display: block; }
.hero .container { text-align: left; }

/* Menu pages: two-column scan pattern inside the same universal site frame. */
body.menu .hero { padding: 24px 0 12px; }
body.menu main > .container { margin-bottom: 44px; }
body.menu .grid,
body.menu .grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
body.menu .panel { margin: 0; }
body.menu .card,
body.menu .guide-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(227, 221, 210, 0.95);
  border-radius: 11px;
  box-shadow: none;
  padding: 14px 16px;
  margin: 0;
}
body.menu .card h2,
body.menu .card h3,
body.menu .guide-card h2,
body.menu .guide-card h3 {
  font-size: 1.02rem;
  line-height: 1.3;
  margin: 0 0 5px;
  letter-spacing: -0.004em;
  font-weight: 660;
}
body.menu .card p,
body.menu .guide-card p {
  font-size: 0.96rem;
  line-height: 1.55;
  margin-bottom: 10px;
  color: var(--muted);
}
body.menu .button {
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 650;
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}
body.menu .button:hover { background: rgba(255, 255, 255, 0.55); }

/* Reference pages such as Tools and Examples: same outer frame, wide tables/examples when useful. */
body.reference .reading table,
body.reference .reading .notice {
  max-width: 100%;
}
body.reference .reading .notice p,
body.reference .reading .notice h2 {
  max-width: var(--measure);
}

/* Homepage exception: larger visual front door inside the same universal site frame. */
body.home .hero { padding: 56px 0 30px; }
body.home .hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: stretch;
}
body.home h1 {
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 1.02;
  margin: 0 0 16px;
  letter-spacing: -0.048em;
  font-weight: 760;
}
body.home h2 {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  margin: 0 0 12px;
  letter-spacing: -0.03em;
  line-height: 1.14;
  font-weight: 720;
}
body.home .lead { font-size: 1.16rem; max-width: 780px; }
body.home .panel,
body.home .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
body.home .panel { padding: 24px; margin: 20px 0; }
body.home .card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
body.home .card h3 { margin-top: 0; }
body.home .card p { color: var(--muted); }
body.home .card .actions { margin-top: auto; }
body.home .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
body.home .grid.two { grid-template-columns: repeat(2, 1fr); }
body.home .tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 740;
  font-size: 0.82rem;
  margin-bottom: 12px;
  text-transform: none;
  letter-spacing: 0;
}
body.home .notice {
  background: var(--warn);
  border: 1px solid #f0d99b;
  border-radius: var(--radius);
  padding: 24px;
}

/* Mobile */
@media (max-width: 860px) {
  header:not(.page-intro) { position: static; }
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }
  nav ul { justify-content: flex-start; }
  body.home .hero-grid,
  body.home .grid,
  body.home .grid.two,
  body.menu .grid,
  body.menu .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root { --page-gutter: 14px; }
  body { font-size: 16px; line-height: 1.65; }
  .container,
  .reading {
    width: calc(100% - (var(--page-gutter) * 2));
  }
  .reading { padding-top: 22px; }
  .hero { padding: 20px 0 12px; }
  h1 { font-size: clamp(1.62rem, 8vw, 2.05rem); }
  h2 { font-size: 1.06rem; }
  .checklist { columns: 1; }
}

/* Source-material practice passages */
.source-block {
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 22rem;
  overflow-y: auto;
  font-size: 0.9rem;
}
.reading details {
  margin: 0.5rem 0 0.75rem;
}
.reading details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

/* Two-column menu home pages (Student Help, Guides): larger headline,
   tighter buttons, equal-height cards with actions pinned to the bottom. */
body.menu .hero { padding: 40px 0 18px; }
body.menu .hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.15rem);
  line-height: 1.05;
  letter-spacing: -0.032em;
  font-weight: 760;
  margin: 0 0 10px;
}
body.menu .hero .lead { font-size: 1.08rem; max-width: 70ch; }
body.menu .card,
body.menu .guide-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
}
body.menu .card h3,
body.menu .guide-card h3 { font-size: 1.08rem; }
body.menu .card .actions,
body.menu .guide-card .actions { margin-top: auto; padding-top: 4px; }
body.menu .button {
  padding: 5px 11px;
  font-size: 0.875rem;
  font-weight: 640;
}
