/* ============================================================
   SINGLE POST — single.css
   Uses CSS variables from :root (style.css)
   ============================================================ */

/* ---------- Layout ---------- */
.single-post {
  padding: 60px 0 80px;
  background: var(--off-white);
}

.single-post-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

/* ---------- Article Card ---------- */
.single-post-article {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ---------- Hero Image ---------- */
.single-post-hero {
  width: 100%;
  max-height: 460px;
  overflow: hidden;
}

.single-post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--tr-slow);
}

.single-post-hero img:hover {
  transform: scale(1.02);
}

/* ---------- Content Area ---------- */
.single-post-content {
  padding: 40px 48px;
}

/* Categories */
.single-post-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.single-cat {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-dim);
  color: var(--accent-dark);
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Title */
.single-post-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--primary);
  line-height: 1.25;
  margin: 0 0 20px;
}

/* Meta */
.single-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.single-post-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.single-post-meta svg {
  color: var(--accent-dark);
  flex-shrink: 0;
}

/* ---------- Post Body Content ---------- */
.post-content {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}

.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-heading);
  color: var(--primary);
  margin: 2em 0 0.6em;
  line-height: 1.3;
}

.post-content h2 { font-size: 1.55rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.05rem; }

.post-content p {
  margin: 0 0 1.4em;
}

.post-content a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--tr-fast);
}

.post-content a:hover {
  color: var(--primary);
}

.post-content ul,
.post-content ol {
  padding-left: 1.5em;
  margin: 0 0 1.4em;
}

.post-content li {
  margin-bottom: 0.5em;
}

.post-content blockquote {
  margin: 2em 0;
  padding: 20px 28px;
  border-left: 4px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: italic;
  color: var(--primary-light);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 1.5em 0;
  box-shadow: var(--shadow-sm);
}

.post-content pre,
.post-content code {
  background: var(--light-bg);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
}

.post-content pre {
  padding: 18px 22px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-content code {
  padding: 2px 6px;
}

/* ---------- Post Footer ---------- */
.single-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 48px;
  border-top: 1px solid var(--border-light);
  background: var(--off-white);
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tag {
  display: inline-block;
  padding: 5px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  text-decoration: none;
  transition: all var(--tr-fast);
}

.post-tag:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Back link */
.link-cta {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--tr-fast);
  white-space: nowrap;
}

.link-cta:hover {
  color: var(--accent-dark);
}

/* ---------- Sidebar ---------- */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 32px;
}

.sidebar-widget {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.sidebar-widget-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--primary);
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-dim);
}

/* CTA Widget */
.sidebar-cta-widget {
  background: linear-gradient(145deg, var(--primary), var(--primary-light));
  border: none;
}

.sidebar-cta-widget .sidebar-widget-title {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,0.15);
}

.sidebar-cta-widget p {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--tr);
  cursor: pointer;
}

.btn--accent {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: var(--shadow-accent);
}

.btn--accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(0,212,255,0.45);
}

.btn--full {
  width: 100%;
}

/* Recent Posts */
.sidebar-recent-post {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-recent-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-recent-post-thumb {
  width: 64px;
  height: 60px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--light-bg);
}

.sidebar-recent-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-recent-post h4 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 4px;
}

.sidebar-recent-post h4 a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--tr-fast);
}

.sidebar-recent-post h4 a:hover {
  color: var(--accent-dark);
}

.sidebar-recent-post span {
  font-size: 0.75rem;
  color: var(--text-light);
  font-family: var(--font-body);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .single-post-layout {
    grid-template-columns: 1fr 280px;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  .single-post { padding: 32px 0 60px; }

  .single-post-layout {
    grid-template-columns: 1fr;
  }

  .single-post-content { padding: 28px 24px; }
  .single-post-footer  { padding: 20px 24px; }

  .blog-sidebar {
    position: static;
  }
}

@media (max-width: 480px) {
  .single-post-content { padding: 22px 18px; }
  .single-post-footer  { padding: 18px; flex-direction: column; align-items: flex-start; }
}