/* content.css — typography & content elements for markdown-rendered pages */

.content-article {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

/* Glossary term anchors — avoid being hidden under sticky / fixed header on mobile */
.content-article [id^="term-"],
.content-article [id]:target {
  scroll-margin-top: 80px;
}

/* Visual highlight when navigating to a specific term via #anchor */
.content-article [id^="term-"]:target {
  background: var(--tm-gold-soft);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  animation: term-highlight 1.5s ease-out;
}
@keyframes term-highlight {
  0% { background: var(--tm-gold); }
  100% { background: var(--tm-gold-soft); }
}

/* ── Headings ────────────────────────────────────────────────────────────── */
.content-article h1,
.content-article h2,
.content-article h3,
.content-article h4,
.content-article h5,
.content-article h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text);
  letter-spacing: -0.01em;
  scroll-margin-top: var(--sp-5);
}

.content-article h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 3px solid var(--tm-maroon);
  display: inline-block;
  padding-right: var(--sp-7);
}

.content-article h2 {
  font-size: var(--text-2xl);
  margin: var(--sp-8) 0 var(--sp-4);
  color: var(--tm-blue);
}

.content-article h3 {
  font-size: var(--text-xl);
  margin: var(--sp-6) 0 var(--sp-3);
}

.content-article h4 {
  font-size: var(--text-lg);
  margin: var(--sp-5) 0 var(--sp-3);
  color: var(--text-secondary);
}

.content-article h5 {
  font-size: var(--text-md);
  margin: var(--sp-4) 0 var(--sp-2);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Paragraphs & inline ─────────────────────────────────────────────────── */
.content-article p {
  margin-bottom: var(--sp-4);
}

.content-article strong { font-weight: 600; color: var(--text); }
.content-article em { font-style: italic; }

.content-article a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 65, 101, 0.4);
  transition: all var(--transition-fast);
}
.content-article a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--tm-maroon);
}

/* ── Lists ───────────────────────────────────────────────────────────────── */
.content-article ul,
.content-article ol {
  margin: 0 0 var(--sp-4) var(--sp-5);
  padding-left: var(--sp-3);
}
.content-article li { margin-bottom: var(--sp-2); }
.content-article li > ul,
.content-article li > ol { margin-top: var(--sp-2); margin-bottom: var(--sp-2); }

.content-article ul li::marker { color: var(--tm-maroon); }
.content-article ol li::marker { color: var(--tm-maroon); font-weight: 600; }

/* ── Blockquotes (callouts) ──────────────────────────────────────────────── */
.content-article blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--tm-gold-soft);
  border-left: 4px solid var(--tm-gold);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.content-article blockquote > :last-child { margin-bottom: 0; }
.content-article blockquote strong:first-of-type { color: var(--tm-maroon-dark); }

/* ── Code ────────────────────────────────────────────────────────────────── */
.content-article code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--tm-maroon-dark);
}

.content-article pre {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  background: #1a1a1f;
  color: #e4e4e8;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}
.content-article pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.content-article table {
  width: 100%;
  margin: var(--sp-5) 0;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.content-article thead {
  background: var(--bg-subtle);
}
.content-article th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.content-article td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.content-article tr:last-child td { border-bottom: none; }
.content-article tr:hover td { background: var(--accent-soft); }

@media (min-width: 769px) {
  .content-article table { white-space: normal; }
  .content-article th, .content-article td { white-space: normal; }
}

/* ── Horizontal rule ─────────────────────────────────────────────────────── */
.content-article hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
  margin: var(--sp-7) 0;
}

/* ── Images ──────────────────────────────────────────────────────────────── */
.content-article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: var(--sp-4) 0;
}

/* ── Glossary term tooltips ──────────────────────────────────────────────── */
.tm-term {
  display: inline;
  position: relative;
  cursor: help;
  border-bottom: 1.5px dotted var(--tm-blue-light);
  color: inherit;
  transition: background var(--transition-fast);
  padding: 0 1px;
  border-radius: 2px;
}
.tm-term:hover,
.tm-term:focus-visible {
  background: var(--tm-gold-soft);
  border-bottom-color: var(--tm-maroon);
  outline: none;
}

