/* Grammar courses — shared styles */
:root {
  --navy:   #1a2744;
  --navy-2: #2a3a5c;
  --gold:   #c9a227;
  --gold-2: #e6bf3e;
  --cream:  #faf6ec;
  --cream-2:#f5ecd7;
  --ink:    #1d2433;
  --muted:  #6b7386;
  --line:   #e6dfc9;
  --ok:     #2f855a;
  --err:    #c53030;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fbf9f2;
  line-height: 1.6;
}
a { color: var(--navy); }

/* ── Top bar ─────────────────────────────────────────────────────── */
.lesson-top {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: #fff;
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.lesson-top .breadcrumb {
  display: inline-flex; align-items: center; gap: 0; flex-shrink: 0;
}
.lesson-top .breadcrumb a {
  color: rgba(255,255,255,0.75); text-decoration: none; font-size: 0.88rem; font-weight: 500;
  padding: 0.35rem 0.55rem; border-radius: 7px; transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.lesson-top .breadcrumb a:first-child { padding-left: 0.3rem; }
.lesson-top .breadcrumb a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.lesson-top .breadcrumb a.bc-active { color: #fff; font-weight: 700; }
.lesson-top .breadcrumb .bc-sep { color: rgba(255,255,255,0.3); font-size: 0.8rem; padding: 0 0.1rem; user-select: none; }
.lesson-top .course-name { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; color: var(--gold-2); }
.lesson-top .top-progress {
  margin-left: auto; display: flex; align-items: center; gap: 0.7rem;
  font-size: 0.85rem; color: rgba(255,255,255,0.85);
}
.lesson-top .progress-bar { width: 180px; height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; overflow: hidden; }
.lesson-top .progress-bar span { display: block; height: 100%; background: var(--gold); transition: width 0.3s; }

/* ── Wrap & header ───────────────────────────────────────────────── */
.lesson-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.lesson-header { margin-bottom: 2.5rem; }
.lesson-eyebrow {
  display: inline-block; background: var(--cream-2); color: var(--navy);
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.35rem 0.85rem; border-radius: 100px; font-weight: 700; margin-bottom: 1rem;
}
.lesson-title {
  font-family: 'Playfair Display', serif; font-size: 2.5rem; line-height: 1.15;
  color: var(--navy); margin: 0 0 0.8rem; font-weight: 800;
}
.lesson-title em { color: var(--gold); font-style: italic; }
.lesson-sub { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ── Callout ─────────────────────────────────────────────────────── */
.callout {
  background: linear-gradient(135deg, #fff7e0 0%, #fff 100%);
  border-left: 4px solid var(--gold);
  padding: 1rem 1.2rem; border-radius: 10px; margin: 1.2rem 0; font-size: 0.98rem;
}
.callout strong { color: var(--navy); }

/* ── Theory ──────────────────────────────────────────────────────── */
.theory {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.8rem 2rem; margin: 1.5rem 0; box-shadow: 0 2px 8px rgba(26,39,68,0.04);
}
.theory h2 {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--navy);
  margin: 0 0 1rem; padding-left: 0.8rem; border-left: 4px solid var(--gold);
}

/* ── Exercise / Quiz ─────────────────────────────────────────────── */
.exercise {
  background: var(--navy); color: #fff;
  border-radius: 14px; padding: 1.8rem 2rem; margin: 2rem 0;
}
.exercise h2 {
  font-family: 'Playfair Display', serif; font-size: 1.5rem;
  color: var(--gold-2); margin: 0 0 0.5rem;
}
.exercise .task { color: rgba(255,255,255,0.8); margin-bottom: 1.2rem; font-size: 0.98rem; }
.exercise .ex-example {
  background: #f8f4ec; border: 1px solid var(--line);
  border-radius: 12px; padding: 1.2rem 1.4rem; margin-bottom: 1.5rem;
  color: var(--ink);
}
.exercise .ex-example p { color: var(--ink); margin: 0 0 0.45rem; font-size: 0.95rem; }
.exercise .ex-example p:last-child { margin-bottom: 0; }
.exercise .ex-example .ex-title {
  font-weight: 700; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--navy); margin: 0 0 0.8rem;
}
.quiz-item {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 0.8rem;
}
.quiz-item .q { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.7rem; }
.quiz-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quiz-options button {
  padding: 0.55rem 1rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; color: #fff; font-family: inherit; font-size: 0.95rem;
  cursor: pointer; transition: all 0.15s;
}
.quiz-options button:hover { background: rgba(255,255,255,0.15); }
.quiz-options button.correct { background: var(--ok); border-color: var(--ok); }
.quiz-options button.wrong   { background: var(--err); border-color: var(--err); }
.quiz-feedback { margin-top: 0.6rem; font-size: 0.9rem; }
.quiz-feedback.ok  { color: #9ae6b4; }
.quiz-feedback.err { color: #feb2b2; }
.btn-retry {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem;
  background: transparent; border: 1.5px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7); padding: 0.55rem 1.2rem; border-radius: 10px;
  font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-retry:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

/* ── Bottom nav ──────────────────────────────────────────────────── */
.lesson-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--line);
}
.lesson-nav a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.4rem; border-radius: 10px; text-decoration: none;
  font-weight: 600; font-size: 0.98rem; transition: all 0.15s;
}
.lesson-nav .prev { color: var(--navy); border: 2px solid var(--line); background: #fff; }
.lesson-nav .prev:hover { border-color: var(--navy); }
.lesson-nav .next { background: var(--navy); color: #fff; }
.lesson-nav .next:hover { background: var(--navy-2); }
.lesson-nav .done-btn {
  background: var(--gold); color: var(--navy); border: none;
  padding: 0.85rem 1.4rem; border-radius: 10px; font-family: inherit;
  font-weight: 700; cursor: pointer; font-size: 0.98rem;
}
.lesson-nav .done-btn.completed { background: var(--ok); color: #fff; }

/* ── Audio buttons ───────────────────────────────────────────────── */
.text-audio-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--navy); color: var(--gold-2);
  border: none; padding: 0.55rem 1.1rem; border-radius: 100px;
  font-size: 0.88rem; font-weight: 600; font-family: inherit;
  cursor: pointer; margin-bottom: 1rem; transition: background 0.15s;
}
.text-audio-btn:hover { background: var(--navy-2); }
.text-audio-btn.playing { background: var(--gold); color: var(--navy); }

/* ── UA toggle ───────────────────────────────────────────────────── */
.ua-btn {
  display: inline-flex; align-items: center;
  margin-left: 0.45rem; padding: 0.1rem 0.45rem;
  font-family: inherit; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1.5px solid var(--gold); border-radius: 4px;
  color: var(--gold); background: transparent;
  cursor: pointer; vertical-align: middle; transition: all 0.15s; line-height: 1.4;
}
.ua-btn:hover { background: var(--gold); color: var(--navy); }
.ua-hint { display: none; margin-top: 0.35rem; font-size: 0.82rem; color: var(--muted); font-style: italic; }
.ua-hint.open { display: block; }

/* ── Overview page ───────────────────────────────────────────────── */
.ov-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #243558 100%);
  color: #fff; padding: 4rem 1.5rem 3rem; text-align: center;
}
.ov-hero h1 {
  font-family: 'Playfair Display', serif; font-size: 3rem;
  margin: 0 0 0.6rem; font-weight: 800;
}
.ov-hero h1 em { color: var(--gold-2); font-style: italic; }
.ov-hero p { font-size: 1.1rem; opacity: 0.85; max-width: 600px; margin: 0 auto; }
.ov-hero .ov-tag {
  display: inline-block; background: rgba(201,162,39,0.18); color: var(--gold-2);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.3rem 0.9rem; border-radius: 100px; margin-bottom: 1.2rem;
}
.ov-stats {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 2.5rem; margin-top: 2rem;
}
.ov-stats div strong { display: block; font-size: 2rem; color: var(--gold-2); font-family: 'Playfair Display', serif; }
.ov-stats div span { font-size: 0.85rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; }
.ov-wrap { max-width: 800px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.ov-about {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.5rem 1.8rem; margin-bottom: 2.5rem;
}
.ov-about p { margin: 0; font-size: 1.05rem; line-height: 1.7; color: var(--ink); }
.ov-lessons { display: flex; flex-direction: column; gap: 0.75rem; }
.ov-section-title {
  font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--navy);
  margin: 0 0 1rem; font-weight: 800;
}
.ov-lesson-card {
  display: flex; align-items: center; gap: 1rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.2rem; text-decoration: none; color: var(--ink);
  transition: all 0.15s;
}
.ov-lesson-card:hover { border-color: var(--gold); transform: translateX(4px); box-shadow: 0 3px 12px rgba(26,39,68,0.08); }
.ov-lesson-card .num {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--cream-2); color: var(--navy);
  border-radius: 50%; text-align: center; line-height: 32px;
  font-weight: 700; font-size: 0.88rem;
}
.ov-lesson-card .card-body { flex: 1; min-width: 0; }
.ov-lesson-card h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; margin: 0 0 0.2rem; color: var(--navy); }
.ov-lesson-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.ov-lesson-card .type {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem; background: var(--cream-2); color: var(--navy);
  border-radius: 100px; font-weight: 700; flex-shrink: 0;
}
.ov-lesson-card .type.quiz    { background: #fff3cd; color: #8a6d1d; }
.ov-lesson-card .type.song    { background: #fde4f0; color: #9a2a5a; }
.ov-lesson-card .type.grammar { background: #dde9ff; color: #2a4a8a; }
.ov-lesson-card .arrow { color: var(--muted); font-size: 1.1rem; flex-shrink: 0; }

/* ── Diary entry ─────────────────────────────────────────────────── */
.diary-entry {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 2rem 2.2rem; margin: 0.5rem 0 1.5rem;
  box-shadow: 0 2px 12px rgba(26,39,68,0.04);
}
.diary-opening {
  display: block; font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-style: italic; color: var(--gold);
  margin-bottom: 1.1rem;
}
.diary-body { font-size: 1.05rem; line-height: 1.8; color: var(--ink); }
.diary-body p { margin: 0 0 1.1rem; }
.diary-body p:last-child { margin-bottom: 0; }
.diary-body strong { color: var(--navy); font-weight: 700; }
.diary-sep { text-align: center; color: var(--muted); letter-spacing: 0.3em; margin: 1.5rem 0; font-size: 0.9rem; user-select: none; }
.diary-exclaim { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 800; color: var(--navy); text-align: center; margin: 0.8rem 0; }
.diary-image-block { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1rem; }
.diary-image-block img { width: 220px; flex-shrink: 0; border-radius: 10px; object-fit: cover; box-shadow: 0 4px 16px rgba(26,39,68,0.1); }
.diary-image-block .diary-text-col { flex: 1; min-width: 0; }

/* ── Grammar focus cards ─────────────────────────────────────────── */
.gram-cards { display: flex; flex-direction: column; gap: 1.5rem; margin: 1.5rem 0; }
.gram-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(26,39,68,0.05); }
.gram-card-head { padding: 1.2rem 1.6rem 1rem; background: var(--navy); }
.gram-card-formula { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 800; color: var(--gold-2); margin: 0 0 0.4rem; }
.gram-card-formula em { color: rgba(255,255,255,0.7); font-style: italic; font-size: 1.1rem; }
.gram-card-meaning { font-size: 0.93rem; color: rgba(255,255,255,0.82); margin: 0; line-height: 1.55; }
.gram-card-meaning strong { color: #fff; }
.gram-card-body { padding: 0.25rem 0; }
.gram-example { display: flex; align-items: baseline; gap: 1.5rem; padding: 0.8rem 1.6rem; border-bottom: 1px solid var(--line); }
.gram-example:last-child { border-bottom: none; }
.gram-ex-en { flex: 1; font-size: 1rem; color: var(--ink); line-height: 1.5; }
.gram-ex-en strong { color: var(--navy); font-weight: 700; }
.gram-ex-ua { flex: 1; font-size: 0.9rem; color: var(--muted); font-style: italic; text-align: right; }
.gram-source { font-size: 0.75rem; color: var(--gold); font-weight: 600; display: block; margin-top: 0.15rem; }

/* ── Song page ───────────────────────────────────────────────────── */
.song-block {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.8rem 2rem; margin: 1.5rem 0;
}
.song-title { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 800; color: var(--navy); margin: 0 0 0.2rem; }
.song-artist { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.2rem; }
.song-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; }
.song-col h3 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 0.8rem; }
.song-lyrics { font-size: 0.97rem; line-height: 2; color: var(--ink); white-space: pre-line; }
.song-lyrics strong { color: var(--navy); font-weight: 700; }
.song-translation { font-size: 0.93rem; line-height: 2; color: var(--muted); white-space: pre-line; font-style: italic; }

/* ── Audio row (US / UK buttons) ────────────────────────────────── */
.audio-row {
  display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.audio-row .text-audio-btn { margin-bottom: 0; }
.audio-row .audio-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); align-self: center;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .lesson-title { font-size: 1.8rem; }
  .ov-hero h1 { font-size: 2rem; }
  .lesson-top { padding-left: 1rem; padding-right: 1rem; }
  .lesson-top .course-name { display: none; }
  .lesson-top .top-progress .txt { display: none; }
  .lesson-top .progress-bar { width: 50px; }
  .lesson-top .breadcrumb a { font-size: 0.8rem; padding: 0.3rem 0.4rem; }
  .diary-entry { padding: 1.4rem 1.2rem; }
  .diary-image-block { flex-direction: column; }
  .diary-image-block img { width: 100%; max-height: 200px; }
  .gram-example { flex-direction: column; gap: 0.2rem; padding: 0.8rem 1.2rem; }
  .gram-ex-ua { text-align: left; }
  .gram-card-formula { font-size: 1.1rem; }
  .song-columns { grid-template-columns: 1fr; }
  .lesson-nav { flex-wrap: wrap; gap: 0.6rem; }
  .lesson-nav a, .lesson-nav .done-btn { flex: 1 1 auto; min-width: 90px; text-align: center; padding: 0.75rem 0.9rem; font-size: 0.88rem; }
}
