/* ============================================================
   Course Studio — instructor console (Design A2 · SEU)
   Southeastern University · Fire Red on Cool Gray + Black.
   One page: course cards with live manifest stats, the lecture
   deck index, the interactives directory, and authoring tools.
   Tokens come from tokens.css.
   ============================================================ */

* { box-sizing: border-box; }

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  border-top: 3px solid var(--accent);   /* letterhead rule */
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main,
.masthead,
.colophon {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 28px;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 40px;
  padding-bottom: 8px;
}

.masthead h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 14px;
}
.masthead h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  background: var(--accent);
}

.masthead-org {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

/* ---------- Sections ---------- */

section {
  margin: 44px 0;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-soft);
}

.section-note {
  margin: -8px 0 18px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- Course cards (hero) ---------- */

#courses { margin-top: 34px; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 28px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  text-decoration: none;
  background: var(--paper);
  transition: border-color 0.15s ease, background 0.15s ease;
  animation: card-enter 0.45s ease both;
  animation-delay: var(--enter-delay, 0ms);
}
.course-card:hover {
  border-color: var(--accent);
  background: var(--paper-tint);
}

.course-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.course-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.chip-draft {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-rule);
  border-radius: var(--radius);
  padding: 2px 8px;
}

.course-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
}

.course-stats {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  min-height: 1.4em;
}
.course-rendered {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-mute);
}

.course-open {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.course-open .arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}
.course-card:hover .course-open .arrow {
  transform: translateX(4px);
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Library cards (decks / interactives index) ---------- */

.lib-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.lib-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  text-decoration: none;
  background: var(--paper);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lib-card:hover {
  border-color: var(--accent);
  background: var(--paper-tint);
}

.lib-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
}

.lib-stats {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.lib-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.lib-open {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.lib-open .arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}
.lib-card:hover .lib-open .arrow {
  transform: translateX(4px);
}

/* ---------- Back link (library subpages) ---------- */

.backlink {
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.15s ease;
}
.backlink:hover { color: var(--accent); }

/* ---------- Lecture decks ---------- */

.deck-group {
  margin-bottom: 26px;
}
.deck-group:last-child { margin-bottom: 0; }

.deck-module {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.deck-module-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.deck-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 28px;
}

.deck-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.deck-link:hover {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.deck-num {
  flex-shrink: 0;
  width: 2.4em;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.deck-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.deck-link:hover .deck-title { color: var(--ink); }

.deck-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---------- Interactives ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.demo-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.demo-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.demo-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.demo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.demo-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---------- Tools ---------- */

.tools-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tool-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
a.tool-card:hover {
  border-color: var(--accent);
  background: var(--paper-tint);
}
.tool-card--static {
  background: var(--paper-soft);
  border-color: var(--rule-soft);
}

.tool-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}
.tool-title .ext { color: var(--accent); }

.tool-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.tool-desc code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  white-space: nowrap;
}

/* ---------- Colophon ---------- */

.colophon {
  margin-top: 56px;
  padding-top: 16px;
  padding-bottom: 28px;
  border-top: 1px solid var(--rule-soft);
}
.colophon p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 28px;
  }
  .course-grid,
  .deck-list,
  .lib-row,
  .tools-row {
    grid-template-columns: 1fr;
  }
  section { margin: 36px 0; }

  main,
  .masthead,
  .colophon { padding: 0 18px; }

  .masthead h1 { font-size: 25px; }
  .course-card { padding: 20px 20px 18px; }
  .lib-card { padding: 18px 18px 16px; }

  /* Uppercase 11.5px on its own line is a 15px-tall target — give the one
     link that leaves these subpages a thumb-sized box. */
  .backlink {
    padding: 12px 0;
    margin-bottom: 0;
  }

  /* Deck rows are the main thing you tap on decks.html. */
  .deck-link { padding: 11px 10px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .course-card { animation: none; }
  .course-open .arrow,
  .deck-link,
  .demo-card,
  .course-card,
  .lib-card,
  .lib-open .arrow,
  .backlink,
  .tool-card { transition: none; }
}

/* ---------- Home-screen web app (iPadOS) ---------- */
/* viewport-fit=cover runs content under the translucent status bar; pad it back out. */

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
}
