/* ============================================================
   coffee-web :: article detail page
   ============================================================ */

/* Reading progress bar */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--bg-elev);
  z-index: 200;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: var(--glow);
  transition: width .1s linear;
}

/* Layout */
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
  aside {
    display: none;
  }
}

/* ── Hero ── */
.hero {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  background: var(--bg-card);
}

.hero-img {
  position: relative;
  height: 320px;
  background: var(--bg-soft) center/cover no-repeat;
  overflow: hidden;
}

.hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--bg-card) 100%);
  pointer-events: none;
}

/* scan-line animation */
.hero-img .scan-line {
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .45;
  animation: scan-move 4s linear infinite;
  z-index: 2;
}
@keyframes scan-move {
  0%   { top: -4px; }
  100% { top: 100%; }
}

/* corner decorations */
.hero-img .corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--accent);
  border-style: solid;
  opacity: .7;
  z-index: 3;
}
.hero-img .corner.tl { top: 8px;  left: 8px;  border-width: 2px 0 0 2px; }
.hero-img .corner.tr { top: 8px;  right: 8px; border-width: 2px 2px 0 0; }
.hero-img .corner.bl { bottom: 8px; left: 8px;  border-width: 0 0 2px 2px; }
.hero-img .corner.br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

/* crosshair */
.hero-img .crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  z-index: 3;
  opacity: .3;
}
.hero-img .crosshair::before,
.hero-img .crosshair::after {
  content: '';
  position: absolute;
  background: var(--accent);
}
.hero-img .crosshair::before { width: 100%; height: 1px; top: 50%; left: 0; transform: translateY(-50%); }
.hero-img .crosshair::after  { width: 1px; height: 100%; left: 50%; top: 0; transform: translateX(-50%); }

/* image label */
.hero-img .label {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--accent);
  font-family: var(--font-mono);
  z-index: 4;
  text-shadow: 0 0 6px var(--accent);
}

/* Hero body */
.hero-body {
  padding: 20px 24px 24px;
}

.hero-cat {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--accent);
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-title {
  font-size: clamp(18px, 2.4vw, 28px);
  font-family: var(--font-display);
  color: var(--fg);
  line-height: 1.3;
  margin: 0 0 12px;
}

.hero-deck {
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 16px;
  font-family: var(--font-mono);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: .08em;
  color: var(--fg-mute);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.hero-meta b {
  color: var(--accent);
  margin-right: 4px;
}
.hero-meta .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.hero-meta .btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 10px;
  letter-spacing: .08em;
  text-decoration: none;
  font-family: var(--font-mono);
  transition: border-color .15s, color .15s;
}
.hero-meta .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Article body ── */
.article-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
}

.article-body h2,
.article-body h3 {
  font-family: var(--font-display);
  color: var(--fg);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.article-body h2 { font-size: 18px; }
.article-body h3 { font-size: 15px; color: var(--accent); }

.article-body p  { margin: 0 0 14px; }
.article-body ul,
.article-body ol { margin: 0 0 14px 20px; }
.article-body li { margin-bottom: 6px; }

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--accent-2); }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 16px 0;
  padding: 10px 16px;
  background: var(--bg-soft);
  color: var(--fg-dim);
  font-style: italic;
}

.article-body pre,
.article-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.article-body pre {
  padding: 14px 16px;
  overflow-x: auto;
  margin: 16px 0;
}
.article-body code {
  padding: 2px 6px;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  display: block;
  margin: 16px auto;
}

/* ── Audio ── */
.article-audio {
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.article-audio h3 {
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin: 0 0 10px;
}
.article-audio audio {
  width: 100%;
  filter: invert(1) hue-rotate(100deg);
}

/* ── Prev / Next ── */
.pn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.pn-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.pn-card:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}
.pn-card .lbl {
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}
.pn-card .lbl.r { text-align: right; }
.pn-card .t {
  font-size: 12px;
  color: var(--fg);
  font-family: var(--font-mono);
  line-height: 1.4;
}
.pn-card.right .t { text-align: right; }

/* ── Comments ── */
.comments-section {
  margin-bottom: 20px;
}
.comments-hd {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.compose {
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 14px;
}
.compose-hd {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg-mute);
  margin-bottom: 10px;
}
.compose-hd .you { color: var(--accent); }
.compose textarea {
  width: 100%;
  min-height: 80px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
}
.compose textarea:focus { border-color: var(--accent); }
.compose-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.send-btn {
  padding: 6px 16px;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.send-btn:hover { background: var(--accent); color: var(--bg); }

.login-prompt {
  padding: 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--fg-mute);
}
.login-prompt a { color: var(--accent); }

.comment-list { padding: 0 14px 14px; }
.cmt {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.cmt:last-child { border-bottom: none; }
.cmt-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--bg-soft);
}
.cmt-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.cmt-head .user { font-size: 11px; font-family: var(--font-mono); color: var(--accent); }
.cmt-head .ts   { font-size: 10px; color: var(--fg-mute); font-family: var(--font-mono); }
.cmt-text { font-size: 13px; color: var(--fg-dim); line-height: 1.6; font-family: var(--font-mono); }
.cmt-reply-wrap { padding-left: 44px; }

/* ── Sidebar: TOC ── */
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc li {
  padding: 5px 14px;
  border-left: 2px solid transparent;
  transition: border-color .15s;
}
.toc li.active { border-left-color: var(--accent); }
.toc li.h3 { padding-left: 26px; }
.toc a {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg-mute);
  text-decoration: none;
  line-height: 1.5;
  display: block;
}
.toc li.active a,
.toc a:hover { color: var(--accent); }

/* ── Sidebar: recent list ── */
.recent-list a {
  display: block;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  transition: background .12s;
}
.recent-list a:hover { background: var(--bg-soft); }
.recent-list a:last-child { border-bottom: none; }
.recent-list .rtitle {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--fg-dim);
  line-height: 1.4;
  margin-bottom: 3px;
}
.recent-list .rdate {
  font-size: 10px;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  letter-spacing: .06em;
}

/* ── Sidebar: categories ── */
.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--fg-dim);
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  transition: color .12s, background .12s;
}
.cat-list a:hover { color: var(--accent); background: var(--bg-soft); }
.cat-list a:last-child { border-bottom: none; }
.cat-list .cnt { color: var(--fg-mute); font-size: 10px; }
