/*
 * blog-python-lesson-style.css
 * Professional high-value tutorial lesson components.
 * Works on top of blog-style.css — do NOT remove that stylesheet.
 * Apply to any tutorial lesson page with: <link rel="stylesheet" href="/blog-python-lesson-style.css">
 */

/* ═══════════════════════════════════════════════
   LESSON PROGRESS BAR (top of page, below breadcrumb)
   ═══════════════════════════════════════════════ */
.lesson-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  padding: 14px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lesson-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.lesson-progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
}

.lesson-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue, #58a6ff));
  border-radius: 99px;
  transition: width 0.5s ease;
}

.lesson-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   WHAT YOU'LL LEARN BOX
   ═══════════════════════════════════════════════ */
.what-you-learn {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.08) 0%, rgba(63, 185, 80, 0.02) 100%);
  border: 1px solid rgba(63, 185, 80, 0.25);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 36px;
}

.what-you-learn-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.what-you-learn ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
}

.what-you-learn ul li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.5;
}

.what-you-learn ul li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ═══════════════════════════════════════════════
   PREREQUISITES BOX
   ═══════════════════════════════════════════════ */
.prereq-box {
  background: rgba(88, 166, 255, 0.06);
  border: 1px solid rgba(88, 166, 255, 0.22);
  border-left: 4px solid #58a6ff;
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 36px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.prereq-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.prereq-content {
  flex: 1;
}

.prereq-title {
  font-size: 13px;
  font-weight: 800;
  color: #58a6ff;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.prereq-box p {
  margin: 0;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.65;
}

.prereq-box a {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 600;
}

.prereq-box a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════
   READING TIME BADGE (shown in .page-meta)
   ═══════════════════════════════════════════════ */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #58a6ff;
}

/* ═══════════════════════════════════════════════
   RICH INTRO BOX (enhanced, used instead of plain intro-box)
   ═══════════════════════════════════════════════ */
.lesson-intro {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.08) 0%, rgba(63, 185, 80, 0.04) 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 40px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text);
}

.lesson-intro p {
  margin: 0 0 12px;
}

.lesson-intro p:last-child {
  margin: 0;
}

/* ═══════════════════════════════════════════════
   CODE OUTPUT BLOCK (shows expected output below code)
   ═══════════════════════════════════════════════ */
.code-output {
  background: #0d1117;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 20px;
  margin-top: -1px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  color: #adbac7;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.code-output-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  margin-top: 2px;
}

.code-output-text {
  flex: 1;
  white-space: pre;
  color: #7ee787;
}

body.light-theme .code-output {
  background: #f0f6fc;
  color: #24292f;
}

body.light-theme .code-output-text {
  color: #116329;
}

/* ═══════════════════════════════════════════════
   PRO TIP BOX (purple accent — advanced insight)
   ═══════════════════════════════════════════════ */
.pro-tip {
  background: rgba(162, 130, 255, 0.07);
  border: 1px solid rgba(162, 130, 255, 0.25);
  border-left: 4px solid #a855f7;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}

.pro-tip-title {
  font-size: 13px;
  font-weight: 800;
  color: #a855f7;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-tip p {
  margin: 0 0 10px;
  font-size: 14.5px;
  color: var(--text2);
  line-height: 1.75;
}

.pro-tip p:last-child {
  margin: 0;
}

body.light-theme .pro-tip {
  background: rgba(162, 130, 255, 0.06);
}

/* ═══════════════════════════════════════════════
   WARNING/MISTAKE CALLOUT (yellow — errors to avoid)
   ═══════════════════════════════════════════════ */
.callout {
  background: rgba(234, 179, 8, 0.07);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-left: 4px solid #eab308;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}

.callout-title {
  font-size: 13px;
  font-weight: 800;
  color: #eab308;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout p {
  margin: 0 0 10px;
  font-size: 14.5px;
  color: var(--text2);
  line-height: 1.75;
}

.callout p:last-child {
  margin: 0;
}

body.light-theme .callout {
  background: #fffbe6;
  border-color: #f1d58a;
}

/* ═══════════════════════════════════════════════
   NOTE CALLOUT (blue — info tips)
   ═══════════════════════════════════════════════ */
.note-box {
  background: rgba(88, 166, 255, 0.07);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-left: 4px solid #58a6ff;
  border-radius: var(--radius);
  padding: 18px 24px;
  margin: 28px 0;
  font-size: 14.5px;
  color: var(--text2);
  line-height: 1.75;
}

.note-box strong {
  color: #58a6ff;
}

/* ═══════════════════════════════════════════════
   REFERENCE / DATA TABLE (enhanced .tbl)
   ═══════════════════════════════════════════════ */
.ref-table-wrap {
  margin: 32px 0;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.ref-table-title {
  background: var(--bg3);
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ref-table th {
  background: var(--bg3);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.ref-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
}

.ref-table tr:last-child td {
  border-bottom: none;
}

.ref-table tr:hover td {
  background: rgba(88, 166, 255, 0.04);
  color: var(--text);
}

.ref-table code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ff7b72;
  border: 1px solid var(--border);
}

body.light-theme .ref-table code {
  color: #cf222e;
}

/* ═══════════════════════════════════════════════
   COMPARISON GRID (side-by-side two code blocks)
   ═══════════════════════════════════════════════ */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}

.comparison-grid .code-block {
  margin: 0;
}

.comparison-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════
   EXERCISE BOX (try-it section, enhanced)
   ═══════════════════════════════════════════════ */
.exercise-box {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.07) 0%, rgba(88, 166, 255, 0.02) 100%);
  border: 1px solid rgba(88, 166, 255, 0.22);
  border-radius: var(--radius);
  padding: 28px;
  margin: 40px 0;
}

