/* Shared styles for the classes index and class pages (teachercolin.com redesign). */

:root {
  --ink: #232019;
  --secondary: #5C5546;
  --meta: #6B6455;
  --body-alt: #403A30;
  --paper: #FFFFFF;
  --warm-panel: #F4F1EA;
  --neutral-tint: #FAF8F4;
  --hairline-neutral: #E7E1D5;

  /* Per-class overrides — set on each class page. Defaults below are Athens. */
  --accent: #4F9483;
  --class-ink: #041712;
  --text-safe: #3A7466;
  --tint: #F4FAF8;
  --hairline: #D9E8E3;
  --eyebrow-ink: #2F6154;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding-left: 22px;
  padding-right: 22px;
}

a { color: inherit; }

/* Both languages show unless JS has run and picked one. */
html.lang-en [lang="vi"] { display: none; }
html.lang-vi [lang="en"] { display: none; }

/* ---------- Language toggle ---------- */

.lang-toggle {
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
}

.lang-toggle button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 9px 16px;
  background: transparent;
  color: inherit;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--class-ink);
}

.lang-toggle button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* On the dark index header the inactive wash and active fill are white-based. */
.hero-dark .lang-toggle {
  background: rgba(255, 255, 255, 0.18);
}
.hero-dark .lang-toggle button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
}

/* On a coloured class header the wash uses the class ink at low opacity;
   the active segment fills solid ink with light text. */
.hero-accent .lang-toggle {
  background: rgba(0, 0, 0, 0.14);
}
.hero-accent .lang-toggle button[aria-pressed="true"] {
  background: var(--class-ink);
  color: #fff;
}

/* ---------- Focus ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.hero-accent a:focus-visible,
.hero-dark a:focus-visible {
  outline-color: currentColor;
}

/* ---------- Eyebrows ---------- */

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Index page ---------- */

.hero-dark {
  background: #232019;
  color: #fff;
  padding: 20px 0 24px;
}

.hero-dark .header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.wordmark { font-size: 16px; font-weight: 600; }

.index-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

.index-intro {
  font-size: 18px;
  line-height: 1.5;
  margin: 8px 0 0;
}
.index-intro[lang="en"] { opacity: .92; }
.index-intro[lang="vi"] { opacity: .78; margin-top: 4px; }

.card-list {
  padding: 18px 0 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.class-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline-neutral);
}

.class-card:hover .card-band-color { filter: brightness(0.97); }

.card-band-color {
  padding: 15px 18px;
}

.card-band-color .eyebrow { color: inherit; }

.card-class-name {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.15;
  margin: 3px 0 0;
}

.card-band-white {
  padding: 15px 18px;
  background: var(--paper);
}

.card-subject-en {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}

.card-subject-vi {
  font-size: 17px;
  font-weight: 400;
  color: var(--secondary);
  line-height: 1.45;
}

.index-footer p {
  font-size: 16px;
  line-height: 1.6;
  margin: 4px 0 0;
}
.index-footer p[lang="en"] { color: var(--body-alt); margin-top: 0; }
.index-footer p[lang="vi"] { color: var(--secondary); }

/* ---------- Class page ---------- */

.hero-accent {
  background: var(--accent);
  color: var(--class-ink);
  padding: 20px 0 26px;
}

.hero-accent .header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.class-eyebrow {
  letter-spacing: 0.12em;
}

.class-name {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 6px 0 12px;
}

.subject-en, .subject-vi {
  font-size: 18px;
  line-height: 1.4;
}
.subject-en { font-weight: 600; }
.subject-vi { font-weight: 400; }

.page-body {
  padding: 20px 0 26px;
}

.button-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-btn {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--hairline-neutral);
}

.link-btn:hover { filter: brightness(0.98); }

.link-btn-archive {
  background: var(--tint);
  border-color: var(--hairline);
}

.link-btn-files {
  background: var(--neutral-tint);
  border-color: var(--hairline-neutral);
}

.icon-tile {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Newsreader', serif;
  font-size: 22px;
  font-weight: 500;
}

.icon-tile-archive { background: var(--text-safe); }
.icon-tile-files { background: var(--ink); }

.btn-title-en, .btn-title-vi {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  display: block;
}
.btn-title-vi { font-size: 18px; font-weight: 400; color: var(--secondary); }

.btn-caption {
  font-size: 16px;
  color: var(--secondary);
  margin-top: 7px;
  line-height: 1.45;
  display: block;
}

.deadline-block {
  margin-top: 20px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 16px 18px;
}

.deadline-eyebrow { color: #B04A36; }

.deadline-line1 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 7px;
}

.deadline-line2 {
  font-size: 17px;
  line-height: 1.4;
  color: var(--secondary);
  margin-top: 3px;
}

.term-block { margin-top: 24px; }

.term-eyebrow {
  letter-spacing: 0.12em;
  color: var(--meta);
  margin-bottom: 10px;
  display: block;
}

.unit-title-en {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 4px;
}

.unit-title-vi {
  font-size: 19px;
  font-weight: 400;
  color: var(--secondary);
  line-height: 1.35;
  margin: 0 0 10px;
}

.myp-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--meta);
  margin-bottom: 14px;
}

.unit-description-en, .unit-description-vi {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 8px;
}
.unit-description-en { color: var(--ink); }
.unit-description-vi { color: var(--secondary); margin-bottom: 0; }

.ask-home {
  margin-top: 16px;
  background: var(--tint);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 15px 17px;
}

.ask-eyebrow {
  color: var(--eyebrow-ink);
  margin-bottom: 7px;
  display: block;
}

.ask-q-en {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
}

.ask-q-vi {
  font-size: 17px;
  line-height: 1.55;
  color: var(--secondary);
  margin-top: 4px;
}

.contact-block {
  margin-top: 24px;
  background: var(--warm-panel);
  border-radius: 14px;
  padding: 18px;
}

.contact-block p {
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
}
.contact-block p[lang="vi"] { color: var(--secondary); margin-top: 6px; }
.contact-block p[lang="en"] { color: var(--ink); }
.contact-block strong { font-weight: 600; }

.signature {
  margin-top: 20px;
  font-size: 16px;
  color: var(--meta);
}
