/* ===========================
   Base / tokens
   =========================== */

:root {
  --cl-text-primary: #111827;   /* near-black */
  --cl-text-secondary: #4b5563; /* grey-600 */
  --cl-text-muted: #6b7280;     /* grey-500 */

  --cl-border: #e5e7eb;         /* grey-200 */
  --cl-surface: #ffffff;        /* white */
  --cl-surface-alt: #f9fafb;    /* grey-50 */
  --cl-surface-footer: #0f172a; /* slate-900 */
  --cl-text-footer-heading: #ffffff;
  --cl-text-footer: #e2e8f0;    /* slate-200 */
  --cl-text-footer-dim: #94a3b8;/* slate-400 */

  --cl-radius-sm: 4px;
  --cl-radius-md: 6px;
  --cl-radius-lg: 8px;

  --cl-focus-ring: #6366f1;     /* indigo-500 */
  --cl-focus-ring-bg: rgba(99,102,241,0.15);

  --cl-font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --cl-container-max: 960px;
  --cl-page-padding-x: 1rem;
  --cl-page-padding-y: 2rem;
}

/* Reset-ish bits */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body.cl-body {
  background: var(--cl-surface);
  color: var(--cl-text-primary);
  font-family: var(--cl-font-stack);
  line-height: 1.5;
  font-size: 16px;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #4f46e5; /* indigo-600 */
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.cl-container {
  max-width: var(--cl-container-max);
  margin: 0 auto;
  padding: var(--cl-page-padding-y) var(--cl-page-padding-x);
}

/* ===========================
   Header / Top nav
   =========================== */

.cl-header {
  background: var(--cl-surface);
  border-bottom: 1px solid var(--cl-border);
  position: relative;
  z-index: 100;
  font-size: 0.9rem;
}

.cl-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  row-gap: 1rem;
  column-gap: 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.cl-header__brand {
  flex: 1 1 auto;
  min-width: 200px;
}

.cl-header__logo-link {
  font-weight: 600;
  font-size: 1rem;
  color: var(--cl-text-primary);
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}
.cl-header__logo-link:hover {
  text-decoration: none;
  color: var(--cl-text-primary);
}

.cl-header__logo-text {
  display: inline-block;
}

.cl-header__tagline {
  margin: .25rem 0 0;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--cl-text-secondary);
  max-width: 32ch;
}

.cl-header__nav {
  flex: 0 0 auto;
}

.cl-header__nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cl-header__nav-item {
  line-height: 1.2;
}

.cl-header__nav-link {
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  color: var(--cl-text-secondary);
  padding-bottom: .25rem;
  border-bottom: 2px solid transparent;
  display: inline-block;
}
.cl-header__nav-link:hover {
  color: var(--cl-text-primary);
  text-decoration: none;
}
.cl-header__nav-item.is-active .cl-header__nav-link {
  color: var(--cl-text-primary);
  border-bottom-color: var(--cl-focus-ring);
  font-weight: 600;
}

/* Search bar in header */
.cl-header__search {
  flex: 1 1 220px;
  max-width: 260px;
}

.cl-search-form {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
}

.cl-search-form__label {
  display: none;
}

.cl-search-form__input {
  flex: 1 1 auto;
  border: 1px solid #cbd5e1; /* slate-300 */
  border-radius: var(--cl-radius-sm);
  padding: .5rem .6rem;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--cl-text-primary);
  background: #fff;
}
.cl-search-form__input:focus {
  outline: 2px solid var(--cl-focus-ring);
  outline-offset: 0;
  border-color: var(--cl-focus-ring);
  box-shadow: 0 0 0 3px var(--cl-focus-ring-bg);
}

.cl-search-form__button {
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: var(--cl-radius-sm);
  padding: .5rem .75rem;
  font-size: .8rem;
  line-height: 1.2;
  color: var(--cl-text-primary);
  cursor: pointer;
  font-weight: 500;
}
.cl-search-form__button:hover {
  background: #f8fafc;
}

/* ===========================
   Page header / intro block
   =========================== */

.cl-page-header {
  margin-bottom: 2rem;
}

.cl-page-header__text {
  max-width: 50rem;
}

.cl-page-header__title {
  margin: 0 0 .5rem;
  font-size: 2.25rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--cl-text-primary);
}

.cl-page-header__description {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--cl-text-secondary);
  max-width: 60ch;
}

/* ===========================
   Main content region
   =========================== */

