/**
 * Schattenwelt – Gilden-/Stadtdatenbank (Redesign, dunkles Gold-Theme).
 * Geladen auf /guilddb, /guild/{id}, /towndb, /town/{id} - beide Entitaeten teilen sich
 * dieselbe Struktur (Suche -> Statistik -> Liste bzw. Bild -> Meta -> Beschreibung -> Mitglieder).
 * Farb-Tokens/.btn-gilded kommen aus layout.css.
 */

.edb-page,
.edb-page *,
.edb-page *::before,
.edb-page *::after {
    box-sizing: border-box;
}

.edb-page__title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    color: var(--sw-gold-bright);
    text-align: center;
    margin: 0 0 1.5rem;
}

/* ── Suche ── */
.edb-search {
    display: flex;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto 1.75rem;
}

.edb-search input[type="text"] {
    flex: 1;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--sw-border-gold);
    border-radius: var(--sw-radius-sm);
    color: var(--sw-gold-bright);
    font-size: 0.95rem;
}

.edb-search input[type="text"]:focus {
    outline: none;
    border-color: var(--sw-gold);
    box-shadow: 0 0 0 3px rgba(201, 166, 92, 0.15);
}

/* ── Statistik-Panel ── */
.edb-panel {
    background: var(--sw-panel-dark);
    border: 1px solid var(--sw-border-gold);
    border-radius: var(--sw-radius);
    padding: 1.5rem;
    margin: 0 auto 2rem;
    max-width: 720px;
}

.edb-panel__title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.1rem;
    color: var(--sw-gold-bright);
    text-align: center;
    margin: 0 0 1rem;
}

.edb-panel__all {
    display: block;
    text-align: center;
    color: var(--sw-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin: -0.5rem 0 1rem;
}

.edb-panel__all:hover {
    color: var(--sw-gold-bright);
}

.edb-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.edb-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--sw-border-gold);
    border-radius: 999px;
    color: var(--sw-text);
    font-size: 0.85rem;
    text-decoration: none;
}

.edb-tag:hover {
    background: rgba(201, 166, 92, 0.12);
    color: var(--sw-gold-bright);
}

.edb-tag span {
    color: var(--sw-gold);
    font-weight: 600;
}

/* ── Liste ── */
.edb-list-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15rem;
    color: var(--sw-gold-bright);
    text-align: center;
    margin: 0 0 1.5rem;
}

.edb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.edb-list__group h4 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    color: var(--sw-gold);
    margin: 0 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--sw-border-gold);
}

.edb-list__group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.edb-list__group li {
    margin-bottom: 0.3rem;
}

.edb-list__group a {
    color: var(--sw-text);
    text-decoration: none;
    font-size: 0.88rem;
}

.edb-list__group a:hover {
    color: var(--sw-gold-bright);
}

/* ── Detailseite ── */
.edb-detail__back {
    display: inline-block;
    color: var(--sw-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.edb-detail__back:hover {
    color: var(--sw-gold-bright);
}

/* Zweispaltig: Bild/Meta links, Beschreibung/Mitglieder rechts - nutzt die volle
   Seitenbreite statt (wie zuvor) alles einspaltig zentriert auf 720px zu quetschen. */
.edb-detail {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    align-items: start;
    gap: 2rem;
}

.edb-detail__image {
    text-align: center;
    margin-bottom: 1.5rem;
}

.edb-detail__image img {
    max-width: 100%;
    border-radius: var(--sw-radius);
    border: 1px solid var(--sw-border-gold);
}

.edb-detail__image p {
    color: var(--sw-text-muted);
    font-style: italic;
}

.edb-detail__edit {
    text-align: center;
    margin-bottom: 1.5rem;
}

.edb-detail__meta p {
    margin: 0 0 0.6rem;
    color: var(--sw-text);
}

.edb-detail__meta strong {
    color: var(--sw-gold-bright);
}

.edb-detail__meta a {
    color: var(--sw-gold-bright);
}

.edb-detail__colors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.edb-detail__colors img {
    width: 140px;
    max-width: 100%;
    border-radius: var(--sw-radius-sm);
    border: 1px solid var(--sw-border-gold);
}

.edb-detail__description {
    padding: 1.5rem;
    background: var(--sw-panel-dark);
    border: 1px solid var(--sw-border-gold);
    border-radius: var(--sw-radius);
    margin-bottom: 2rem;
}

.edb-detail__description > strong {
    display: block;
    color: var(--sw-gold-bright);
    font-family: 'Cinzel', Georgia, serif;
    margin-bottom: 0.75rem;
}

.edb-detail__description p {
    margin: 0 0 0.75rem;
    color: var(--sw-text);
}

.edb-detail__description p:last-child {
    margin-bottom: 0;
}

.edb-detail__description ul,
.edb-detail__description ol {
    margin: 0 0 0.75rem;
    padding-left: 1.5rem;
    color: var(--sw-text);
}

.edb-detail__members h2 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.25rem;
    color: var(--sw-gold-bright);
    margin: 0 0 1.25rem;
}

.edb-detail__members h3 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    color: var(--sw-gold);
    margin: 1.25rem 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--sw-border-gold);
}

.edb-detail__members ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.edb-detail__members li {
    padding: 0.4rem 0;
    color: var(--sw-text);
    font-size: 0.9rem;
}

.edb-detail__members a {
    color: var(--sw-gold-bright);
    text-decoration: none;
}

.edb-detail__members a:hover {
    text-decoration: underline;
}

.edb-detail__members .edb-muted {
    color: var(--sw-text-muted);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .edb-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .edb-search {
        flex-direction: column;
    }

    .edb-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .edb-detail__colors {
        justify-content: center;
    }
}
