/* =========================================================================
   DES 212 · Design Media II — course archive
   Static stylesheet. Hand-edit freely; build.py never overwrites this file.
   ========================================================================= */

:root {
  --bg:        #f6f5f1;   /* warm off-white page */
  --surface:   #ffffff;
  --text:      #1c1c1e;
  --muted:     #6c6c72;
  --line:      #e4e2dc;
  --line-soft: #efeee9;
  --ink:       #27395a;   /* deep ink-blue accent */
  --ink-soft:  #eef1f7;
  --ink-700:   #1b2a45;
  --warn-bg:   #fff4e2;
  --warn-tx:   #8a5a00;
  /* module accent hues, used as thin borders / tags */
  --m1: #b5651d;  /* terracotta  */
  --m2: #3f7d56;  /* green        */
  --m3: #6a4c93;  /* violet       */
  --sidebar-w: 280px;
  --content-max: 820px;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ------------------------------------------------------ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 0 60px;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 46px 40px 120px;
}
.content-inner { width: 100%; max-width: var(--content-max); }

/* ---------- Sidebar nav ------------------------------------------------- */
.brand {
  display: block;
  padding: 0 22px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.brand .code { font-weight: 700; font-size: 17px; letter-spacing: .02em; color: var(--ink-700); }
.brand .sub  { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.nav { font-size: 14.5px; }
.nav-group { margin-top: 16px; }
.nav-group > .nav-h {
  display: block;
  padding: 6px 22px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav a {
  display: block;
  padding: 6px 22px 6px 26px;
  color: var(--text);
  border-left: 3px solid transparent;
}
.nav a:hover { background: var(--ink-soft); text-decoration: none; }
.nav a.sub { padding-left: 38px; font-size: 13.5px; color: var(--muted); }
.nav a.exercise { padding-left: 38px; font-size: 13px; color: var(--muted); }
.nav a.active {
  background: var(--ink-soft);
  border-left-color: var(--ink);
  color: var(--ink-700);
  font-weight: 600;
}
.nav .m1 { border-left-color: var(--m1); }
.nav .m2 { border-left-color: var(--m2); }
.nav .m3 { border-left-color: var(--m3); }

/* ---------- Topbar (mobile) -------------------------------------------- */
.topbar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .code { font-weight: 700; color: var(--ink-700); }
.menu-btn {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 6px 10px; font-size: 18px; cursor: pointer; line-height: 1;
}
.scrim { display: none; }

/* ---------- Content typography ----------------------------------------- */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }

.page-title {
  font-size: 30px; line-height: 1.2; font-weight: 700;
  margin: 0 0 28px; color: var(--ink-700); letter-spacing: -0.01em;
}

.content-inner h2 { font-size: 22px; margin: 38px 0 12px; line-height: 1.3; }
.content-inner h3 { font-size: 18.5px; margin: 30px 0 10px; }
.content-inner h4 { font-size: 16px; margin: 24px 0 8px; }
.content-inner p { margin: 0 0 15px; }
.content-inner ul, .content-inner ol { margin: 0 0 16px; padding-left: 24px; }
.content-inner li { margin: 5px 0; }
.content-inner img { max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; }
.content-inner hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }
.content-inner code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--ink-soft); padding: 2px 6px; border-radius: 5px;
}
.content-inner strong { color: var(--ink-700); }

/* ---------- File download buttons (from Canvas file links) -------------- */
.instructure_file_link, a.dl-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink-soft); border: 1px solid #d6deec;
  color: var(--ink-700); font-weight: 600; font-size: 14.5px;
  padding: 9px 14px; border-radius: 9px; margin: 4px 8px 4px 0;
  text-decoration: none;
}
.instructure_file_link::before, a.dl-btn::before { content: "↓"; font-weight: 700; }
.instructure_file_link:hover, a.dl-btn:hover { background: #e4ebf7; text-decoration: none; }

/* ---------- Video / media ---------------------------------------------- */
.media { margin: 18px 0 22px; }
.media iframe, .media video {
  width: 100%; max-width: 720px; aspect-ratio: 16 / 9; height: auto;
  border: 0; border-radius: 10px; background: #000; display: block;
}
.media-cap { font-size: 13px; color: var(--muted); margin-top: 7px; }
.pending {
  display: inline-block; background: var(--warn-bg); color: var(--warn-tx);
  font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 20px; margin-left: 8px;
}
.video-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 720px; aspect-ratio: 16/9;
  background: #15161a; color: #e8e8ea; border-radius: 10px; text-align: center; padding: 20px;
}
.video-placeholder .play { font-size: 34px; opacity: .85; }
.video-placeholder .nm { font-size: 14px; margin-top: 10px; word-break: break-word; }

/* ---------- Callouts ---------------------------------------------------- */
.callout {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--ink); border-radius: var(--radius);
  padding: 14px 18px; margin: 20px 0;
}
.callout.note { border-left-color: var(--m2); }
.callout.warn { border-left-color: var(--m1); background: var(--warn-bg); }
.callout .h { font-weight: 700; margin-bottom: 4px; }

