/* ClapAssist Interview Questions Pages — Extended Stylesheet
   Extends tools.css with components specific to question/answer pages:
   question cards, difficulty badges, company tags, expandable answers,
   sidebar navigation, quiz mode, and deep-content layouts. */

/* ---------- Question Page Layout ---------- */
.q-page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 960px) {
  .q-page-grid {
    grid-template-columns: 1fr;
  }
  .q-sidebar { order: -1; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-4);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color .15s;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .sep {
  color: var(--hair-3);
  font-size: 11px;
}

/* ---------- Page Header ---------- */
.q-page-header {
  margin-bottom: 36px;
}

.q-page-header h1 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 12px;
}

.q-page-header .q-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-3);
}

.q-page-header .q-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.q-page-header .q-desc {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 720px;
  margin-top: 16px;
}

/* ---------- Table of Contents ---------- */
.q-toc {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.q-toc h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.q-toc ol {
  list-style: none;
  counter-reset: toc;
  padding: 0;
  margin: 0;
}

.q-toc ol li {
  counter-increment: toc;
  margin-bottom: 6px;
}

.q-toc ol li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 4px 0;
  transition: color .15s;
  line-height: 1.4;
}

.q-toc ol li a::before {
  content: counter(toc) ".";
  font-weight: 700;
  color: var(--accent);
  min-width: 22px;
  font-size: 13px;
}

.q-toc ol li a:hover {
  color: var(--accent-ink);
}

/* ---------- Question Card ---------- */
.q-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
  transition: box-shadow .2s var(--ease);
}

.q-card:hover {
  box-shadow: var(--shadow-md);
}

.q-card-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}

.q-card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-right: 12px;
  flex: none;
}

.q-card-question {
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.015em;
  line-height: 1.35;
}

.q-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.q-card-body {
  padding: 24px 28px 28px;
}

/* ---------- Difficulty Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge-easy {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid rgba(22, 163, 74, .2);
}

.badge-medium {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid var(--warn-line);
}

.badge-hard {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid rgba(225, 29, 72, .2);
}

/* ---------- Company Tags ---------- */
.company-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.company-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--paper-2);
  border: 1px solid var(--hair);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}

.company-tag::before {
  content: "🏢";
  font-size: 10px;
}

/* ---------- Answer Sections ---------- */
.answer-section {
  margin-bottom: 20px;
}

.answer-section:last-child {
  margin-bottom: 0;
}

.answer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--hair);
}

.answer-label .label-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex: none;
}

.label-why {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-line);
}

.label-why .label-icon {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.label-framework {
  color: var(--ok);
  border-bottom-color: rgba(22, 163, 74, .2);
}

.label-framework .label-icon {
  background: var(--ok-soft);
  border: 1px solid rgba(22, 163, 74, .2);
}

.label-sample {
  color: var(--ink-2);
  border-bottom-color: var(--hair-2);
}

.label-sample .label-icon {
  background: var(--paper-2);
  border: 1px solid var(--hair-2);
}

.label-redflags {
  color: var(--bad);
  border-bottom-color: rgba(225, 29, 72, .15);
}

.label-redflags .label-icon {
  background: var(--bad-soft);
  border: 1px solid rgba(225, 29, 72, .2);
}

.answer-content {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.65;
}

.answer-content p {
  margin-bottom: 10px;
}

.answer-content p:last-child {
  margin-bottom: 0;
}

.answer-content ul, .answer-content ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.answer-content li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.answer-content strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Framework Steps ---------- */
.framework-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fw-step {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  background: var(--ok-soft);
  border-radius: var(--r-sm);
  border: 1px solid rgba(22, 163, 74, .12);
}

.fw-step-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ok);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-top: 1px;
}

.fw-step-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

/* ---------- Sample Answer (Expandable) ---------- */
.sample-answer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper-2);
  border: 1px solid var(--hair-2);
  border-radius: var(--r-sm);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all .16s;
}

.sample-answer-toggle:hover {
  border-color: var(--accent-line);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.sample-answer-toggle .toggle-arrow {
  transition: transform .2s var(--ease);
  font-size: 12px;
}

.sample-answer-toggle.open .toggle-arrow {
  transform: rotate(90deg);
}

.sample-answer-body {
  display: none;
  margin-top: 12px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.65;
  position: relative;
}

.sample-answer-body.open {
  display: block;
  animation: fadeSlideIn .25s var(--ease);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sample-answer-body .copy-sample {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  border: 1px solid var(--hair-2);
  color: var(--ink-3);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.sample-answer-body .copy-sample:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ---------- Red Flags Box ---------- */
.redflags-box {
  background: var(--bad-soft);
  border: 1px solid rgba(225, 29, 72, .15);
  border-radius: var(--r-sm);
  padding: 14px 18px;
}

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

.redflags-box li {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}

.redflags-box li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: var(--bad);
  font-weight: 700;
  font-size: 12px;
}

/* ---------- Practice CTA (inline, per question) ---------- */
.practice-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(79, 70, 229, .06), rgba(99, 102, 241, .04));
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  margin-top: 20px;
}

.practice-cta-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.practice-cta-text strong {
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.practice-cta .btn {
  height: 36px;
  font-size: 12.5px;
  padding: 0 16px;
  white-space: nowrap;
  flex: none;
}

/* ---------- Sidebar ---------- */
.q-sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.sidebar-card h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair);
}

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

.sidebar-links li {
  margin-bottom: 2px;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: all .15s;
}

.sidebar-links a:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.sidebar-links a.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.sidebar-links .link-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

/* ---------- Role Hub Cards ---------- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.role-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: all .2s var(--ease);
  display: flex;
  flex-direction: column;
}

.role-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-line);
}

.role-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
}

.role-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}

.role-card p {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}

.role-card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.topic-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  border: 1px solid var(--hair);
  color: var(--ink-3);
  font-weight: 500;
}

.role-card-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}

/* ---------- Stats Bar (top of each page) ---------- */
.stats-bar {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}

.stat-label {
  font-size: 12px;
  color: var(--ink-4);
  font-weight: 500;
}

/* ---------- Print overrides for question pages ---------- */
@media print {
  .q-sidebar, .practice-cta, .breadcrumbs, .stats-bar { display: none !important; }
  .q-page-grid { grid-template-columns: 1fr !important; }
  .q-card { break-inside: avoid; page-break-inside: avoid; }
  .sample-answer-body { display: block !important; }
  .sample-answer-toggle { display: none !important; }
}
