/* ==========================================================================
   Epiworld Custom Theme – Crimson-to-Purple palette from the logo
   Primary:  #a41e45 (deep crimson/ruby)
   Accent:   #5d3875 (deep purple)
   Gradient: crimson → purple
   ========================================================================== */

/* ── Light mode colour overrides ──────────────────────────────────────────── */
[data-md-color-scheme="default"] {
  --md-primary-fg-color:        #a41e45;
  --md-primary-fg-color--light: #c4325a;
  --md-primary-fg-color--dark:  #8a1a3a;
  --md-accent-fg-color:         #5d3875;
  --md-accent-fg-color--transparent: rgba(93, 56, 117, 0.1);

  /* Typeset links */
  --md-typeset-a-color: #a41e45;
}

/* ── Dark mode colour overrides ───────────────────────────────────────────── */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #a41e45;
  --md-primary-fg-color--light: #c4325a;
  --md-primary-fg-color--dark:  #8a1a3a;
  --md-accent-fg-color:         #9b6fbf;
  --md-accent-fg-color--transparent: rgba(155, 111, 191, 0.1);

  --md-typeset-a-color: #d4587a;
}

/* ── Header gradient ──────────────────────────────────────────────────────── */
.md-header {
  background: linear-gradient(135deg, #a41e45 0%, #5d3875 100%);
}

/* Tabs bar inherits the gradient but slightly darker */
.md-tabs {
  background: linear-gradient(135deg, #8a1a3a 0%, #4a2d5e 100%);
}

/* ── Hero section on homepage ─────────────────────────────────────────────── */
.epiworld-hero {
  background: linear-gradient(135deg, #a41e45 0%, #5d3875 100%);
  color: #fff;
  padding: 3rem 2rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.epiworld-hero .hero-text {
  flex: 1;
  text-align: left;
}

.epiworld-hero .hero-illustration {
  flex: 0 0 280px;
  text-align: center;
}

.epiworld-hero .hero-illustration img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
}

.epiworld-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.epiworld-hero .hero-tagline {
  font-size: 1.25rem;
  font-weight: 400;
  opacity: 0.92;
  margin-bottom: 1.75rem;
  max-width: 640px;
}

.epiworld-hero .hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.epiworld-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.epiworld-hero .hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.epiworld-hero .hero-buttons a {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.epiworld-hero .hero-buttons a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.epiworld-hero .btn-primary {
  background: #fff;
  color: #a41e45;
}

.epiworld-hero .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ── Language logos section ────────────────────────────────────────────────── */
.lang-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin: 2.5rem 0;
  padding: 1.5rem 0;
}

.lang-logos .lang-logo-item {
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}

.lang-logos .lang-logo-item:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.lang-logos .lang-logo-item img {
  height: 64px;
  width: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

.lang-logos .lang-logo-item span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--md-typeset-color);
}

/* ── Network illustration banner ──────────────────────────────────────────── */
.network-banner {
  text-align: center;
  margin: 2rem 0;
  padding: 1rem 0;
}

.network-banner img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.network-banner img:hover {
  opacity: 1;
}

/* ── Feature highlights on homepage ───────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.feature-card {
  background: linear-gradient(145deg, #a41e45, #5d3875);
  color: #fff;
  padding: 1.5rem;
  border-radius: 0.625rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(164, 30, 69, 0.25);
}

.feature-card .feature-icon {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
  line-height: 1.5;
}

/* ── Section cards (Documentation Sections) ───────────────────────────────── */
.md-typeset .grid.cards > ol > li,
.md-typeset .grid.cards > ul > li {
  border: 1px solid rgba(164, 30, 69, 0.15);
  border-radius: 0.625rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.md-typeset .grid.cards > ol > li:hover,
.md-typeset .grid.cards > ul > li:hover {
  border-color: #a41e45;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(164, 30, 69, 0.12);
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > ol > li,
[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li {
  border-color: rgba(155, 111, 191, 0.2);
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > ol > li:hover,
[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li:hover {
  border-color: #9b6fbf;
  box-shadow: 0 8px 24px rgba(93, 56, 117, 0.2);
}

/* ── Code blocks ──────────────────────────────────────────────────────────── */
.md-typeset code {
  border-radius: 0.25rem;
}

.md-typeset pre > code {
  border-radius: 0.5rem;
}

/* ── Footer accent ────────────────────────────────────────────────────────── */
.md-footer {
  background: linear-gradient(135deg, #3a1028 0%, #2a1a3a 100%);
}

/* ── Admonition accent colours ────────────────────────────────────────────── */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #a41e45;
}

.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: rgba(164, 30, 69, 0.1);
}

.md-typeset .tip > .admonition-title::before,
.md-typeset .tip > summary::before {
  background-color: #a41e45;
}

/* ── Navigation & sidebar accent ──────────────────────────────────────────── */
.md-nav__link--active,
.md-nav__link:hover {
  color: var(--md-accent-fg-color);
}

/* ── Smooth content width ─────────────────────────────────────────────────── */
.md-content {
  max-width: none;
}

/* ── Hide permalink anchors inside hero & feature cards ────────────────────── */
.epiworld-hero .headerlink,
.feature-card .headerlink {
  display: none;
}

/* ── Responsive hero ──────────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
  .epiworld-hero {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.25rem;
  }
  .epiworld-hero .hero-text {
    text-align: center;
  }
  .epiworld-hero .hero-badges {
    justify-content: center;
  }
  .epiworld-hero .hero-buttons {
    justify-content: center;
  }
  .epiworld-hero h1 {
    font-size: 2rem;
  }
  .epiworld-hero .hero-tagline {
    font-size: 1.05rem;
  }
  .epiworld-hero .hero-illustration {
    flex: 0 0 auto;
    max-width: 200px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .lang-logos {
    gap: 2rem;
  }
  .lang-logos .lang-logo-item img {
    height: 48px;
  }
}

/* ── Respect reduced-motion preference ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .epiworld-hero .hero-buttons a,
  .feature-card,
  .md-typeset .grid.cards > ol > li,
  .md-typeset .grid.cards > ul > li,
  .lang-logos .lang-logo-item,
  .network-banner img {
    transition: none;
  }

  .epiworld-hero .hero-buttons a:hover,
  .feature-card:hover,
  .md-typeset .grid.cards > ol > li:hover,
  .md-typeset .grid.cards > ul > li:hover,
  .lang-logos .lang-logo-item:hover {
    transform: none;
    box-shadow: none;
  }
}
