/* medicine.kazimiri.com -- Year 1 Medicine, University of Rzeszów
   Self-contained: no webfonts, no CDN, no JS framework. Works offline. */

:root {
  --bg:        #f7f8fa;
  --surface:   #ffffff;
  --surface-2: #eef1f6;
  --ink:       #16191f;
  --ink-2:     #4a5260;
  --ink-3:     #767f8d;
  --line:      #dde2ea;
  --accent:    #0b5ed7;
  --accent-2:  #e7effc;
  --nerve:     #7a3ea3;
  --clin:      #b3261e;
  --clin-bg:   #fdecea;
  --ok:        #1a7f4b;
  --ok-bg:     #e6f4ec;
  --warn:      #8a6100;
  --warn-bg:   #fdf3d8;
  --pl:        #a3374a;
  --radius: 10px;
  --wrap: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0f1216;
    --surface:   #171b21;
    --surface-2: #1f242c;
    --ink:       #e8ebf0;
    --ink-2:     #b4bcc8;
    --ink-3:     #8a94a2;
    --line:      #2b323c;
    --accent:    #6ea8ff;
    --accent-2:  #17233a;
    --nerve:     #c79bea;
    --clin:      #ff9c92;
    --clin-bg:   #2e1b19;
    --ok:        #6cd39a;
    --ok-bg:     #142a1f;
    --warn:      #ecc86a;
    --warn-bg:   #2b2415;
    --pl:        #ef9aa8;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.62 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

/* ---- masthead ---- */
header.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
header.top .wrap { display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; flex-wrap: wrap; }
header.top a.home { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
header.top a.home span { color: var(--accent); }
nav.top { margin-left: auto; display: flex; gap: .25rem; flex-wrap: wrap; }
nav.top a {
  color: var(--ink-2); text-decoration: none; font-size: .88rem;
  padding: .35rem .6rem; border-radius: 7px; white-space: nowrap;
}
nav.top a:hover { background: var(--surface-2); color: var(--ink); }
nav.top a[aria-current="page"] { background: var(--accent-2); color: var(--accent); font-weight: 600; }

main { padding: 1.5rem 0 4rem; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .4rem; letter-spacing: -.02em; }
h2 { font-size: 1.22rem; margin: 2rem 0 .7rem; letter-spacing: -.01em; }
h3 { font-size: 1.02rem; margin: 1.4rem 0 .5rem; }
p  { margin: 0 0 .9rem; }
.lede { color: var(--ink-2); font-size: 1.02rem; margin-bottom: 1.4rem; }
.muted { color: var(--ink-3); font-size: .87rem; }

a { color: var(--accent); }

/* ---- cards ---- */
.grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: inherit;
}
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.card p  { margin: 0; color: var(--ink-2); font-size: .89rem; }
.card .n { font-size: .74rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.15rem; margin: 0 0 1rem;
}

/* ---- callouts ---- */
.note, .clinical, .win {
  border-left: 3px solid var(--line); padding: .7rem .95rem; border-radius: 0 8px 8px 0;
  margin: 0 0 1rem; font-size: .93rem;
}
.clinical { border-left-color: var(--clin); background: var(--clin-bg); }
.clinical strong:first-child { color: var(--clin); }
.win { border-left-color: var(--ok); background: var(--ok-bg); }
.note { border-left-color: var(--warn); background: var(--warn-bg); }

/* ---- tables ---- */
.tw { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.pl, .pl-term { color: var(--pl); font-weight: 600; }

/* ---- code / pathway diagrams ---- */
pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem .9rem; overflow-x: auto; font-size: .82rem; line-height: 1.5; margin: 0 0 1.1rem;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }

/* ---- interactive bits ---- */
.controls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 0 0 1rem; }
input[type="search"], select, button {
  font: inherit; font-size: .92rem; padding: .48rem .7rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
input[type="search"] { flex: 1 1 14rem; min-width: 0; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }

.opt {
  display: block; width: 100%; text-align: left; margin: 0 0 .45rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: .93rem;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--clin); background: var(--clin-bg); }

.score { font-variant-numeric: tabular-nums; font-weight: 600; }
.hidden { display: none !important; }

details { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: .6rem .85rem; margin: 0 0 .6rem; }
details[open] { padding-bottom: .85rem; }
summary { cursor: pointer; font-weight: 600; font-size: .95rem; }

footer.site { border-top: 1px solid var(--line); padding: 1.25rem 0 2.5rem; color: var(--ink-3); font-size: .83rem; }
footer.site a { color: var(--ink-2); }

@media (max-width: 34rem) {
  h1 { font-size: 1.35rem; }
  nav.top a { padding: .3rem .45rem; font-size: .82rem; }
  body { font-size: 15.5px; }
}

button.say {
  font-size: .76rem; padding: .12rem .42rem; margin-left: .35rem;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); cursor: pointer;
  vertical-align: baseline; line-height: 1.5;
}
button.say:hover { border-color: var(--accent); color: var(--accent); }

/* Study aids that are linked in the navigation but not yet built. Shown as
   plain text rather than links: a dead link that 403s reads as a broken site,
   and silently deleting the entry hides the roadmap. */
.soon { color: var(--ink-3); cursor: default; }
.soon::after { content: " · in progress"; font-size: .78em; opacity: .75; }

/* In the header the label must match the real links exactly, or it renders a
   size larger than everything beside it and reads as a layout fault. The long
   suffix is dropped there in favour of a compact tag. */
nav.top .soon {
  font-size: .88rem; padding: .35rem .6rem; white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: .3rem;
}
nav.top .soon::after {
  content: "soon"; font-size: .66rem; letter-spacing: .02em;
  text-transform: uppercase; opacity: .85;
  border: 1px solid var(--line); border-radius: 4px; padding: 0 .25rem;
}
.card.soon { opacity: .55; }
.card.soon::after { content: none; }
