/* =============================================================
   blog-post.css — individual blog post page (/blog/:slug)
   ============================================================= */

:root {
  --navy:       #1a3a5c;
  --navy-dark:  #122840;
  --orange:     #e07b1a;
  --white:      #ffffff;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --blue-600:   #2563eb;
  --radius:     10px;
  --radius-lg:  16px;
  --transition: 0.18s ease;
  --grid-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cdefs%3E%3Cpattern id='g' width='80' height='80' patternUnits='userSpaceOnUse'%3E%3Crect width='80' height='80' fill='none'/%3E%3Cpath d='M 80 0 L 0 0 0 80' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Cpath d='M 20 0 L 20 80 M 40 0 L 40 80 M 60 0 L 60 80 M 0 20 L 80 20 M 0 40 L 80 40 M 0 60 L 80 60' fill='none' stroke='rgba(255,255,255,0.02)' stroke-width='0.5'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='80' height='80' fill='url(%23g)'/%3E%3C/svg%3E");
}

/* ── Hero ── */
.post-hero {
  position: relative;
  background: var(--navy-dark);
  padding: 48px 0 56px;
  overflow: hidden;
}
.post-hero-bg { position: absolute; inset: 0; background-image: var(--grid-svg); pointer-events: none; }
.post-hero-inner { position: relative; z-index: 1; max-width: 760px; }

.post-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color var(--transition);
}
.post-hero-back:hover { color: rgba(255,255,255,0.9); }
.post-hero-back svg { width: 14px; height: 14px; }

.post-hero-date {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-hero-date svg { width: 13px; height: 13px; flex-shrink: 0; }

.post-hero-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
}

.post-hero-excerpt {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  max-width: 620px;
}

/* ── Hero skeleton ── */
.post-hero-skel { display: flex; flex-direction: column; gap: 14px; }
.post-skel {
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.07) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.07) 75%);
  background-size: 200% 100%;
  animation: post-shimmer 1.5s infinite;
}
.post-skel--date  { height: 13px; width: 120px; }
.post-skel--title { height: 40px; width: 85%; border-radius: 8px; }
.post-skel--title2{ height: 40px; width: 60%; border-radius: 8px; margin-top: -6px; }
.post-skel--sub   { height: 16px; width: 70%; }
.post-skel--sub2  { height: 16px; width: 50%; }
@keyframes post-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Cover image ── */
.post-cover-wrap {
  background: var(--white);
  padding: 40px 0 0;
}
.post-cover-img {
  display: block;
  width: 100%;
  max-width: 760px;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  margin: 0 auto;
}

/* ── Article body ── */
.post-body {
  background: var(--white);
  padding: 48px 0 80px;
}
.post-inner {
  max-width: 760px;
  margin: 0 auto;
}

/* ── Body skeleton ── */
.post-body-skel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-body-skel-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #edf1f7 25%, #dce4f0 50%, #edf1f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.post-body-skel-line--heading { height: 22px; width: 55%; border-radius: 6px; margin-top: 12px; }
.post-body-skel-line--full    { width: 100%; }
.post-body-skel-line--long    { width: 90%; }
.post-body-skel-line--med     { width: 75%; }
.post-body-skel-line--short   { width: 45%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Rich-text content (Tiptap HTML output) ── */
.post-content {
  font-size: 16px;
  color: var(--gray-700);
  line-height: 1.8;
}

.post-content > * + * { margin-top: 1.25em; }

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--navy);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.post-content h1 { font-size: 28px; }
.post-content h2 { font-size: 22px; }
.post-content h3 { font-size: 18px; }
.post-content h4 { font-size: 16px; }

.post-content p { margin-bottom: 0; }

.post-content a {
  color: var(--blue-600);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.post-content a:hover { text-decoration: none; }

.post-content strong { font-weight: 700; color: var(--gray-900); }
.post-content em { font-style: italic; }

.post-content ul,
.post-content ol {
  padding-left: 1.5em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { line-height: 1.65; }

.post-content blockquote {
  border-left: 4px solid var(--navy);
  padding: 12px 20px;
  background: var(--gray-100);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gray-600);
  font-style: italic;
  margin: 1.5em 0;
}
.post-content blockquote p { margin-bottom: 0; }

.post-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--navy);
}

.post-content pre {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 2em 0;
}

.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  display: block;
  margin: 1.5em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.post-content th,
.post-content td {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  text-align: left;
}
.post-content th {
  background: var(--gray-100);
  font-weight: 700;
  color: var(--navy);
}

/* ── Not-found / error states ── */
.post-not-found {
  text-align: center;
  padding: 60px 0 20px;
  color: var(--gray-500);
}
.post-not-found h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.post-not-found p  { font-size: 15px; line-height: 1.65; margin-bottom: 24px; }
.post-not-found a  { color: var(--blue-600); font-weight: 600; text-decoration: none; }
.post-not-found a:hover { text-decoration: underline; }

.post-error {
  background: #fff3e0;
  border: 1px solid #ffd5a0;
  border-radius: var(--radius);
  padding: 18px 22px;
  color: #9a5700;
  font-size: 14px;
}

/* ── Related posts ── */
.post-related {
  padding: 56px 0;
  border-top: 1px solid var(--gray-200);
}
.post-related-title {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 28px;
}
.post-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.post-related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: var(--white, #fff);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.post-related-card:hover {
  border-color: rgba(26, 58, 92, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}
.post-related-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange, #e07b1a);
}
.post-related-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}
.post-related-card-excerpt {
  font-size: 13.5px;
  color: var(--gray-500);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-related-card-readmore {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-top: auto;
}

/* ── Responsive ── */
@media (max-width: 800px) {
  .post-hero { padding: 36px 0 44px; }
  .post-body  { padding: 36px 0 64px; }
  .post-cover-wrap { padding-top: 28px; }
  .post-related-grid { grid-template-columns: 1fr; }
}