.tm-term-link {
  display: inline-block;
  margin-left: 1px;
  font-size: 0.7em;
  vertical-align: super;
  color: var(--tm-blue);
  text-decoration: none !important;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}
.tm-term:hover .tm-term-link { opacity: 1; }

/* Floating tooltip (positioned by JS) */
.tm-tooltip {
  position: absolute;
  z-index: var(--z-tooltip);
  max-width: 340px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--text);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.tm-tooltip:not([hidden]) { opacity: 1; transform: translateY(0); }
.tm-tooltip::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 16px;
  width: 10px; height: 10px;
  background: var(--text);
  transform: rotate(45deg);
}

/* ── Beginner callouts (special blockquote styling for "Pentru începători") ── */
.beginner-callout {
  background: linear-gradient(135deg, var(--tm-gold-soft) 0%, white 100%);
  border-left: 4px solid var(--tm-gold);
  padding: var(--sp-5);
  border-radius: var(--radius);
  margin: var(--sp-5) 0;
}
.beginner-callout::before {
  content: "💡 Pentru începători";
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tm-maroon);
  margin-bottom: var(--sp-2);
}

/* ── Mobile typography refinements ───────────────────────────────────────── */
@media (max-width: 768px) {
  .content-article { font-size: var(--text-sm); }
  .content-article h1 { font-size: var(--text-2xl); padding-right: 0; }
  .content-article h2 { font-size: var(--text-xl); }
  .content-article h3 { font-size: var(--text-lg); }
  .content-article pre { padding: var(--sp-3); margin-left: calc(var(--sp-3) * -1); margin-right: calc(var(--sp-3) * -1); border-radius: 0; }
}

/* ── WOW Hero — landing page only ───────────────────────────────────────── */
.hero {
  position: relative;
  margin: calc(var(--sp-5) * -1) calc(var(--sp-7) * -1) var(--sp-8);
  padding: var(--sp-10) var(--sp-7) var(--sp-8);
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top left, rgba(119, 36, 50, 0.04), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(0, 65, 101, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-subtle) 100%);
  z-index: -2;
}
.hero-bg::before {
  /* Subtle gold dot pattern */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--tm-gold) 0.5px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.12;
  z-index: -1;
}
.hero-inner { position: relative; max-width: 720px; }

.hero-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--tm-maroon);
  margin-bottom: var(--sp-3);
  padding: 4px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--sp-4);
  border-bottom: none;
  padding: 0;
  display: block;
}
.hero-accent {
  background: linear-gradient(135deg, var(--tm-maroon) 0%, var(--tm-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--tm-maroon); /* fallback */
}
.hero-lede {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: var(--sp-7);
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
}
.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.hero-cta::after {
  content: "→";
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  opacity: 0;
  color: var(--tm-maroon);
  font-size: 1.2rem;
  font-weight: 700;
  transition: all var(--transition);
}
.hero-cta:hover {
  border-color: var(--tm-maroon);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  padding-right: calc(var(--sp-5) + 16px);
}
.hero-cta:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.hero-cta-primary {
  background: linear-gradient(135deg, var(--tm-maroon) 0%, var(--tm-maroon-dark) 100%);
  border-color: var(--tm-maroon-dark);
  color: white;
}
.hero-cta-primary::after { color: var(--tm-gold); }
.hero-cta-primary:hover { color: white; border-color: var(--tm-gold); }
.hero-cta-primary .hero-cta-icon {
  background: rgba(255, 255, 255, 0.15);
  color: var(--tm-gold);
}
.hero-cta-primary strong { color: white; }
.hero-cta-primary small { color: rgba(255, 255, 255, 0.85); }

.hero-cta-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--tm-maroon);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.hero-cta strong {
  display: block;
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}
.hero-cta small {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.3;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}
.hero-stat {
  display: flex;
  flex-direction: column;
}
.hero-stat strong {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--tm-blue);
  line-height: 1;
  margin-bottom: 2px;
}
.hero-stat span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .hero {
    margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-6);
    padding: var(--sp-7) var(--sp-4) var(--sp-6);
  }
  .hero-title { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .hero-lede { font-size: var(--text-md); }
  .hero-actions { grid-template-columns: 1fr; }
  .hero-stats { gap: var(--sp-4); }
}