.exercise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.exercise-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.exercise-level {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.exercise-level.beginner {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.exercise-level.intermediate {
  background: rgba(227, 179, 65, 0.12);
  color: #e3b341;
  border: 1px solid rgba(227, 179, 65, 0.3);
}

.exercise-level.advanced {
  background: rgba(247, 76, 0, 0.1);
  color: #f97316;
  border: 1px solid rgba(247, 76, 0, 0.25);
}

.exercise-task {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 18px;
}

.exercise-hint {
  font-size: 13px;
  color: var(--text3);
  margin-top: 10px;
  font-style: italic;
}

.exercise-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  background: var(--accent);
  color: #ffffff !important;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.exercise-run-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   KEY TAKEAWAYS SECTION
   ═══════════════════════════════════════════════ */
.key-takeaways {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 48px 0 40px;
}

.key-takeaways-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-takeaways ol {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.key-takeaways ol li {
  font-size: 14.5px;
  color: var(--text2);
  line-height: 1.65;
  padding-left: 6px;
}

.key-takeaways ol li strong {
  color: var(--text);
}

/* ═══════════════════════════════════════════════
   FAQ ACCORDION SECTION
   ═══════════════════════════════════════════════ */
.faq-section {
  margin: 40px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-header {
  background: var(--bg3);
  padding: 16px 24px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text2);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 24px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body, 'Inter', sans-serif);
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--bg3);
}

.faq-arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text2);
  transition: transform 0.25s ease, background 0.2s;
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, padding 0.2s ease;
  padding: 0 24px;
  font-size: 14.5px;
  color: var(--text2);
  line-height: 1.8;
}

.faq-answer p {
  margin: 0 0 10px;
}

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

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 24px 20px;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
  background: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════════
   AUTHOR + UPDATED FOOTER
   ═══════════════════════════════════════════════ */
.lesson-author {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding: 20px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lesson-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #58a6ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(88, 166, 255, 0.3);
}

.lesson-author-info {
  flex: 1;
}

.lesson-author-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.lesson-author-meta {
  font-size: 13px;
  color: var(--text2);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.lesson-author-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ═══════════════════════════════════════════════
   INLINE SUBSECTION HEADING (h2 inside sections)
   ═══════════════════════════════════════════════ */
.sub-heading {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-heading-num {
  font-size: 13px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   PARAGRAPH STYLES (inside .content, outside .section)
   ═══════════════════════════════════════════════ */
.content > p,
.content p {
  font-size: 15.5px;
  color: var(--text2);
  line-height: 1.85;
  margin-bottom: 18px;
}

.content p strong,
.content li strong {
  color: var(--text);
  font-weight: 700;
}

.content ul,
.content ol {
  padding-left: 24px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content ul li,
.content ol li {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   TABLE OF CONTENTS (inline - quick jump)
   ═══════════════════════════════════════════════ */
.toc-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0 40px;
  font-size: 14px;
}

.toc-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.toc-box ol {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-box ol li a {
  color: var(--blue, #58a6ff);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

.toc-box ol li a:hover {
  color: var(--accent);
  text-decoration: underline;
}
