/* blog.css — Tajul Furqan Academy Blog Styles */

:root {
  --dark:        #262A2A;
  --dark-2:      #303A3A;
  --teal:        #17c9a3;
  --teal-mid:    #23d4ad;
  --teal-soft:   #cfeee6;
  --gold:        #e9bb3f;
  --text-light:  #eaf6f2;
  --text-muted:  #8eb7ad;
  --text-dark:   #0f2f27;
  --card:        #1E2828;
  --border:      rgba(255, 255, 255, .12);
  --shadow:      0 16px 40px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text-light);
  background: var(--dark);
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 12px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  font-size: 15px;
}
.btn-primary  { background: var(--gold); color: #12231d; box-shadow: 0 12px 28px rgba(233,187,63,.3); }
.btn-secondary { background: transparent; color: var(--text-light); border-color: var(--border); }

/* ── Navigation ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(38,42,42,.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav {
  height: 76px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.logo {
  font-weight: 800; font-size: 22px; text-decoration: none;
  color: var(--text-light); display: flex; align-items: center; gap: 10px;
}
.logo img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.logo span { color: var(--teal); }
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; }
.nav-links a.active { color: var(--teal); font-weight: 700; }

/* ── Blog Hero ───────────────────────────────────────────────────────────── */
.blog-hero {
  padding: 72px 0 60px;
  background:
    radial-gradient(900px 400px at 0% -10%, rgba(23,201,163,.18) 0%, transparent 60%),
    radial-gradient(800px 360px at 100% 120%, rgba(14,97,81,.18) 0%, transparent 60%),
    linear-gradient(140deg, var(--dark), var(--dark-2));
  position: relative; overflow: hidden;
}
.blog-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(23,201,163,.07) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}
.blog-hero-inner {
  position: relative; z-index: 2;
  max-width: 700px;
}
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--teal); font-weight: 700; margin-bottom: 14px;
}
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 56px); line-height: 1.1;
  margin: 0 0 16px; color: var(--text-light);
}
.blog-hero p {
  font-size: clamp(16px, 1.8vw, 20px); line-height: 1.7;
  color: var(--text-muted); margin: 0;
}

/* ── Posts Grid Section ──────────────────────────────────────────────────── */
.blog-section { padding: 64px 0 92px; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* ── Post Card ───────────────────────────────────────────────────────────── */
.post-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  border-color: rgba(23,201,163,.35);
}

.post-card-img {
  aspect-ratio: 16 / 9;
  overflow: hidden; position: relative;
  background: var(--dark-2);
  flex-shrink: 0;
}
.post-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.04); }

.post-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark-2);
  color: var(--teal); font-size: 32px; opacity: .5;
}

.post-card-body {
  padding: 20px 22px 22px;
  display: flex; flex-direction: column; flex: 1;
}

