/* ================================================================
   css/inner.css — Shared styles for Blog & Project detail pages
   Inherits all tokens from style.css (always load style.css first)
   ================================================================ */

/* ── READING PROGRESS BAR ────────────────────────────────────── */
.progress-bar-wrap {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  z-index: 200;
  background: transparent;
}
#reading-progress {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ── BACK TO TOP ─────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 90;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover   { background: var(--accent); }

/* ── INNER NAV LOGO BACK LINK ────────────────────────────────── */
.nav__back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
  transition: color var(--dur);
}
.nav__back:hover { color: var(--accent); }
.nav__back svg { width: 16px; height: 16px; }

/* ── PAGE HERO (shared) ──────────────────────────────────────── */
.inner-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.inner-hero .breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.inner-hero .breadcrumb a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--dur);
}
.inner-hero .breadcrumb a:hover { color: var(--accent); }

.inner-hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.inner-hero__title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  max-width: 22ch;
}

.inner-hero__meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.inner-hero__meta strong { color: var(--ink); }
.inner-hero__meta .tag  { margin: 0; }

.inner-hero__cover {
  margin-top: 3rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 480px;
}
.inner-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── CONTENT LAYOUT ──────────────────────────────────────────── */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
  padding: 4rem 0;
}

/* ── PROSE (article body) ────────────────────────────────────── */
.prose {
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--ink-light);
  min-width: 0;
}
.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
}
.prose p  { margin-bottom: 1.4rem; max-width: 68ch; }
.prose ul, .prose ol {
  margin: 0 0 1.4rem 1.5rem;
}
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a  { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { text-decoration: none; }
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 0.75rem 1.5rem;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink);
}
.prose pre {
  background: #1a1916;
  color: #e8e4dd;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.65;
  border: 1px solid #2d2a25;
}
.prose code {
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.85em;
}
.prose p code, .prose li code {
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent);
  border: 1px solid var(--border);
}
.prose img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 2rem 0;
  width: 100%;
}

/* Copy button (injected by JS) */
.copy-btn {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: #2d2a25;
  color: #9c9790;
  border: 1px solid #3d3a35;
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.copy-btn:hover { background: var(--accent); color: #fff; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.sidebar-card__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
  display: block;
}

/* TOC */
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.toc-list a {
  font-size: 0.85rem;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: block;
  transition: background var(--dur), color var(--dur);
  border-left: 2px solid transparent;
}
.toc-list a:hover {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent);
}

/* Related posts in sidebar */
.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.related-list a {
  font-size: 0.875rem;
  color: var(--ink-light);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  transition: color var(--dur);
}
.related-list a:hover { color: var(--accent); }

/* Author card */
.author-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.author-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-alt);
}
.author-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
}
.author-card__role {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ── PROJECT-SPECIFIC ────────────────────────────────────────── */
.project-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.stat-card__value {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}
.screenshot-grid img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: 100%;
  margin: 0;
}

/* ── NEXT / PREV NAV ─────────────────────────────────────────── */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.page-nav__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.page-nav__item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.page-nav__item.next { text-align: right; }
.page-nav__dir {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 0.35rem;
}
.page-nav__title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.3;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .sidebar { position: static; }
}

@media (max-width: 600px) {
  .inner-hero { padding: 2.5rem 0 2rem; }
  .screenshot-grid { grid-template-columns: 1fr; }
  .page-nav { grid-template-columns: 1fr; }
  .page-nav__item.next { text-align: left; }
  .project-stats { grid-template-columns: repeat(2, 1fr); }
}
