/* ============================================================
   JUNAID RAZZAQ — Case Study: LinkedIn Voice Skill
   Article-specific styles only — base tokens, reset, nav,
   footer, and theme toggle are inherited from style.css
   ============================================================ */

/* --- READING PROGRESS BAR --- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 300;
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
}

/* --- HERO --- */
.cs-hero {
  padding-top: calc(64px + 5rem);
  padding-bottom: 4.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cs-hero__inner { max-width: 760px; }

.cs-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.cs-hero h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.cs-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.75rem;
}

.cs-meta__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cs-meta__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.cs-meta__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.cs-meta__divider {
  width: 1px; height: 14px;
  background: var(--border);
  flex-shrink: 0;
}

.cs-meta__item {
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.cs-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 680px;
}

/* --- PAGE LAYOUT (sidebar + article) --- */
.cs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-top: 4rem;
  padding-bottom: 7rem;
}

@media (min-width: 1040px) {
  .cs-layout {
    grid-template-columns: 220px 1fr;
    gap: 5rem;
  }
}

/* --- SIDEBAR TOC --- */
.cs-toc { display: none; }

@media (min-width: 1040px) {
  .cs-toc {
    display: block;
    align-self: stretch; /* lets the column be as tall as the article so sticky works */
  }
}

.cs-toc__sticky {
  position: sticky;
  top: calc(64px + 2rem);
}

.cs-toc__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0.9rem;
}

.cs-toc nav ol {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.cs-toc nav ol li a {
  display: block;
  font-size: 0.81rem;
  color: var(--text-subtle);
  text-decoration: none;
  padding: 0.32rem 0.7rem;
  border-left: 2px solid var(--border);
  transition: color 0.18s, border-color 0.18s;
  line-height: 1.45;
}

.cs-toc nav ol li a:hover { color: var(--text-muted); border-left-color: var(--text-subtle); }
.cs-toc nav ol li a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }

.cs-toc__actions { margin-top: 2rem; }

.cs-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
}

.cs-share:hover { border-color: var(--accent); color: var(--accent); }
.cs-share.copied { border-color: #16a34a; color: #16a34a; background: rgba(22,163,74,0.05); }

/* --- MOBILE TOC --- */
.cs-toc-mobile {
  display: block;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
}

@media (min-width: 1040px) { .cs-toc-mobile { display: none; } }

.cs-toc-mobile summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.cs-toc-mobile[open] summary { border-bottom-color: var(--border); }
.cs-toc-mobile summary::marker, .cs-toc-mobile summary::-webkit-details-marker { display: none; }

.cs-toc-mobile .toggle-icon { transition: transform 0.2s; color: var(--text-subtle); }
.cs-toc-mobile[open] .toggle-icon { transform: rotate(180deg); }

.cs-toc-mobile__inner { padding: 1rem 1.25rem 1.25rem; }

.cs-toc-mobile__inner ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cs-toc-mobile__inner ol li a {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 0.3rem 0;
  transition: color 0.2s;
}
.cs-toc-mobile__inner ol li a:hover { color: var(--accent); }

/* --- ARTICLE WRAPPER --- */
.cs-article { min-width: 0; max-width: 720px; }

/* --- SECTION STRUCTURE --- */
.cs-section { margin-bottom: 4rem; }
.cs-section:last-child { margin-bottom: 0; }

.cs-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.cs-section h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.cs-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.75rem;
  margin-top: 2rem;
  line-height: 1.4;
}
.cs-section h3:first-child { margin-top: 0; }

.cs-section p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.87;
  margin-bottom: 1.2rem;
}
.cs-section p:last-child { margin-bottom: 0; }

.cs-section strong { font-weight: 600; color: var(--text); }
.cs-section em { font-style: italic; }

.cs-section ul, .cs-section ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.cs-section li {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 0.55rem;
}
.cs-section li:last-child { margin-bottom: 0; }
.cs-section li strong { font-weight: 600; color: var(--text); }

/* --- DIVIDER --- */
.cs-divider {
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

/* --- PHASE STEPPER --- */
.phase-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2.5rem 0;
  position: relative;
}

@media (min-width: 560px) {
  .phase-steps {
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
  }

  .phase-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% / 4 + 20px);
    right: calc(50% / 4 + 20px);
    height: 1px;
    background: var(--border);
    z-index: 0;
  }
}

@media (max-width: 559px) {
  .phase-steps::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    bottom: 20px;
    width: 2px;
    background: var(--border);
    z-index: 0;
    border-radius: 1px;
  }
}

.phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

@media (max-width: 559px) {
  .phase-step {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    gap: 1rem;
  }
}

.phase-step__num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.phase-step__content { padding-top: 0.75rem; }
@media (max-width: 559px) { .phase-step__content { padding-top: 0.2rem; } }

.phase-step__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.phase-step__desc {
  font-size: 0.77rem;
  color: var(--text-subtle);
  line-height: 1.45;
  max-width: 120px;
}
@media (max-width: 559px) { .phase-step__desc { max-width: none; } }

/* --- PHASE HEADER (number circle + label inline) --- */
.phase-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.4rem;
}

