/* ============================================================
   SCU:BA — style.css
   Blue color palette, clean and professional
   ============================================================ */

:root {
  --navy:   #0369a1;
  --blue:   #0ea5e9;
  --mid:    #38bdf8;
  --light:  #e0f2fe;
  --pale:   #f0f9ff;
  --text:   #0f172a;
  --muted:  #64748b;
  --border: #bae6fd;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }

/* --- Body / page layout --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--pale);
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* --- Centering utility --- */
.center {
  text-align: center;
}

/* Prose content inside .center should stay left-aligned */
.center p,
.center ul,
.center ol,
.center li {
  text-align: left;
}

table.center {
  margin-left: auto;
  margin-right: auto;
}

/* --- Links --- */
a             { color: var(--blue); text-decoration: none; }
a:hover       { color: var(--mid);  text-decoration: underline; }
a:visited     { color: #4338ca; }

/* --- Banner --- */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--light);
  color: var(--navy);
  font-size: 3.5rem;
  font-weight: 700;
  //letter-spacing: 0.04em;
  text-align: center;
  padding: 0.6rem 1.5rem;
  margin: 0 -1.5rem 0;
  border-bottom: 1px solid var(--border);
}

/* --- Navigation ---
   All four pages put nav buttons inside a .nobr div.
   Bleed to the edges of body with negative margins. */
.nobr {
  display: block;
  background: var(--navy);
  padding: 0.7rem 1.5rem;
  text-align: center;
  margin: 0 -1.5rem 2.5rem;
  border-bottom: 3px solid var(--mid);
}

.nobr a {
  display: inline-block;
  margin: 0 0.5rem;
  text-decoration: none;
}

.nobr button {
  background: transparent;
  color: #bae6fd;
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 5px;
  padding: 0.6rem 1.6rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nobr button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(125, 211, 252, 0.75);
}

/* --- Page title (h1) --- */
h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.025em;
  margin: 0.25rem 0 1.5rem;
}

/* --- Section headings (h2) --- */
h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue);
  margin: 2.25rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--light);
}

/* Day entries: the date in the heading is prominent */
h2[id^="day"] {
  color: var(--navy);
  font-size: 1.1rem;
}

/* Back-to-calendar arrow inside day headings */
.back-to-top,
.back-to-top:visited {
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 400;
  margin-left: 0.4em;
  text-decoration: none;
  vertical-align: middle;
}
.back-to-top:hover { color: var(--blue); }

/* --- In-page section nav (resources.html) --- */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  font-size: 0.9rem;
}

.section-nav li:not(:last-child)::after {
  content: "\2022";
  color: var(--border);
  margin: 0 0.6rem;
}

.section-nav a {
  color: var(--blue);
  text-decoration: none;
}

.section-nav a:hover {
  color: var(--mid);
  text-decoration: underline;
}

/* --- Sub-headings (h3) --- */
h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 1.25rem 0 0.4rem;
}

/* --- Paragraphs --- */
p { margin: 0 0 0.75rem; }

/* --- Lists --- */
ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 0.75rem;
}

li { margin-bottom: 0.2rem; }

ul ul, ol ol, ul ol, ol ul {
  margin-top: 0.2rem;
  margin-bottom: 0.1rem;
}

