/* ============================================================
   CodeWithJoy — Design System
   ============================================================ */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-border: #e8e6e1;
  --color-border-light: #f0ede8;

  --color-text: #1a1a1a;
  --color-text-secondary: #6b6b6b;
  --color-text-muted: #9b9b9b;

  --color-accent: #1a73e8;
  --color-accent-dark: #1557b0;
  --color-accent-light: #e8f0fe;

  --color-green: #0d9488;
  --color-yellow: #d97706;
  --color-red: #dc2626;
  --color-purple: #7c3aed;
  --color-orange: #ea580c;

  --grad-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --grad-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --grad-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.16);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --nav-height: 65px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   NAVBAR
   ============================================================ */
.cwj-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  z-index: 1000;
  transition: var(--transition);
}

.cwj-nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--nav-height);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-icon {
  color: var(--color-accent);
  font-size: 1.3em;
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(102,126,234,0.4);
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-brand:hover .brand-avatar {
  border-color: var(--color-accent);
  transform: scale(1.06);
}

.footer-brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
}

.nav-linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  background: linear-gradient(135deg, #0077b5, #005885);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-linkedin-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,119,181,0.4);
  color: white;
}

.nav-linkedin-link i { font-size: 0.9rem; }

.nav-linkedin-text { display: inline; }

@media (max-width: 900px) {
  .nav-linkedin-text { display: none; }
  .nav-linkedin-link { padding: 7px 10px; }
}

@media (max-width: 480px) {
  .nav-linkedin-link { display: none; }
}

.nav-search {
  flex: 1;
  max-width: 340px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  background: var(--color-border-light);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text);
  transition: var(--transition);
  outline: none;
}

.search-input:focus {
  background: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-lnk {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}

.nav-lnk:hover { color: var(--color-text); background: var(--color-border-light); }

.admin-lnk { color: var(--color-purple) !important; }

.nav-drop { position: relative; }
.nav-drop:hover .drop-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.drop-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drop-menu::-webkit-scrollbar { width: 4px; }
.drop-menu::-webkit-scrollbar-track { background: transparent; }
.drop-menu::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.drop-menu::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

.drop-menu-right {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(-8px);
}

.nav-drop:hover .drop-menu-right { transform: translateX(0) translateY(0); }

.drop-item {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text);
  transition: var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
}

.drop-item:hover { background: var(--color-border-light); }
.drop-item.text-danger { color: var(--color-red); }
.drop-header { display: block; padding: 8px 12px; font-size: 0.8rem; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); margin-bottom: 4px; }

.btn-avatar {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 6px;
  border-radius: var(--radius-full);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.btn-avatar:hover { color: var(--color-text); background: var(--color-border-light); }

.btn-nav-outline {
  padding: 8px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  transition: var(--transition);
}

.btn-nav-outline:hover { border-color: var(--color-text); background: var(--color-text); color: white; }

.btn-nav-primary {
  padding: 8px 20px;
  background: var(--color-text);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-nav-primary:hover { background: #333; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 24px 20px;
  z-index: 999;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-lg);
}

.mobile-menu.open { display: flex; }

.mobile-menu a,
.mobile-menu button {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.mobile-menu a:hover, .mobile-menu button:hover { background: var(--color-border-light); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content { padding-top: var(--nav-height); min-height: 100vh; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  background: var(--grad-hero);
  color: white;
  padding: 110px 0 90px;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}

.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
  filter: blur(60px);
  animation: float-shape 12s ease-in-out infinite;
}

.shape-1 { width: 500px; height: 500px; background: #667eea; top: -200px; right: -100px; animation-delay: 0s; }
.shape-2 { width: 350px; height: 350px; background: #764ba2; bottom: -100px; left: -50px; animation-delay: -4s; }
.shape-3 { width: 250px; height: 250px; background: #4facfe; top: 50%; left: 50%; animation-delay: -8s; }

@keyframes float-shape {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: fit-content;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-headline {
  font-size: clamp(1.9rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  word-break: break-word;
  hyphens: auto;
  margin-top: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #a78bfa, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

.hero-sub {
  font-size: clamp(0.85rem, 1.8vw, 0.97rem);
  line-height: 1.8;
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  margin-bottom: 20px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: white;
  color: #0f172a;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }

.btn-hero-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.btn-hero-ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.7); }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px 28px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
  width: fit-content;
}

.stat-card { text-align: center; }
.stat-number { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; }
.stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.6); }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.15); }

/* ── Hero two-column layout ─────────────────────────────── */
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero-left .hero-badge { margin-bottom: 12px; }
.hero-left .hero-headline { margin-bottom: 0; }
.hero-left .hero-sub { margin-top: 18px; margin-bottom: 28px; }
.hero-left .hero-cta { margin-bottom: 36px; }
.hero-left .hero-stats { width: fit-content; }

/* ── Hot Area card ──────────────────────────────────────── */
.hot-area { display: flex; flex-direction: column; }

.hot-area-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), box-shadow 0.4s ease;
}

