/*
 * Das Borbarad-Projekt
 *
 * Responsive re-interpretation of the original 2003 layout: dark red marbled
 * textures, black borders, light grey text and orange-red links.
 */

:root {
    --color-text: #d0d0d0;
    --color-text-strong: #ececec;
    --color-muted: #a8a8a8;
    --color-link: #ff5533;
    --color-link-hover: #ececec;
    --color-accent: #ff3300;
    --color-border: #000;
    --color-input: #500b07;

    --texture-main: url("../images/bg_main-i4SPulf.jpg");
    /* The original content texture is too light for accessible link contrast,
       so it is darkened with a translucent black overlay. */
    --texture-content: linear-gradient(rgb(0 0 0 / 35%), rgb(0 0 0 / 35%)), url("../images/bg_content-GDj1Kjz.jpg");

    --font-body: Verdana, 'DejaVu Sans', 'Bitstream Vera Sans', Geneva, system-ui, sans-serif;
    --radius: 3px;
    --shadow: 0 2px 8px rgb(0 0 0 / 60%);
    --gap: 1rem;
    --sidebar-width: 14rem;
    --content-max-width: 78rem;

    color-scheme: dark;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: #2a0705 var(--texture-main);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.65;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Links ------------------------------------------------------------ */

a {
    color: var(--color-link);
    text-decoration: none;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -10rem;
    left: 1rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--texture-content);
    border: 1px solid var(--color-border);
}

.skip-link:focus {
    top: 1rem;
}

/* --- Page frame ------------------------------------------------------- */

.page {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--gap) var(--gap);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap);
    padding: 1rem 0;
}

.site-header__title {
    display: block;
    line-height: 0;
}

.site-header__title img {
    width: 560px;
}

.nav-toggle {
    display: none;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-areas: 'nav main';
    gap: var(--gap);
    align-items: start;
}

.layout--with-aside {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--sidebar-width);
    grid-template-areas: 'nav main aside';
}

.layout__nav {
    grid-area: nav;
}

.layout__main {
    grid-area: main;
}

.layout__aside {
    grid-area: aside;
}

.panel {
    background: var(--texture-content);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.layout__main {
    padding: 1.25rem 1.5rem;
}

/* --- Navigation ------------------------------------------------------- */

.nav-section {
    padding: 0.75rem 1rem;
}

.nav-section + .nav-section {
    margin-top: var(--gap);
}

.nav-section__title {
    margin: 0 0 0.35rem;
    padding: 0;
    color: var(--color-text-strong);
    font-size: 0.875rem;
    font-weight: bold;
    background: none;
    border: 0;
    border-radius: 0;
}

.nav-section__title a {
    color: inherit;
}

.nav-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
}

.nav-list a {
    display: block;
    padding: 0.15rem 0 0.15rem 1rem;
    position: relative;
}

/* Small red diamond instead of the old "dot.gif" bullet */
.nav-list a::before {
    content: '';
    position: absolute;
    left: 0.1rem;
    top: 0.72em;
    width: 0.4rem;
    height: 0.4rem;
    background: var(--color-accent);
    border: 1px solid var(--color-border);
    transform: rotate(45deg);
}

.nav-list a[aria-current='page'],
.nav-list a[aria-current='true'],
.nav-section__title a[aria-current] {
    color: var(--color-text-strong);
    font-weight: bold;
}

/* --- Footer ----------------------------------------------------------- */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: var(--gap);
    padding: 0.75rem 1.5rem;
    font-size: 0.8125rem;
}

.site-footer p {
    margin: 0;
}

.site-footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- Typography ------------------------------------------------------- */

