/* =============================================================
   English Together — Main Stylesheet
   Fonts: Inter (UI) + Nunito (body, Vietnamese support)
   Theme: Clean, modern educational — Blue primary
   ============================================================= */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Primary — Blue educational */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;

  /* Secondary — Orange accent */
  --secondary: #F97316;
  --secondary-dark: #EA580C;
  --secondary-light: #FFF7ED;

  /* Backgrounds */
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-alt: #F1F5F9;
  --bg-dark: #0F172A;

  /* Text */
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-on-dark: #FFFFFF;

  /* Borders */
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Accent colors */
  --accent-green: #16A34A;
  --accent-purple: #7C3AED;
  --accent-teal: #0891B2;
  --accent-pink: #DB2777;
  --accent-orange: #EA580C;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-md: 0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-hover: 0 20px 40px rgba(37,99,235,.15);

  /* Radii */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 80px;

  /* Container */
  --container-max: 1200px;
  --container-px: 24px;

  --transition: 0.2s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: clamp(22px, 4vw, 32px); letter-spacing: -0.02em; }
h2 { font-size: clamp(18px, 3vw, 24px); letter-spacing: -0.01em; }
h3 { font-size: clamp(16px, 2.5vw, 20px); }
h4 { font-size: clamp(15px, 2vw, 17px); }

/* ── Top Stripe ─────────────────────────────────────────────── */
.top-stripe {
  height: 3px;
  background: linear-gradient(90deg,
    #2563EB 0%, #7C3AED 35%, #0891B2 65%, #2563EB 100%);
  background-size: 200% 100%;
  animation: stripeScroll 6s linear infinite;
}

@keyframes stripeScroll {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* ── Section ────────────────────────────────────────────────── */
.section {
  padding: var(--space-xl) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}

.section-title {
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 800;
  color: var(--text);
}

.see-all {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--primary-light);
  background: transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.see-all:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.nav-logo-dot {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  flex-shrink: 0;
}

.nav-logo-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.2px;
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

/* ── Nav Auth Area ──────────────────────────────────────────── */
.nav-auth {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--primary);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.nav-login-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

/* ── Nav User Menu ──────────────────────────────────────────── */
.nav-user-menu {
  position: relative;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nav-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}

.nav-user-dropdown.is-open {
  display: flex;
}

.nav-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-dropdown a,
.nav-user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.nav-logout-btn {
  color: #DC2626 !important;
}

.nav-logout-btn:hover {
  background: #FEF2F2 !important;
  color: #DC2626 !important;
}

/* ── Nav CTA (kept for backward compat) ─────────────────────── */
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  background: var(--primary);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

/* ── Burger ─────────────────────────────────────────────────── */
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-burger:hover { background: var(--bg-alt); }

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.15s;
  transform-origin: center;
}

.nav.is-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Drawer ──────────────────────────────────────────── */
.nav-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 8px 0 14px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: var(--shadow-md);
}

.nav-drawer a,
.nav-drawer-login {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 12px var(--container-px);
  transition: color var(--transition), background var(--transition);
  display: block;
}

.nav-drawer a:hover { color: var(--text); background: var(--bg-alt); }

.nav.is-open .nav-drawer {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-drawer-login {
  margin: 8px var(--container-px) 0;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff !important;
  border-radius: var(--radius-pill);
  text-align: center;
  font-weight: 700;
}

.nav-drawer-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--container-px);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  background: var(--primary);
  color: #fff;
  font-family: 'Nunito', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  letter-spacing: .1px;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,.45);
}

.btn-primary.btn-block {
  width: 100%;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  background: transparent;
  color: var(--text);
  font-family: 'Nunito', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border-strong);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), color var(--transition);
  letter-spacing: .1px;
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ── Auth Page ───────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 64px - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px var(--container-px);
  background: linear-gradient(135deg, var(--bg) 0%, #EFF6FF 50%, var(--bg) 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  font-size: 48px;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1;
}

.auth-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.auth-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.form-group input,
.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Nunito', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.auth-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-group input::placeholder,
.auth-form input::placeholder {
  color: var(--text-muted);
}

.input-with-toggle {
  position: relative;
}

.input-with-toggle input {
  padding-right: 46px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition);
}

.toggle-password:hover { color: var(--text); }

.auth-note {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin-top: 20px;
  line-height: 1.6;
}

.auth-note a {
  color: var(--primary);
  font-weight: 700;
  transition: color var(--transition);
}

.auth-note a:hover { color: var(--primary-dark); }

