:root {
  --blog-bg: #101010;
  --blog-surface: #191919;
  --blog-surface-soft: #212121;
  --blog-border: #363636;
  --blog-text: #f4f8fc;
  --blog-muted: #b3b3b3;
  --blog-accent: #f7dc24;
  --blog-danger: #ff6b7d;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--blog-bg);
  color: var(--blog-text);
  font-family: Inter, sans-serif;
}

.blog-view-page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0 96px;
}

.article-header,
.article-content,
.article-author,
.article-comments {
  width: min(820px, 100%);
  margin-inline: auto;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  color: var(--blog-muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.article-back:hover { color: var(--blog-accent); }


.article-header h1 {
  max-width: 780px;
  margin: 0;
  color: var(--blog-text);
  font-family: Poppins, sans-serif;
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.article-lead {
  max-width: 740px;
  margin: 24px 0 0;
  color: #d5d5d5;
  font-size: 20px;
  line-height: 1.65;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
  color: var(--blog-muted);
  font-size: 14px;
  font-weight: 600;
}

.article-meta span,
.article-meta time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.article-cover {
  width: min(820px, 100%);
  margin: clamp(32px, 4vw, 52px) auto clamp(40px, 5vw, 60px);
  overflow: hidden;
  border-radius: 12px;
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.article-cover:has(> img[hidden]),
.article-cover img[hidden] { display: none; }

.article-content {
  color: #e4e4e4;
  font-size: 18px;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.article-content > :first-child { margin-top: 0; }
.article-content > :last-child { margin-bottom: 0; }

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2em 0 .65em;
  color: var(--blog-text);
  font-family: Poppins, sans-serif;
  line-height: 1.25;
}

.article-content h1 { font-size: 34px; }
.article-content h2 { font-size: 29px; }
.article-content h3 { font-size: 24px; }
.article-content h4 { font-size: 20px; }
.article-content p { margin: 0 0 1.35em; }
.article-content :is(ul, ol) {
  margin-block: 0 1.5em;
  list-style-position: outside;
}

.article-content ul {
  padding-inline-start: 1.5em;
  list-style-type: disc;
}

.article-content ol {
  padding-inline-start: 2.25em;
  list-style-type: decimal;
}

.article-content ul ul { list-style-type: circle; }
.article-content li + li { margin-block-start: .45em; }
.article-content li::marker { color: var(--blog-accent); }
.article-content li > p { margin-block-end: .65em; }
.article-content li > :is(ul, ol) { margin-block: .4em 0; }
.article-content li > :last-child { margin-block-end: 0; }

.article-content a {
  color: var(--blog-accent);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-content img,
.article-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
  border: 1px solid var(--blog-border);
  border-radius: 10px;
}

.article-content blockquote {
  margin: 28px 0;
  padding: 8px 0 8px 22px;
  border-left: 3px solid var(--blog-accent);
  color: #d1d1d1;
}

.article-content pre {
  max-width: 100%;
  margin: 28px 0;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  background: #0c0c0c;
}

.article-content code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #212121;
  color: #e0e0e0;
  font-size: .9em;
}

.article-content pre code { padding: 0; background: none; }
.article-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.article-content th,
.article-content td { padding: 12px 14px; border: 1px solid var(--blog-border); text-align: left; }

.article-loading,
.article-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  color: var(--blog-muted);
  text-align: center;
}

.article-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--blog-border);
  border-top-color: var(--blog-accent);
  border-radius: 50%;
  animation: blog-spin .8s linear infinite;
}

@keyframes blog-spin { to { transform: rotate(360deg); } }

.article-author {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  margin-top: 48px;
  padding: clamp(14px, 2.5vw, 22px);
  border: 1px solid #35443a;
  border-radius: 12px;
  background: #171e1a;
}

.article-author-avatar {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 9px;
  border: 1px solid #435146;
  object-fit: cover;
  image-rendering: pixelated;
  background: #0e1510;
}