.post-card-meta {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.post-meta-sep { color: var(--border); }

.post-card-title {
  font-size: 18px; font-weight: 800; line-height: 1.35;
  margin: 0 0 10px; color: var(--text-light);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.post-card-excerpt {
  font-size: 14px; line-height: 1.65; color: var(--text-muted);
  margin: 0 0 auto;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.post-read-more {
  display: inline-block; margin-top: 16px;
  font-size: 13px; font-weight: 700; color: var(--teal);
}
.post-card:hover .post-read-more { color: var(--teal-mid); }

/* ── No Posts / Error ────────────────────────────────────────────────────── */
.no-posts, .blog-error {
  grid-column: 1 / -1; text-align: center;
  padding: 64px 24px; color: var(--text-muted); font-size: 18px;
}

/* ── Skeleton Loading ────────────────────────────────────────────────────── */
.skeleton { pointer-events: none; }
.skeleton-block {
  background: linear-gradient(90deg, var(--dark-2) 25%, rgba(255,255,255,.04) 50%, var(--dark-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  width: 100%; height: 100%;
}
.skeleton-line {
  height: 14px; border-radius: 6px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--dark-2) 25%, rgba(255,255,255,.04) 50%, var(--dark-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Single Post Page ────────────────────────────────────────────────────── */

/* Hero image */
.post-hero {
  width: 100%; margin: 24px 0 36px;
  border-radius: 12px; overflow: hidden;
}
.post-hero img {
  width: 100%; height: auto;
  display: block;
}

/* Post wrapper (content column) */
.post-wrapper {
  max-width: 720px; margin: 0 auto;
  padding: 48px 0 80px;
}

.post-top-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); font-weight: 600;
  margin-bottom: 16px;
}

.post-wrapper h1 {
  font-size: clamp(28px, 4vw, 48px); line-height: 1.15;
  margin: 0 0 36px; color: var(--text-light);
}

/* ── Post Body Typography ─────────────────────────────────────────────────── */
.post-body {
  font-size: 17px; line-height: 1.85; color: var(--text-light);
}
.post-body p          { margin: 0 0 1.5em; }
.post-body h2         { font-size: clamp(22px, 3vw, 30px); line-height: 1.25; margin: 2em 0 .75em; color: var(--text-light); }
.post-body h3         { font-size: clamp(19px, 2.5vw, 24px); line-height: 1.3; margin: 1.75em 0 .6em; color: var(--text-light); }
.post-body h4         { font-size: 18px; margin: 1.5em 0 .5em; color: var(--text-light); }
.post-body strong     { color: var(--text-light); font-weight: 700; }
.post-body em         { color: var(--teal-soft); font-style: italic; }
.post-body code       { background: rgba(23,201,163,.12); border: 1px solid rgba(23,201,163,.2); border-radius: 4px; padding: 2px 6px; font-size: .9em; color: var(--teal); }
.post-body a          { color: var(--teal); text-underline-offset: 3px; }
.post-body a:hover    { color: var(--teal-mid); }
.post-body ul,
.post-body ol         { padding-left: 22px; margin: 0 0 1.5em; }
.post-body li         { margin-bottom: .5em; color: var(--text-muted); }
.post-body li strong  { color: var(--text-light); }
.post-body blockquote {
  border-left: 3px solid var(--teal);
  margin: 2em 0; padding: .75em 0 .75em 20px;
  color: var(--text-muted); font-style: italic; font-size: 18px;
}
.post-figure { margin: 2em 0; }
.post-figure img { width: 100%; border-radius: 12px; display: block; }

/* ── HifzBuddy CTA Box ───────────────────────────────────────────────────── */
.hb-cta {
  margin: 52px 0 40px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1a2d28 0%, #1e2e2a 60%, #1c2b26 100%);
  border: 1px solid rgba(23, 201, 163, .18);
  box-shadow: 0 0 48px rgba(23, 201, 163, .06), 0 20px 48px rgba(0, 0, 0, .3);
  display: grid;
  grid-template-columns: 55fr 45fr;
  overflow: hidden;
  position: relative;
}

.hb-cta::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(23, 201, 163, .06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.hb-cta::after {
  content: "";
  position: absolute;
  top: 50%; left: -60px;
  transform: translateY(-50%);
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(23, 201, 163, .14) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.hb-cta-left {
  padding: 40px 36px;
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
}

.hb-cta-heading {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 800; line-height: 1.2;
  margin: 0 0 20px;
  color: var(--text-light);
}

.hb-cta-features {
  list-style: none;
  padding: 0; margin: 0 0 28px;
  display: flex; flex-direction: column; gap: 10px;
}

.hb-cta-features li {
  font-size: 14px; color: var(--text-muted);
  display: flex; align-items: flex-start; gap: 8px;
  line-height: 1.5;
}

.hb-cta-btn { align-self: flex-start; }

.hb-cta-sub {
  margin: 10px 0 0;
  font-size: 12px; color: var(--text-muted); opacity: .65;
}

.hb-cta-right {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 32px 32px 0;
  position: relative; z-index: 2;
}

.hb-cta-img-frame {
  width: 100%;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(23, 201, 163, .14);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}

.hb-cta-img-frame img { width: 100%; height: auto; display: block; }

@media (max-width: 680px) {
  .hb-cta { grid-template-columns: 1fr; }
  .hb-cta-left { padding: 32px 24px 20px; }
  .hb-cta-right { padding: 0 24px 28px; }
  .hb-cta-btn { align-self: stretch; text-align: center; }
}

/* Back link */
.post-back { margin-top: 52px; padding-top: 32px; border-top: 1px solid var(--border); }

/* Post loading skeleton */
.post-loading { padding: 64px 24px; max-width: 720px; margin: 0 auto; }
.post-loading .skeleton-line { margin-bottom: 14px; }

/* Post error */
.post-error {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted); font-size: 18px;
}
.post-error a { color: var(--teal); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  padding: 36px 0;
  background: #191F1F;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-grid {
  display: flex; justify-content: space-between;
  gap: 16px; align-items: center; flex-wrap: wrap;
}
.footer-grid a { color: var(--text-muted); text-decoration: none; font-size: 14px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .nav-links { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .blog-section { padding: 48px 0 72px; }
  .post-wrapper { padding: 36px 0 64px; }
  .post-hero { margin: 16px 0 24px; border-radius: 8px; }
}