/* ── Print-all combined page (offline study / PDF) ──────────────────────── */
.print-all {
  max-width: none;
  padding: var(--sp-7);
}
.print-cover {
  text-align: center;
  padding: var(--sp-12) var(--sp-5);
  border-bottom: 3px solid var(--tm-maroon);
  margin-bottom: var(--sp-10);
  page-break-after: always;
}
.print-cover h1 {
  font-size: 3.5rem;
  color: var(--tm-maroon);
  border-bottom: none;
  display: inline-block;
  padding: 0;
  margin-bottom: var(--sp-3);
}
.print-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
}
.print-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-7);
}
.print-instructions {
  display: inline-block;
  padding: var(--sp-3) var(--sp-5);
  background: var(--tm-gold-soft);
  border-left: 4px solid var(--tm-gold);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.print-page {
  margin-bottom: var(--sp-10);
  padding-bottom: var(--sp-7);
  border-bottom: 1px dashed var(--border);
  page-break-after: always;
}
.print-page-section {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tm-maroon);
  font-weight: 700;
  margin-bottom: var(--sp-3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTE PENTRU PAGINI HTML-NATIVE (lectures, atelier practic)
   Reutilizabile pe orice pagină — nu hardcoded pe un pathway specific.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Callouts (6 variante: tip, atenție, exemplu, notă, exercițiu, greșeală) ─ */
.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3) var(--sp-4);
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius);
  border-left: 4px solid var(--border-strong);
  background: var(--bg-subtle);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.callout-icon {
  font-size: 1.4rem;
  line-height: 1;
  align-self: start;
  grid-row: span 2;
}
.callout-title {
  font-weight: 700;
  color: var(--text);
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}
.callout-body { color: var(--text); }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body p { margin-bottom: var(--sp-2); font-size: var(--text-sm); }
.callout-body ul, .callout-body ol { margin-bottom: var(--sp-2); margin-left: var(--sp-4); }

