/* Rules: a board's (Pages/Shared/_Rules.cshtml, at the top of the board's page and above
   its new-thread and reply forms), the community's page (/rules), and the link boards on
   the index (Shared/_BoardRow). Only the custom properties from site.css. */

/* ---- A board's rules: a box that folds to one line ---- */
.rules-box {
    margin: 0 0 16px;
    background: var(--surface);
    border: 1px solid var(--card-line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--elev-1);
}
.rules-summary {
    display: flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 8px 14px;
    cursor: pointer; list-style: none;
    font-family: var(--font-heading); font-weight: 700; color: var(--ink);
    border-radius: var(--radius);
}
.rules-summary::-webkit-details-marker { display: none; }
.rules-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rules-mark { flex: none; color: var(--accent); }
.rules-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rules-chevron { flex: none; color: var(--muted); transition: transform 0.15s var(--ease); }
.rules-box[open] > .rules-summary .rules-chevron { transform: rotate(180deg); }
.rules-box[open] > .rules-summary { border-bottom: 1px solid var(--line-soft); border-radius: var(--radius) var(--radius) 0 0; }
.rules-body { padding: 4px 16px 14px; overflow-wrap: anywhere; }
.rules-body > :first-child { margin-top: 10px; }
.rules-body > :last-child { margin-bottom: 0; }

/* A long set of rules scrolls inside its box on a wide screen, so the threads stay near. */
@media (min-width: 640px) {
    .rules-body { max-height: 22rem; overflow-y: auto; }
}

/* On a phone-sized screen a folding box is folded by js/rules.js; until it has run, its
   words are not drawn, so they never show for a moment and vanish. */
@media (max-width: 639.98px) {
    html.js .rules-box[data-rules-fold="yes"]:not([data-rules-ready]) > .rules-body { display: none; }
}

/* Above a reply or the new-thread form: a little room before the form. */
.compose > .rules-box { margin-bottom: 14px; }

/* ---- The community's rules page, /rules ---- */
.rules-page { padding: 18px 18px 22px; }
.rules-page-updated { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
@media (min-width: 640px) {
    .rules-page { padding: 24px 28px 28px; }
}

/* ---- A board that is only a link, on the index (Shared/_BoardRow) ---- */
.board-link-mark { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--muted); }
.board-link-site { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); overflow-wrap: anywhere; }
.board-link-site svg { flex: none; }

