/**
 * Andalali - Static pages
 * Scoped to .al-sp, loaded only on /static/{page_url}.
 */

.al-sp {
  --sp-primary: var(--al-primary, #5426ef);
  --sp-primary-soft: var(--al-primary-soft, #f0ecff);
  --sp-ink: #10112f;
  --sp-body: #2b2f4a;
  --sp-muted: #5b607c;
  --sp-line: #eceefa;
  --sp-surface: #ffffff;
  --sp-soft: #f7f5ff;
  --sp-radius: 16px;
  --sp-c1: #5426ef;
  --sp-c2: #6f8cff;
  --sp-text: #ffffff;
  --sp-overlay: .45;
  color: var(--sp-ink);
  padding-bottom: clamp(24px, 4vw, 46px);
}

.al-sp-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: clamp(15px, 2.5vw, 32px);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.al-sp-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 52px) 0 clamp(24px, 3.4vw, 44px);
  color: var(--sp-text);
  background: linear-gradient(135deg, var(--sp-c1) 0%, var(--sp-c2) 100%);
  isolation: isolate;
}

.al-sp-hero--color::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset-block-start: -170px;
  inset-inline-end: -150px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}

.al-sp-hero--image {
  background-image: linear-gradient(180deg, rgba(8, 10, 24, var(--sp-overlay)) 0%, rgba(8, 10, 24, var(--sp-overlay)) 45%, rgba(8, 10, 24, calc(var(--sp-overlay) + .22)) 100%), var(--sp-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.al-sp-hero--image::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset-block-start: -160px;
  inset-inline-end: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.al-sp-hero-inner {
  position: relative;
  z-index: 1;
}

/* breadcrumbs */
.al-sp-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.al-sp-crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sp-text) !important;
  opacity: .82;
  text-decoration: none !important;
  transition: opacity .15s;
}

.al-sp-crumbs a:hover {
  opacity: 1;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.al-sp-crumbs-sep {
  font-size: 10px;
  opacity: .55;
}

.al-sp-crumbs-current {
  opacity: .72;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60vw;
}

/* title & description */
.al-sp-title {
  margin: 12px 0 0;
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.8px;
  color: var(--sp-text);
  overflow-wrap: break-word;
}

.al-sp-title::after {
  content: '';
  display: block;
  width: 62px;
  height: 4px;
  margin-top: 16px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--sp-text) 55%, transparent);
}

.al-sp-excerpt {
  margin: 14px 0 0;
  max-width: 66ch;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--sp-text);
  opacity: .86;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* meta chips */
.al-sp-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.al-sp-hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--sp-text);
  backdrop-filter: blur(4px);
}

.al-sp-hero-meta li i {
  font-size: 11px;
  opacity: .85;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.al-sp-body {
  margin-top: clamp(16px, 2.4vw, 28px);
}

.al-sp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}

.al-sp-card {
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  box-shadow: 0 1px 2px rgba(16, 17, 47, .04), 0 14px 34px rgba(16, 17, 47, .05);
  overflow: hidden;
}

.al-sp-card-body {
  padding: clamp(20px, 3vw, 44px);
}

.al-sp-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 14px clamp(18px, 3vw, 44px);
  border-top: 1px solid var(--sp-line);
  background: var(--sp-soft);
  font-size: 12.5px;
  color: var(--sp-muted);
}

.al-sp-footer-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.al-sp-footer-note i {
  color: var(--sp-primary);
}

.al-sp-top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--sp-primary) !important;
  text-decoration: none !important;
}

.al-sp-top:hover {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Page content (wysiwyg output)
   ========================================================================== */

.al-sp-content {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--sp-body);
  overflow-wrap: break-word;
}

.al-sp-content>*:first-child {
  margin-top: 0 !important;
}

.al-sp-content>*:last-child {
  margin-bottom: 0 !important;
}

.al-sp-content h1,
.al-sp-content h2,
.al-sp-content h3,
.al-sp-content h4,
.al-sp-content h5,
.al-sp-content h6 {
  color: var(--sp-ink);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.3px;
  scroll-margin-top: 96px;
}

.al-sp-content h1 {
  font-size: clamp(23px, 2.8vw, 30px);
  margin: 34px 0 14px;
}