.callout-tip {
  background: linear-gradient(135deg, var(--tm-gold-soft) 0%, #fdf9e7 100%);
  border-left-color: var(--tm-gold);
}
.callout-tip .callout-title { color: var(--tm-maroon-dark); }

.callout-atentie {
  background: #fff4ed;
  border-left-color: #d97706;
}
.callout-atentie .callout-title { color: #b45309; }

.callout-exemplu {
  background: #edf7ed;
  border-left-color: #15803d;
}
.callout-exemplu .callout-title { color: #166534; }

.callout-nota {
  background: var(--bg-subtle);
  border-left-color: var(--text-muted);
}
.callout-nota .callout-title { color: var(--text-secondary); }

.callout-exercitiu {
  background: #f5f0fb;
  border-left-color: #7c3aed;
}
.callout-exercitiu .callout-title { color: #6d28d9; }

.callout-greseala {
  background: #fef2f2;
  border-left-color: #b91c1c;
}
.callout-greseala .callout-title { color: #991b1b; }

/* ── Exercise + Solution accordion (HTML5 <details> native, zero JS) ────── */
.exercise {
  margin: var(--sp-5) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.exercise:hover { box-shadow: var(--shadow-sm); }
.exercise[data-done="true"] {
  border-color: #15803d;
  background: #f8fcf8;
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.exercise[data-done="true"] .exercise-header {
  background: linear-gradient(180deg, #ecf7ec 0%, #f8fcf8 100%);
  border-bottom-color: #c5e0c5;
}

.exercise-num {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  background: var(--tm-maroon);
  color: white;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}
.exercise[data-done="true"] .exercise-num { background: #15803d; }

.exercise-title {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--text);
  margin: 0;
}

.exercise-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.exercise-check input[type="checkbox"] {
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: #15803d;
}
.exercise-check-label-done { display: none; color: #15803d; font-weight: 600; }
.exercise[data-done="true"] .exercise-check-label-todo { display: none; }
.exercise[data-done="true"] .exercise-check-label-done { display: inline; }

.exercise-body {
  padding: var(--sp-4) var(--sp-5);
}
.exercise-body p:first-child { margin-top: 0; }
.exercise-body p:last-child { margin-bottom: 0; }
.exercise-body ol, .exercise-body ul { margin-bottom: var(--sp-3); }

.exercise-prompt {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

/* The <details> solution toggle */
.exercise-solution {
  margin-top: var(--sp-4);
  border-top: 1px dashed var(--border);
  padding-top: var(--sp-4);
}
.exercise-solution > summary {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--tm-maroon);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--accent-soft);
  border-radius: var(--radius);
  transition: background var(--transition-fast);
}
.exercise-solution > summary::-webkit-details-marker { display: none; }
.exercise-solution > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform var(--transition-fast);
  color: var(--tm-maroon);
}
.exercise-solution[open] > summary::before { transform: rotate(90deg); }
.exercise-solution > summary:hover { background: rgba(119, 36, 50, 0.12); }
.exercise-solution[open] > summary {
  background: var(--tm-maroon);
  color: white;
  margin-bottom: var(--sp-3);
}
.exercise-solution[open] > summary::before { color: var(--tm-gold); }

.exercise-solution-body {
  background: linear-gradient(135deg, #f5f0fb 0%, #faf7fd 100%);
  border-left: 3px solid #7c3aed;
  padding: var(--sp-4) var(--sp-5);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}
.exercise-solution-body > :last-child { margin-bottom: 0; }

/* ── Progress bar (exercises completed) ─────────────────────────────────── */
.progress-tracker {
  position: sticky;
  top: var(--sp-3);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: var(--sp-5) 0;
  padding: var(--sp-3) var(--sp-4);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
}
.progress-tracker-label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.progress-tracker-label strong {
  color: var(--tm-maroon);
  font-size: var(--text-md);
}
.progress-tracker-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-tracker-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tm-maroon) 0%, var(--tm-blue) 100%);
  border-radius: var(--radius-pill);
  transition: width var(--transition-slow);
  width: 0%;
}
.progress-tracker-reset {
  padding: 4px 12px;
  font-size: var(--text-xs);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.progress-tracker-reset:hover { background: var(--bg-subtle); color: var(--tm-maroon); }

/* ── Speech rubric (self-check grid) ────────────────────────────────────── */
.speech-rubric {
  margin: var(--sp-5) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.speech-rubric table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  border: none;
  border-radius: 0;
  font-size: var(--text-sm);
  display: table;
  overflow: visible;
  white-space: normal;
}
.speech-rubric thead { background: var(--tm-maroon); }
.speech-rubric th {
  color: white;
  font-weight: 600;
  padding: var(--sp-3) var(--sp-3);
  text-align: left;
  white-space: normal;
  border: none;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}
.speech-rubric th:first-child { width: 22%; }
.speech-rubric td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.speech-rubric td:first-child {
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text);
}
.speech-rubric tr:last-child td { border-bottom: none; }
.speech-rubric td small {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Tip cards (micro-cards grid) ───────────────────────────────────────── */
.tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
}
.tip-card {
  padding: var(--sp-4);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 3px solid var(--tm-gold);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.tip-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tip-card-num {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tm-maroon);
}
.tip-card-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.tip-card-body {
  color: var(--text-secondary);
  margin: 0;
}

/* ── Mermaid diagram container ──────────────────────────────────────────── */
pre.mermaid {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  margin: var(--sp-5) 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-align: center;
  overflow-x: auto;
  line-height: 1.4;
  white-space: pre-wrap;
}
pre.mermaid svg { display: inline-block; max-width: 100%; height: auto; }

/* ── Speech analyzer widget ─────────────────────────────────────────────── */
.speech-widget {
  margin: var(--sp-6) 0;
  padding: var(--sp-5);
  background: linear-gradient(135deg, #fafbfd 0%, var(--bg-subtle) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.speech-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.speech-widget-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.speech-widget-title-icon {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  background: var(--tm-maroon);
  color: white;
  font-size: 1rem;
}
.speech-widget-disclaimer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.speech-widget-disclaimer::before { content: "🔒"; }

.speech-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.speech-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 18px;
  background: var(--tm-maroon);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.speech-btn:hover:not(:disabled) {
  background: var(--tm-maroon-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.speech-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.speech-btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.speech-btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--tm-maroon);
  color: var(--tm-maroon);
}
.speech-btn-danger {
  background: white;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.speech-btn-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #b91c1c;
}
.speech-btn .speech-btn-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: speech-pulse 1.2s ease-in-out infinite;
}
@keyframes speech-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.speech-status {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}
.speech-status[data-state="recording"] { color: #b91c1c; font-weight: 600; }
.speech-status[data-state="ready"] { color: #15803d; font-weight: 600; }

.speech-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.speech-stat {
  padding: var(--sp-3);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.speech-stat-value {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--tm-blue);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.speech-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.speech-fillers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  min-height: 32px;
}
.speech-filler-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--tm-gold-soft);
  border: 1px solid var(--tm-gold);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--tm-maroon-dark);
}
.speech-filler-badge[data-count="0"] { display: none; }
.speech-filler-badge .speech-filler-count {
  background: var(--tm-maroon);
  color: white;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
}

.speech-transcript {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  max-height: 200px;
  overflow-y: auto;
  color: var(--text);
}
.speech-transcript:empty::before {
  content: "Transcrierea apare aici după ce începi să vorbești…";
  color: var(--text-muted);
  font-style: italic;
}
.speech-transcript mark {
  background: var(--tm-gold-soft);
  color: var(--tm-maroon-dark);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

.speech-audio-section {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--border);
}
.speech-audio-section[hidden] { display: none !important; }
.speech-audio-section audio {
  width: 100%;
  margin-bottom: var(--sp-3);
}

.speech-suggestions {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--tm-gold-soft);
  border-left: 4px solid var(--tm-gold);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.speech-suggestions[hidden] { display: none !important; }
.speech-suggestions h4 {
  margin: 0 0 var(--sp-2);
  font-size: var(--text-sm);
  color: var(--tm-maroon-dark);
}
.speech-suggestions ul { margin: 0 0 0 var(--sp-4); }
.speech-suggestions li { margin-bottom: 4px; }

.speech-fallback {
  padding: var(--sp-4);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #991b1b;
  font-size: var(--text-sm);
}

/* ── Micro-Q&A (întrebări colapsabile inline — verificare a înțelegerii) ── */
.micro-qa {
  margin: var(--sp-3) 0;
  border-left: 3px solid var(--tm-blue-light);
  background: linear-gradient(90deg, #eff6ff 0%, transparent 70%);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0;
  font-size: var(--text-sm);
}
.micro-qa > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  color: var(--tm-blue);
  user-select: none;
  border-radius: 0 var(--radius) 0 0;
  transition: background var(--transition-fast);
}
.micro-qa > summary::-webkit-details-marker { display: none; }
.micro-qa > summary::before {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--radius-pill);
  background: var(--tm-blue);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.micro-qa[open] > summary::before { content: "✓"; background: #15803d; }
.micro-qa > summary:hover { background: rgba(0, 65, 101, 0.08); }
.micro-qa-body {
  padding: var(--sp-2) var(--sp-3) var(--sp-3) calc(var(--sp-3) + 30px);
  color: var(--text);
  line-height: var(--leading-normal);
  background: white;
  border-radius: 0 0 var(--radius) 0;
}
.micro-qa-body > :last-child { margin-bottom: 0; }
.micro-qa-body p { margin-bottom: var(--sp-2); }

/* ── Rubric form (auto-evaluare după discurs) ─────────────────────────── */
.rubric-form {
  margin: var(--sp-5) 0;
  padding: var(--sp-5);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.rubric-form-header {
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.rubric-form-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--sp-1);
}
.rubric-form-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}
.rubric-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.rubric-meta label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rubric-meta input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: var(--bg);
  color: var(--text);
}
.rubric-meta input[type="text"]:focus {
  outline: none;
  border-color: var(--tm-blue);
  box-shadow: var(--focus-ring);
}

.rubric-dim {
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-2) var(--sp-4);
  align-items: start;
}
.rubric-dim:last-of-type { border-bottom: none; }
.rubric-dim legend {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
  margin: 0;
  padding: 0;
}
.rubric-dim-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  grid-column: 1;
  margin: 0;
}
.rubric-dim-scale {
  display: flex;
  gap: 4px;
  align-items: center;
  grid-row: span 2;
}
.rubric-dim-scale label {
  position: relative;
  cursor: pointer;
}
.rubric-dim-scale input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rubric-dim-scale-btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}
.rubric-dim-scale label:hover .rubric-dim-scale-btn {
  border-color: var(--tm-maroon);
  color: var(--tm-maroon);
}
.rubric-dim-scale input:checked + .rubric-dim-scale-btn {
  background: var(--tm-maroon);
  color: white;
  border-color: var(--tm-maroon-dark);
}
.rubric-dim-scale input:focus-visible + .rubric-dim-scale-btn {
  box-shadow: var(--focus-ring);
}

