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

body {
  font-family: Georgia, "Times New Roman", serif;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  color: #1a1a1a;
  line-height: 1.75;
  background: #fdfcfa;
}

a {
  color: #8b0000;
}

a:visited {
  color: #8b0000;
}

/* ── Header ── */

header {
  border-bottom: 2px solid #8b0000;
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  height: 110px;
  width: auto;
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header h1 {
  font-size: 1.9rem;
  margin: 0.25rem 0 0.2rem;
  color: #1a1a1a;
}

.subtitle {
  color: #666;
  margin: 0;
  font-size: 1.2rem;
  font-style: italic;
}

/* ── Site nav (Home / Calendar / Reading List) ── */

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.site-nav-btn {
  font-size: 1.1rem;
  color: #8b0000;
  text-decoration: none;
}

.site-nav-btn:hover {
  text-decoration: underline;
}

.site-nav-btn.active {
  font-weight: 600;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #8b0000;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #8b0000;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.back-link:hover {
  text-decoration: underline;
}

/* ── Homepage class list ── */

.class-section {
  margin-bottom: 2rem;
}

.class-section h2 {
  font-size: 1.15rem;
  color: #1a1a1a;
  margin: 0 0 0.4rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  border-bottom: 1px solid #e0d8d0;
  padding-bottom: 0.2rem;
}

.class-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.class-list li {
  margin: 0.45rem 0;
}

.class-list a {
  color: #8b0000;
  font-size: 1.05rem;
  text-decoration: none;
}

.class-list a:hover {
  text-decoration: underline;
}

/* ── Tabs ── */

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #ddd;
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.55rem 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: #8b0000;
}

.tab-btn.active {
  color: #8b0000;
  border-bottom-color: #8b0000;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Notes body (mammoth output) ── */

.notes-body h1 {
  font-size: 1.5rem;
  color: #1a1a1a;
  margin-top: 1.5rem;
}

.notes-body h2 {
  font-size: 1.25rem;
  color: #2c2c2c;
  margin-top: 1.4rem;
}

.notes-body h3 {
  font-size: 1.1rem;
  color: #3a3a3a;
  margin-top: 1.2rem;
}

.notes-body h4 {
  font-size: 1rem;
  color: #444;
  margin-top: 1rem;
}

.notes-body p {
  margin: 0.55rem 0;
}

.notes-body ul,
.notes-body ol {
  padding-left: 1.75rem;
  margin: 0.4rem 0;
}

.notes-body li {
  margin: 0.2rem 0;
}

.notes-body strong {
  font-weight: 700;
}

.notes-body em {
  font-style: italic;
}

.notes-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.notes-body th,
.notes-body td {
  border: 1px solid #ccc;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.notes-body th {
  background: #f5f0eb;
  font-weight: 700;
}

/* Class 16 personal-notes separator */
.notes-separator {
  border: none;
  border-top: 1px dashed #bbb;
  margin: 2.5rem 0 1rem;
}

.notes-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin: 0 0 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
}

/* ── Readings / PDF viewer ── */

.no-readings {
  color: #999;
  font-style: italic;
  font-size: 0.95rem;
}

.pdf-viewer {
  margin-bottom: 2.5rem;
}

.pdf-viewer h3 {
  font-size: 1rem;
  color: #555;
  margin: 0 0 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pdf-viewer iframe {
  display: block;
  width: 100%;
  height: 800px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

.pdf-open-link {
  display: none;
}

/* ── Reading list ── */

.reading-list section {
  margin-bottom: 2.5rem;
}

.reading-list h2 {
  font-size: 1.15rem;
  color: #1a1a1a;
  margin: 0 0 0.4rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  border-bottom: 1px solid #e0d8d0;
  padding-bottom: 0.2rem;
}

.reading-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reading-list li {
  margin: 0.4rem 0;
}

.reading-list a {
  color: #8b0000;
  font-size: 1rem;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.reading-list a:hover {
  text-decoration: underline;
}

/* ── Prev / next navigation ── */

.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0d8d0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.page-nav a {
  color: #8b0000;
  text-decoration: none;
}

.page-nav a:hover {
  text-decoration: underline;
}

/* ── Video player ── */

.video-player {
  margin-bottom: 2.5rem;
}

.video-player h3 {
  font-size: 1rem;
  color: #555;
  margin: 0 0 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.video-player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* ── Arrow spans in notes ── */

.arrow {
  font-size: 1.25em;
  line-height: 1;
}

/* ── Contact page ── */

.staff-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.staff-list li {
  margin-bottom: 1.25rem;
  line-height: 1.9;
}

.staff-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.staff-photo {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.staff-list strong {
  font-size: 1.2rem;
}

/* ── Footer ── */

footer {
  margin-top: 3rem;
  border-top: 1px solid #eee;
  padding-top: 0.75rem;
  font-size: 0.78rem;
  color: #bbb;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .hamburger {
    display: block;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .site-nav .site-nav-btn {
    display: none;
  }

  .site-nav.open .site-nav-btn {
    display: block;
    padding: 0.35rem 0;
  }

  .pdf-viewer iframe {
    display: none;
  }

  .pdf-open-link {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.6rem 1.2rem;
    background: #8b0000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
  }
}