/* ── Lesson Paywall ─────────────────────────────────────────── */
.lesson-paywall {
  margin: 32px 0;
  background: linear-gradient(135deg, var(--primary-light) 0%, #F0F9FF 100%);
  border: 2px solid rgba(37,99,235,.2);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.lesson-paywall-inner {
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lesson-paywall-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 4px;
}

.lesson-paywall-inner h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.lesson-paywall-inner p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.65;
  margin: 0;
}

.lesson-paywall-inner .btn-primary {
  margin-top: 8px;
}

/* ── Hero Banner ─────────────────────────────────────────────── */
.hero {
  background: var(--bg);
  padding: 72px var(--container-px) 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.08) 0%, transparent 70%);
  top: -200px;
  right: -150px;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.07) 0%, transparent 70%);
  bottom: -80px;
  left: 5%;
  pointer-events: none;
}

.hero-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text { max-width: 640px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
  border: 1.5px solid rgba(37,99,235,.2);
  letter-spacing: .2px;
}

.hero-text h1 {
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 900;
  margin-bottom: 18px;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.5px;
}

.hero-text h1 em {
  font-style: normal;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 520px;
  font-weight: 500;
  line-height: 1.75;
}

.hero-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Hero with background image */
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(248,250,252,.85) 40%, rgba(248,250,252,.0) 70%, rgba(248,250,252,.5) 100%);
  z-index: 0;
}

/* ── Stat Bar ────────────────────────────────────────────────── */
.stat-bar {
  background: var(--bg-dark);
  padding: 24px var(--container-px);
  display: flex;
  justify-content: center;
  gap: clamp(28px, 8vw, 96px);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  min-width: 70px;
}

.stat-num {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
  line-height: 1;
  color: #60A5FA;
  letter-spacing: -.5px;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
}

