/* ========================================
   Blog Shared Styles
   RS Arun Portfolio — blog.css
   ======================================== */

/* --- Variables (mirror portfolio) --- */
:root {
  --bg: #080808;
  --bg-card: #0f0f0f;
  --bg-elevated: #141414;
  --white: #ffffff;
  --offwhite: #e8e8e8;
  --text: #a0a0a0;
  --text-muted: #555555;
  --accent: #E8723A;
  --accent-light: #f0935e;
  --accent-dim: rgba(232, 114, 58, 0.08);
  --accent-glow: rgba(232, 114, 58, 0.2);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --font-hero: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(232, 114, 58, 0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* --- Reading Progress Bar --- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* --- Back Navigation --- */
.blog-back {
  position: fixed;
  top: 1.25rem;
  left: 1.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.blog-back:hover {
  color: var(--accent);
  border-color: rgba(232, 114, 58, 0.3);
  background: rgba(232, 114, 58, 0.04);
}

.blog-back svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}

.blog-back:hover svg {
  transform: translateX(-2px);
}

/* --- Hero Section --- */
.blog-hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 8rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232, 114, 58, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(232, 114, 58, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.blog-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
  width: 100%;
}

/* --- Post Meta (date, read time) --- */
.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.post-meta-item {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.post-meta-divider {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
}

/* --- Tag Pills --- */
.post-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.post-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(232, 114, 58, 0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

/* --- Post Title --- */
.post-title {
  font-family: var(--font-hero);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--white);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

/* --- Post Subtitle --- */
.post-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  line-height: 1.6;
  color: #6a6a6a;
  max-width: 640px;
  margin: 0 auto;
}

/* --- Blog Body --- */
.blog-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* Intro paragraph — slightly larger */
.blog-body > p:first-of-type,
.blog-intro p {
  font-size: 1.15rem;
  line-height: 1.9;
  color: #b8b8b8;
}

.blog-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #a0a0a0;
  margin-bottom: 1.5rem;
}

.blog-body strong {
  color: #e8e8e8;
  font-weight: 600;
}

.blog-body em {
  color: #c8c8c8;
  font-style: italic;
}

/* --- Section Number --- */
.section-number {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  margin-top: 3.5rem;
}

/* --- Headings --- */
.blog-body h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  position: relative;
}

.blog-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-body h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #c8c8c8;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* --- Pull Quote --- */
.pull-quote {
  border-left: 4px solid var(--accent);
  padding: 1.5rem 2rem;
  margin: 3rem 0;
  position: relative;
  background: linear-gradient(135deg, rgba(232, 114, 58, 0.03) 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
}

.pull-quote p {
  font-size: 1.3rem !important;
  line-height: 1.7 !important;
  color: var(--white) !important;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 0 !important;
}

.source-cite {
  display: block;
  font-size: 0.75rem;
  color: #555;
  margin-top: 0.75rem;
  font-style: normal;
  letter-spacing: 0.03em;
}

/* --- Callout Boxes --- */
.callout {
  background: rgba(232, 114, 58, 0.05);
  border-left: 3px solid var(--accent);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 2rem 0;
}

.callout-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.callout p {
  font-size: 0.95rem !important;
  line-height: 1.75 !important;
  color: #b0b0b0 !important;
  margin-bottom: 0 !important;
}

.callout p + p {
  margin-top: 0.75rem !important;
}

.callout--warning {
  background: rgba(251, 191, 36, 0.05);
  border-left-color: #f59e0b;
}

.callout--warning .callout-title {
  color: #f59e0b;
}

/* --- Code --- */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #1a1a1a;
  color: #f0935e;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

pre {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: #a8d8a8;
  font-size: 0.875rem;
  line-height: 1.7;
}

/* --- Key Points List --- */
.key-points {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.key-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.6rem 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #a0a0a0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.key-points li:last-child {
  border-bottom: none;
}

.key-points li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.55rem;
}

/* --- Numbered List (styled) --- */
.numbered-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  counter-reset: item;
}

.numbered-list li {
  counter-increment: item;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #a0a0a0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.numbered-list li:last-child {
  border-bottom: none;
}

.numbered-list li::before {
  content: counter(item, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(232, 114, 58, 0.2);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  letter-spacing: 0.05em;
}

/* --- Stat Block --- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-hero);
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Divider --- */
.blog-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 3rem auto;
  border-radius: 2px;
}

/* --- Author Card --- */
.author-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-top: 4rem;
  transition: border-color 0.2s;
}

.author-card:hover {
  border-color: var(--border-hover);
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c05a2a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hero);
  font-size: 1.5rem;
  color: var(--white);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.author-info {
  flex: 1;
}

.author-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.author-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.author-link {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(232, 114, 58, 0.25);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.author-link:hover {
  background: var(--accent-dim);
  border-color: rgba(232, 114, 58, 0.4);
}

/* --- Post Footer --- */
.post-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-top: 2.5rem;
  display: flex;
  justify-content: center;
}

.post-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}

.post-footer-link:hover {
  color: var(--accent);
}

/* --- Inline citation/reference --- */
.cite-inline {
  font-size: 0.8em;
  color: #555;
  font-style: italic;
}

/* --- Highlight span --- */
.highlight {
  color: var(--accent-light);
  font-weight: 600;
}

/* --- Decision table --- */
.decision-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.decision-table th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(232, 114, 58, 0.2);
}

.decision-table td {
  padding: 0.75rem 1rem;
  color: #a0a0a0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}

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

.decision-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* --- Checklist --- */
.checklist {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.65rem 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #a0a0a0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.checklist li:last-child {
  border-bottom: none;
}

.check-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent-dim);
  border: 1px solid rgba(232, 114, 58, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.check-icon::after {
  content: '✓';
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .blog-hero {
    min-height: 55vh;
    padding: 6rem 1.25rem 3rem;
  }

  .post-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .blog-body {
    padding: 2.5rem 1.25rem 4rem;
  }

  .blog-back {
    top: 0.75rem;
    left: 1rem;
    font-size: 0.7rem;
    padding: 0.4rem 0.7rem;
  }

  .pull-quote p {
    font-size: 1.1rem !important;
  }

  .author-card {
    flex-direction: column;
    text-align: center;
  }

  .author-link {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-body h2 {
    font-size: 1.45rem;
  }

  .decision-table {
    font-size: 0.82rem;
  }

  .decision-table th,
  .decision-table td {
    padding: 0.6rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .blog-hero {
    padding: 5rem 1rem 2.5rem;
  }

  .post-meta {
    gap: 0.6rem;
  }

  .stat-row {
    grid-template-columns: 1fr 1fr;
  }
}
