/* ============================================================
   MUSC 3323 — History of Rock
   Universal stylesheet for individual chapter/week HTML files
   WCAG 2.1 AA compliant: contrast ratios verified ≥ 4.5:1
   ============================================================
   Drop this into the same folder as the slide HTML files and
   link it from each chapter file with:

     <link rel="stylesheet" href="musc-3323-slides.css">

   Once linked you can DELETE the inline <style> block in the
   chapter file. Nothing else needs to change.
   ============================================================ */


/* ---------- DESIGN TOKENS ----------------------------------- */
:root {
  /* Type ramp — clamp() gives smooth fluid sizing */
  --fs-h1:    clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --fs-h2:    clamp(1.25rem, 1.05rem + 1vw,   1.6rem);
  --fs-h3:    clamp(1.05rem, 0.95rem + 0.6vw, 1.25rem);
  --fs-body:  1.0625rem;     /* 17px — slightly above default for readability */
  --fs-small: 0.95rem;

  /* Spacing scale */
  --sp-1: 0.5rem;
  --sp-2: 0.75rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2rem;
  --sp-6: 2.75rem;

  /* Color palette — all combos verified for WCAG AA on white */
  --c-text:        #1a1a1a;   /* 16.6:1 on white */
  --c-text-soft:   #3d3d3d;   /* 11.2:1 on white */
  --c-muted:       #595959;   /*  7.0:1 on white */
  --c-bg:          #fafaf7;   /* warm off-white, easier on eyes than #fff */
  --c-surface:     #ffffff;
  --c-border:      #c9c9c9;
  --c-border-soft: #e3e3e3;

  /* SUNY Oneonta crimson — darkened for AA on white */
  --c-accent:      #9a1f24;   /* 6.6:1 on white */
  --c-accent-bg:   #fdeeef;   /* tint for highlight blocks */

  /* Listening guide purple — darkened from #6a0dad for AA */
  --c-lg:          #5a0a96;   /* 8.6:1 on white */
  --c-lg-bg:       #f3ebfa;
  --c-lg-row:      #faf5ff;

  /* Focus ring — high visibility for keyboard nav */
  --c-focus:       #ffbf00;

  --radius:    6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.08);
}


/* ---------- RESET & BASE ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  /* System font stack — friendly, readable, fast-loading */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  max-width: 920px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { display: block; }

/* ---------- HEADINGS --------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-text);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
  word-wrap: break-word;
}

h1 {
  font-size: var(--fs-h1);
  border-bottom: 4px solid var(--c-accent);
  padding-bottom: var(--sp-2);
  margin-top: var(--sp-3);
  letter-spacing: -0.01em;
}

/* H2 = chapter section divider. Card-style, NOT just a black box */
h2 {
  font-size: var(--fs-h2);
  background: var(--c-surface);
  border: 1px solid var(--c-border-soft);
  border-left: 6px solid var(--c-accent);
  padding: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

h3 {
  font-size: var(--fs-h3);
  color: var(--c-accent);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-2);
}

/* First H1 + intro pair sits closer together */
h1 + h2 {
  margin-top: var(--sp-3);
  border-left-color: var(--c-text);
}


/* ---------- PARAGRAPHS & TEXT ------------------------------ */
p { margin: 0 0 var(--sp-3); max-width: 70ch; }

strong { font-weight: 700; color: var(--c-text); }
em     { font-style: italic; }


/* ---------- LISTS ------------------------------------------ */
ul, ol {
  margin: 0 0 var(--sp-4);
  padding-left: var(--sp-5);
}

li {
  margin-bottom: var(--sp-2);
  line-height: 1.6;
}

/* Nested lists — slightly smaller, softer color */
li ul, li ol { margin-top: var(--sp-2); margin-bottom: 0; }

li li {
  font-size: 0.97em;
  color: var(--c-text-soft);
  margin-bottom: var(--sp-1);
}


/* ---------- LINKS ------------------------------------------ */
a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: background-color 0.15s, color 0.15s;
}
a:hover { background: var(--c-accent-bg); }
a:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ---------- IMAGES & THUMBNAILS ---------------------------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Inline content images (e.g. synth photos) */
main > img,
main > p > img {
  max-width: 480px;
  margin: var(--sp-3) 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

/* YouTube preview thumbnails — friendlier card style */
a.image-link {
  display: inline-block;
  max-width: 480px;
  margin: var(--sp-3) 0 var(--sp-4);
  position: relative;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--c-border);
  background: var(--c-surface);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
a.image-link:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: transparent;
}
a.image-link:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-color: var(--c-accent);
}
a.image-link img {
  display: block;
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
}

/* Play-button overlay on YT thumbs — purely decorative */
a.image-link::after {
  content: "▶";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  background: rgba(154, 31, 36, 0.92);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  padding-left: 4px;          /* visual centering of triangle */
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}


/* ---------- TABLES ----------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-4) 0;
  font-size: var(--fs-small);
  background: var(--c-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th, td {
  border: 1px solid var(--c-border-soft);
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

thead th {
  background: #ececec;
  color: var(--c-text);
  font-weight: 700;
  border-bottom: 2px solid var(--c-border);
}

tbody tr:nth-child(even) td { background: #fafafa; }


/* ---------- LISTENING GUIDE -------------------------------- */
.listening-guide {
  border: 2px solid var(--c-lg);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin: var(--sp-5) 0;
  background: var(--c-lg-bg);
  box-shadow: var(--shadow-sm);
}

.listening-guide h3 {
  background: var(--c-lg);
  color: #fff;
  padding: var(--sp-2) var(--sp-3);
  margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-3);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.listening-guide p {
  color: var(--c-text);
  max-width: none;
}

.listening-guide .lg-title {
  font-weight: 700;
  color: var(--c-lg);
  font-size: 1.1em;
  margin-bottom: var(--sp-3);
  line-height: 1.4;
}

.listening-guide .lg-label {
  font-weight: 700;
  color: var(--c-lg);
  display: inline-block;
  margin-right: 0.25em;
}

.listening-guide table {
  background: var(--c-surface);
  margin-top: var(--sp-3);
}

.listening-guide table th {
  background: #e8d8f5;
  color: var(--c-lg);
  border-bottom: 2px solid var(--c-lg);
}

.listening-guide tbody tr:nth-child(even) td {
  background: var(--c-lg-row);
}


/* ---------- ACCESSIBILITY HELPERS -------------------------- */

/* Visible focus outlines on every interactive element */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}

/* Skip link — invisible until focused, jumps to main content.
   Add <a class="skip-link" href="#main">Skip to content</a>
   right after <body> if desired. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--c-text);
  color: #fff;
  padding: var(--sp-2) var(--sp-3);
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Honor reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  a.image-link:hover { transform: none; }
}


/* ---------- PRINT ------------------------------------------ */
@media print {
  body { background: #fff; max-width: none; padding: 0; }
  h2 { box-shadow: none; border: 1px solid #000; }
  a { color: #000; text-decoration: underline; }
  a.image-link::after { display: none; }
  .listening-guide { page-break-inside: avoid; }
}


/* ---------- RESPONSIVE ------------------------------------- */
@media (max-width: 600px) {
  body { padding: var(--sp-3); }
  h2 { padding: var(--sp-2) var(--sp-3); }
  .listening-guide { padding: var(--sp-3); }
  .listening-guide h3 {
    margin: calc(var(--sp-3) * -1) calc(var(--sp-3) * -1) var(--sp-3);
  }
  ul, ol { padding-left: var(--sp-4); }
}
