/* RPG Lexikon – Frontend stylesheet
 * Light style with fixed colours.
 * Accent: purple #7f5d92
 */

.rpglex-wrap {
    max-width: 1120px;
    margin: 28px auto 45px;
    padding: 0 16px;
    box-sizing: border-box;
    color: #383438;
}

.rpglex-wrap *,
.rpglex-tooltip {
    box-sizing: border-box;
}

.rpglex-wrap a {
    color: #6f4d82;
}

.rpglex-wrap a:hover {
    color: #5f406f;
}

.rpglex-topbar {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 14px;
    background: #e4e4e4;
    border: 1px solid #9d999d;
}

.rpglex-search {
    position: relative;
    flex: 1 1 380px;
}

.rpglex-search input,
.rpglex-field input[type="text"],
.rpglex-field input[type="url"],
.rpglex-field textarea,
.rpglex-field select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #aaa6aa;
    background: #f3f3f3;
    color: #383438;
    font: inherit;
    outline: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.rpglex-search input:focus,
.rpglex-field input[type="text"]:focus,
.rpglex-field input[type="url"]:focus,
.rpglex-field textarea:focus,
.rpglex-field select:focus {
    border-color: #7f5d92;
    background: #f8f8f8;
    outline: 2px solid #d7cbdc;
    outline-offset: 1px;
}

.rpglex-search input::placeholder,
.rpglex-field textarea::placeholder,
.rpglex-field input::placeholder {
    color: #817b80;
    opacity: 1;
}

.rpglex-search-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    max-height: 430px;
    overflow: auto;
    background: #f3f3f3;
    border: 1px solid #aaa6aa;
}

.rpglex-search-results.is-open {
    display: block;
}

.rpglex-search-item {
    display: block;
    padding: 11px 13px;
    border-bottom: 1px solid #d1ced1;
    color: #383438 !important;
    text-decoration: none;
    transition: background-color .15s ease;
}

.rpglex-search-item:last-child {
    border-bottom: 0;
}

.rpglex-search-item:hover,
.rpglex-search-item.is-active {
    background: #ebe7ed;
}

.rpglex-search-item strong {
    display: block;
    margin-bottom: 3px;
    color: #6f4d82;
}

.rpglex-search-item small {
    display: block;
    margin-bottom: 4px;
    color: #6d676c;
}

.rpglex-nav,
.rpglex-actions,
.rpglex-checks,
.rpglex-chips,
.rpglex-alphabet,
.rpglex-meta {
    display: flex;
    flex-wrap: wrap;
}

.rpglex-nav {
    gap: 8px;
}

.rpglex-actions {
    gap: 8px;
    margin-top: 14px;
}

.rpglex-checks {
    gap: 7px 15px;
}

.rpglex-chips {
    gap: 6px;
    margin: 10px 0;
}

.rpglex-meta {
    gap: 8px 14px;
    color: #6d676c;
    font-size: .88rem;
}