/* ── Card base ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ── Category Grid ───────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 14px 20px;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.cat-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
  flex-shrink: 0;
  line-height: 1;
}

.cat-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.cat-count {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--text-muted);
  min-height: 2.2em;
  line-height: 1.4;
  text-align: center;
}

/* Category color variants */
.cat-blue { background: #EFF6FF; border-color: #BFDBFE; }
.cat-blue .cat-name { color: #1D4ED8; }
.cat-blue:hover { border-color: var(--primary); box-shadow: 0 6px 20px rgba(37,99,235,.18); }

.cat-green { background: #F0FDF4; border-color: #BBF7D0; }
.cat-green .cat-name { color: #15803D; }
.cat-green:hover { border-color: var(--accent-green); box-shadow: 0 6px 20px rgba(22,163,74,.18); }

.cat-orange { background: #FFF7ED; border-color: #FED7AA; }
.cat-orange .cat-name { color: #C2410C; }
.cat-orange:hover { border-color: var(--secondary); box-shadow: 0 6px 20px rgba(249,115,22,.2); }

.cat-pink { background: #FDF2F8; border-color: #FBCFE8; }
.cat-pink .cat-name { color: #9D174D; }
.cat-pink:hover { border-color: var(--accent-pink); box-shadow: 0 6px 20px rgba(219,39,119,.18); }

.cat-purple { background: #F5F3FF; border-color: #DDD6FE; }
.cat-purple .cat-name { color: #6D28D9; }
.cat-purple:hover { border-color: var(--accent-purple); box-shadow: 0 6px 20px rgba(124,58,237,.18); }

.cat-yellow { background: #FEFCE8; border-color: #FEF08A; }
.cat-yellow .cat-name { color: #A16207; }
.cat-yellow:hover { border-color: #EAB308; box-shadow: 0 6px 20px rgba(234,179,8,.2); }

/* ── Post Grid & Card ────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary-light), #E0E7FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.post-card-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius-pill);
  letter-spacing: .3px;
  border: 1.5px solid rgba(37,99,235,.2);
  text-transform: uppercase;
}

.post-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  transition: color var(--transition);
}

.post-card:hover .post-card-title { color: var(--primary-dark); }

.post-card-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── Resource Grid & Card ────────────────────────────────────── */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.res-card { display: flex; flex-direction: column; }

.res-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.res-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  transition: color var(--transition);
}

.res-card:hover .res-card-name { color: var(--primary-dark); }

.res-card-desc {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.res-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ── Exercise Card ───────────────────────────────────────────── */
.ex-card { display: flex; flex-direction: column; }

.ex-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.ex-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  transition: color var(--transition);
}

.ex-card:hover .ex-card-title { color: var(--primary-dark); }

.ex-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  letter-spacing: .2px;
}

.badge-free {
  background: #F0FDF4;
  color: #166534;
  border: 1.5px solid #BBF7D0;
}

.badge-pro {
  background: #FEFCE8;
  color: #A16207;
  border: 1.5px solid #FEF08A;
}

.badge-level {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1.5px solid rgba(37,99,235,.2);
}

.badge-skill {
  background: #F0F9FF;
  color: #0369A1;
  border: 1.5px solid #BAE6FD;
}

.badge-age {
  margin-left: 10px;
  background: #F5F3FF;
  color: #6D28D9;
  border: 1.5px solid #DDD6FE;
}

/* ── Newsletter ──────────────────────────────────────────────── */
.newsletter {
  background: var(--bg-dark);
  padding: 64px var(--container-px);
  position: relative;
  overflow: hidden;
}

.newsletter::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.15) 0%, transparent 70%);
  top: -150px;
  right: 0;
  pointer-events: none;
}

.newsletter::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.18) 0%, transparent 70%);
  bottom: -80px;
  left: 5%;
  pointer-events: none;
}

.newsletter-inner {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.newsletter-inner h3 {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -.3px;
}

.newsletter-inner p {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,.68);
  margin-bottom: 28px;
  line-height: 1.65;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-input {
  flex: 1;
  min-width: 220px;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  font-family: 'Nunito', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.newsletter-input:focus {
  border-color: rgba(37,99,235,.8);
  background: rgba(255,255,255,.12);
}

.newsletter-input::placeholder { color: rgba(255,255,255,.4); }

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary-dark);
  font-weight: 700;
  transition: color var(--transition);
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb-sep {
  color: var(--border-strong);
  font-size: 14px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 32px 0 8px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(37,99,235,.3);
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
}

.empty-state-icon {
  font-size: 60px;
  margin-bottom: 18px;
}

.empty-state h3 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
}

/* ── Footer Wave Divider ─────────────────────────────────────── */
.footer-wave {
  position: relative;
  background: var(--bg);
  line-height: 0;
  margin-top: var(--space-2xl);
}

.footer-wave svg {
  width: 100%;
  height: 64px;
  display: block;
}

.footer-wave-icons {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.footer-wave-icons span {
  font-size: 20px;
  opacity: .45;
  animation: waveIconBob 3s ease-in-out infinite;
  display: inline-block;
}

.footer-wave-icons span:nth-child(2) { animation-delay: .3s; }
.footer-wave-icons span:nth-child(3) { animation-delay: .6s; }
.footer-wave-icons span:nth-child(4) { animation-delay: .9s; }
.footer-wave-icons span:nth-child(5) { animation-delay: 1.2s; }
.footer-wave-icons span:nth-child(6) { animation-delay: 1.5s; }
.footer-wave-icons span:nth-child(7) { animation-delay: 1.8s; }
.footer-wave-icons span:nth-child(8) { animation-delay: 2.1s; }

@keyframes waveIconBob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer { background: var(--bg-dark); }

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.footer-top {
  padding: 48px 0 36px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo-name {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-tagline {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  line-height: 1.65;
  margin: 0;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.footer-social-btn:hover {
  background: rgba(37,99,235,.2);
  color: #93C5FD;
  border-color: rgba(37,99,235,.4);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 32px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,.35);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  transition: color var(--transition);
}

.footer-col a:hover { color: rgba(255,255,255,.9); }

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.25);
}

.footer-bottom-links { display: flex; gap: 20px; }

.footer-bottom-links a {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.3);
  transition: color var(--transition);
}

.footer-bottom-links a:hover { color: rgba(255,255,255,.65); }

/* ── AdSense / Ad units ──────────────────────────────────────── */
.ad-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  min-height: 90px;
  overflow: hidden;
  margin: var(--space-lg) 0;
}

.ad-unit-wide  { width: 100%; min-height: 90px; }
.ad-unit-rect  { width: 100%; min-height: 280px; }

/* ── Rich-text / Prose ───────────────────────────────────────── */
.prose {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.78;
  color: var(--text);
  max-width: 720px;
}

.prose h2 {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 800;
  color: var(--text);
  margin: 36px 0 14px;
}

.prose h3 {
  font-size: clamp(16px, 2.5vw, 19px);
  font-weight: 800;
  color: var(--text-secondary);
  margin: 26px 0 10px;
}

.prose p { margin-bottom: 16px; }

.prose ul, .prose ol { margin: 0 0 16px 24px; }

.prose li { margin-bottom: 6px; }

.prose strong { font-weight: 800; color: var(--text); }

.prose blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 22px 0;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 600;
}

.prose img {
  border-radius: var(--radius-lg);
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.prose code {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .88em;
  font-family: 'Courier New', monospace;
  color: var(--primary-dark);
  font-weight: 700;
}

.prose pre {
  background: var(--bg-dark);
  color: #93C5FD;
  padding: 20px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 22px 0;
}

.prose a { color: var(--primary-dark); font-weight: 700; }
.prose a:hover { color: var(--primary); }

/* ── Page layout (detail pages) ─────────────────────────────── */
.page-body {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--container-px);
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.page-main { min-width: 0; }

.page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 88px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.sidebar-card h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
  letter-spacing: .4px;
  text-transform: uppercase;
}

/* =============================================================
   Course Player — Tabs + Sidebar + Content
   ============================================================= */

/* ── Tab Bar ────────────────────────────────────────────────── */
.course-tabs-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 80;
}

.course-tabs-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.course-tabs-inner::-webkit-scrollbar { display: none; }

.course-tab {
  flex-shrink: 0;
  display: inline-block;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.course-tab:hover { color: var(--text); }

.course-tab.is-active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* ── Player Grid ────────────────────────────────────────────── */
.course-player {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 120px);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.course-sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.course-sidebar-inner { padding: 12px 0; }

.course-lesson-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  line-height: 1.4;
}

.course-lesson-link:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.course-lesson-link.is-active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  font-weight: 700;
}

.course-lesson-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 1px;
}