.cl-main {
  background: var(--cl-surface);
}

.cl-main__inner {
  /* .cl-container provides width + padding */
}

.cl-content {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cl-text-primary);
}

/* Typography inside .cl-content */
.cl-content h2,
.cl-content h3,
.cl-content h4 {
  color: var(--cl-text-primary);
  line-height: 1.3;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: .75rem;
}

.cl-content h2 {
  font-size: 1.25rem;
}

.cl-content h3 {
  font-size: 1.05rem;
}

.cl-content p {
  color: var(--cl-text-primary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.cl-content ul,
.cl-content ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
  color: var(--cl-text-primary);
  font-size: 1rem;
  line-height: 1.6;
}
.cl-content li {
  margin-bottom: .5rem;
}
.cl-content li a {
  text-decoration: none;
}
.cl-content li a:hover {
  text-decoration: underline;
}

/* Details / FAQ-style disclosure */
.cl-content details {
  border: 1px solid var(--cl-border);
  border-radius: var(--cl-radius-md);
  background: var(--cl-surface-alt);
  padding: .75rem 1rem;
  margin: 0 0 1rem;
}

.cl-content details[open] {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.cl-content details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--cl-text-primary);
  font-size: .95rem;
  line-height: 1.4;
  list-style: none;
}
.cl-content details summary::-webkit-details-marker {
  display: none;
}
.cl-content details p {
  margin-top: .75rem;
  font-size: .9rem;
  color: var(--cl-text-secondary);
  line-height: 1.5;
}

/* Horizontal rule between sections created with --- in Markdown */
.cl-content hr {
  border: 0;
  border-top: 1px solid var(--cl-border);
  margin: 2rem 0;
}

/* Links inside body copy */
.cl-content a {
  color: #4f46e5; /* indigo-600 */
  text-decoration: none;
  border-bottom: 1px solid rgba(99,102,241,0.3);
}
.cl-content a:hover {
  text-decoration: none;
  border-bottom-color: rgba(99,102,241,0.6);
}

/* ===========================
   Article prev/next nav cards
   =========================== */

.cl-article-nav-wrapper {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cl-border);
}

.cl-article-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.cl-article-nav__item {
  flex: 1 1 260px;
  text-decoration: none;
  border: 1px solid var(--cl-border);
  border-radius: var(--cl-radius-md);
  background: var(--cl-surface);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  padding: 1rem 1rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cl-article-nav__item:hover {
  border-color: var(--cl-focus-ring);
  box-shadow: 0 0 0 3px var(--cl-focus-ring-bg);
  text-decoration: none;
}

.cl-article-nav__label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--cl-focus-ring);
  line-height: 1.2;
  margin-bottom: .25rem;
}

.cl-article-nav__title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--cl-text-primary);
  line-height: 1.4;
  word-break: break-word;
}

/* ===========================
   Footer
   =========================== */

.cl-footer {
  background: var(--cl-surface-footer);
  color: var(--cl-text-footer);
  margin-top: 4rem;
  font-size: .8rem;
}

.cl-footer__inner {
  padding: 2rem var(--cl-page-padding-x) 3rem;
}

.cl-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
}

.cl-footer__col {
  flex: 1 1 160px;
  min-width: 160px;
}

.cl-footer__heading {
  margin: 0 0 .75rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--cl-text-footer-heading);
  line-height: 1.4;
}

.cl-footer__text {
  margin: 0;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--cl-text-footer);
  max-width: 40ch;
}

.cl-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cl-footer__link {
  display: inline-block;
  margin: 0 0 .5rem;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--cl-text-footer);
  text-decoration: none;
}
.cl-footer__link:hover {
  text-decoration: underline;
  color: #fff;
}

.cl-footer__bottom {
  border-top: 1px solid rgba(226,232,240,.15);
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.cl-footer__legal {
  margin: 0;
  font-size: .75rem;
  line-height: 1.4;
  color: var(--cl-text-footer-dim);
  text-align: left;
}

/* ===========================
   Responsiveness
   =========================== */

@media (max-width: 640px) {
  .cl-header__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cl-header__nav-list {
    gap: .75rem 1rem;
  }

  .cl-header__search {
    max-width: 100%;
  }

  .cl-page-header__title {
    font-size: 1.4rem;
  }

  .cl-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .cl-footer__top {
    flex-direction: column;
  }

  .cl-article-nav {
    flex-direction: column;
  }

  .cl-article-nav__item {
    width: 100%;
  }
}