/* ============================================================
   Markdown-Ausgabe — gilt ueberall, wo MarkdownRenderer.php rendert:
   Guides, News, Build-Notizen und die Editor-Vorschauen.
   Global geladen (layout.php), damit kein Anzeigeort vergessen wird.
   ============================================================ */

/* ---- Tabellen ---- */
.md-table-wrap {
    /* Breite Tabellen scrollen in sich, die Seite nie horizontal. */
    overflow-x: auto;
    margin: 1.25rem 0;
    border: 1px solid var(--border-panel, #252830);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.015);
}
.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    line-height: 1.5;
}
.md-table th,
.md-table td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-panel, #252830);
    vertical-align: top;
}
.md-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-panel, #13151a);
    color: var(--red-bright, #e5484d);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-bottom-width: 2px;
}
.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.md-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.md-table code { white-space: nowrap; }

@media (max-width: 640px) {
    .md-table { font-size: 0.86rem; }
    .md-table th, .md-table td { padding: 0.45rem 0.6rem; }
}

/* ---- Bild mit Unterschrift ---- */
.guide-figure { margin: 1.25rem 0; }
.guide-figure img { display: block; margin: 0; }
.guide-figure__caption {
    margin-top: 0.45rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-dimmed, #7a7870);
    font-style: italic;
}
/* In der Galerie sitzt die Unterschrift unter dem jeweiligen Bild. */
.guide-gallery .guide-figure { margin: 0; }

/* ---- Checklisten ---- */
li.md-task {
    list-style: none;
    margin-left: -1.35em;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
li.md-task input[type="checkbox"] {
    margin: 0.28em 0 0 0;
    accent-color: var(--red-bright, #e5484d);
    flex: 0 0 auto;
    pointer-events: none;
}
li.md-task--done { color: var(--text-dimmed, #7a7870); }

/* ---- Callouts ---- */
.guide-callout {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}
.guide-callout--info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}
.guide-callout--warning {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: #fdba74;
}
.guide-callout__title {
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}
.guide-callout--tip {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.22);
    color: #86efac;
}
.guide-callout--danger {
    background: rgba(220, 38, 38, 0.09);
    border: 1px solid rgba(220, 38, 38, 0.28);
    color: #fca5a5;
}

/* ---- FAQ-Eintrag ---- */
.guide-faq {
    border: 1px solid var(--border-panel, #252830);
    border-radius: 6px;
    margin: 0.6rem 0;
    background: rgba(255, 255, 255, 0.015);
}
.guide-faq summary {
    padding: 0.7rem 0.95rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary, #e0ddd5);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq summary::before {
    content: "";
    flex: 0 0 auto;
    width: 0.5rem; height: 0.5rem;
    border-right: 2px solid var(--red-bright, #e5484d);
    border-bottom: 2px solid var(--red-bright, #e5484d);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}
.guide-faq[open] summary::before { transform: rotate(45deg); }
.guide-faq > div { padding: 0 0.95rem 0.8rem 1.95rem; }
.guide-faq > div > :first-child { margin-top: 0; }

/* ---- Interner Link auf Guide/News ---- */
a.guide-link { font-weight: 600; }

/* ---- Redaktionsstand in der Guide-Infokarte ---- */
.guide-review-state { color: #86efac; }
.guide-review-state--outdated { color: #fdba74; }

/* ---- Patch-Aenderungen: [change type="buff|nerf|new|fix"] ---- */
.md-change {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0.35rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.94rem;
    line-height: 1.55;
}
.md-change__badge {
    flex: 0 0 auto;
    min-width: 3.1rem;
    text-align: center;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.5;
    margin-top: 0.1rem;
}
.md-change__text > :first-child { margin-top: 0; }
.md-change__text > :last-child { margin-bottom: 0; }

.md-change--buff { border-left-color: #22c55e; }
.md-change--buff .md-change__badge { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.md-change--nerf { border-left-color: #dc2626; }
.md-change--nerf .md-change__badge { background: rgba(220, 38, 38, 0.18); color: #fca5a5; }
.md-change--new  { border-left-color: #c4a24e; }
.md-change--new .md-change__badge  { background: rgba(196, 162, 78, 0.18); color: #e8cf8f; }
.md-change--fix  { border-left-color: #64748b; }
.md-change--fix .md-change__badge  { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }

/* ---- Entity-Karte: Mention mit {card} ---- */
.md-entity-card {
    margin: 1rem 0;
    /* Das Tooltip-Markup bringt eine eigene Breite mit — die Karte legt sich
       darum, statt rechts einen leeren Streifen zu lassen. */
    width: fit-content;
    max-width: min(420px, 100%);
}
/* Das Tooltip-Markup bringt seinen Rahmen nur im schwebenden Overlay mit —
   als Block im Text setzt die Karte ihn selbst. */
.md-entity-card--loaded {
    border: 1px solid var(--border-panel, #252830);
    border-radius: 8px;
    background: #0d0e12;
    overflow: hidden;
}
.md-entity-card--loaded > * {
    position: static !important;
    display: block;
    max-width: 100%;
}
@media (max-width: 480px) {
    .md-entity-card { max-width: 100%; }
}

/* ---- Vorschau-Band ueber unveroeffentlichten Guides/News ---- */
.draft-preview-bar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    /* Gleiche Breite wie der Artikel darunter, statt randlos ueber die Seite */
    max-width: 960px;
    margin: 0.35rem auto 1rem;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(249, 115, 22, 0.35);
    border-radius: 8px;
    background: rgba(249, 115, 22, 0.08);
    font-size: 0.9rem;
    color: #fdba74;
}
.draft-preview-bar__badge {
    flex: 0 0 auto;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    background: rgba(249, 115, 22, 0.25);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