.course-lesson-link.is-active .course-lesson-num {
  background: var(--primary);
  color: #fff;
}

.course-lesson-name { flex: 1; }

/* ── Content Area ───────────────────────────────────────────── */
.course-content {
  background: var(--bg);
  overflow-y: auto;
}

.course-content-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px var(--container-px) 80px;
}

.course-lesson-heading {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.25;
}

.course-lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

/* ── Audio ──────────────────────────────────────────────────── */
.course-audios {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.caudio {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: box-shadow 0.18s;
}

.caudio:hover {
  box-shadow: 0 4px 16px rgba(37,99,235,.1);
}

.caudio.is-playing {
  border-left-color: var(--primary-dark);
  box-shadow: 0 4px 20px rgba(37,99,235,.15);
}

.caudio-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.15s, transform 0.12s;
}

.caudio-btn:hover  { background: var(--primary-dark); transform: scale(1.07); }
.caudio-btn:active { transform: scale(0.95); }

.caudio-body { flex: 1; min-width: 0; }

.caudio-label-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.caudio-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 1;
  word-break: break-word;
  line-height: 1.4;
}

.caudio-transcript-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.caudio-transcript-btn:hover,
.caudio-transcript-btn.is-open {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: var(--accent-green);
}

.caudio-transcript {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
  background: #F8FAFC;
  border-left: 3px solid #86EFAC;
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  margin-bottom: 8px;
  display: none;
}

.caudio-transcript.is-open { display: block; }

.caudio-track {
  display: flex;
  align-items: center;
  gap: 10px;
}

.caudio-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
}

.caudio-bar:hover { height: 7px; }
.caudio-bar:hover .caudio-thumb { opacity: 1; }

.caudio-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  pointer-events: none;
  position: relative;
}

.caudio-thumb {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-dark);
  opacity: 0;
  transition: opacity 0.15s;
}

.caudio-times {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  display: flex;
  gap: 2px;
}

.caudio-speeds {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.caudio-speed {
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
  line-height: 1.6;
}

.caudio-speed:hover { border-color: var(--primary); color: var(--primary); }

.caudio-speed.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Images ─────────────────────────────────────────────────── */
.course-images {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.course-image-figure {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.course-image { width: 100%; height: auto; display: block; }

.course-image-caption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Prev/Next nav ──────────────────────────────────────────── */
.course-lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.course-nav-btn {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  max-width: 48%;
  line-height: 1.4;
}

.course-nav-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ── Post body typography ────────────────────────────────────── */
.post-body {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-body > * + * { margin-top: 1.2em; }

/* Headings */
.post-body h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin: 2.2em 0 0.6em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--primary-light);
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
  margin: 1.8em 0 0.5em;
}

.post-body h4 {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 1.5em 0 0.4em;
}

.post-body p { margin-bottom: 1.15em; }
.post-body p:last-child { margin-bottom: 0; }

.post-body a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.post-body a:hover { color: var(--primary); }

.post-body ul, .post-body ol {
  padding-left: 1.5em;
  margin: 0.8em 0 1.2em;
}

.post-body li {
  margin-bottom: 0.45em;
  line-height: 1.7;
}

.post-body li::marker { color: var(--primary); }
.post-body ol li::marker { font-weight: 700; }

.post-body blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px 16px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.6em 0;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 600;
  font-size: 1.02em;
}

.post-body strong { font-weight: 800; color: var(--text); }
.post-body em     { font-style: italic; }

.post-body code {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.87em;
  font-family: 'Courier New', monospace;
  color: var(--primary-dark);
  font-weight: 700;
}

.post-body pre {
  background: var(--bg-dark);
  color: #93C5FD;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 0.88em;
  line-height: 1.65;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.post-body figure { margin: 2em 0; }

.post-body figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
  display: block;
}

.post-body figcaption {
  font-size: 0.82em;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5em;
  line-height: 1.5;
  font-style: italic;
}

.post-body img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.6em auto;
  max-width: 100%;
  height: auto;
  display: block;
}

