/* ============================================================
   Microhub — Dynamic CMS Pages Stylesheet
   Modern, responsive, high-converting article & policy layout
   ============================================================ */

.cms-page {
  padding-top: calc(var(--nav-h, 72px) + 0px);
  background: #f8fafc;
  color: #1e293b;
  min-height: 80vh;
}

/* --- Hero Banner --- */
.cms-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 6vw, 76px) 0 clamp(44px, 5vw, 68px);
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(37,99,235,0.14), transparent 60%),
    radial-gradient(700px 380px at 90% 10%, rgba(6,182,212,0.12), transparent 62%),
    linear-gradient(180deg, #eef4ff 0%, #f8fafc 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.cms-hero-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 32px);
}

.cms-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 16px;
}

.cms-breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cms-breadcrumb a:hover {
  color: var(--primary, #1668dc);
}

.cms-breadcrumb .sep {
  color: #cbd5e1;
  font-size: 11px;
}

.cms-breadcrumb span[aria-current] {
  color: var(--primary, #1668dc);
}

.cms-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary, #1668dc);
  background: rgba(37, 99, 235, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.cms-hero h1 {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: #0f172a;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.cms-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.cms-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.cms-meta-badge i {
  color: var(--primary, #1668dc);
  font-size: 12px;
}

/* --- Body Layout --- */
.cms-body {
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) clamp(18px, 4vw, 32px) clamp(56px, 8vw, 96px);
}

.cms-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.cms-grid.no-sidebar {
  display: block;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.cms-grid.no-sidebar .cms-article-card {
  width: 100%;
}

/* --- Sticky Sidebar --- */
.cms-sidebar {
  position: sticky;
  top: calc(var(--nav-h, 72px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cms-nav-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 16px 36px -28px rgba(15, 23, 42, 0.25);
}

.cms-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.cms-nav-header strong {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary, #1668dc);
  font-weight: 800;
}

.cms-nav-count {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 8px;
  border-radius: 999px;
}

.cms-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cms-nav-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cms-nav-item a:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary, #1668dc);
  transform: translateX(3px);
}

.cms-nav-item.active a {
  background: var(--primary, #1668dc);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 18px -6px rgba(22, 104, 220, 0.45);
}

.cms-nav-item.active a:hover {
  transform: none;
}

/* Sidebar Contact Box */
.cms-help-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.4);
}

.cms-help-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #ffffff;
}

.cms-help-card p {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 16px;
}

.cms-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.cms-help-btn:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.cms-help-btn.ws {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.cms-help-btn.ws:hover {
  background: rgba(255, 255, 255, 0.2);
}

.cms-article-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: clamp(26px, 4vw, 44px);
  box-shadow: 0 20px 44px -32px rgba(15, 23, 42, 0.35);
}

/* About Us specific card & hero refinements */
.cms-about-page .cms-hero {
  padding: clamp(38px, 5vw, 56px) 0 clamp(32px, 4vw, 44px);
}

.cms-about-page .cms-hero h1 {
  margin-bottom: 0;
}

.cms-about-page .cms-article-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.07), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  padding: clamp(28px, 4.5vw, 48px);
}

.cms-featured-img-wrap {
  margin-bottom: 32px;
  border-radius: 18px;
  overflow: hidden;
  max-height: 440px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.cms-featured-img {
  width: 100%;
  height: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.cms-featured-img-wrap:hover .cms-featured-img {
  transform: scale(1.02);
}

/* --- WYSIWYG Content Rendering --- */
.cms-content {
  font-size: 15.5px;
  line-height: 1.82;
  color: #334155;
  word-break: break-word;
}

.cms-content > *:first-child {
  margin-top: 0 !important;
}

.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4,
.cms-content h5,
.cms-content h6 {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 36px;
  margin-bottom: 14px;
  line-height: 1.25;
}

.cms-content h2 {
  font-size: clamp(21px, 2.6vw, 27px);
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}

.cms-content h3 {
  font-size: clamp(18px, 2.2vw, 22px);
}

.cms-content h4 {
  font-size: clamp(16px, 1.8vw, 19px);
}

.cms-content p {
  margin: 0 0 16px;
}

.cms-content ul,
.cms-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.cms-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.cms-content a {
  color: var(--primary, #1668dc);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.cms-content a:hover {
  color: #0d4db0;
}

.cms-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: #f8fafc;
  border-left: 4px solid var(--primary, #1668dc);
  border-radius: 0 12px 12px 0;
  color: #475569;
  font-style: italic;
}

.cms-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 18px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.cms-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14.5px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cms-content th,
.cms-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.cms-content th {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
}

.cms-content tr:nth-child(even) {
  background: #f8fafc;
}

.cms-content pre,
.cms-content code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 13.5px;
}

.cms-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 20px 0;
}

/* --- Article Bottom Banner --- */
.cms-bottom-cta {
  margin-top: 36px;
  padding: clamp(24px, 3.4vw, 36px);
  border-radius: 20px;
  background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 60%, #0e7490 100%);
  color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.cms-bottom-cta h3 {
  font-size: clamp(19px, 2.4vw, 24px);
  margin: 0 0 6px;
  color: #ffffff;
}

.cms-bottom-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
}

.cms-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cms-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cms-cta-btn.solid {
  background: #ffffff;
  color: #0f172a;
}

.cms-cta-btn.solid:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.cms-cta-btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.cms-cta-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* --- Responsive Breakpoints --- */
@media (max-width: 980px) {
  .cms-grid {
    grid-template-columns: 1fr;
  }
  .cms-sidebar {
    position: static;
  }
  .cms-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .cms-nav-item {
    flex: 1 1 calc(50% - 6px);
  }
}

@media (max-width: 600px) {
  .cms-nav-item {
    flex: 1 1 100%;
  }
  .cms-hero-meta {
    gap: 8px;
  }
  .cms-meta-badge {
    font-size: 11.5px;
    padding: 6px 10px;
  }
}