.rubric-notes {
  margin-top: var(--sp-4);
}
.rubric-notes label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
  margin-bottom: var(--sp-1);
}
.rubric-notes textarea {
  width: 100%;
  min-height: 96px;
  padding: var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.rubric-notes textarea:focus {
  outline: none;
  border-color: var(--tm-blue);
  box-shadow: var(--focus-ring);
}

.rubric-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}
.rubric-actions button {
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.rubric-actions .btn-primary {
  background: var(--tm-maroon);
  color: white;
  border: 1px solid var(--tm-maroon-dark);
}
.rubric-actions .btn-primary:hover { background: var(--tm-maroon-dark); }
.rubric-actions .btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.rubric-actions .btn-secondary:hover {
  border-color: var(--tm-maroon);
  color: var(--tm-maroon);
  background: var(--bg-subtle);
}

.rubric-summary {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-subtle);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--text);
}
.rubric-status {
  margin-top: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-height: 1.2em;
}

/* ── Sub-pagini pathway: cuprins lateral / breadcrumb intern ──────────── */
.subpage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-5);
  padding: var(--sp-3);
  background: var(--bg-subtle);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
}
.subpage-nav-label {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  padding: 4px 0;
  margin-right: var(--sp-2);
}
.subpage-nav a {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: white;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.subpage-nav a:hover {
  border-color: var(--tm-maroon);
  color: var(--tm-maroon);
  text-decoration: none;
}
.subpage-nav a[aria-current="page"] {
  background: var(--tm-maroon);
  color: white;
  border-color: var(--tm-maroon-dark);
  font-weight: 600;
}

/* ── Bibliography list ──────────────────────────────────────────────────── */
.bibliography {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.bibliography li {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.bibliography li:last-child { border-bottom: none; }
.bibliography .biblio-author {
  font-weight: 600;
  color: var(--text);
}
.bibliography .biblio-title {
  font-style: italic;
  color: var(--text-secondary);
}

/* ── Section anchors with emoji-icon ────────────────────────────────────── */
.lecture-section {
  scroll-margin-top: var(--sp-7);
}
.lecture-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tm-maroon);
  margin-bottom: var(--sp-2);
}

/* ── Lecture hero (intro block) ─────────────────────────────────────────── */
.lecture-hero {
  margin: 0 0 var(--sp-7);
  padding: var(--sp-6) 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.lecture-hero .lecture-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tm-maroon);
  margin-bottom: var(--sp-2);
}
.lecture-hero h1 {
  margin-bottom: var(--sp-3);
  border-bottom: none;
  padding-right: 0;
  display: block;
}
.lecture-hero-lede {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
  max-width: 680px;
}
.lecture-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lecture-hero-meta strong {
  display: block;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--tm-blue);
  letter-spacing: -0.02em;
  text-transform: none;
}