.post-body hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2.5em 0;
}

.post-body > p:first-of-type {
  font-size: 1.06em;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Post content (alias for .post-body) ────────────────────── */
.post-content {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
}

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

.post-content h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin: 2.2em 0 0.6em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--primary-light);
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
  margin: 1.8em 0 0.5em;
}

.post-content h4 {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 1.5em 0 0.4em;
}

.post-content p { margin-bottom: 1.15em; }
.post-content p:last-child { margin-bottom: 0; }

.post-content a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.post-content a:hover { color: var(--primary); }

.post-content ul, .post-content ol {
  padding-left: 1.5em;
  margin: 0.8em 0 1.2em;
}

.post-content li { margin-bottom: 0.45em; line-height: 1.7; }
.post-content li::marker { color: var(--primary); }
.post-content ol li::marker { font-weight: 700; }

.post-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px 16px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.6em 0;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 600;
  font-size: 1.02em;
}

.post-content strong { font-weight: 800; color: var(--text); }
.post-content em     { font-style: italic; }

.post-content code {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.87em;
  font-family: 'Courier New', monospace;
  color: var(--primary-dark);
  font-weight: 700;
}

.post-content pre {
  background: var(--bg-dark);
  color: #93C5FD;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 0.88em;
  line-height: 1.65;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.post-content figure { margin: 2em 0; }

.post-content figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
  display: block;
}

.post-content figcaption {
  font-size: 0.82em;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5em;
  line-height: 1.5;
  font-style: italic;
}

.post-content img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.6em auto;
  max-width: 100%;
  height: auto;
  display: block;
}

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

.post-content > p:first-of-type {
  font-size: 1.06em;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; }
  .nav-burger { display: flex; }
  .nav-logo-name { display: none; }

  .hero-bg-img { object-position: center right; }
  .hero { padding: 48px var(--container-px) 40px; }
  .hero-btns { flex-direction: column; align-items: flex-start; }

  .btn-primary,
  .btn-outline { width: 100%; max-width: 300px; }

  .cat-grid { grid-template-columns: repeat(3, 1fr); }

  .post-grid { grid-template-columns: 1fr; }

  .res-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

  .footer-wave { margin-top: var(--space-xl); }
  .footer-top  { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }

  .page-body { grid-template-columns: 1fr; }
  .page-sidebar { position: static; }

  .section { padding: 32px 0; }

  .newsletter { padding: 48px var(--container-px); }
  .newsletter-row { flex-direction: column; align-items: stretch; }
  .newsletter-input { min-width: unset; }
  .newsletter-row .btn-primary { width: 100%; }

  .stat-bar { gap: 24px; }

  .course-player { grid-template-columns: 1fr; min-height: unset; }
  .course-sidebar { position: static; height: auto; max-height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
  .course-content-inner { padding: 24px 0 48px; }
  .course-lesson-heading { font-size: 22px; }
  .course-tab { padding: 12px 14px; font-size: 13px; }
  .course-images { grid-template-columns: 1fr; }

  .auth-card { padding: 28px 20px; }
  .auth-page { padding: 32px var(--container-px); }

  .lesson-paywall-inner { padding: 28px 20px; }

  .post-content { font-size: 16px; }
  .post-content h2 { font-size: 20px; }
  .post-content h3 { font-size: 17px; }
  .post-content h4 { font-size: 15px; }

  .post-body { font-size: 16px; }
  .post-body h2 { font-size: 20px; }
  .post-body h3 { font-size: 17px; }
  .post-body h4 { font-size: 15px; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }

  .cat-grid { grid-template-columns: repeat(2, 1fr); }

  .cat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 7px);
  }

  .filter-bar { gap: 6px; }

  .filter-pill { font-size: 12px; padding: 5px 12px; }

  .lesson-paywall-inner h3 { font-size: 18px; }

  .btn-primary,
  .btn-outline { width: 100%; max-width: 100%; }
}

@media (min-width: 1100px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}