.hot-area-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
}

.hot-area-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hot-area-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 16px;
  background: linear-gradient(135deg, rgba(249,115,22,0.3), rgba(239,68,68,0.3));
  border: 1px solid rgba(249,115,22,0.5);
  border-radius: var(--radius-full);
  color: #fdba74;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hot-area-badge i {
  color: #fb923c;
  animation: flicker 2.5s ease-in-out infinite;
}

@keyframes flicker {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.15); }
}

.hot-area-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  overflow: hidden;
}

.hot-area-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.hot-area-video-glow {
  position: absolute;
  inset: -1px;
  border-radius: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(102,126,234,0.15) 100%);
  pointer-events: none;
}

.hot-area-footer {
  padding: 18px 20px 20px;
  display: flex;
  justify-content: center;
}

.btn-discover {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 32px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 20px rgba(249,115,22,0.4);
  position: relative;
  overflow: hidden;
}

.btn-discover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fb923c, #f43f5e);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-discover:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 28px rgba(249,115,22,0.55);
  color: white;
}

.btn-discover:hover::before { opacity: 1; }
.btn-discover span, .btn-discover i { position: relative; z-index: 1; }

.btn-discover i {
  transition: transform 0.3s ease;
}
.btn-discover:hover i { transform: translateX(4px); }

.hero-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero-scroll-hint a {
  color: rgba(255,255,255,0.5);
  animation: bounce 2s ease-in-out infinite;
  font-size: 1.2rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================================================
   FEATURED SECTION
   ============================================================ */
.featured-section { padding: 80px 0; }

.section-header { margin-bottom: 40px; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.featured-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 28px;
}

/* ── 4-card featured grid ───────────────────────────────── */
.featured-grid-4 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: stretch;   /* both columns grow to the same height */
}

/* Hero card fills full column height and stacks image above body */
.featured-grid-4 .featured-hero-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.featured-grid-4 .featured-hero-card .card-image-wrap {
  height: 220px;
  flex-shrink: 0;
}

.featured-grid-4 .featured-hero-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Hero card title: max 2 lines */
.featured-grid-4 .card-title-lg {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hero card excerpt: max 3 lines */
.featured-grid-4 .card-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 16px;
}

/* Right column stretches to match hero card, cards share height equally */
.featured-side-3 {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

/* Each side card takes an equal 1/3 of the right column */
.featured-side-3 > .featured-side-card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Side card inner layout: fill height, image fills its column */
.featured-grid-4 .featured-side-card {
  border-radius: var(--radius-lg);
  display: flex;
  align-items: stretch;
}

.featured-grid-4 .side-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
}