.phase-header__num {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phase-header .cs-section-label { margin-bottom: 0; }

/* --- PULL QUOTE --- */
.pull-quote {
  margin: 2.5rem 0;
  padding: 1.4rem 1.75rem;
  border-left: 3px solid var(--accent);
  background: rgba(37, 99, 235, 0.04);
  border-radius: 0 10px 10px 0;
}

[data-theme="dark"] .pull-quote { background: rgba(59, 130, 246, 0.07); }

.pull-quote p {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--navy);
  line-height: 1.55;
  margin-bottom: 0 !important;
  font-style: italic;
}

/* --- EXPANDABLE PROMPT BLOCK --- */
.prompt-block {
  margin: 1.75rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
}

[data-theme="dark"] .prompt-block { background: #1C2128; }

.prompt-block summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.prompt-block[open] summary { border-bottom-color: var(--border); }
.prompt-block summary::marker, .prompt-block summary::-webkit-details-marker { display: none; }

.prompt-block .toggle-icon { color: var(--text-subtle); transition: transform 0.2s; }
.prompt-block[open] .toggle-icon { transform: rotate(180deg); }

.prompt-block__body {
  padding: 1.35rem 1.5rem;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.82;
}

.prompt-block__body p { margin-bottom: 1rem; }
.prompt-block__body p:last-child { margin-bottom: 0; }

/* --- ROUND SECTION (Interview rounds) --- */
.round-section {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--bg-alt);
  margin: 2rem 0;
}

.round-section__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.round-section h3 { margin-top: 0 !important; }

.round-section p {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.82;
  margin-bottom: 1rem;
}
.round-section p:last-child { margin-bottom: 0; }

.round-section ol, .round-section ul { padding-left: 1.4rem; margin-bottom: 0; }

.round-section li {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.8;
  margin-bottom: 0.6rem;
}
.round-section li:last-child { margin-bottom: 0; }
.round-section li strong { font-weight: 600; color: var(--text); }
.round-section li em { font-style: italic; }

/* --- TABLE --- */
.cs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cs-table th {
  background: var(--bg-alt);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cs-table td {
  padding: 0.75rem 1.1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  line-height: 1.65;
}
.cs-table td em { font-style: italic; }
.cs-table tr:last-child td { border-bottom: none; }

/* --- CRINGE / ANTI-PATTERN LIST --- */
.cringe-list {
  margin: 2rem 0;
  background: var(--navy);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

[data-theme="dark"] .cringe-list { background: #161B22; border-color: rgba(255,255,255,0.07); }

.cringe-list__header {
  padding: 0.9rem 1.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.cringe-list ul { list-style: none; padding: 0; margin: 0; }

.cringe-list li {
  padding: 0.95rem 1.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.65;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0 !important;
}

[data-theme="dark"] .cringe-list li { color: rgba(205,217,229,0.82); }

.cringe-list li:last-child { border-bottom: none; }

.cringe-list li::before {
  content: '✕';
  color: #ef4444;
  font-size: 0.72rem;
  flex-shrink: 0;
  margin-top: 0.22rem;
  font-weight: 700;
}

.cringe-list li strong { color: rgba(255,255,255,0.92); font-weight: 600; }
[data-theme="dark"] .cringe-list li strong { color: rgba(226,232,240,0.92); }

/* --- SKILL STRUCTURE NUMBERED LIST --- */
.skill-structure {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  counter-reset: skill-item;
}

.skill-structure li {
  counter-increment: skill-item;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0 !important;
  transition: border-color 0.2s;
}

.skill-structure li:hover { border-color: var(--accent); }

.skill-structure li::before {
  content: counter(skill-item, decimal-leading-zero);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1rem;
  color: var(--accent);
  opacity: 0.55;
  flex-shrink: 0;
  line-height: 1.65;
  min-width: 24px;
}

.skill-structure li strong { color: var(--navy); font-weight: 600; }

/* --- ITERATION PUSH CARDS --- */
.iteration-push {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-alt);
}

.iteration-push__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.iteration-push h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.75rem;
  margin-top: 0 !important;
  line-height: 1.4;
}

.iteration-push p {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 0.85rem;
}
.iteration-push p:last-child { margin-bottom: 0; }
.iteration-push p em { font-style: italic; }
.iteration-push p strong { font-weight: 600; color: var(--text); }

.iteration-push__lesson {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.87rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
}
.iteration-push__lesson strong { color: var(--navy); font-style: normal; font-weight: 600; }

/* --- 9 LESSONS CARD GRID --- */
.lesson-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (min-width: 540px) { .lesson-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .lesson-grid { grid-template-columns: repeat(3, 1fr); } }

.lesson-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.lesson-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.lesson-card__num {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 400;
  color: var(--accent);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.lesson-card h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
  margin-top: 0 !important;
  line-height: 1.4;
}

.lesson-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.72;
  margin-bottom: 0 !important;
}
.lesson-card p em { font-style: italic; }

/* --- BACK TO TOP BUTTON --- */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.2s;
  z-index: 50;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45); }

/* --- SECTION SCROLL ANCHOR OFFSET --- */
[id] { scroll-margin-top: 84px; }
