* {
  box-sizing: border-box;
}

body.frontend-body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #f8fafc;
  color: #0f172a;
  margin: 0;
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary:hover {
  background: #1d4ed8;
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-amber {
  background: #fef3c7;
  color: #92400e;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-purple {
  background: #f5f3ff;
  color: #6d28d9;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.1s;
}

.nav-link:hover {
  color: #2563eb;
  background: #eff6ff;
}

.nav-link.active {
  color: #2563eb;
  background: #eff6ff;
}

.post-card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.post-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.category-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
  color: #334155;
}

.category-btn:hover,
.category-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.frontend-bottom-nav {
  display: none;
}

.prose h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 36px 0 14px;
  line-height: 1.25;
}

.prose h3 {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  margin: 28px 0 10px;
  line-height: 1.3;
}

.prose p {
  font-size: 16px;
  color: #334155;
  line-height: 1.8;
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
  margin: 0 0 16px;
}

.prose li {
  font-size: 16px;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 6px;
}

.prose strong {
  color: #0f172a;
  font-weight: 700;
}

.prose a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.prose a:hover {
  text-decoration: underline;
}

.prose blockquote {
  border-left: 4px solid #2563eb;
  padding: 14px 20px;
  background: #eff6ff;
  border-radius: 0 10px 10px 0;
  margin: 20px 0;
  font-style: italic;
  color: #1e40af;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.prose th {
  background: #f1f5f9;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.prose td {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.toc-link {
  display: block;
  font-size: 13px;
  color: #475569;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.1s;
  border-left: 2px solid transparent;
}

.toc-link:hover,
.toc-link.active {
  color: #2563eb;
  background: #eff6ff;
  border-left-color: #2563eb;
}

#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: #2563eb;
  z-index: 100;
  transition: width 0.1s;
  width: 0%;
}

.option-display {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #fff;
  margin-bottom: 8px;
}

.option-display.correct {
  border-color: #16a34a;
  background: #f0fdf4;
}

.option-display.wrong {
  border-color: #e2e8f0;
  background: #fafafa;
  opacity: 0.65;
}

.option-label-box {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #64748b;
  flex-shrink: 0;
}

.option-display.correct .option-label-box {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.related-q {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}

.related-q:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.blog-layout-two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.question-layout-two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.featured-post-row {
  flex-direction: row;
  align-items: stretch;
  max-height: 280px;
}

.featured-post-media {
  flex: 0 0 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  min-height: 200px;
}

@media (max-width: 900px) {
  .featured-post-row {
    flex-direction: column;
    max-height: none;
  }

  .featured-post-media {
    flex: none;
    height: 160px;
    font-size: 52px;
  }
}

.frontend-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  color: #334155;
}

.frontend-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.4);
}

.frontend-mobile-menu.is-open {
  display: block;
}

.frontend-mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 88vw);
  height: 100%;
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

.frontend-mobile-menu-panel .nav-link {
  display: block;
  padding: 12px 14px;
}

.frontend-auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.page-hero {
  background: linear-gradient(160deg, #eff6ff 0%, #f8fafc 60%);
  padding: 48px 0;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px;
}

.page-hero p {
  font-size: 16px;
  color: #475569;
  margin: 0;
  line-height: 1.65;
}

.breadcrumb-bar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 0;
  font-size: 13px;
  color: #64748b;
}

.breadcrumb-bar a {
  color: #64748b;
  text-decoration: none;
}

.breadcrumb-bar a:hover {
  color: #2563eb;
}

.breadcrumb-bar .current {
  color: #1d4ed8;
  font-weight: 600;
}

/* Site footer */
.site-footer {
  position: relative;
  margin-top: 48px;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  color: #cbd5e1;
}

.site-footer-accent {
  height: 3px;
  background: linear-gradient(90deg, #1d4ed8, #3b82f6, #60a5fa);
}

.site-footer-main {
  padding: 48px 24px 40px;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.site-footer-brand {
  max-width: 320px;
}

.site-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 14px;
}

.site-footer-logo-icon {
  width: 36px;
  height: 36px;
  background: #2563eb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.site-footer-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.site-footer-logo-text span {
  color: #60a5fa;
}

.site-footer-tagline {
  font-size: 14px;
  line-height: 1.65;
  color: #94a3b8;
  margin: 0 0 18px;
}

.site-footer-cta {
  font-size: 14px;
  padding: 11px 20px;
}

.site-footer-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 14px;
}

.site-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer-links a {
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer-links a:hover {
  color: #fff;
}

.site-footer-exams {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.site-footer-exam-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer-exam-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.site-footer-exam-pill:hover {
  color: #fff;
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.15);
}

.site-footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.site-footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px 28px;
}

.site-footer-copy {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.site-footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer-bottom-links a {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer-bottom-links a:hover {
  color: #93c5fd;
}

@media (min-width: 640px) {
  .site-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 900px) {
  .site-footer-grid {
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
  }

  .site-footer-brand {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .frontend-container {
    padding: 0 16px;
  }

  .site-footer-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-footer-bottom-inner {
    padding-left: 16px;
    padding-right: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .frontend-bottom-nav {
    display: flex !important;
  }

  .frontend-desktop-nav,
  .frontend-auth-actions .btn-primary {
    display: none !important;
  }

  .frontend-desktop-sidebar {
    display: none !important;
  }

  .frontend-auth-actions .nav-link {
    display: none;
  }

  .frontend-mobile-toggle {
    display: flex;
  }

  .blog-layout-two-col,
  .question-layout-two-col {
    grid-template-columns: 1fr;
  }

  body.frontend-body {
    padding-bottom: 60px;
  }

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