/* ==========================================================================
   THEME: SINGLE POST LAYOUT & COMMENTS
   ========================================================================== */

/* --- 1. CORE VARIABLES --- */
:root {
  --bg-dark: #050505;
  --bg-card: #0c0c0e;
  --bg-surface: #121215;
  --border: #222;
  --border-light: #333;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #eab308;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: "Google Sans", "Inter", sans-serif;
  margin: 0;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* --- 2. TYPOGRAPHY & INLINE ELEMENTS --- */
h1, h2, h3, h4, h5, h6 { font-family: "Space Grotesk", sans-serif; font-weight: 700; color: #fff; letter-spacing: -0.5px; margin: 3rem 0 1.5rem; }
p { font-size: 1.125rem; color: #d1d5db; line-height: 1.85; margin-bottom: 1.5rem; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: #60a5fa; text-decoration: underline; }

em, i.recursive { font-family: "Recursive", monospace; font-variation-settings: "MONO" 1, "slnt" -15; font-style: italic; color: #60a5fa; background: rgba(96, 165, 250, 0.1); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-weight: 500; }
.entry-content code { font-family: "Recursive", monospace; font-size: 0.85em; background: rgba(255, 255, 255, 0.08); padding: 0.2rem 0.4rem; border-radius: 6px; color: #e5e7eb; border: 1px solid rgba(255, 255, 255, 0.1); }

/* --- 3. LAYOUT CONTAINERS --- */
.container-hero { max-width: 1400px; margin: 0 auto; padding: 0 5%; }
.container-article { max-width: 1300px; margin: 0 auto; padding: 4rem 5%; display: grid; grid-template-columns: 1fr 300px; gap: 4rem; align-items: start; }

/* --- 4. HERO SECTION --- */
.post-hero { position: relative; padding: 8rem 0 6rem; border-bottom: 1px solid var(--border); overflow: hidden; background: #080809; }
.post-hero::before { content: ""; position: absolute; top: -50%; left: -10%; width: 60vw; height: 60vw; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%); z-index: 1; filter: blur(80px); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 4rem; align-items: center; position: relative; z-index: 2; }
.meta-bar { display: flex; flex-wrap: wrap; gap: 1rem; font-family: "Recursive", monospace; font-size: 0.8rem; color: var(--text-muted); align-items: center; margin-bottom: 1.5rem; }
.meta-tag { background: rgba(59, 130, 246, 0.1); color: var(--accent); padding: 0.3rem 0.8rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 1px; border: 1px solid rgba(59, 130, 246, 0.2); font-weight: 600; }
.post-title { font-size: clamp(2.5rem, 4vw, 4rem); line-height: 1.1; margin: 0 0 1.5rem 0; background: linear-gradient(to right, #ffffff, #a1a1aa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.page-subtitle { font-size: 1.25rem; color: #9ca3af; margin: 0 0 2rem 0; line-height: 1.6; max-width: 800px; }

/* Execution Plan / Post Summary in Hero */
.hero-bullets { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 2rem; backdrop-filter: blur(10px); }
.hero-bullets span { font-family: "Recursive", monospace; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; display: block; letter-spacing: 1px; }
.hero-bullets ul { list-style: none; padding: 0; margin: 0; }
.hero-bullets li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 0.75rem; color: #e5e7eb; font-size: 1.05rem; line-height: 1.6; }
.hero-bullets li i { color: var(--success); font-size: 1rem; margin-top: 4px; }
.hero-bullets li:last-child { margin-bottom: 0; }

.hero-author { display: flex; align-items: center; gap: 1rem; border-top: 1px solid var(--border); padding-top: 2rem; margin-top: 2rem;}
.hero-author img { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }
.hero-author h4 { font-size: 1.1rem; margin: 0; color: #fff; }
.hero-author p { font-family: "Recursive", monospace; font-size: 0.8rem; color: var(--accent); margin: 0; }

.hero-image-wrapper { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6); border: 1px solid var(--border-light); background: #000; }
.hero-image-wrapper img { width: 100%; height: auto; object-fit: cover; display: block; opacity: 0.9; }
.mac-dots { position: absolute; top: 0; left: 0; width: 100%; padding: 16px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent); display: flex; gap: 8px; z-index: 10; }
.mac-dot { width: 12px; height: 12px; border-radius: 50%; }

/* --- 5. STICKY SIDEBAR --- */
.sidebar { position: sticky; top: 2rem; }
.toc-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; }
.toc-widget h4 { margin: 0 0 1rem 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; color: #fff; font-family: "Recursive", monospace; }
.toc-widget ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); margin-left: 0.5rem; }
.toc-widget li { margin-bottom: 0.8rem; position: relative; padding-left: 1rem; }
.toc-widget li::before { content: ""; position: absolute; left: -2px; top: 10px; width: 8px; height: 2px; background: var(--border); transition: var(--transition); }
.toc-widget li:hover::before { background: var(--accent); width: 12px; }
.toc-widget a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.toc-widget a:hover { color: #fff; text-decoration: none; }

.subscribe-widget { background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), transparent); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; }
.subscribe-widget i { font-size: 2rem; color: var(--accent); margin-bottom: 1rem; }
.subscribe-widget h4 { margin: 0 0 0.5rem 0; font-size: 1.1rem; }
.subscribe-widget p { font-size: 0.85rem; margin-bottom: 1rem; line-height: 1.5; color: #d1d5db; }
.subscribe-widget input { width: 100%; box-sizing: border-box; background: var(--bg-dark); border: 1px solid var(--border); padding: 0.6rem; border-radius: 6px; color: #fff; margin-bottom: 0.5rem; outline: none; }
.subscribe-widget button { width: 100%; background: var(--text-main); color: #000; font-weight: 700; font-family: "Space Grotesk", sans-serif; border: none; padding: 0.6rem; border-radius: 6px; cursor: pointer; transition: var(--transition); }
.subscribe-widget button:hover { background: var(--accent); color: #fff; }

/* --- 6. CONTENT FORMATTING (Base) --- */
.entry-content { font-size: 1.125rem; min-width: 0; }
.entry-content > * { margin-bottom: 2rem; }
.entry-content h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-top: 4rem; }
.entry-content ul, .entry-content ol { padding-left: 2rem; color: #d1d5db; line-height: 1.8; }
.entry-content blockquote { border-left: 4px solid var(--accent); margin: 3rem 0; padding: 1.5rem 2rem; background: var(--bg-card); border-radius: 0 12px 12px 0; border: 1px solid var(--border); border-left-width: 4px; }
.entry-content blockquote p { font-style: italic; color: #fff; margin: 0; font-size: 1.2rem; }
.entry-content img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }

/* --- 7. FOOTER NAVIGATION --- */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; border-top: 1px solid var(--border); padding-top: 4rem; margin: 4rem 0; }
.nav-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; transition: var(--transition); display: flex; flex-direction: column; text-decoration: none;}
.nav-card:hover { border-color: var(--border-light); transform: translateY(-3px); }
.nav-label { font-family: "Recursive", monospace; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.8rem; }
.nav-title { font-family: "Space Grotesk", sans-serif; font-size: 1.2rem; color: #fff; font-weight: 600; line-height: 1.4; margin: 0; }
.nav-next { text-align: right; }

/* --- 8. TERMINAL-STYLE COMMENTS SECTION --- */
#comments { margin-top: 2rem; }
.comments-title, .comment-reply-title { font-family: "Recursive", monospace; font-size: 1.3rem; margin-bottom: 2.5rem; color: #fff; display: flex; align-items: center; gap: 10px; border: none; font-weight: normal; }
.comments-title::before, .comment-reply-title::before { content: "root@codesmiley:~$ ./"; color: var(--success); }

.comment-list { list-style: none; padding: 0; margin: 0 0 4rem 0; }
.comment-list .comment { margin-bottom: 2rem; }
.comment-list .children { list-style: none; padding-left: 0; margin-top: 1.5rem; border-left: 1px dashed var(--border-light); margin-left: 1.5rem; }
.comment-list .children .comment { position: relative; padding-left: 2rem; margin-bottom: 1.5rem; }
.comment-list .children .comment::before { content: ""; position: absolute; left: 0; top: 2rem; width: 1.5rem; height: 1px; border-bottom: 1px dashed var(--border-light); }

.comment-body { background: #000; border: 1px solid var(--border-light); border-radius: 8px; padding: 1.5rem; transition: var(--transition); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.comment-body:hover { border-color: var(--accent); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1); }

.comment-meta { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px dotted #333; }
.comment-author { display: flex; align-items: center; gap: 1rem; font-family: "Recursive", monospace; font-weight: 600; font-size: 0.95rem; color: #fff; }
.comment-author img.avatar { width: 36px; height: 36px; border-radius: 4px; border: 1px solid var(--border); filter: grayscale(100%); opacity: 0.8; }
.comment-author .fn a { color: var(--accent); text-decoration: none; }
.comment-author .fn::before { content: "usr@"; color: var(--text-muted); font-weight: 400; }
.bypostauthor .comment-author .fn::before { content: "root@"; color: var(--danger); }
.comment-author .fn::after { content: ":~$"; color: var(--success); font-weight: 400; margin-left: 5px; margin-right: 10px; }
.comment-metadata { font-family: "Recursive", monospace; font-size: 0.75rem; color: #555; }
.comment-metadata a { color: #666; }

.comment-content { font-family: "Recursive", monospace; font-size: 0.95rem; line-height: 1.7; color: #a1a1aa; }
.comment-content p { font-size: inherit; color: inherit; margin-bottom: 1rem; line-height: inherit; font-family: inherit; }
.comment-content p::before { content: "> "; color: var(--accent); font-weight: bold; }

.reply { margin-top: 1rem; text-align: left; }
.reply .comment-reply-link { display: inline-flex; align-items: center; gap: 5px; font-family: "Recursive", monospace; font-size: 0.75rem; color: var(--text-muted); background: transparent; padding: 0.3rem 0; text-transform: uppercase; border: none; transition: var(--transition); }
.reply .comment-reply-link::before { content: "↳"; color: var(--success); font-size: 1rem; }
.reply .comment-reply-link:hover { color: var(--accent); }

/* Form */
.comment-respond { background: #000; border: 1px solid var(--border-light); border-radius: 8px; padding: 2rem; position: relative; }
.comment-respond::before { content: "TERMINAL"; position: absolute; top: -10px; left: 20px; background: #000; padding: 0 10px; font-family: "Recursive", monospace; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; }
.comment-notes, .logged-in-as { font-family: "Recursive", monospace; font-size: 0.85rem; color: #666; margin-bottom: 1.5rem; }
.comment-form-comment, .comment-form-author, .comment-form-email, .comment-form-url { margin-bottom: 1.5rem; }
.comment-form label { display: flex; align-items: center; gap: 8px; font-family: "Recursive", monospace; font-size: 0.85rem; color: var(--accent); margin-bottom: 0.5rem; }
.comment-form label::before { content: "$"; color: var(--success); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; background: #050505; border: 1px dashed var(--border-light); border-radius: 4px; padding: 1rem; color: #10b981; font-family: "Recursive", monospace; font-size: 0.95rem; outline: none; transition: var(--transition); box-sizing: border-box; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--success); background: #000; box-shadow: 0 0 15px rgba(34, 197, 94, 0.15); }
.form-submit { margin: 0; text-align: left; }
.submit { background: transparent; color: var(--success); font-family: "Recursive", monospace; font-weight: 700; font-size: 0.9rem; border: 1px solid var(--success); border-radius: 4px; padding: 0.8rem 2rem; cursor: pointer; transition: var(--transition); text-transform: uppercase; letter-spacing: 1px; }
.submit:hover { background: rgba(34, 197, 94, 0.1); box-shadow: 0 0 15px rgba(34, 197, 94, 0.2); }

/* --- RESPONSIVE OVERRIDES --- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .container-article { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  .sidebar, .post-nav { grid-template-columns: 1fr; gap: 1rem; }
  .nav-next { text-align: left; }
  .comment-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .submit { width: 100%; }
}