/* ==============================
   AHMAD BLOG — GLOBAL STYLES
   Dark theme matching screenshot
   ============================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #161616;
  --card: #141414;
  --border: rgba(255,255,255,0.08);
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #e85d24;
  --accent2: #c44a18;
  --purple: #8b5cf6;
  --green: #10b981;
  --blue: #3b82f6;
  --pink: #ec4899;
  --amber: #f59e0b;
  --teal: #14b8a6;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

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

/* ====== NAVBAR ====== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #e85d24, #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, #e85d24, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.create-btn {
  background: linear-gradient(135deg, #e85d24, #c44a18);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.create-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.create-btn:active { transform: scale(0.98); }

/* ====== HERO ====== */
.hero {
  position: relative;
  padding: 100px 24px 60px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(232,93,36,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 50%, rgba(139,92,246,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(56px, 10vw, 96px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -3px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(90deg, #e85d24, #8b5cf6, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

/* Stats */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 36px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #e85d24, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Search */
.search-form {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: 8px;
}

.search-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: rgba(232,93,36,0.5); }

.search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.search-btn:hover { opacity: 0.85; }

/* ====== CATEGORY PILLS ====== */
.category-section {
  padding: 20px 0 32px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  transition: all 0.2s;
  cursor: pointer;
}

.pill:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

.pill-active {
  background: rgba(232,93,36,0.15);
  border-color: rgba(232,93,36,0.4);
  color: #e85d24;
}

/* ====== FEATURED CARD ====== */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 60px;
}

.featured-img-wrap { position: relative; height: 360px; overflow: hidden; }
.featured-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.featured-card:hover .featured-img { transform: scale(1.03); }

.featured-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.featured-badge {
  display: inline-block;
  background: linear-gradient(135deg, #e85d24, #f59e0b);
  color: #fff;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  width: fit-content;
}

.featured-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.featured-summary { font-size: 15px; color: var(--text-muted); line-height: 1.7; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-tag {
  background: rgba(232,93,36,0.15);
  color: #e85d24;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.post-date { font-size: 13px; color: var(--text-muted); }

.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e85d24, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.read-btn {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
  width: fit-content;
  margin-top: 6px;
}

.read-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ====== POSTS GRID ====== */
.posts-section { padding-bottom: 80px; }

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
}

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

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.14);
}

.post-card-link { display: block; }

.post-card-img-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card:hover .post-card-img { transform: scale(1.05); }

.card-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  color: #e85d24;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.post-card-body { padding: 20px; }

.post-card-meta { margin-bottom: 8px; }
.post-card-date { font-size: 12px; color: var(--text-muted); }

.post-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.author-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e85d24, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
}

.author-name { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.read-more { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

/* ====== POST HERO ====== */
.post-hero {
  position: relative;
  height: 480px;
  overflow: hidden;
}

.post-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.3) 60%, transparent 100%);
}

.post-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 0;
}

.back-category-badge {
  display: inline-block;
  background: rgba(232,93,36,0.2);
  color: #e85d24;
  border: 1px solid rgba(232,93,36,0.4);
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.post-hero-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -1px;
  max-width: 800px;
  margin-bottom: 20px;
}

.post-hero-meta { display: flex; align-items: center; gap: 20px; }

/* ====== POST LAYOUT ====== */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 80px;
  align-items: start;
}

.post-article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}

.post-lead {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 32px;
  font-style: italic;
}

.post-body {
  font-size: 16px;
  line-height: 1.8;
  color: #ccc;
}

.post-body h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
}

.post-body p { margin-bottom: 16px; }

.post-body strong { color: var(--text); font-weight: 600; }

.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ====== SIDEBAR ====== */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.author-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.author-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e85d24, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.related-list { display: flex; flex-direction: column; gap: 16px; }

.related-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.2s;
}

.related-item:hover { background: rgba(255,255,255,0.04); }

.related-img {
  width: 64px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.related-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.related-date { font-size: 11px; color: var(--text-muted); }

/* ====== FOOTER ====== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 1fr; }
  .featured-img-wrap { height: 240px; }
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .stats-row { gap: 24px; }
  .stat-num { font-size: 32px; }
}