h1,
h2,
h3 {
    color: var(--color-text-strong);
    font-weight: bold;
    line-height: 1.3;
    background: var(--texture-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

h1 {
    margin: 0 0 1.25rem;
    padding: 0.6rem 1rem;
    font-size: 1.25rem;
    text-align: center;
}

h2 {
    margin: 2rem 0 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 1.0625rem;
}

h3 {
    margin: 1.5rem 0 0.75rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.9375rem;
}

h4 {
    margin: 1.25rem 0 0.5rem;
    color: var(--color-text-strong);
    font-size: 0.9375rem;
}

p,
ul,
ol,
dl {
    margin: 0 0 1em;
}

main p {
    hyphens: auto;
}

.text-center {
    text-align: center;
}

.text-small {
    font-size: 0.8125rem;
}

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

.logo {
    display: block;
    margin: 1.5rem auto;
}

.columns {
    columns: 16rem;
    column-gap: 2rem;
}

.columns > li {
    break-inside: avoid;
}

.back-to-top {
    display: inline-block;
    font-size: 0.8125rem;
}

.notice {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    background: rgb(0 0 0 / 30%);
}

/* Spoiler box for game master information ("Meisterinformationen"): the
   content stays hidden until the button (the summary) opens it. */
.mi {
    margin: 0 0 1em;
}

.mi > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: rgb(0 0 0 / 30%);
    font-size: 0.875em;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.mi > summary::-webkit-details-marker {
    display: none;
}

.mi > summary::before {
    content: "▸" / "";
    transition: transform 0.15s;
}

.mi > summary::after {
    content: "anzeigen";
    opacity: 0.75;
}

.mi[open] > summary::before {
    transform: rotate(90deg);
}

.mi[open] > summary::after {
    content: "verbergen";
}

.mi > summary:hover,
.mi > summary:focus-visible {
    border-color: var(--color-accent);
}

.mi[open] > summary {
    border-color: rgb(255 51 0 / 60%);
}

/* Dark like the rest of the page; the dashed border sets it apart from
   quotes (solid bar on the left). */
.mi__content {
    margin-top: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgb(0 0 0 / 45%);
    color: var(--color-text-strong);
    border: 1px dashed rgb(255 51 0 / 60%);
    border-radius: var(--radius);
}

blockquote {
    margin: 0 0 1em;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    background: rgb(0 0 0 / 20%);
}

/* --- Pages and chapters ----------------------------------------------- */

.section-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
}

.section-nav a {
    display: block;
    padding: 0.25rem 0.75rem;
    background: var(--texture-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.section-nav a[aria-current='page'] {
    color: var(--color-text-strong);
    font-weight: bold;
    text-decoration: none;
}

.byline {
    margin-top: -0.75rem;
    color: var(--color-muted);
    font-size: 0.8125rem;
    text-align: center;
}

.toc {
    margin: 0 0 1.5rem;
    padding: 0.75rem 1rem;
    background: rgb(0 0 0 / 25%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.toc__title {
    margin: 0 0 0.5rem;
    padding: 0;
    font-size: 0.9375rem;
    background: none;
    border: 0;
}

.toc ol {
    margin: 0;
    padding-left: 1.75rem;
    columns: 18rem;
    column-gap: 2rem;
    font-size: 0.875rem;
}

.toc li {
    break-inside: avoid;
}

.toc a[aria-current='page'] {
    color: var(--color-text-strong);
    font-weight: bold;
}

.chapter::after {
    content: '';
    display: block;
    clear: both;
}

.chapter-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--gap);
    margin-top: 2rem;
}

.chapter-nav a {
    display: flex;
    flex-direction: column;
    max-width: 48%;
    padding: 0.5rem 0.75rem;
    background: var(--texture-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.chapter-nav a:hover {
    text-decoration: none;
}

.chapter-nav__next {
    margin-left: auto;
    text-align: right;
}

/* Boxes of the old style sheet: a highlighted title line ("entry-title")
   followed by one or more bordered text blocks ("entry-text"). */
.entry-title {
    margin: 1.25rem 0 0;
    padding: 0.35rem 0.6rem;
    background: var(--texture-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.entry-text {
    margin: 0;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--color-border);
    border-top: 0;
}

.entry-text + :not(.entry-text) {
    margin-top: 1em;
}

/* Descriptions of downloads are HTML with their own paragraphs. */
.download .entry-text > :first-child {
    margin-top: 0;
}

.download .entry-text > :last-child {
    margin-bottom: 0;
}

.indented {
    margin-inline: 1.5rem;
}

.hanging-indent {
    margin-block: 0 0.35em;
    padding-left: 1.5rem;
    text-indent: -1.5rem;
}

.verse {
    margin-inline: 1.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: rgb(0 0 0 / 15%);
}

.quote {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    background: rgb(0 0 0 / 20%);
}

.text-right {
    text-align: right;
}

.text-bold {
    font-weight: bold;
}

.float-left {
    float: left;
    margin: 0 0.75rem 0.5rem 0;
    border: 1px solid #300;
}

main img {
    max-width: 100%;
    height: auto;
}

main table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

main td,
main th {
    padding: 0.25rem 0.5rem;
    vertical-align: top;
}

/* --- Adventures ------------------------------------------------------- */

.adventure {
    display: flex;
    flex-wrap: wrap-reverse;
    align-items: flex-start;
    gap: 1rem 1.5rem;
}

.adventure__details {
    flex: 1 1 18rem;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0;
}

.adventure__details dt {
    color: var(--color-muted);
}

.adventure__details dd {
    margin: 0;
}

.adventure__cover {
    flex: 0 0 auto;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

/* --- Forms ------------------------------------------------------------ */

input,
select,
textarea,
button {
    font: inherit;
}

input:not([type='checkbox'], [type='radio']),
select,
textarea {
    width: 100%;
    max-width: 40rem;
    padding: 0.35rem 0.5rem;
    background: var(--color-input);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

button,
.button {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: var(--texture-main);
    color: var(--color-accent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
}

button:hover,
.button:hover {
    color: var(--color-link-hover);
    text-decoration: none;
}

/* Formatting toolbar of BBCode text areas (see bbcode_toolbar.js) */
.bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.bbcode-toolbar__button {
    min-width: 2rem;
    padding: 0.1rem 0.5rem;
}

.bbcode-toolbar__bold {
    font-weight: bold;
}

.bbcode-toolbar__italic {
    font-style: italic;
}

/* Dialog of the toolbar for links */
.bbcode-dialog {
    width: min(92vw, 30rem);
    padding: 1rem 1.25rem;
    background: var(--texture-main);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.bbcode-dialog::backdrop {
    background: rgb(0 0 0 / 70%);
}

.bbcode-dialog__title {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.bbcode-dialog label {
    display: block;
    margin-top: 0.5rem;
}

.bbcode-dialog__help {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
}

.bbcode-dialog__buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* --- Tablet: right sidebar moves below the left navigation ---------- */

@media (max-width: 70rem) {
    .layout--with-aside {
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
        grid-template-areas:
            'nav main'
            'aside main';
    }
}

/* --- Mobile: single column, navigation in a collapsible menu --------- */

@media (max-width: 48rem) {
    .page {
        padding: 0 0.5rem 0.5rem;
    }

    .site-header {
        justify-content: space-between;
        padding: 0.75rem 0;
    }

    .site-header__title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 0.4rem;
    }

    .nav-toggle[hidden] {
        display: none;
    }

    .nav-toggle__icon,
    .nav-toggle__icon::before,
    .nav-toggle__icon::after {
        display: block;
        width: 1.1rem;
        height: 2px;
        background: currentcolor;
        transition: transform 0.2s ease;
    }

    .nav-toggle__icon {
        position: relative;
    }

    .nav-toggle__icon::before,
    .nav-toggle__icon::after {
        content: '';
        position: absolute;
        left: 0;
    }

    .nav-toggle__icon::before {
        top: -0.35rem;
    }

    .nav-toggle__icon::after {
        top: 0.35rem;
    }

    .nav-toggle[aria-expanded='true'] .nav-toggle__icon {
        background: transparent;
    }

    .nav-toggle[aria-expanded='true'] .nav-toggle__icon::before {
        transform: translateY(0.35rem) rotate(45deg);
    }

    .nav-toggle[aria-expanded='true'] .nav-toggle__icon::after {
        transform: translateY(-0.35rem) rotate(-45deg);
    }

    .layout,
    .layout--with-aside {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            'nav'
            'aside'
            'main';
        gap: 0.5rem;
    }

    /* Without JavaScript the navigation simply stays visible above the
       content; with JavaScript it is collapsed until the toggle is used. */
    .js-navigation .layout__nav:not(.is-open),
    .js-navigation .layout__aside:not(.is-open) {
        display: none;
    }

    .nav-section + .nav-section {
        margin-top: 0.5rem;
    }

    .nav-list {
        font-size: 0.9375rem;
    }

    .nav-list a {
        padding-block: 0.35rem;
    }

    .layout__main {
        padding: 1rem;
    }

    h1 {
        font-size: 1.125rem;
    }

    .site-footer {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Downloads --------------------------------------------------------- */

.download,
.news-entry {
    margin-bottom: 1.25rem;
}

/* The titles of downloads and news are headings for the document outline,
   but look like the entry titles of the old website. */
.download__title,
.news-entry > .entry-title {
    margin: 0;
    padding: 0.35rem 0.6rem;
    font-size: inherit;
    font-weight: normal;
    text-align: left;
    border-radius: var(--radius) var(--radius) 0 0;
}

.download-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.download-list li {
    margin-bottom: 0.2rem;
}

.download-list .text-small {
    white-space: nowrap;
}

/* --- Forms and notices ------------------------------------------------- */

.form {
    max-width: 40rem;
    margin-bottom: 1.5rem;
}

/* Rows of the form themes (Symfony's div layout and hand-written forms) */
.form > div > div,
.form__row {
    margin-bottom: 1rem;
}

.form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

/* Checkboxes come before their label (Symfony renders the label first). */
.form__row--checkbox,
.form div:has(> input[type='checkbox']) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.form div:has(> input[type='checkbox']) > input[type='checkbox'] {
    order: -1;
}

.form div:has(> input[type='checkbox']) > label,
.form__row--checkbox label {
    flex: 1 1 0;
    margin: 0;
    font-weight: normal;
}

.form div:has(> input[type='checkbox']) > ul {
    flex-basis: 100%;
}

.form .help-text,
.form [id$='_help'] {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
}

.form ul {
    margin: 0.25rem 0;
    padding: 0;
    list-style: none;
    color: #ff8a70;
    font-size: 0.875rem;
}

.notice--success {
    border-color: #6a9a4a;
}

.notice--error {
    border-color: var(--color-accent);
    color: var(--color-text-strong);
}

.details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0 0 1.5rem;
}

.details dt {
    color: var(--color-muted);
}

.details dd {
    margin: 0;
}

/* --- Forums ------------------------------------------------------------- */

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
}

.breadcrumb li + li::before {
    content: '›';
    margin-right: 0.25rem;
    color: var(--color-muted);
}

.forum-summary h2 {
    margin: 1.25rem 0 0;
    font-size: inherit;
    text-align: left;
}

.forum-summary .entry-text p:last-child {
    margin-bottom: 0;
}

.thread-list {
    display: table;
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
}

.thread-list th {
    padding: 0.4rem 0.5rem;
    background: var(--texture-main);
    text-align: left;
    font-size: 0.8125rem;
}

.thread-list td {
    padding: 0.4rem 0.5rem;
    border-top: 1px solid var(--color-border);
}

.thread-list td:first-child a {
    display: block;
}

.thread-list__count {
    text-align: center;
}

.thread-list__label {
    display: none;
}

.post {
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.post__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    padding: 0.35rem 0.6rem;
    background: var(--texture-main);
    border-bottom: 1px solid var(--color-border);
}

.post__author {
    font-weight: bold;
    color: var(--color-text-strong);
}

.post__badge {
    vertical-align: -2px;
}

.post__meta {
    margin-left: auto;
}

.post__content {
    padding: 0.6rem;
    overflow-wrap: anywhere;
}

.post__content .quote {
    margin: 0.5rem 0;
}

.pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
}

.pagination a,
.pagination span {
    display: block;
    min-width: 2rem;
    padding: 0.15rem 0.5rem;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.pagination [aria-current='page'] {
    background: var(--texture-main);
    color: var(--color-text-strong);
    font-weight: bold;
}

.pagination .pagination__gap {
    border-color: transparent;
}

@media (max-width: 48rem) {
    .thread-list,
    .thread-list tbody,
    .thread-list tr,
    .thread-list td {
        display: block;
    }

    .thread-list thead {
        display: none;
    }

    .thread-list tr {
        border-top: 1px solid var(--color-border);
        padding: 0.4rem 0.5rem;
    }

    .thread-list td {
        padding: 0.1rem 0;
        border: 0;
        text-align: left;
        font-size: 0.8125rem;
    }

    .thread-list td:first-child {
        font-size: 0.9375rem;
    }

    .thread-list__label {
        display: inline;
        color: var(--color-muted);
    }
}

/* --- Writing in the forums --------------------------------------------- */

.form--wide {
    max-width: none;
}

.form--wide textarea {
    max-width: none;
    min-height: 10rem;
    resize: vertical;
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding: 0.25rem 0.6rem;
    border-top: 1px solid var(--color-border);
}

.post__actions {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

.post-preview__title {
    font-weight: bold;
    color: var(--color-text-strong);
}

.reply {
    margin-top: 1.5rem;
}

.button--danger {
    border-color: var(--color-accent);
    color: var(--color-text-strong);
}

.badge {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0 0.4rem;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    color: var(--color-text-strong);
    font-size: 0.75rem;
    font-weight: bold;
    vertical-align: 1px;
}

/* --- Quotes and guestbook ---------------------------------------------- */

.quote-entry__text {
    font-style: italic;
}

.guestbook-reply {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--color-accent);
    background: var(--texture-main);
}

/* --- Polls ------------------------------------------------------------- */

.poll-list {
    columns: 2 18rem;
    padding-left: 1.25rem;
}

.poll {
    margin-bottom: 1.5rem;
}

.poll__question {
    font-size: 1.05rem;
}

.poll__options {
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}

.poll__option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(6rem, 12rem) 9rem;
    gap: 0.25rem 0.75rem;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--color-border);
}

.poll__bar {
    height: 0.7rem;
    background: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.poll__bar span {
    display: block;
    height: 100%;
    background: var(--color-accent);
}

.poll__votes {
    font-size: 0.8125rem;
    text-align: right;
    color: var(--color-muted);
}

@media (max-width: 48rem) {
    .poll__option {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .poll__label {
        grid-column: 1 / -1;
    }
}

/* --- Lightbox (gallery) -------------------------------------------------- */

.lightbox {
    max-width: min(95vw, 70rem);
    max-height: 95vh;
    padding: 0.75rem;
    background: var(--texture-main);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.lightbox::backdrop {
    background: rgb(0 0 0 / 80%);
}

.lightbox__figure {
    margin: 0;
    text-align: center;
}

.lightbox__figure img {
    max-width: 100%;
    max-height: calc(95vh - 5rem);
    object-fit: contain;
}

.lightbox__figure figcaption {
    margin-top: 0.5rem;
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    padding: 0.1rem 0.6rem;
    font-size: 1.5rem;
    line-height: 1;
}

.lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
}

.lightbox__nav--previous {
    top: 50%;
    left: 0.5rem;
}

.lightbox__nav--next {
    top: 50%;
    right: 0.5rem;
}

/* --- Search ------------------------------------------------------------- */

/* Honeypot of the contact form: invisible for people, filled in by bots */
.contact-form__trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.nav-search {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.nav-search input {
    flex: 1 1 auto;
    min-width: 0;
}

/* Areas of the search page: a dropdown with checkboxes (<details>), see
   search_filter_controller.js */
.search-form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.search-filter {
    position: relative;
    max-width: 100%;
}

.search-filter > summary {
    display: flex;
    align-items: center;
    gap: 0.4em;
    max-width: min(28rem, 100%);
    padding: 0.35rem 0.6rem;
    background: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.search-filter > summary::-webkit-details-marker {
    display: none;
}

.search-filter > summary > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-filter > summary::after {
    content: "▾" / "";
    margin-left: auto;
    padding-left: 0.4em;
}

.search-filter > summary:hover,
.search-filter > summary:focus-visible,
.search-filter[open] > summary {
    border-color: var(--color-accent);
}

.search-filter__options {
    position: absolute;
    z-index: 10;
    top: calc(100% + 0.25rem);
    left: 0;
    min-width: 14rem;
    margin: 0;
    padding: 0.4rem 0;
    background: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form .search-filter__options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.25rem 0.75rem;
    font-weight: normal;
    cursor: pointer;
}

.form .search-filter__options label:hover {
    background: rgb(0 0 0 / 30%);
    color: var(--color-text-strong);
}

.search-filter__options input {
    accent-color: var(--color-accent);
}

.search-area {
    margin-bottom: 1.5rem;
}

.search-hit {
    margin-bottom: 1rem;
}

.search-hit__title {
    margin: 0;
    font-size: 1rem;
}

.search-hit__meta,
.search-hit__excerpt {
    margin: 0.15rem 0 0;
}

mark {
    padding: 0 0.1em;
    background: rgb(204 51 34 / 45%);
    color: var(--color-text-strong);
    border-radius: 2px;
}