/* ── TOC (mini, sticky on desktop) ──────────────────────────────────────── */
.lecture-toc {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.lecture-toc-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.lecture-toc ol {
  margin: 0;
  padding-left: var(--sp-5);
  columns: 2;
  column-gap: var(--sp-5);
}
.lecture-toc li {
  margin-bottom: 4px;
  break-inside: avoid;
}
@media (max-width: 768px) {
  .lecture-toc ol { columns: 1; }
}

/* ── Mobile refinements for components ──────────────────────────────────── */
@media (max-width: 768px) {
  .callout { padding: var(--sp-3); grid-template-columns: 1fr; }
  .callout-icon { grid-row: auto; }
  .speech-stats { grid-template-columns: 1fr 1fr; }
  .progress-tracker { flex-wrap: wrap; gap: var(--sp-2); position: static; }
  .exercise-header { flex-wrap: wrap; }
  .exercise-check { width: 100%; padding-left: 42px; margin-top: var(--sp-2); }
}

/* ── Lecture comparison table (used in /teorie/ sinteza) ─────────────────── */
.lecture-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-4) 0;
  font-size: 0.95em;
}
.lecture-table thead th {
  background: #fbfaf7;
  border-bottom: 2px solid var(--border, #e5e7eb);
  padding: var(--sp-3);
  text-align: left;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}
.lecture-table tbody td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: top;
}
.lecture-table tbody tr:last-child td {
  border-bottom: none;
}
.lecture-table tbody tr:hover {
  background: #fbfaf7;
}