/* Side card title: max 2 lines then truncate */
.featured-grid-4 .side-card-title {
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Side card thumbnail: fixed width, fills card height */
.featured-grid-4 .side-card-image {
  width: 100px;
  flex-shrink: 0;
  height: auto;
  align-self: stretch;
}

.featured-grid-4 .side-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-grid-4 .side-placeholder {
  width: 100px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-grid-4 .card-meta-sm { font-size: 0.75rem; flex-shrink: 0; }

/* Group badges */
.feat-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.feat-badge-ios    { background: rgba(0,122,255,0.12); color: #0a84ff; border: 1px solid rgba(0,122,255,0.25); }
.feat-badge-dotnet { background: rgba(91,33,182,0.12); color: #7c3aed; border: 1px solid rgba(91,33,182,0.25); }
.feat-badge-design { background: rgba(236,72,153,0.12); color: #db2777; border: 1px solid rgba(236,72,153,0.25); }
.feat-badge-other  { background: rgba(234,179,8,0.12);  color: #ca8a04; border: 1px solid rgba(234,179,8,0.25); }

/* for the card-image-wrap badge positioning */
.feat-group-badge.feat-badge-ios,
.feat-group-badge.feat-badge-dotnet,
.feat-group-badge.feat-badge-design,
.feat-group-badge.feat-badge-other {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  color: white;
  border: none;
  letter-spacing: 0.05em;
}

/* inside side-card-body — override position:absolute */
.side-card-body .feat-group-badge {
  position: static;
  background: none;
  backdrop-filter: none;
}

.feat-badge-ios.side-card-body    { color: #0a84ff !important; }

/* inside side-card-body color overrides */
.side-card-body .feat-badge-ios    { color: #0a84ff; background: rgba(0,122,255,0.1); border: 1px solid rgba(0,122,255,0.2); }
.side-card-body .feat-badge-dotnet { color: #7c3aed; background: rgba(91,33,182,0.1); border: 1px solid rgba(91,33,182,0.2); }
.side-card-body .feat-badge-design { color: #db2777; background: rgba(236,72,153,0.1); border: 1px solid rgba(236,72,153,0.2); }
.side-card-body .feat-badge-other  { color: #ca8a04; background: rgba(234,179,8,0.1);  border: 1px solid rgba(234,179,8,0.2); }

/* Placeholder colours per group */
.feat-placeholder-ios    { background: linear-gradient(135deg, #0a84ff, #0055d4); }
.feat-placeholder-dotnet { background: linear-gradient(135deg, #7c3aed, #4f1db5); }
.feat-placeholder-design { background: linear-gradient(135deg, #db2777, #9d174d); }
.feat-placeholder-other  { background: linear-gradient(135deg, #d97706, #b45309); }
.feat-placeholder-ios i, .feat-placeholder-dotnet i,
.feat-placeholder-design i, .feat-placeholder-other i {
  font-size: 3rem; color: rgba(255,255,255,0.35);
}

/* Responsive */
@media (max-width: 1024px) {
  .featured-grid-4 {
    grid-template-columns: 1fr;
    align-items: start;          /* restore natural height on stacked layout */
  }
  .featured-grid-4 .featured-hero-card { height: auto; }
  .featured-side-3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: auto;
  }
  .featured-side-3 > .featured-side-card { flex: none; min-height: 160px; }
  .featured-grid-4 .side-card-image { width: 88px; }
  .featured-grid-4 .side-placeholder { width: 88px; }
}

@media (max-width: 640px) {
  .featured-grid-4 { grid-template-columns: 1fr; }
  .featured-side-3 { grid-template-columns: 1fr; }
  .featured-grid-4 .featured-hero-card .card-image-wrap { height: 180px; }
  .featured-side-3 > .featured-side-card { min-height: 120px; }
}

.featured-hero-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-slow);
}

.featured-hero-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }

.card-image-wrap {
  display: block;
  position: relative;
  height: 280px;
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.featured-hero-card:hover .card-image-wrap img { transform: scale(1.04); }

.card-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.3);
}

.card-category {
  position: absolute;
  top: 16px; left: 16px;
  padding: 4px 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.card-body { padding: 28px; }

.card-title-link { color: var(--color-text); }
.card-title-link:hover .card-title-lg, .card-title-link:hover .side-card-title { color: var(--color-accent); }

.card-title-lg {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  transition: color var(--transition);
}

.card-excerpt {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 20px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.meta-dot { color: var(--color-text-muted); }

.author-info { display: flex; align-items: center; gap: 8px; }

.author-avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gradient-avatar { background: var(--grad-primary); }

.featured-side { display: flex; flex-direction: column; gap: 20px; }

.featured-side-card {
  display: flex;
  gap: 16px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: var(--transition-slow);
  padding: 0;
}

.featured-side-card:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }

.side-card-body { padding: 20px; flex: 1; }
.card-category-sm {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 6px;
  display: block;
}

.side-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  transition: color var(--transition);
}

.card-meta-sm { font-size: 0.8rem; color: var(--color-text-muted); display: flex; gap: 6px; align-items: center; }

.side-card-image {
  width: 110px;
  flex-shrink: 0;
  overflow: hidden;
}

.side-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-side-card:hover .side-card-image img { transform: scale(1.05); }

.side-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-warm);
  color: rgba(255,255,255,0.4);
  font-size: 2rem;
  font-weight: 800;
}

/* ============================================================
   TOPICS STRIP
   ============================================================ */
.topics-strip {
  padding: 20px 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  overflow: hidden;
}

.topics-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.topics-scroll::-webkit-scrollbar { display: none; }
.topics-label { font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }

.topic-chip {
  padding: 7px 18px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-text);
  transition: var(--transition);
}

.topic-chip:hover { background: var(--color-text); color: white; transform: translateY(-1px); }

/* ============================================================
   LATEST SECTION / POSTS GRID
   ============================================================ */
.latest-section { padding: 80px 0; }

.latest-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 60px;
  min-width: 0;
}

.latest-grid > * { min-width: 0; }

.posts-list { display: flex; flex-direction: column; gap: 0; }

.post-card {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border-light);
  transition: var(--transition);
}

.post-card:hover .post-card-title { color: var(--color-accent); }

.post-card-body { flex: 1; }

.post-card-top { margin-bottom: 10px; }
.author-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.author-name { font-weight: 600; }
.post-category-lnk { font-weight: 600; color: var(--color-accent); font-size: 0.85rem; }

.post-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  transition: color var(--transition);
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.post-date { font-size: 0.8rem; color: var(--color-text-muted); }

.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag-pill {
  padding: 3px 10px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.tag-pill:hover { background: var(--color-accent-light); color: var(--color-accent); }

.tag-pill-lg {
  padding: 6px 16px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  transition: var(--transition);
  display: inline-block;
  margin: 4px;
}

.tag-pill-lg:hover { background: var(--color-text); color: white; }

.post-stats { font-size: 0.8rem; color: var(--color-text-muted); display: flex; gap: 10px; margin-left: auto; }

.post-card-image {
  width: 160px;
  height: 120px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card-image img { transform: scale(1.05); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-column { display: flex; flex-direction: column; gap: 28px; }

.sidebar-widget {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title i { color: var(--color-accent); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-cloud-item {
  padding: 6px 14px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.tag-cloud-item:hover { background: var(--color-text); color: white; transform: scale(1.02); }

.newsletter-widget { background: linear-gradient(135deg, #0f172a, #1e293b); color: white; }
.newsletter-widget .widget-title { color: white; }
.newsletter-widget p { font-size: 0.88rem; color: rgba(255,255,255,0.7); margin-bottom: 16px; }
.newsletter-icon { font-size: 1.8rem; margin-bottom: 12px; }

.newsletter-form { display: flex; flex-direction: column; gap: 8px; }

.newsletter-input {
  padding: 10px 16px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.newsletter-input::placeholder { color: rgba(255,255,255,0.5); }
.newsletter-input:focus { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.15); }

.newsletter-btn {
  padding: 10px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.newsletter-btn:hover { background: var(--color-accent-dark); transform: translateY(-1px); }

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.category-list::-webkit-scrollbar { width: 4px; }
.category-list::-webkit-scrollbar-track { background: transparent; }
.category-list::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.category-list::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

.category-lnk {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.category-lnk:hover { background: var(--color-border-light); color: var(--color-text); }

.cat-count {
  background: var(--color-border-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-wrap {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pagination-wrap::-webkit-scrollbar { display: none; }

.page-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: var(--transition);
  flex-shrink: 0;
}

.page-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.page-btn.active { background: var(--color-text); color: white; border-color: var(--color-text); }

/* ============================================================
   POST DETAIL
   ============================================================ */
.post-hero { background: var(--grad-hero); color: white; padding: 80px 0 60px; }
.post-hero-inner { max-width: 780px; }
.post-hero-category { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #a78bfa; margin-bottom: 16px; display: block; }
.post-hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 16px; letter-spacing: -0.02em; }
.post-hero-excerpt { font-size: 1.1rem; color: rgba(255,255,255,0.75); line-height: 1.65; margin-bottom: 28px; }
.post-hero-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.author-card-sm { display: flex; align-items: center; gap: 12px; }
.author-avatar-md { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 0.9rem; }
.author-name-strong { font-weight: 700; font-size: 0.9rem; }
.post-date-small { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.post-actions-top { display: flex; align-items: center; gap: 14px; }
.action-stat { font-size: 0.85rem; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 6px; }

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.like-btn:hover, .like-btn.liked { background: rgba(239, 68, 68, 0.2); border-color: #ef4444; color: #ef4444; }
.like-btn.liked i { color: #ef4444; }

.post-featured-image { max-width: 900px; margin: -30px auto 0; padding: 0 24px; position: relative; z-index: 2; }
.post-featured-image img { width: 100%; border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); }

.post-layout { display: grid; grid-template-columns: 720px; justify-content: center; padding: 60px 24px; gap: 60px; }
.post-content-column { min-width: 0; }

.post-body.prose {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.85;
  color: #2d2d2d;
}

.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font-sans); font-weight: 800; letter-spacing: -0.02em; margin: 2em 0 0.8em; color: var(--color-text); }
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }
.prose p { margin-bottom: 1.5em; }
.prose a { color: var(--color-accent); text-decoration: underline; text-decoration-color: transparent; transition: var(--transition); }
.prose a:hover { text-decoration-color: var(--color-accent); }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose ul, .prose ol { margin: 1em 0 1.5em 2em; }
.prose li { margin-bottom: 0.5em; }
.prose blockquote { border-left: 4px solid var(--color-accent); padding: 16px 24px; margin: 2em 0; background: var(--color-accent-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; color: var(--color-text-secondary); }
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 24px;
  border-radius: var(--radius-md);
  overflow: auto;
  margin: 2em 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 640px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  counter-reset: line;
}

.prose pre::-webkit-scrollbar { width: 6px; height: 6px; }
.prose pre::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 3px; }
.prose pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.prose pre::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

.prose code { font-family: var(--font-mono); font-size: 0.875em; background: var(--color-border-light); padding: 2px 6px; border-radius: 4px; color: #c026d3; }
.prose pre code { background: none; color: inherit; padding: 0; white-space: inherit; word-break: inherit; font-size: 0.88rem; }
.prose img { border-radius: var(--radius-md); margin: 2em auto; box-shadow: var(--shadow-md); max-width: 100%; height: auto; display: block; object-fit: scale-down; }
.prose hr { border: none; border-top: 1px solid var(--color-border); margin: 3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 2em 0; font-family: var(--font-sans); display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 16px; border: 1px solid var(--color-border); text-align: left; white-space: nowrap; }
.prose th { background: var(--color-border-light); font-weight: 700; }
.prose * { max-width: 100%; }

.post-tags-section { margin: 40px 0; display: flex; flex-wrap: wrap; gap: 8px; }

.post-share { display: flex; align-items: center; gap: 10px; margin: 32px 0; padding: 20px; background: var(--color-border-light); border-radius: var(--radius-lg); }
.share-label { font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 4px; }

.share-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-size: 0.9rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.copy-link { background: var(--color-text-secondary); }
.share-btn:hover { transform: scale(1.1); }

.author-bio-card { display: flex; gap: 20px; padding: 28px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); margin: 40px 0; }
.author-avatar-lg { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: white; font-size: 1.4rem; flex-shrink: 0; }
.author-bio-body h4 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.author-bio-body p { font-size: 0.9rem; color: var(--color-text-secondary); line-height: 1.6; }

/* ============================================================
   RELATED POSTS
   ============================================================ */
.related-section { padding: 60px 0; background: var(--color-surface); border-top: 1px solid var(--color-border-light); }
.related-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 28px; letter-spacing: -0.02em; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.related-card { background: var(--color-bg); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border-light); transition: var(--transition-slow); }
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.related-card-img { display: block; height: 160px; overflow: hidden; }
.related-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.related-card:hover .related-card-img img { transform: scale(1.05); }
.related-card-body { padding: 16px; }
.related-card-body h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; transition: color var(--transition); }
.related-card:hover .related-card-body h4 { color: var(--color-accent); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section { padding: 60px 0; }
.comments-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 32px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.02em; }
.comments-title i { color: var(--color-accent); }

.comment-form-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: 28px; margin-bottom: 40px; }
.comment-form-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--color-text-secondary); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 16px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text);
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.form-textarea { resize: vertical; min-height: 100px; }
.field-error { font-size: 0.8rem; color: var(--color-red); margin-top: 4px; display: block; }

.btn-submit-comment {
  padding: 12px 28px;
  background: var(--color-text);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-submit-comment:hover { background: var(--color-accent); transform: translateY(-1px); }

.comments-list { display: flex; flex-direction: column; gap: 24px; }

.comment-item { display: flex; gap: 14px; }
.reply-item { padding-left: 20px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 0.8rem; flex-shrink: 0; }
.comment-avatar.sm { width: 28px; height: 28px; font-size: 0.7rem; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-header strong { font-size: 0.9rem; font-weight: 700; }
.comment-date { font-size: 0.78rem; color: var(--color-text-muted); }
.comment-text { font-size: 0.9rem; line-height: 1.65; color: var(--color-text-secondary); }
.comment-replies { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border-light); display: flex; flex-direction: column; gap: 16px; }

/* ============================================================
   ARCHIVE
   ============================================================ */
.archive-header { padding: 80px 0 40px; background: var(--grad-hero); color: white; text-align: center; }
.archive-badge { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #a78bfa; margin-bottom: 10px; }
.archive-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.archive-desc { color: rgba(255,255,255,0.7); font-size: 1.05rem; margin-bottom: 16px; }
.archive-count { font-size: 0.85rem; color: rgba(255,255,255,0.5); }

.posts-grid { max-width: 800px; margin: 0 auto; padding: 60px 0; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 48px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--color-border-light);
}

.auth-header { text-align: center; margin-bottom: 32px; }
.brand-icon.lg { font-size: 2rem; color: var(--color-accent); display: block; margin-bottom: 16px; }
.auth-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.auth-header p { color: var(--color-text-secondary); font-size: 0.9rem; }

.auth-form { display: flex; flex-direction: column; gap: 0; }

.input-password-wrap { position: relative; }
.toggle-password { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--color-text-muted); padding: 4px; }
.toggle-password:hover { color: var(--color-text); }

.form-check-row { margin-bottom: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

.btn-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--color-text);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.btn-auth-submit:hover { background: var(--color-accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.auth-footer { margin-top: 24px; text-align: center; font-size: 0.875rem; color: var(--color-text-secondary); }
.auth-footer a { color: var(--color-accent); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-errors { background: #fff5f5; border: 1px solid #fed7d7; border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-size: 0.875rem; color: var(--color-red); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-notif {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  animation: slide-in-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success { background: #0d9488; color: white; }
.toast-info { background: var(--color-accent); color: white; }

@keyframes slide-in-right {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #0f172a;
  color: white;
  padding: 60px 0 24px;
  margin-top: 0;
}

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }

.footer-brand .footer-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.footer-brand .brand-text { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 800; font-size: 1.1rem; }
.footer-brand p { font-size: 0.9rem; color: rgba(255,255,255,0.5); line-height: 1.65; margin-bottom: 20px; max-width: 280px; }

.social-links { display: flex; gap: 10px; }
.social-links a {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
  font-size: 0.9rem;
}

.social-links a:hover { background: var(--color-accent); color: white; transform: translateY(-2px); }

.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); margin-bottom: 16px; }
.footer-col a, .footer-link-btn { display: block; color: rgba(255,255,255,0.7); font-size: 0.9rem; margin-bottom: 10px; transition: var(--transition); background: none; border: none; cursor: pointer; font-family: var(--font-sans); padding: 0; text-align: left; }
.footer-col a:hover, .footer-link-btn:hover { color: white; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px; text-align: center; }
.footer-bottom p { font-size: 0.85rem; color: rgba(255,255,255,0.4); }

/* ============================================================
   EMPTY STATE / ERROR PAGE
   ============================================================ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 3rem; color: var(--color-text-muted); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--color-text-secondary); font-size: 0.9rem; }

.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; }
.error-icon { font-size: 4rem; margin-bottom: 20px; }
.error-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.error-page p { color: var(--color-text-secondary); margin-bottom: 28px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-layout { grid-template-columns: 1fr; gap: 40px; }
  .hot-area { max-width: 500px; margin: 0 auto; width: 100%; }
  .latest-grid { grid-template-columns: 1fr; }
  .sidebar-column { display: grid; grid-template-columns: 1fr 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }

  .nav-links { display: none; }
  .nav-search { max-width: 160px; }
  .nav-toggle { display: flex; }
  .nav-inner { gap: 10px; }

  .hero-section { padding: 70px 0 56px; }
  .hero-layout { gap: 32px; }
  .hero-stats { gap: 16px; padding: 14px 18px; flex-wrap: wrap; }
  .hot-area-card { max-width: 100%; }
  .btn-discover { padding: 12px 24px; font-size: 0.875rem; }

  .featured-grid { grid-template-columns: 1fr; }
  .featured-side { display: none; }
  .card-image-wrap { height: 200px; }

  /* Posts */
  .post-card { flex-direction: column; gap: 12px; }
  .post-card-image { width: 100%; height: 180px; border-radius: var(--radius-md); }
  .post-card-body { min-width: 0; width: 100%; }
  .post-card-title { font-size: 1rem; }
  .post-card-excerpt { -webkit-line-clamp: 2; }
  .post-card-footer { flex-wrap: wrap; gap: 6px; }
  .post-stats { margin-left: 0; }

  /* Sidebar */
  .sidebar-column { grid-template-columns: 1fr; width: 100%; }
  .sidebar-widget { min-width: 0; width: 100%; box-sizing: border-box; }
  .tag-cloud { gap: 6px; }
  .tag-cloud-item { font-size: 0.78rem; padding: 5px 10px; }
  .newsletter-form { gap: 6px; }
  .category-list { max-height: 200px; }

  /* Pagination */
  .pagination-wrap { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 4px 0 8px; }
  .page-btn { width: 36px; height: 36px; font-size: 0.8rem; }

  .post-layout { padding: 32px 16px; grid-template-columns: 1fr; }
  .post-body.prose { font-size: 1rem; }
  .prose pre { font-size: 0.82rem; padding: 16px; max-height: 400px; }

  .form-row-2 { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .auth-card { padding: 28px 20px; }

  .section-title { font-size: 1.5rem; }
  .post-hero { padding: 60px 0 40px; }
  .post-hero-title { font-size: 1.6rem; }
  .post-hero-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-scroll-hint { display: none; }
}

@media (max-width: 480px) {
  .nav-search { display: none; }
  .hero-cta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-stats { flex-direction: column; gap: 10px; width: 100%; }
  .stat-divider { display: none; }
  .stat-card { display: flex; align-items: center; gap: 10px; }
  .stat-number { font-size: 1.4rem; }
  .hero-badge { font-size: 0.72rem; }
  .hero-headline { font-size: clamp(1.6rem, 7vw, 2.2rem); }

  .container { padding: 0 16px; }
  .post-card-footer { flex-wrap: wrap; gap: 8px; }
  .post-card-image { height: 160px; }
  .post-card-title { font-size: 0.95rem; }
  .tag-pill { font-size: 0.7rem; padding: 2px 8px; }
  .tag-cloud-item { font-size: 0.75rem; padding: 4px 8px; }
  .sidebar-widget { padding: 18px 14px; }
  .latest-section { padding: 40px 0; }
  .pagination-wrap { gap: 5px; }
  .page-btn { width: 32px; height: 32px; font-size: 0.75rem; }
  .author-bio-card { flex-direction: column; }
  .author-avatar-lg { margin: 0 auto; }
  .comment-form-card { padding: 20px 16px; }
  .prose pre { max-height: 320px; }
}
