/* ================================================
   SAURABH PORTFOLIO — post.css
   Individual blog post page styles
   ================================================ */

.post-main {
  padding-top: 80px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.post-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text3);
  text-decoration: none;
  margin-bottom: 40px;
  margin-top: 24px;
  transition: color .2s;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.post-back:hover { color: var(--text2); }
.post-back svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

/* ── HEADER ── */
.post-header { margin-bottom: 44px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }

.post-cat {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.post-title {
  font-family: var(--f-head);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 16px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text3);
  flex-wrap: wrap;
}

.post-meta-dot { opacity: 0.4; }

/* ── ARTICLE BODY ── */
.post-body { font-family: var(--f-body); font-size: 16px; line-height: 1.85; color: var(--text2); }
.post-body > * + * { margin-top: 1.4em; }
.post-body p { color: var(--text2); }

.post-body h2 {
  font-family: var(--f-head); font-size: 20px; font-weight: 700; color: var(--text);
  letter-spacing: -.4px; margin-top: 2.2em; margin-bottom: .6em; line-height: 1.2;
}
.post-body h3 {
  font-family: var(--f-head); font-size: 16px; font-weight: 600; color: var(--text);
  margin-top: 1.8em; margin-bottom: .4em;
}
.post-body a { color: var(--accent); border-bottom: 1px solid var(--accent-glow); transition: border-color .2s; }
.post-body a:hover { border-color: var(--accent); }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body em { font-style: italic; }
.post-body ul, .post-body ol { padding-left: 1.4em; display: flex; flex-direction: column; gap: .35em; }
.post-body li { color: var(--text2); }

.post-body pre {
  background: var(--bg3); border: 1px solid var(--border2); border-radius: 10px;
  padding: 18px 20px; overflow-x: auto; margin: 1.6em 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.post-body pre code {
  font-family: var(--f-mono); font-size: 13px; color: var(--text);
  background: transparent; border: none; padding: 0; border-radius: 0; line-height: 1.7;
}
.post-body code {
  font-family: var(--f-mono); font-size: 13px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; color: var(--accent);
}
.post-body blockquote {
  border-left: 3px solid var(--accent); padding: 12px 20px; margin: 1.6em 0;
  background: var(--surface); border-radius: 0 8px 8px 0;
}
.post-body blockquote p { color: var(--text); font-style: italic; margin: 0; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* ================================================
   POST IMAGE STYLES
   Copy-paste template for adding images to posts:

   <figure class="post-img-wrap">
     <img src="../../assets/your-image.jpg" alt="Description" class="post-img" />
     <figcaption class="post-img-caption">Optional caption text here</figcaption>
   </figure>

   Variants (add to .post-img-wrap):
   - (no extra class)         full width, default
   - img-small                60% width, centered
   - img-rounded              extra-rounded corners (20px)
   - img-left                 float left, text wraps around
   - img-right                float right, text wraps around
   ================================================ */

.post-img-wrap {
  margin: 2em 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.post-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 480px;
  transition: transform .4s ease;
}

.post-img-wrap:hover .post-img {
  transform: scale(1.015);
}

.post-img-caption {
  display: block;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--text3);
  padding: 10px 16px 12px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  letter-spacing: .3px;
}

.post-img-wrap.img-small { max-width: 60%; margin-left: auto; margin-right: auto; }
.post-img-wrap.img-rounded { border-radius: 20px; }
.post-img-wrap.img-left { float: left; max-width: 45%; margin: 0.5em 1.8em 1em 0; }
.post-img-wrap.img-right { float: right; max-width: 45%; margin: 0.5em 0 1em 1.8em; }

/* Clearfix for floated images */
.post-body::after { content: ''; display: table; clear: both; }

/* ── FOOTER ── */
.post-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ── READ NEXT ── */
.read-next {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.read-next-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 16px;
}

.read-next-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.read-next-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
}

.read-next-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-2px);
}

.read-next-card-dir {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text3);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.read-next-card-dir svg { width: 12px; height: 12px; fill: currentColor; flex-shrink: 0; }

.read-next-card-title {
  font-family: var(--f-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -.2px;
}

.read-next-card-cat {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--accent);
}

.read-next-card.prev { align-items: flex-start; }
.read-next-card.next { align-items: flex-end; text-align: right; }
.read-next-grid.single { grid-template-columns: 1fr; }

/* ── RESPONSIVE ── */
@media(max-width: 580px) {
  .post-body { font-size: 15px; }
  .post-body pre { padding: 14px 16px; }
  .post-body pre code { font-size: 12px; }
  .post-img-wrap.img-left, .post-img-wrap.img-right { float: none; max-width: 100%; margin: 1.6em 0; }
  .post-img-wrap.img-small { max-width: 100%; }
  .read-next-grid { grid-template-columns: 1fr; }
  .read-next-card.next { align-items: flex-start; text-align: left; }
}
