/* Game description styles: the look of the staff-written texts on a game page and a group page.
   - Every rule begins with ".description-body ", the class of the element that holds the text.
   - Colours are the design system names (var(--color-text), var(--color-border), ...), so dark and light both work.
   - The class names below come from the texts themselves. Do not rename them.
   - How a section opens and closes is done by the page itself; this block decides only how it looks. */

/* ---------- title and intro: at the left edge, as the sections are ---------- */

.description-body .description_container {
    max-width: none;
    margin: 0;
    padding: 0;
}

.description-body .header {
    margin: 0;
    padding-bottom: var(--space-4);
    text-align: start;
}

/* The fading line of the site, under the intro. */
.description-body .header::after {
    content: "";
    display: block;
    height: 1px;
    margin-top: var(--space-4);
    background: var(--line);
}

.description-body .description_title {
    margin: 0;
    white-space: normal;
}

.description-body h1 {
    margin: 0;
    color: var(--color-text);
    font-size: var(--fs-h1);
    font-weight: 300;
    line-height: 1.25;
    text-wrap: balance;
}

.description-body h1 .lighter {
    display: block;
    margin-top: var(--space-1);
    color: var(--color-text-muted);
    font-size: var(--fs-h3);
}

/* The intro in two columns on a wide screen, as a section text is. */
.description-body .description_desc {
    max-width: none;
    margin: var(--space-3) 0 0;
    columns: 2;
    column-gap: var(--space-6);
    color: var(--color-text-muted);
    font-size: var(--fs-body);
    line-height: 1.7;
}

/* ---------- running text ---------- */

.description-body p {
    margin: 0 0 1em;
}

.description-body p:last-child,
.description-body ul:last-child,
.description-body ol:last-child {
    margin-bottom: 0;
}

.description-body strong,
.description-body b {
    color: var(--color-text);
    font-weight: 700;
}

.description-body a {
    color: var(--color-accent-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}

.description-body a:hover {
    color: var(--color-text);
}

.description-body ul,
.description-body ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

.description-body li {
    margin: 0 0 .4em;
}

.description-body li::marker {
    color: var(--color-accent-text);
}

/* A heading in the running text, not on a section bar. */
.description-body h2,
.description-body h3 {
    margin: 1.4em 0 .5em;
    color: var(--color-text);
    font-size: var(--fs-h2);
    font-weight: 300;
    line-height: 1.3;
}

.description-body h3 {
    font-size: var(--fs-h3);
}

/* ---------- a section: a card as wide as the page ---------- */

.description-body .description_accordion {
    width: auto;
    margin: 0 0 var(--space-2);
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    background: var(--color-card);
}

/* A closed section lights up under the pointer. An open one keeps its quiet edge: its filled diamond says it is open. */
.description-body .description_accordion:hover {
    border-color: var(--color-border-active);
}

.description-body input:checked + .description_accordion {
    border-color: var(--color-border);
}

.description-body .accordion_title_wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
}

.description-body .accordion_title_wrapper .title {
    flex: 1;
    min-width: 0;
    padding: 0;
    font-size: inherit;
}

.description-body .accordion_title_wrapper h1,
.description-body .accordion_title_wrapper h2 {
    margin: 0;
    padding: 0;
    color: var(--color-text);
    font-size: var(--fs-h3);
    font-weight: 300;
    line-height: 1.35;
    text-align: start;
}

/* The diamond before a section title: empty when closed, filled when open. */
.description-body .accordion_title_wrapper .icon {
    display: block;
    flex: none;
    order: -1;
    width: 12px;
    height: 12px;
    margin: 0 var(--space-1);
    border: 1px solid var(--color-border-active);
    font-style: normal;
    transform: rotate(45deg);
    transition: background var(--ease), box-shadow var(--ease);
}

.description-body .accordion_title_wrapper .icon::before {
    content: none;
}

.description-body input:checked + .description_accordion .accordion_title_wrapper .icon {
    background: var(--color-accent-bright);
    box-shadow: var(--glow);
}

/* An open section: its text in two columns on a wide screen, so the lines stay short. */
.description-body .accordian_description {
    columns: 2;
    column-gap: var(--space-6);
    column-rule: 1px solid var(--color-border);
}

.description-body .accordian_description li {
    break-inside: avoid;
}

/* A paragraph is not cut in two by the column break. A section of one paragraph may be, or its second column would stand empty. */
.description-body .accordian_description p:not(:only-child) {
    break-inside: avoid;
}

/* A heading stays with what it heads, in the same column. */
.description-body .accordian_description h2,
.description-body .accordian_description h3,
.description-body .accordian_description h4 {
    break-after: avoid;
}

.description-body input:checked + .description_accordion .accordian_description {
    padding-bottom: var(--space-4);
}

/* ---------- a text without sections: one column of reading width ---------- */

.description-body > :not(.description_container) {
    max-width: 46rem;
    margin-right: auto;
    margin-left: auto;
}

/* ---------- styling typed into a text, brought into both themes ---------- */

.description-body [style*="font-family"] {
    font-family: inherit !important;
}

.description-body [style*="justify"] {
    text-align: start !important;
}

.description-body hr {
    height: 1px !important;
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
    border: 0 !important;
    background: var(--line) !important;
}

/* The small rounded tags. */
.description-body span[style*="border-radius:999px"] {
    border-color: var(--color-border) !important;
    color: var(--color-text);
}

.description-body span[style*="#4a90d9"] {
    border-color: var(--color-border-active) !important;
    color: var(--color-accent-text);
}

.description-body div[style*="background-color"] {
    border-radius: 0 !important;
    background-color: var(--color-panel) !important;
}

.description-body a[style] {
    color: var(--color-accent-text) !important;
    text-decoration: underline !important;
}

.description-body span[style*="rgb(61, 142, 185)"],
.description-body [style*="#1d73bc"] {
    color: var(--color-accent-text) !important;
}

/* ---------- Wowhead links: an item keeps the colour of its quality ---------- */

/* Wowhead marks a link to an item with the quality of the item: q0 poor, q1 common, q2 uncommon, q3 rare, q4 epic,
   q5 legendary, q6 artifact, q7 and q8 heirloom. In light-dark() the first colour is for the light theme and the
   second for the dark one: Wowhead's own colour on dark (rare and epic a little brighter, to be read on this
   ground), a deeper shade of it on light. A common item is white at Wowhead: here it has the text colour. */
.description-body a.q0 {
    color: light-dark(#616266, #9d9d9d) !important;
}

.description-body a.q1 {
    color: var(--color-text) !important;
}

.description-body a.q2 {
    color: light-dark(#1a7115, #1eff00) !important;
}

.description-body a.q3 {
    color: light-dark(#0461bd, #378de1) !important;
}

.description-body a.q4 {
    color: light-dark(#8d31cd, #b765ee) !important;
}

.description-body a.q5 {
    color: light-dark(#945110, #ff8000) !important;
}

.description-body a.q6 {
    color: light-dark(#696148, #e5cc80) !important;
}

.description-body a.q7,
.description-body a.q8 {
    color: light-dark(#0d6a85, #00ccff) !important;
}

/* ---------- narrow screens ---------- */

@media (max-width: 62rem) {
    .description-body .description_desc,
    .description-body .accordian_description {
        columns: 1;
    }

    .description-body .description_accordion {
        padding: 0 var(--space-3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .description-body .accordion_title_wrapper .icon {
        transition: none;
    }
}
