/* El grid principal sense màxim ample */
.md-grid {
  max-width: initial !important;
}

/* O bé apuntant al inner content */
.md-main__inner.md-grid {
  max-width: initial !important;
}

/* Treure marges/paddings laterals */
.md-content, .md-main__inner, .md-header, .md-footer {
  margin: 0 !important;
  padding: 0 !important;
}

/* Estil per als blocs de codi */
.highlight {
    border-radius: 4px;
}

/* Estil per a les admonicions d'IA */
.admonition.danger {
    border-color: #9c27b0;
}

.admonition.warning {
    border-color: #ff9800;
}

/* ── Hero banner (index.md) ─────────────────────────────────── */
.hero-banner {
    background: linear-gradient(135deg, #4a148c 0%, #1565c0 60%, #00695c 100%);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    margin: 1.5rem 0 2rem;
    text-align: center;
    color: #fff;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* ── Badges genèrics ────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
}

.badge-purple  { background: #7b1fa2; }
.badge-cyan    { background: #00838f; }
.badge-green   { background: #2e7d32; }
.badge-orange  { background: #e65100; }
.badge-blue    { background: #1565c0; }
.badge-red     { background: #b71c1c; }

/* ── Stats grid (index.md — "El curs en xifres") ───────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--md-code-bg-color, #f5f5f5);
    border: 1px solid var(--md-default-fg-color--lightest, #e0e0e0);
    border-radius: 10px;
    padding: 1.2rem 1rem;
    text-align: center;
}

[data-md-color-scheme="slate"] .stat-card {
    background: #1e1e2e;
    border-color: #3d3d5c;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #7c4dff;
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.82rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================================
   Mermaid — correcció mode fosc
   =========================================== */

[data-md-color-scheme="slate"] .mermaid svg {
  background: transparent !important;
}

[data-md-color-scheme="slate"] .mermaid svg text,
[data-md-color-scheme="slate"] .mermaid svg tspan {
  fill: #ffffff !important;
}
[data-md-color-scheme="slate"] .mermaid svg rect:not([fill="none"]),
[data-md-color-scheme="slate"] .mermaid svg circle:not([fill="none"]),
[data-md-color-scheme="slate"] .mermaid svg ellipse:not([fill="none"]),
[data-md-color-scheme="slate"] .mermaid svg polygon:not([fill="none"]) {
  fill: #2d1b69 !important;
  stroke: #7c3aed !important;
}

/* ===========================================
   Timeline Mermaid 10 — correcció específica
   =========================================== */

[data-md-color-scheme="slate"] g[class*="section"] path,
[data-md-color-scheme="slate"] g[class*="section"] rect,
[data-md-color-scheme="slate"] g[class*="section"] circle {
  fill: #1a1a3e !important;
  stroke: #7c3aed !important;
}

[data-md-color-scheme="slate"] g[class*="section"] text,
[data-md-color-scheme="slate"] g[class*="section"] tspan {
  fill: #e8e8ff !important;
}

[data-md-color-scheme="slate"] g[class*="section"] line {
  stroke: #7c3aed !important;
}

[data-md-color-scheme="slate"] .mermaid .lineWrapper line {
  stroke: #7c3aed !important;
}

[data-md-color-scheme="slate"] .mermaid .eventWrapper {
  filter: none !important;
}