.al-sp-content h2 {
  position: relative;
  font-size: clamp(20px, 2.3vw, 25px);
  margin: 34px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sp-line);
}

.al-sp-content h2::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  bottom: -1px;
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sp-primary), #8f6bff);
}

.al-sp-content h3 {
  font-size: clamp(17px, 1.9vw, 20px);
  margin: 26px 0 10px;
}

.al-sp-content h4 {
  font-size: 16px;
  margin: 22px 0 8px;
}

.al-sp-content p {
  margin: 0 0 16px;
}

.al-sp-content a {
  color: var(--sp-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.al-sp-content a:hover {
  text-decoration-thickness: 2px;
}

.al-sp-content strong,
.al-sp-content b {
  color: var(--sp-ink);
  font-weight: 600;
}

.al-sp-content ul,
.al-sp-content ol {
  margin: 0 0 18px;
  padding-inline-start: 22px;
}

.al-sp-content ul {
  list-style: disc;
}

.al-sp-content ol {
  list-style: decimal;
}

.al-sp-content li {
  margin-bottom: 8px;
  padding-inline-start: 4px;
}

.al-sp-content li::marker {
  color: var(--sp-primary);
}

.al-sp-content li>ul,
.al-sp-content li>ol {
  margin: 8px 0 0;
}

.al-sp-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border-radius: 12px;
}

.al-sp-content figure {
  margin: 20px 0;
}

.al-sp-content figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--sp-muted);
  text-align: center;
}

.al-sp-content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-inline-start: 4px solid var(--sp-primary);
  border-radius: 0 12px 12px 0;
  background: var(--sp-soft);
  color: #3b4060;
  font-style: normal;
}

.al-sp-content blockquote p:last-child {
  margin-bottom: 0;
}

.al-sp-content hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--sp-line);
}

.al-sp-content table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 14px;
}

.al-sp-content th,
.al-sp-content td {
  padding: 10px 12px;
  border: 1px solid var(--sp-line);
  text-align: start;
  vertical-align: top;
}

.al-sp-content th {
  background: var(--sp-soft);
  color: var(--sp-ink);
  font-weight: 700;
}

.al-sp-content pre {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f1225;
  color: #e8e9f5;
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
}

.al-sp-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--sp-soft);
  color: var(--sp-primary);
  font-size: .92em;
}

.al-sp-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.al-sp-content iframe,
.al-sp-content video {
  max-width: 100%;
  border: 0;
  border-radius: 12px;
}

.al-sp-content .text-info {
  color: var(--sp-primary) !important;
}

.al-sp-content .text-muted {
  color: var(--sp-muted) !important;
}

/* ==========================================================================
   Sidebar widgets
   ========================================================================== */

.al-sp-aside {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 88px;
  align-self: start;
}

.al-sp-widget {
  padding: 16px 18px;
  border: 1px solid var(--sp-line);
  border-radius: 14px;
  background: var(--sp-surface);
  box-shadow: 0 1px 2px rgba(16, 17, 47, .04);
}

.al-sp-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #7b819b;
}

.al-sp-widget-title i {
  color: var(--sp-primary);
  font-size: 12px;
}

/* table of contents */
.al-sp-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: sp-toc;
}

.al-sp-toc li {
  counter-increment: sp-toc;
  margin: 0;
}

.al-sp-toc a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  color: #3f4463 !important;
  text-decoration: none !important;
  transition: background .15s, color .15s;
}

.al-sp-toc a::before {
  content: counter(sp-toc);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--sp-soft);
  color: var(--sp-primary);
  font-size: 10.5px;
  font-weight: 700;
}

.al-sp-toc a:hover {
  background: var(--sp-soft);
  color: var(--sp-primary) !important;
}

.al-sp-toc li.al-sp-toc-sub a {
  padding-inline-start: 30px;
  font-size: 13px;
  color: #5b607c !important;
}

.al-sp-toc li.al-sp-toc-sub a::before {
  background: transparent;
  color: #9aa0bb;
}

/* quick links */
.al-sp-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.al-sp-links li {
  margin: 0;
}

.al-sp-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #3f4463 !important;
  text-decoration: none !important;
  transition: background .15s, color .15s;
}

.al-sp-links a:hover {
  background: var(--sp-soft);
  color: var(--sp-primary) !important;
}

.al-sp-links a img {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: cover;
}