/* ── Lecture description list (mini-glosar) ──────────────────────────────── */
.lecture-dl {
  margin: var(--sp-4) 0;
  display: grid;
  gap: var(--sp-3);
}
.lecture-dl dt {
  font-weight: 600;
  color: var(--brand-maroon, #772432);
  font-size: 1.02em;
  margin-bottom: 2px;
}
.lecture-dl dd {
  margin: 0 0 0 var(--sp-3);
  padding-left: var(--sp-3);
  border-left: 2px solid var(--border, #e5e7eb);
  color: var(--text-soft, #555);
  line-height: 1.55;
}

@media (max-width: 640px) {
  .lecture-table { font-size: 0.88em; }
  .lecture-table thead th, .lecture-table tbody td { padding: var(--sp-2); }
  .lecture-dl dd { margin-left: var(--sp-2); padding-left: var(--sp-2); }
}

/* ── Print rules for components ─────────────────────────────────────────── */
@media print {
  .speech-widget, .progress-tracker { display: none !important; }
  .exercise-solution[open] { display: block; }
  .exercise-solution > summary { display: none; }
  .exercise-solution-body { background: white; border-left-color: #999; }
  pre.mermaid { border: 1px solid #999; background: white; }
  .callout {
    background: white !important;
    border: 1px solid #999 !important;
    border-left: 4px solid #999 !important;
  }
}

/* ── Print styles (browser Print → Save as PDF) ─────────────────────────── */
@media print {
  body { display: block; background: white; }
  .sidebar, .menu-toggle, .backdrop, .content-footer, .search-overlay, .tm-tooltip, .skip-link { display: none !important; }
  .content { max-width: 100%; padding: 0; margin: 0; }
  .content-header { display: none; }
  .content-article { font-size: 11pt; line-height: 1.5; color: black; }
  .content-article a { color: var(--text); text-decoration: none; }
  .content-article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; word-break: break-all; }
  .content-article a[href^="/"]::after { content: ""; }
  .tm-term { border-bottom: none; }
  .tm-term-link { display: none; }
  .content-article h1 { font-size: 18pt; }
  .content-article h2 { font-size: 14pt; color: #333; page-break-after: avoid; }
  .content-article h3 { font-size: 12pt; page-break-after: avoid; }
  .content-article pre { background: #f5f5f5; color: black; border: 1px solid #ccc; }
  .content-article code { background: #f5f5f5; color: black; }
  .content-article table { page-break-inside: avoid; }
  .print-cover { page-break-after: always; }
  .print-page { page-break-before: always; border: none; }
  .print-instructions { display: none; }
  @page { margin: 1.5cm; }
}