/* =========================================================================
   Home page
   ========================================================================= */
.hero {
  background: linear-gradient(135deg, var(--ink-700), var(--ink));
  color: #fff; border-radius: 16px; padding: 46px 44px; margin-bottom: 40px;
}
.hero .eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.hero h1 { font-size: 38px; margin: 10px 0 6px; line-height: 1.1; letter-spacing: -0.02em; }
.hero .tagline { font-size: 17px; opacity: .92; margin: 0 0 18px; }
.hero .lede { font-size: 15.5px; opacity: .9; max-width: 640px; line-height: 1.6; }
.hero .meta { margin-top: 22px; font-size: 13.5px; opacity: .8; }
.hero-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .30);
}
.hero-btn:hover { background: rgba(255, 255, 255, .24); text-decoration: none; }
.hero-btn.primary { background: #fff; color: var(--ink-700); border-color: #fff; }
.hero-btn.primary:hover { background: #eef1f7; }

.section-h { font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 40px 0 16px; }

.quicklinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.quicklinks a {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: var(--text); font-weight: 600;
}
.quicklinks a:hover { border-color: var(--ink); text-decoration: none; }
.quicklinks a .d { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 3px; }

.modules { display: grid; gap: 18px; }
.mod-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--ink); border-radius: 12px; padding: 22px 24px;
}
.mod-card.m1 { border-left-color: var(--m1); }
.mod-card.m2 { border-left-color: var(--m2); }
.mod-card.m3 { border-left-color: var(--m3); }
.mod-card .mod-n { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mod-card h3 { margin: 4px 0 14px; font-size: 21px; }
.mod-card .row { margin: 12px 0 4px; }
.mod-card .row .lbl { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: block; margin-bottom: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips a {
  font-size: 13.5px; background: var(--bg); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 20px; color: var(--text);
}
.chips a:hover { background: var(--ink-soft); border-color: var(--ink); text-decoration: none; }

/* ---------- Resource library grid -------------------------------------- */
.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.rl-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; display: flex; flex-direction: column;
}
.rl-card h3 { margin: 0 0 4px; font-size: 16.5px; }
.rl-card .files { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.rl-card .files a {
  font-size: 12.5px; font-family: var(--mono); background: var(--ink-soft);
  border: 1px solid #d6deec; color: var(--ink-700); padding: 3px 9px; border-radius: 7px;
}
.rl-card .files a:hover { background: #e4ebf7; text-decoration: none; }

/* ---------- Footer ------------------------------------------------------ */
.site-footer {
  margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: underline; }

/* ---------- Prev / next ------------------------------------------------- */
.pagenav { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px;
  padding-top: 22px; border-top: 1px solid var(--line); }
.pagenav a {
  flex: 1 1 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; color: var(--text); }
.pagenav a:hover { border-color: var(--ink); text-decoration: none; }
.pagenav a.next { text-align: right; }
.pagenav a .d { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pagenav a .t { font-weight: 600; }
.pagenav .spacer { flex: 1 1 0; }

/* ---------- Responsive -------------------------------------------------- */
@media (max-width: 900px) {
  .topbar { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 100;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 2px 0 18px rgba(0,0,0,.12);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim {
    display: block; position: fixed; inset: 0; z-index: 90;
    background: rgba(0,0,0,.4);
  }
  .content { padding: 26px 20px 90px; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 29px; }
}

/* ---------- External YouTube embeds in tutorial bodies ------------------ */
.content-inner iframe[src*="youtube"] {
  width: 100%; max-width: 720px; aspect-ratio: 16 / 9; height: auto;
  border: 0; border-radius: 10px; margin: 6px 0; background: #000;
}
.yt-link { display: inline-block; font-size: 13.5px; font-weight: 600; margin: 2px 0 16px; }

/* ---------- Resource-library placeholder name chips -------------------- */
.namechips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.namechips span {
  font-size: 13.5px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); padding: 6px 13px; border-radius: 20px;
}

/* ---------- Tutorials overview page ------------------------------------ */
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 8px; }
.tut-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--ink); border-radius: 12px; padding: 16px 18px; color: var(--text);
}
.tut-card.m1 { border-left-color: var(--m1); }
.tut-card.m2 { border-left-color: var(--m2); }
.tut-card.m3 { border-left-color: var(--m3); }
.tut-card:hover { border-color: var(--ink); text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.tut-card .tut-n { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.tut-card .tut-t { font-size: 16px; font-weight: 600; color: var(--ink-700); }

.quicklinks a.big-link { background: var(--ink-soft); border-color: var(--ink); font-size: 16px; font-weight: 700; }

/* ---------- Inline PDF viewer (lecture slides, syllabus) --------------- */
.pdf-embed { margin: 6px 0 24px; }
.pdf-embed iframe {
  width: 100%; aspect-ratio: 16 / 9; height: auto;   /* one slide per view (lecture PDFs are 16:9) */
  border: 1px solid var(--line); border-radius: 10px; background: #f4f4f2; display: block;
}
.pdf-embed .dl-btn { margin-top: 10px; }