.al-sp-links a>i:first-child {
  width: 20px;
  text-align: center;
  color: var(--sp-primary);
  font-size: 13px;
}

.al-sp-links a>span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.al-sp-link-arrow {
  flex: 0 0 auto;
  font-size: 10px;
  color: #a6abc6;
}

/* mobile site navigation inside the page */
.al-sp-mobile-nav {
  margin-bottom: 16px;
}

/* ==========================================================================
   Night mode
   ========================================================================== */

body.night-mode .al-sp {
  --sp-ink: #f2f0ff;
  --sp-body: #c9cce0;
  --sp-muted: #a4a8c4;
  --sp-line: #272b44;
  --sp-surface: #16182a;
  --sp-soft: #1b1d31;
  --sp-primary: #9b8cff;
  --sp-primary-soft: #24203f;
}

body.night-mode .al-sp .al-sp-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

body.night-mode .al-sp .al-sp-content blockquote {
  color: #cfd2e6;
}

body.night-mode .al-sp .al-sp-content th,
body.night-mode .al-sp .al-sp-content code {
  background: #1b1d31;
}

body.night-mode .al-sp .al-sp-content pre {
  background: #0b0d19;
}

body.night-mode .al-sp .al-sp-content code {
  color: #b9aaff;
}

body.night-mode .al-sp .al-sp-widget-title {
  color: #8f93b2;
}

body.night-mode .al-sp .al-sp-toc a,
body.night-mode .al-sp .al-sp-links a {
  color: #c7cae0 !important;
}

body.night-mode .al-sp .al-sp-toc a:hover,
body.night-mode .al-sp .al-sp-links a:hover {
  background: #24263d;
  color: #b9aaff !important;
}

body.night-mode .al-sp .al-sp-toc a::before {
  background: #24263d;
  color: #b9aaff;
}

body.night-mode .al-sp .al-sp-toc li.al-sp-toc-sub a {
  color: #9ea2c0 !important;
}

body.night-mode .al-sp .al-sp-toc li.al-sp-toc-sub a::before {
  background: transparent;
  color: #7e83a3;
}

body.night-mode .al-sp .al-sp-link-arrow {
  color: #7e83a3;
}

body.night-mode .al-sp .al-sp-card-footer {
  background: #131528;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1199.98px) {
  .al-sp-grid {
    grid-template-columns: minmax(0, 1fr) 288px;
  }
}

@media (max-width: 991.98px) {
  .al-sp-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .al-sp-aside {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .al-sp-aside>.al-sp-widget:only-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .al-sp-hero {
    padding: 22px 0 24px;
  }

  .al-sp-title {
    margin-top: 10px;
    font-size: clamp(22px, 6.6vw, 30px);
    letter-spacing: -.5px;
  }

  .al-sp-title::after {
    margin-top: 12px;
    width: 48px;
    height: 3px;
  }

  .al-sp-excerpt {
    margin-top: 12px;
    font-size: 13.5px;
    -webkit-line-clamp: 3;
  }

  .al-sp-hero-meta {
    margin-top: 14px;
    gap: 6px;
  }

  .al-sp-hero-meta li {
    padding: 4px 9px;
    font-size: 10px;
    letter-spacing: .3px;
  }

  .al-sp-card {
    border-radius: 14px;
  }

  .al-sp-card-body {
    padding: 18px 16px;
  }

  .al-sp-content {
    font-size: 15px;
    line-height: 1.72;
  }

  .al-sp-content h2 {
    margin-top: 26px;
  }

  .al-sp-content h3 {
    margin-top: 22px;
  }

  /* keep wide tables usable on small screens */
  .al-sp-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .al-sp-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .al-sp-card-footer {
    padding: 12px 16px;
    font-size: 12px;
  }
}

@media (max-width: 479.98px) {
  .al-sp-crumbs {
    font-size: 11.5px;
  }

  .al-sp-crumbs-current {
    max-width: 46vw;
  }

  .al-sp-content {
    font-size: 14.5px;
  }

  .al-sp-content ul,
  .al-sp-content ol {
    padding-inline-start: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .al-sp * {
    transition: none !important;
  }
}


/* ==========================================================================
   Reading experience (progress bar, skip link, print)
   ========================================================================== */

.al-sp-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 1035;
  height: 3px;
  background: color-mix(in srgb, var(--sp-primary) 14%, transparent);
  pointer-events: none;
}

.al-sp-progress-bar {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--sp-primary), #8f6bff);
  transition: transform .1s linear;
  will-change: transform;
}

