/* ═══════════════════════════════════════════════
   SimPaths Documentation — Custom Theme
   Refined academic aesthetic
═══════════════════════════════════════════════ */

/* ── Self-hosted fonts (zero external requests) ── */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --md-text-font: "Inter";
  --md-code-font: "JetBrains Mono";
}

/* ── CSS Variables ── */
:root {
  --sp-primary:       #1e3050;
  --sp-accent:        #2478b5;
  --sp-accent-light:  #3b9ede;
  --sp-accent-bright: #4fb3f0;
  --sp-gradient:      linear-gradient(135deg, #162540 0%, #1e3358 55%, #1a3550 100%);
  --sp-hero-gradient: linear-gradient(135deg, #0f1c34 0%, #1e3358 50%, #163050 100%);
  --sp-card-shadow:   0 4px 20px rgba(20,40,70,0.10);
  --sp-transition:    all 0.2s ease;
}

/* ═══════════════════════════════════════════════
   MATERIAL THEME PALETTE
═══════════════════════════════════════════════ */

[data-md-color-primary="custom"] {
  --md-primary-fg-color:        #1e3050;
  --md-primary-fg-color--light: #2a4570;
  --md-primary-fg-color--dark:  #12203a;
  --md-primary-bg-color:        #ffffff;
  --md-primary-bg-color--light: rgba(255,255,255,0.7);
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color:              #2478b5;
  --md-accent-fg-color--transparent: rgba(36,120,181,0.1);
  --md-accent-bg-color:              #ffffff;
  --md-accent-bg-color--light:       rgba(255,255,255,0.7);
}

/* ═══════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════ */

[data-md-color-scheme="slate"] {
  --md-default-bg-color:          #111c2e;
  --md-default-bg-color--light:   #1a2940;
  --md-default-bg-color--lighter: #223450;
  --md-default-bg-color--lightest:#2c3f5c;
  --md-code-bg-color:             #1a2940;
  --md-default-fg-color:          rgba(255,255,255,0.92);
  --md-default-fg-color--light:   rgba(255,255,255,0.72);
  --md-default-fg-color--lighter: rgba(255,255,255,0.48);
  --md-default-fg-color--lightest:rgba(255,255,255,0.14);
}

[data-md-color-scheme="slate"] .md-typeset a {
  color: #5cb8f0 !important;
}
[data-md-color-scheme="slate"] .md-typeset a:hover {
  color: #8dd0f7 !important;
}

[data-md-color-scheme="slate"] .md-nav__item--active > .md-nav__link {
  color: #5cb8f0 !important;
}
[data-md-color-scheme="slate"] .md-nav__link:hover {
  color: #8dd0f7 !important;
}
[data-md-color-scheme="slate"] .md-nav__link--active {
  color: #5cb8f0 !important;
}

[data-md-color-scheme="slate"] .md-typeset .feature-card {
  background: #1a2940;
  border-color: rgba(255,255,255,0.06);
}
[data-md-color-scheme="slate"] .md-typeset .feature-card a {
  color: #5cb8f0 !important;
}

[data-md-color-scheme="slate"] .md-typeset .hero {
  background: linear-gradient(135deg, #0c1624 0%, #162845 50%, #103048 100%);
}

[data-md-color-scheme="slate"] .md-typeset .country-tag {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: #1e3050;
}

[data-md-color-scheme="slate"] .md-typeset .highlight {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
  background: rgba(36,120,181,0.08);
}

/* ═══════════════════════════════════════════════
   LINKS
═══════════════════════════════════════════════ */

.md-typeset a:not(.md-button):not(.headerlink):not(.md-nav__link):not(.card-link) {
  color: var(--sp-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.md-typeset a:not(.md-button):not(.headerlink):not(.md-nav__link):not(.card-link):hover {
  color: var(--sp-primary);
  border-bottom-color: var(--sp-primary);
}

[data-md-color-scheme="slate"] .md-typeset a:not(.md-button):not(.headerlink):not(.md-nav__link):not(.card-link):hover {
  color: #8dd0f7 !important;
  border-bottom-color: #8dd0f7 !important;
}

/* ═══════════════════════════════════════════════
   HEADER & NAVIGATION
═══════════════════════════════════════════════ */

.md-header {
  background: var(--sp-gradient) !important;
  box-shadow: 0 2px 16px rgba(20,40,70,0.35);
}

.md-tabs {
  background: rgba(255,255,255,0.05) !important;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.md-tabs__link {
  font-weight: 500;
  font-size: 0.79rem;
  letter-spacing: 0.02em;
  opacity: 0.78;
  transition: opacity 0.15s ease;
}
.md-tabs__link:hover,
.md-tabs__link--active {
  opacity: 1;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */

.md-nav__title {
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp-accent) !important;
  padding-bottom: 0.25rem;
}

.md-nav__item--active > .md-nav__link {
  font-weight: 600;
  color: var(--sp-accent) !important;
}

.md-nav__link {
  font-size: 0.76rem;
  transition: color 0.12s ease;
}

/* ═══════════════════════════════════════════════
   CONTENT — TYPOGRAPHY
═══════════════════════════════════════════════ */

.md-content {
  max-width: 820px;
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.6;
}

.md-typeset h1 {
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.015em;
  border-bottom: 2px solid transparent;
  border-image: var(--sp-gradient) 1;
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
}

.md-typeset h2 {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-top: 1.4rem;
  margin-bottom: 0.45rem;
  color: var(--md-default-fg-color);
}

.md-typeset h3 {
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  color: var(--md-default-fg-color);
}

/* Paragraph justification */
.md-typeset p {
  margin-top: 0;
  margin-bottom: 0.75em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Tighter list spacing */
.md-typeset ul,
.md-typeset ol {
  margin-top: 0.3em;
  margin-bottom: 0.7em;
}
.md-typeset ul li,
.md-typeset ol li {
  margin-bottom: 0.2em;
}
.md-typeset ul li:last-child,
.md-typeset ol li:last-child {
  margin-bottom: 0;
}

/* Blockquote */
.md-typeset blockquote {
  border-left: 3px solid var(--sp-accent);
  background: rgba(36,120,181,0.05);
  border-radius: 0 6px 6px 0;
  padding: 0.7rem 1.1rem;
  margin: 1rem 0;
  font-style: italic;
  color: var(--md-default-fg-color--light);
}

/* ═══════════════════════════════════════════════
   CODE BLOCKS
═══════════════════════════════════════════════ */

.md-typeset code {
  border-radius: 4px;
  font-size: 0.78em;
  padding: 0.1em 0.35em;
  background: rgba(36,120,181,0.07);
  color: #1a5a8a;
}

[data-md-color-scheme="slate"] .md-typeset code {
  background: rgba(92,184,240,0.1);
  color: #8dd0f7;
}

.md-typeset pre > code {
  font-size: 0.78em;
  line-height: 1.65;
  background: none;
  color: inherit;
  padding: 0;
}

.md-typeset .highlight {
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 1px 10px rgba(0,0,0,0.07);
  margin: 1em 0;
}

/* ═══════════════════════════════════════════════
   ADMONITIONS & DETAILS
═══════════════════════════════════════════════ */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px !important;
  border-left-width: 4px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  font-size: 0.81rem;
}

.md-typeset .admonition-title,
.md-typeset summary {
  font-weight: 600;
  font-size: 0.81rem;
}

/* ═══════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════ */

.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  font-size: 0.84em;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.md-typeset table:not([class]) th {
  background: var(--sp-gradient);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.6rem 1rem;
}

.md-typeset table:not([class]) td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset table:not([class]) tr:last-child td {
  border-bottom: none;
}

.md-typeset table:not([class]) tr:hover td {
  background: rgba(36,120,181,0.04);
}

/* ═══════════════════════════════════════════════
   HERO SECTION (homepage)
═══════════════════════════════════════════════ */

.md-typeset .hero {
  background: var(--sp-hero-gradient);
  border-radius: 14px;
  padding: 2.2rem 2.2rem;
  margin: 1rem 0 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.md-typeset .hero::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
  pointer-events: none;
}

.md-typeset .hero::after {
  content: '';
  position: absolute;
  bottom: -70px; left: -30px;
  width: 220px; height: 220px;
  background: rgba(36,120,181,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.md-typeset .hero h1 {
  color: #fff !important;
  font-size: 1.95rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  line-height: 1.2;
  border: none;
  letter-spacing: -0.02em;
}

.md-typeset .hero .tagline {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.4rem;
  font-weight: 400;
  max-width: 100%;
  line-height: 1.6;
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}

/* ── Hero badges ── */
.md-typeset .hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.md-typeset .hero-badge {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.88);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Hero CTA buttons ── */
.md-typeset .hero-cta {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.md-typeset .hero-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 7px;
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none !important;
  border-bottom: none !important;
  transition: var(--sp-transition);
  position: relative;
  z-index: 1;
}

.md-typeset .hero-cta .btn-primary {
  background: #fff;
  color: var(--sp-primary) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.md-typeset .hero-cta .btn-primary:hover {
  background: #eef4fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.md-typeset .hero-cta .btn-outline {
  background: transparent;
  color: #fff !important;
  border: 1.5px solid rgba(255,255,255,0.4) !important;
}
.md-typeset .hero-cta .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.8) !important;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════
   FEATURE CARDS (homepage)
═══════════════════════════════════════════════ */

.md-typeset .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}

.md-typeset .feature-card {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  padding: 1.2rem 1.3rem 1rem;
  transition: var(--sp-transition);
  position: relative;
  overflow: hidden;
}

.md-typeset .feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--sp-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.md-typeset .feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sp-card-shadow);
  border-color: rgba(36,120,181,0.25);
}

.md-typeset .feature-card:hover::before {
  opacity: 1;
}

.md-typeset .feature-card .card-icon {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
  display: block;
  line-height: 1;
}

.md-typeset .feature-card h3 {
  font-size: 0.9rem !important;
  font-weight: 600;
  margin: 0 0 0.25rem !important;
  padding: 0 !important;
  color: var(--md-default-fg-color) !important;
  border: none !important;
}

.md-typeset .feature-card p {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
  margin: 0 0 0.4rem;
  line-height: 1.5;
  text-align: left;
}

.md-typeset .feature-card a {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--sp-accent) !important;
  text-decoration: none !important;
  border-bottom: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.2rem;
  transition: color 0.12s ease, gap 0.12s ease;
}

.md-typeset .feature-card a:hover {
  color: var(--sp-primary) !important;
  gap: 0.25rem;
}

/* ═══════════════════════════════════════════════
   COUNTRIES STRIP (homepage)
═══════════════════════════════════════════════ */

.md-typeset .countries {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.md-typeset .country-tag {
  background: #eef4fa;
  color: #1e3050;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.73rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */

.md-footer {
  background: #12203a;
}

.md-footer-meta {
  background: rgba(0,0,0,0.18);
}

.md-footer__link {
  opacity: 0.75;
  transition: opacity 0.12s ease;
}
.md-footer__link:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════
   SEARCH
═══════════════════════════════════════════════ */

.md-search__form {
  border-radius: 8px;
  background: rgba(255,255,255,0.10) !important;
  transition: background 0.15s ease;
}
.md-search__form:focus-within {
  background: rgba(255,255,255,0.16) !important;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */

.md-typeset .md-button {
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.84rem;
  transition: var(--sp-transition);
}
.md-typeset .md-button:hover {
  transform: translateY(-1px);
}
.md-typeset .md-button--primary {
  background: var(--sp-gradient);
  border-color: transparent;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .md-typeset .hero {
    padding: 1.8rem 1.3rem;
  }
  .md-typeset .hero h1 {
    font-size: 1.6rem;
  }
  .md-typeset .card-grid {
    grid-template-columns: 1fr;
  }
}