.article-author-copy { min-width: 0; overflow-wrap: anywhere; }
.article-author-label, .article-author-bio { margin: 0; line-height: 1.5; color: #b6c3b9; }
.article-author-label { font-size: 11px; }
.article-author-bio { margin-top: 4px; font-size: 13px; }
.article-author-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin-top: 2px; }
.article-author-name strong { min-width: 0; color: #edf3ee; font-size: 18px; line-height: 1.25; }
.article-author-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.author-badge {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid #544d30;
  border-radius: 5px;
  background: #2a281b;
  color: #ffe683;
  font-size: 11px;
}
.author-badge-verified { color: #9cddba; border-color: #3e6150; background: #21362a; }
.author-badge-youtuber { color: #ff9aab; border-color: #6b4850; background: #312226; }

.article-author-profile {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 11px;
  border: 1px solid #435146;
  border-radius: 8px;
  color: #edf3ee;
  font-size: 12px;
  font-weight: 650;
}
.article-author-profile:hover { color: #ffe683; border-color: #918147; background: #242a1e; }
.article-author-profile:focus-visible { outline: 2px solid #ffe683; outline-offset: 3px; }

@media (max-width: 520px) {
  .article-author { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px 12px; }
  .article-author-avatar { width: 48px; height: 48px; }
  .article-author-profile { grid-column: 2; }
}

.article-comments { margin-top: 72px; }
.comments-heading { padding-bottom: 20px; border-bottom: 1px solid var(--blog-border); }
.comments-heading h2 { margin: 0; font-family: Poppins, sans-serif; font-size: 28px; }

.comment-compose,
.comments-login {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: var(--blog-surface);
}

.comment-compose label { display: block; margin-bottom: 10px; font-weight: 700; }
.comment-compose textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid #474747;
  border-radius: 6px;
  outline: none;
  background: #121212;
  color: var(--blog-text);
  font: inherit;
}
.comment-compose textarea:focus { border-color: var(--blog-accent); }
.comment-compose-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.btn-primary,
.btn-secondary,
.comment-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.btn-primary { background: var(--blog-accent); color: #0f0f0f; }
.btn-secondary,
.comment-action { border-color: var(--blog-border); background: transparent; color: var(--blog-text); }
.btn-primary:disabled { cursor: not-allowed; opacity: .45; }

.comments-login { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.comments-login p { margin: 0; color: var(--blog-muted); }
.blog-comments-list { margin-top: 18px; }

.blog-comment {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--blog-border);
  align-items: start;
}
.blog-comment-avatar { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--blog-surface); image-rendering: pixelated; }
.blog-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.blog-comment-head strong { font-size: 15px; }
.blog-comment-time { color: var(--blog-muted); font-size: 12px; }
.blog-comment-text { margin: 8px 0 0; color: #dfdfdf; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-badge { padding: 2px 7px; border-radius: 999px; background: #313131; color: #cdcdcd; font-size: 11px; font-weight: 800; }
.comment-badge-founder { color: #ffd95a; }
.comment-badge-youtuber { color: #ff8792; }
.comment-badge-premium { color: #f7dc24; }
.blog-comment-actions { display: flex; align-self: start; align-items: flex-start; gap: 6px; height: max-content; }
.comment-action { width: 36px; height: 36px; min-height: 36px; flex: 0 0 36px; padding: 0; color: var(--blog-muted); }
.comment-action.danger { color: var(--blog-danger); }
.comments-empty { padding: 28px 0; color: var(--blog-muted); text-align: center; }
.blog-replies { margin-top: 14px; border-left: 2px solid var(--blog-border); }
.blog-reply { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 11px; padding: 14px 0 14px 18px; }
.blog-reply + .blog-reply { border-top: 1px solid rgba(54, 54, 54, .7); }
.blog-reply .blog-comment-avatar { width: 36px; height: 36px; }
.reply-compose { margin-top: 14px; padding: 14px; border: 1px solid var(--blog-border); border-radius: 8px; background: #121212; }
.reply-compose textarea { display: block; width: 100%; min-height: 86px; resize: vertical; padding: 12px; border: 1px solid #474747; border-radius: 6px; background: #101010; color: var(--blog-text); font: inherit; }
.reply-compose textarea:focus { outline: none; border-color: var(--blog-accent); }
.reply-compose-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

@media (max-width: 768px) {
  .blog-view-page { width: min(100% - 28px, 680px); padding: 48px 0 72px; }
  .article-back { margin-bottom: 34px; }
  .article-header h1 { font-size: 34px; }
  .article-lead { font-size: 17px; }
  .article-content { font-size: 16px; }
  .article-content h1 { font-size: 28px; }
  .article-content h2 { font-size: 25px; }
  .article-content h3 { font-size: 21px; }
  .article-comments { margin-top: 56px; }
}

@media (max-width: 520px) {
  .article-header h1 { font-size: 30px; }
  .article-meta { display: grid; }
  .comment-compose,
  .comments-login { padding: 18px; }
  .comments-login { align-items: stretch; flex-direction: column; }
  .blog-comment { grid-template-columns: 38px minmax(0, 1fr); }
  .blog-comment-avatar { width: 38px; height: 38px; }
  .blog-comment-actions { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .article-spinner { animation: none; }
}