/* --- Thumbnail + link (resources.html) --- */
.thumbnail-link {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.thumbnail {
  flex: none;
  width: 90px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* --- Horizontal rule --- */
hr {
  border: none;
  border-top: 1px solid var(--light);
  margin: 2rem 0;
}

/* --- Week divider (index.html journal) --- */
.week-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2.5rem;
}

.week-divider::before,
.week-divider::after {
  content: "";
  flex: 1;
  height: 3px;
  background: var(--navy);
  border-radius: 2px;
}

.week-divider span {
  flex: none;
  color: var(--navy);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Code --- */
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.875em;
  background: var(--pale);
  color: var(--navy);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* --- Italic / emphasis --- */
i, em { font-style: italic; }

/* --- Code blocks (multi-line program listings) --- */
.code-frame {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

/* Filename tab above the code */
.code-frame-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--navy);
  color: #bae6fd;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 1rem;
}

.copy-btn {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  flex: none;
  margin: 0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #bae6fd;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(186, 230, 253, 0.35);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.copy-btn.copied {
  color: #bbf7d0;
  border-color: rgba(187, 247, 208, 0.5);
}

pre.code-block {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
}

/* Override Prism's theme background/shadow to match the site palette */
pre.code-block,
pre.code-block[class*="language-"] {
  background: var(--light) !important;
}

pre.code-block code[class*="language-"] {
  text-shadow: none;
}

/* The generic inline `code` rule above adds a border/background/padding
   meant for short inline snippets. Applied to the multi-line <code> inside
   a <pre>, an inline element's border gets redrawn on every wrapped line.
   Reset it here so only the .code-frame border shows. */
pre.code-block code {
  border: none;
  border-radius: 0;
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ============================================================
   Pygame key-constants table  (resources.html)
   Three column-groups side by side to save vertical space.
   ============================================================ */
.key-table-wrap {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.key-table {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.key-table th,
.key-table td {
  border: 1px solid var(--border);
  padding: 0.2rem 0.4rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.key-table td {
  background: ivory;
}

.key-table th:nth-child(1), .key-table td:nth-child(1) { width: 42%; }
.key-table th:nth-child(2), .key-table td:nth-child(2) { width: 16%; }
.key-table th:nth-child(3), .key-table td:nth-child(3) { width: 42%; }

.key-table th {
  background: var(--navy);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-align: left;
}

.key-table td:nth-child(2) {
  text-align: center;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color: var(--navy);
}

.key-table td:last-child {
  color: var(--muted);
}

@media (max-width: 640px) {
  .key-table-wrap {
    flex-direction: column;
    gap: 1.5rem;
  }

  .key-table {
    width: 100%;
    font-size: 0.8rem;
  }
}

/* ============================================================
   Schedule table  (index.html)
   ============================================================ */
table.center {
  border-collapse: collapse;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
}

table.center th,
table.center td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  text-align: center;
  min-width: 72px;
  white-space: nowrap;
}

/* Top header row: Mon Tue Wed Thu Fri */
table.center tr:first-child th {
  background: var(--navy);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-color: var(--navy);
}

/* Empty corner cell */
table.center tr:first-child td {
  background: var(--navy);
  border-color: var(--navy);
}

/* Week-label column: Week 1, Week 2, … */
table.center tr:not(:first-child) th {
  background: var(--pale);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border-color: var(--border);
}

/* Date cells */
table.center td {
  color: var(--muted);
  font-size: 0.875rem;
}

table.center td a {
  font-weight: 500;
  color: var(--blue);
}

table.center td a:hover {
  color: var(--mid);
}

/* "no class" cells (td with no link) */
table.center td:not(:has(a)):not(:empty) {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.82rem;
}

/* ============================================================
   Bios table  (about.html)
   Note: the inline <style> block in about.html controls
   color, th background-color, th font-weight, th text-align,
   and td padding — those declarations win over this sheet.
   We add border, spacing, and image styles here.
   ============================================================ */
table.bios {
  border-collapse: collapse;
  margin: 1.5rem auto;
  font-size: 0.95rem;
  max-width: 640px;
  width: 100%;
}

table.bios th,
table.bios td {
  border: 1px solid var(--border);
  vertical-align: middle;
}

/* th: padding not set by inline style */
table.bios th {
  padding: 0.75rem;
  min-width: 130px;
}

table.bios li {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

table.bios img {
  display: block;
  margin: 0 auto 0.5rem;
  border: 3px solid var(--light);
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 640px) {
  body {
    font-size: 17px;
    padding: 0 1rem 3rem;
  }

  .banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem 0.5rem;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    margin: 0 -1rem 0;
  }

  .banner img {
    width: 26px;
  }

  .nobr {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 -1rem 2rem;
    padding: 0.6rem 0.5rem;
  }

  .nobr a {
    margin: 0;
  }

  .nobr button {
    font-size: 0.72rem;
    padding: 0.32rem 0.55rem;
  }

  h1 { font-size: 1.3rem; }

  h2 { font-size: 1.15rem; }

  h3 { font-size: 0.9rem; }

  table.center {
    font-size: 0.82rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.center th,
  table.center td {
    padding: 0.35rem 0.5rem;
    min-width: 52px;
  }

  table.bios {
    font-size: 0.9rem;
  }

  table.bios th {
    min-width: 100px;
  }

  table.bios td {
    padding-left: 0.75rem !important;
    padding-right: 0.5rem !important;
  }
}
