/* Gunn Notes layout on top of base.css. Tokens and base elements live there. */
.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.spread { justify-content: space-between; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; } /* base.css styles .btn for buttons only */
.meta { color: var(--ink-2); font-size: 0.92rem; }
.form-msg { font-weight: 600; color: var(--ink); }
[hidden] { display: none !important; } /* .field and .row set display, which would beat the attribute */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Gunn Notes carries a class grid plus a sidebar, so it gets a little more room than a quiz page. */
.app-shell { max-width: 880px; }
.lede { color: var(--ink-2); margin-top: -12px; }
.foot-note { margin-top: 40px; color: var(--ink-2); font-size: 0.92rem; }

/* forms */
.field { display: block; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-2); font-size: 0.92rem; margin: 4px 0 0; }
.field input, .field select, .field textarea { width: 100%; }
.field input[type="password"] { min-height: 44px; border: var(--border); border-radius: var(--radius-sm); padding: 0 12px; font: inherit; background: var(--card); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.item-box { border-top: var(--border); padding-top: 16px; }
.item-box:first-child { border-top: 0; padding-top: 0; }

/* The mockup sets the legend, the unit counts and the invite fine print in --ink-3.
   That is 3.2:1 on paper, under the 4.5:1 floor in docs/design.md, so they use --ink-2 (6.1:1).
   --ink-3 stays on the file/link glyph, which is a UI icon whose words are in the meta line. */

/* home hero: the search is the loudest thing on the page */
.hero {
  background: var(--paper-deep);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 18px;
}
.hero-row { display: flex; gap: 12px; align-items: stretch; }
.search { position: relative; flex: 1; display: flex; align-items: center; }
.search svg {
  position: absolute; left: 16px;
  width: 20px; height: 20px;
  fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
.search input {
  height: 58px;
  min-height: 58px;
  font-size: 1.15rem;
  font-weight: 500;
  padding-left: 48px;
  border-color: var(--ink);
  background: var(--card);
}
.hero .btn { height: 58px; min-height: 58px; padding: 0 22px; white-space: nowrap; }
.hero-count { margin-top: 14px; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.legend { margin-top: 14px; color: var(--ink-2); font-size: 0.92rem; }

/* home: classes on the left, what is new and who posted it on the right */
.home-cols { display: grid; grid-template-columns: 1fr; gap: 32px; margin-top: 8px; }
.side { display: grid; gap: 20px; align-content: start; }
@media (min-width: 860px) {
  .home-cols { grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; align-items: start; }
}

.subject { margin-top: 30px; }
.subject h2 { margin-bottom: 12px; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.class-card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--ease);
}
.class-card:hover, .class-card:focus-visible { border-color: var(--ink); }
.class-card h3 { margin-bottom: 5px; }
.class-card .count { color: var(--ink-2); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.subject-math .class-card { background: var(--math); }
.subject-chem .class-card { background: var(--chem); }
.subject-english .class-card { background: var(--english); }

/* Classes with nothing in them are slots to fill, not cards that failed.
   Same footprint as a stocked card, dashed and empty, and never the words "0 notes". */
.class-card.slot {
  display: flex; align-items: center;
  background: transparent;
  border: 2px dashed var(--line-soft);
  transition: border-color var(--ease), color var(--ease);
}
.subject-math .class-card.slot,
.subject-chem .class-card.slot,
.subject-english .class-card.slot { background: transparent; }
.class-card.slot h3 { margin-bottom: 0; font-weight: 600; color: var(--ink-2); }
.class-card.slot:hover, .class-card.slot:focus-visible { border-style: solid; border-color: var(--ink); }
.class-card.slot:hover h3, .class-card.slot:focus-visible h3 { color: var(--ink); }

/* new this week */
.fresh h2 { margin-bottom: 10px; }
.fresh ul { list-style: none; margin: 0; padding: 0; }
.fresh li { border-top: 1px solid var(--line-soft); }
.fresh li:first-child { border-top: 0; }
.fresh a { display: block; padding: 9px 0; text-decoration: none; }
.fresh li:first-child a { padding-top: 0; }
.fresh-title { display: block; font-weight: 600; }
.fresh a:hover .fresh-title, .fresh a:focus-visible .fresh-title { text-decoration: underline; }
.fresh-sub { display: block; color: var(--ink-2); font-size: 0.85rem; }

/* contributors board */
.board h2 { margin-bottom: 4px; }
.board > .meta { display: block; margin-bottom: 14px; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { padding: 11px 0; border-top: 1px solid var(--line-soft); }
.board li:first-child { border-top: 0; padding-top: 0; }
.board-name {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-weight: 600;
}
.board-name b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 3px; background: var(--line-soft); margin: 7px 0 5px; }
.bar span { display: block; height: 100%; border-radius: 3px; background: var(--ink); }
.board-sub { color: var(--ink-2); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* class view */
.crumb { margin-top: 4px; font-weight: 500; }
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--ink); }

.class-hero {
  margin-top: 16px;
  padding: 26px 24px;
  border-radius: var(--radius);
  border: 2px solid var(--line-soft);
  background: var(--paper-deep);
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: flex-end; justify-content: space-between;
}
.class-hero.tint-math { background: var(--math); }
.class-hero.tint-chem { background: var(--chem); }
.class-hero.tint-english { background: var(--english); }
.class-hero h2 {
  font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.1rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.class-hero .class-sub { margin-top: 8px; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }

.unit { margin-top: 18px; padding: 18px 20px; }
.unit h3 { margin-bottom: 4px; }
.unit .unit-count { color: var(--ink-2); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.notes { list-style: none; margin: 10px 0 0; padding: 0; }
.note {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.note:first-child { border-top: 0; }
.note-kind { flex: none; margin-top: 3px; color: var(--ink-3); }
.note-kind svg { width: 19px; height: 19px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.note-body { flex: 1; min-width: 0; }
.note-title { font-weight: 600; color: inherit; text-decoration: none; }
.note-title:hover, .note-title:focus-visible { text-decoration: underline; }
.note-meta {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 0.9rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.tag {
  background: var(--paper-deep);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
}
.download { font-weight: 600; color: var(--ink-2); }
.download:hover, .download:focus-visible { color: var(--ink); }

.vote {
  flex: none;
  width: 48px; min-height: 54px;
  padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--card);
  border: 2px solid var(--line);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.vote svg { width: 15px; height: 15px; fill: currentColor; display: block; }
.vote:hover { background: var(--paper-deep); border-color: var(--ink); color: var(--ink); }
.vote[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.vote[aria-pressed="true"]:hover { background: #3a352c; border-color: #3a352c; color: var(--paper); }

/* a class with nothing in it yet */
.invite { margin-top: 18px; padding: 30px 24px; text-align: center; }
.invite h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.015em; }
.invite p { max-width: 46ch; margin: 10px auto 0; color: var(--ink-2); }
.invite .btn { display: inline-flex; align-items: center; text-decoration: none; margin-top: 18px; }
.invite .fine { font-size: 0.9rem; color: var(--ink-2); margin-top: 14px; }

/* admin */
.tabs .count { margin-left: 6px; font-weight: 600; opacity: 0.7; }
.admin-row { border-top: var(--border); padding-top: 16px; margin-top: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }

@media (max-width: 560px) {
  .hero-row { flex-wrap: wrap; }
  .hero .btn { width: 100%; justify-content: center; }
  .class-hero { align-items: flex-start; }
}