.rpglex-btn,
.rpglex-nav a {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #aaa6aa;
    background: #efefef;
    color: #454045 !important;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.rpglex-btn:hover,
.rpglex-nav a:hover {
    background: #ebe7ed;
    border-color: #92739f;
    color: #5f406f !important;
}

.rpglex-btn-primary {
    border-color: #7f5d92;
    background: #7f5d92;
    color: #ffffff !important;
    font-weight: 700;
}

.rpglex-btn-primary:hover {
    background: #735486;
    border-color: #735486;
    color: #ffffff !important;
}

.rpglex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.rpglex-card,
.rpglex-form,
.rpglex-article {
    border: 1px solid #aaa6aa;
    background: #e7e7e7;
}

.rpglex-card {
    padding: 18px;
}

.rpglex-card h1,
.rpglex-card h2,
.rpglex-card h3,
.rpglex-card h4,
.rpglex-article h1,
.rpglex-article h2,
.rpglex-article h3,
.rpglex-article h4,
.rpglex-section > h2,
.rpglex-section-title h2,
.rpglex-section-title h3 {
    color: #7f5d92;
}

.rpglex-card h2,
.rpglex-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.rpglex-card p:last-child {
    margin-bottom: 0;
}

.rpglex-card-link,
.rpglex-category-card {
    display: block;
    color: #383438 !important;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.rpglex-card-link:hover,
.rpglex-category-card:hover {
    background: #ebe7ed;
    border-color: #92739f;
    color: #383438 !important;
}

.rpglex-category-card {
    border-top: 3px solid #7f5d92;
}

.rpglex-section {
    margin: 24px 0;
}

.rpglex-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.rpglex-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rpglex-list-item {
    display: block;
    padding: 12px 14px;
    border: 1px solid #aaa6aa;
    background: #e7e7e7;
    color: #383438 !important;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.rpglex-list-item:hover {
    background: #ebe7ed;
    border-color: #92739f;
}

.rpglex-list-item strong {
    display: block;
    color: #6f4d82;
}

.rpglex-list-item small {
    color: #6d676c;
}

.rpglex-alphabet {
    gap: 6px;
}

.rpglex-alphabet a {
    min-width: 31px;
    padding: 7px 6px;
    border: 1px solid #aaa6aa;
    background: #efefef;
    color: #454045 !important;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.rpglex-alphabet a:hover {
    background: #ebe7ed;
    border-color: #92739f;
    color: #5f406f !important;
}

.rpglex-article {
    overflow: hidden;
}

.rpglex-article-image {
    display: block;
    width: 100%;
    max-height: 430px;
    object-fit: cover;
    border-bottom: 1px solid #aaa6aa;
}

.rpglex-article-head {
    padding: 24px 26px 16px;
    border-bottom: 1px solid #c2bec2;
    background: #dedede;
}

.rpglex-article-head h1 {
    margin: 0 0 9px;
    font-size: 2rem;
    line-height: 1.15;
}

.rpglex-article-body {
    padding: 26px;
    color: #383438;
    line-height: 1.75;
    text-align: justify;
}

.rpglex-article-body img {
    max-width: 100%;
    height: auto;
}

.rpglex-article-body a {
    color: #6f4d82;
}

.rpglex-article-body blockquote {
    margin: 18px 0;
    padding: 12px 16px;
    border-left: 3px solid #7f5d92;
    background: #efedef;
    color: #454045;
}

.rpglex-status,
.rpglex-question-state {
    display: inline-block;
    border: 1px solid #aaa6aa;
    background: #efefef;
    color: #4a4549;
}

.rpglex-status {
    padding: 4px 8px;
    font-size: .78rem;
}

.rpglex-question-state {
    padding: 3px 7px;
    font-size: .78rem;
}

.rpglex-warning {
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid #92739f;
    border-left: 3px solid #7f5d92;
    background: #efedef;
    color: #383438;
}

.rpglex-hiddenwarn {
    border-color: #9b5a5a;
    border-left: 3px solid #9b5a5a;
}

.rpglex-chip {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid #aaa6aa;
    background: #efefef;
    color: #4a4549 !important;
    text-decoration: none;
    font-size: .82rem;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.rpglex-chip:hover {
    border-color: #92739f;
    background: #ebe7ed;
    color: #5f406f !important;
}

.rpglex-cat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    vertical-align: middle;
    background: #7f5d92;
}

.rpglex-faq {
    padding: 14px 0;
    border-top: 1px solid #c2bec2;
}

.rpglex-faq:first-child {
    border-top: 0;
}

.rpglex-faq summary {
    color: #6f4d82;
    cursor: pointer;
    font-weight: 700;
}

.rpglex-faq summary:hover {
    color: #5f406f;
}

.rpglex-faq-answer {
    padding: 10px 0 0;
    color: #383438;
    line-height: 1.65;
}

.rpglex-form {
    padding: 21px;
}

.rpglex-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.rpglex-field {
    margin-bottom: 15px;
}

.rpglex-field label {
    display: block;
    margin-bottom: 6px;
    color: #5f406f;
    font-weight: 700;
}

.rpglex-field textarea {
    min-height: 120px;
    resize: vertical;
}

.rpglex-field textarea.rpglex-editor {
    min-height: 420px;
    font-family: Consolas, Monaco, monospace;
}

.rpglex-field select option {
    background: #f3f3f3;
    color: #383438;
}

.rpglex-help {
    display: block;
    margin-top: 5px;
    color: #6d676c;
    font-size: .82rem;
}

.rpglex-questionbox {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #c2bec2;
}

.rpglex-empty {
    padding: 23px;
    border: 1px dashed #aaa6aa;
    background: #efefef;
    color: #6d676c;
    text-align: center;
}

.rpglex-columns {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr);
    gap: 18px;
}

.rpglex-side .rpglex-card {
    margin-bottom: 16px;
}

.rpglex-inlineform {
    display: inline;
}

.rpglex-relations ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.rpglex-relations li {
    margin: 4px 0;
}

.rpglex-fav-on {
    border-color: #7f5d92;
    color: #6f4d82 !important;
    font-weight: 700;
    background: #ebe7ed;
}

.rpglex-danger {
    border-color: #9b5a5a !important;
    color: #874646 !important;
}

.rpglex-danger:hover {
    background: #f0e5e5 !important;
    border-color: #874646 !important;
    color: #743b3b !important;
}

.rpglex-pinned {
    display: inline-block;
    margin-bottom: 7px;
    color: #6f4d82;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
}

/* Automatic lexicon links – also used in ordinary forum posts. */
.rpglex-link {
    color: #6f4d82 !important;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.rpglex-link:hover {
    color: #5f406f !important;
}

.rpglex-missing {
    color: #777176;
    border-bottom: 1px dashed #8c868b;
}

.rpglex-ambiguous {
    border-bottom: 1px dotted #7f5d92;
}

.rpglex-tooltip {
    position: fixed;
    z-index: 99999;
    max-width: 340px;
    padding: 12px 14px;
    border: 1px solid #928d92;
    background: #f3f3f3;
    color: #383438;
    font-size: 13px;
    line-height: 1.45;
    pointer-events: none;
}

.rpglex-tooltip strong {
    display: block;
    margin-bottom: 5px;
    color: #6f4d82;
    font-size: 14px;
}

.rpglex-tooltip small {
    display: block;
    margin-top: 6px;
    color: #6d676c;
}

@media (max-width: 760px) {
    .rpglex-wrap {
        padding: 0 10px;
    }

    .rpglex-columns,
    .rpglex-form-grid {
        grid-template-columns: 1fr;
    }

    .rpglex-article-head,
    .rpglex-article-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .rpglex-topbar {
        align-items: stretch;
    }

    .rpglex-nav {
        width: 100%;
    }
}