html[dir="RTL"] .al-sp-progress-bar {
  transform-origin: right center;
}

/* keyboard only skip link */
.al-sp-skip {
  position: absolute;
  z-index: 1040;
  inset-block-start: -70px;
  inset-inline-start: 14px;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--sp-primary);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 8px 20px rgba(16, 17, 47, .18);
  transition: inset-block-start .15s ease;
}

.al-sp-skip:focus,
.al-sp-skip:focus-visible {
  inset-block-start: 0;
  outline: 0;
}

/* the article gets a soft accent line (matches the page header) */
.al-sp-card {
  position: relative;
}

.al-sp-card::before {
  content: '';
  position: absolute;
  z-index: 1;
  inset-block-start: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sp-primary), #8f6bff 60%, transparent);
  pointer-events: none;
}

.al-sp-footer-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

.al-sp-print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--sp-muted);
  cursor: pointer;
  transition: color .15s;
}

.al-sp-print:hover,
.al-sp-print:focus-visible {
  color: var(--sp-primary);
  outline: 0;
}

/* pages without the sidebar read in a single, centered column */
.al-sp-grid--full {
  grid-template-columns: minmax(0, 1fr);
}

.al-sp-grid--full .al-sp-card {
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
}

/* a hover lift keeps the sidebar widgets feeling interactive */
.al-sp-widget {
  transition: box-shadow .2s ease, border-color .2s ease;
}

.al-sp-widget:hover {
  border-color: color-mix(in srgb, var(--sp-primary) 22%, var(--sp-line));
  box-shadow: 0 10px 26px rgba(16, 17, 47, .08);
}

/* tablet & phone polish */
@media (max-width: 991.98px) {
  .al-sp-grid--full .al-sp-card {
    max-width: none;
  }

  .al-sp-aside {
    margin-top: 4px;
  }
}

@media (max-width: 767.98px) {
  .al-sp-progress {
    height: 2.5px;
  }

  .al-sp-card::before {
    height: 3px;
  }

  .al-sp-print {
    font-size: 12px;
  }

  .al-sp-footer-actions {
    gap: 6px 14px;
  }
}

@media (max-width: 479.98px) {
  .al-sp-hero-inner {
    padding-inline: 16px;
  }

  .al-sp-excerpt {
    max-width: none;
  }

  .al-sp-card-footer {
    align-items: flex-start;
  }

  .al-sp-footer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .al-sp-content h2 {
    padding-bottom: 8px;
  }

  .al-sp-content blockquote {
    padding: 12px 14px;
    border-radius: 0 10px 10px 0;
  }
}

/* night mode */
body.night-mode .al-sp .al-sp-progress {
  background: rgba(155, 140, 255, .16);
}

body.night-mode .al-sp .al-sp-print:hover {
  color: #b9aaff;
}

body.night-mode .al-sp .al-sp-widget:hover {
  border-color: #3a3f61;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .al-sp-progress,
  .al-sp-skip,
  .al-sp-print,
  .al-sp-top,
  .al-sp-aside,
  .al-sp-crumbs,
  .al-sp-hero-meta,
  .al-sp-mobile-nav,
  .al-sp-card-footer {
    display: none !important;
  }

  .al-sp {
    padding-bottom: 0;
  }

  .al-sp-hero {
    padding: 0 0 14px;
    background: #fff !important;
    color: #000 !important;
  }

  .al-sp-hero::after {
    display: none !important;
  }

  .al-sp-title,
  .al-sp-excerpt,
  .al-sp-crumbs-current,
  .al-sp-content,
  .al-sp-content h1,
  .al-sp-content h2,
  .al-sp-content h3,
  .al-sp-content h4 {
    color: #000 !important;
  }

  .al-sp-title::after {
    background: #000 !important;
  }

  .al-sp-body {
    margin-top: 10px;
  }

  .al-sp-grid {
    display: block;
  }

  .al-sp-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .al-sp-card::before {
    display: none !important;
  }

  .al-sp-card-body {
    padding: 0;
  }
}



