/* Projektweite Ergänzungen zum BooksOnline-Design (Tokens und bo-Komponenten liegen unter styles/design/). */
html {
    background: var(--surface-100);
}

body {
    margin: 0;
}

.bo-skip-link {
    position: absolute;
    left: -9999px;
}

.bo-skip-link:focus {
    left: var(--space-3);
    top: var(--space-3);
    z-index: 10;
    padding: var(--space-2) var(--space-3);
    background: var(--surface-200);
    color: var(--ink);
    outline: 3px solid var(--accent-ink);
}

/* Die Vorschauen des Design-Systems setzen diese Werte inline. */
.bo-row__author {
    display: block;
}

.bo-night .bo-stand {
    color: var(--on-night-body);
}

.bo-hero .bo-circle--1 {
    left: 46%;
    top: 56px;
}

.bo-hero .bo-circle--2 {
    left: 52%;
    top: 300px;
}

/* Die Navigation trägt alle Listen einer Domain und darf umbrechen. */
.bo-header .bo-nav {
    flex-wrap: wrap;
}

/* Hinweis, solange eine Liste noch keinen Import hat. */
.bo-empty {
    padding: var(--space-3) 0;
    color: var(--ink-muted);
}

/* Längere Site-Namen als „BookOnline“ passen mobil nicht in die halbe Footer-Spalte des Systems. */
@media (max-width: 480px) {
    .bo-footer__top {
        grid-template-columns: 1fr;
    }
}

/* Zehn Genre-Kacheln: etwas niedriger als die 280 px des Systems, damit die Übersicht kompakt bleibt. */
.bo-genres .bo-genre {
    min-height: 220px;
}

/* Rechtstexte (Impressum, Datenschutz): linksbündig unter dem Seitenkopf, Zeilen höchstens 760 px. */
.bo-legal > * {
    max-width: 760px;
}

.bo-legal h2 {
    font-size: 22px;
    line-height: 28px;
    font-weight: 700;
    letter-spacing: -0.8px;
    margin: var(--space-5) 0 var(--space-3);
}

.bo-legal p,
.bo-legal li {
    font-size: 16px;
    line-height: 26px;
    margin: 0 0 var(--space-3);
}

.bo-legal__list {
    padding-left: var(--space-4);
}

.bo-legal__contact {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--space-1) var(--space-4);
    margin: 0;
    font-size: 16px;
    line-height: 26px;
}

.bo-legal__contact dt {
    color: var(--ink-muted);
}

.bo-legal__contact dd {
    margin: 0;
}

/* Tipp der Woche im Hero der Startseite: der Verlagsnachweis klein unter den Buttons, auch auf dunklem Grund lesbar. */
.bo-hero__credit {
    margin: var(--space-3) 0 0;
    color: inherit;
    opacity: .75;
}

/* Admin-Bereich (/admin auf lesealarm.de): schlichte Tabellen, auf dem Handy waagerecht scrollbar. */
.bo-admin h2 {
    font-size: 22px;
    line-height: 28px;
    margin: var(--space-5) 0 var(--space-3);
}

.bo-admin table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 22px;
}

.bo-admin th,
.bo-admin td {
    padding: var(--space-1) var(--space-3);
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.bo-admin th {
    color: var(--ink-muted);
    font-weight: 600;
}

.bo-admin h3 {
    font-size: 16px;
    margin: var(--space-3) 0 var(--space-1);
}

.bo-admin__author {
    margin: var(--space-2) 0;
}

.bo-admin__author summary {
    cursor: pointer;
    font-weight: 600;
}

.bo-admin__count,
.bo-admin__hidden {
    color: var(--ink-muted);
    font-size: 14px;
    font-weight: 400;
}

.bo-admin__error {
    color: var(--danger);
}

.bo-admin__cover {
    width: 56px;
}

.bo-admin__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ===== Mobil (≤ 760 px): nichts darf die Seite verbreitern, alles in Daumenreichweite ===== */
@media (max-width: 760px) {
    /* Kopf einer Liste: „Ganze Top 10“ rutscht unter den Titel statt über den Rand. */
    .bo-sectionhead {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        margin-bottom: var(--space-4);
    }

    .bo-title {
        font-size: 28px;
        line-height: 34px;
        letter-spacing: -1px;
    }

    .bo-lead {
        font-size: 17px;
        line-height: 27px;
    }

    /* Das System blendet die Navigation mobil aus – hier wird sie zu einer wischbaren Chip-Leiste. */
    .bo-header .bo-container {
        flex-wrap: wrap;
        height: auto;
        gap: var(--space-2);
        padding-top: var(--space-3);
        padding-bottom: var(--space-2);
    }

    .bo-header .bo-nav {
        display: flex;
        flex-wrap: nowrap;
        width: calc(100% + 2 * var(--space-4));
        margin: 0 calc(-1 * var(--space-4));
        padding: 0 var(--space-4) var(--space-1);
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .bo-header .bo-nav::-webkit-scrollbar {
        display: none;
    }

    .bo-header .bo-nav a {
        flex: none;
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 var(--space-3);
        border: 1px solid color-mix(in srgb, var(--on-night) 22%, transparent);
        border-radius: var(--radius-pill);
        font-size: 14px;
    }

    .bo-header .bo-nav a[aria-current="page"] {
        box-shadow: none;
        background: var(--accent);
        border-color: var(--accent);
        color: var(--night-100) !important;
    }

    /* Hero kompakt: Text und kleines Cover passen in einen Bildschirm. */
    .bo-hero {
        padding: var(--space-4) 0 72px;
    }

    .bo-hero .bo-container {
        gap: var(--space-4);
    }

    .bo-hero__book {
        font-size: 24px;
        line-height: 30px;
    }

    .bo-hero__stage {
        order: -1;
        padding: 0;
    }

    .bo-hero__stage .bo-cover--lg {
        width: 120px;
        font-size: 14px;
    }

    .bo-hero__actions {
        gap: var(--space-2) var(--space-3);
    }

    .bo-hero__actions .bo-btn:not(.bo-btn--link) {
        min-height: 48px;
    }

    .bo-hero .bo-circle {
        display: none;
    }

    /* Karussell: Steuerung bleibt in der Breite, die Statuszeile darf umbrechen. */
    .bo-carousel__controls {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: var(--space-2);
    }

    .bo-carousel__controls .bo-btn {
        min-height: 44px;
        padding: 0 var(--space-3);
    }

    .bo-carousel.is-enhanced .bo-carousel__stage {
        height: 260px;
        touch-action: pan-y;
    }

    .bo-detail__title {
        font-size: 26px;
        line-height: 32px;
    }

    .bo-buy {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
    }
}

/* ===== Seitenkopf für Unterseiten (Liste, Genre, Genre-Übersicht): templates/_pagehead.html.twig ===== */
.bo-pagehead {
    position: relative;
    overflow: hidden;
    padding: 56px 0 48px;
    background:
        radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
        linear-gradient(180deg, var(--surface-200), var(--surface-100));
    border-bottom: 1px solid var(--border);
}

.bo-pagehead .bo-container {
    position: relative;
    z-index: 1;
}

/* Genre-Bild der Domain blendet von rechts ein. */
.bo-pagehead--image::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(55%, 680px);
    background: var(--bo-img) center / cover no-repeat;
    mask-image: linear-gradient(90deg, transparent 0%, black 60%);
}

.bo-pagehead .bo-lead {
    max-width: 560px;
}

.bo-pagehead__crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    font-size: 13px;
    line-height: 20px;
    color: var(--ink-muted);
}

.bo-pagehead__crumbs a {
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: none;
}

.bo-pagehead__crumbs a:hover {
    text-decoration: underline;
}

.bo-pagehead__facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
}

.bo-pagehead__facts li {
    padding: 4px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--surface-100) 70%, transparent);
    font-size: 13px;
    line-height: 20px;
    color: var(--ink-body);
}

.bo-section--tight {
    padding-top: var(--space-5);
}

/* ===== Genre-Kacheln: Form je Theme, Anheben beim Zeigen; Teaser auf der Startseite ===== */
.bo-genre {
    border-radius: var(--bo-radius);
    transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}

.bo-genre:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 36px -22px color-mix(in srgb, var(--ink) 80%, transparent);
}

.bo-genres--teaser {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.bo-genres--teaser .bo-genre {
    min-height: 190px;
    padding: 18px;
}

.bo-genres--teaser .bo-genre b {
    font-size: 19px;
    line-height: 24px;
}

.bo-genres--teaser .bo-genre span {
    font-size: 13px;
    line-height: 18px;
}

@media (max-width: 1080px) and (min-width: 761px) {
    .bo-genres--teaser {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .bo-pagehead {
        padding: var(--space-4) 0 var(--space-4);
    }

    .bo-pagehead--image::after {
        width: 100%;
        opacity: .28;
        mask-image: linear-gradient(180deg, black 0%, transparent 100%);
    }

    /* Teaser: wischbare Reihe statt Raster. */
    .bo-genres--teaser {
        display: flex;
        gap: 12px;
        margin: 0 calc(-1 * var(--space-4));
        padding: 0 var(--space-4) var(--space-2);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .bo-genres--teaser .bo-genre {
        flex: 0 0 68%;
        scroll-snap-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bo-genre {
        transition: none;
    }

    .bo-genre:hover {
        transform: none;
    }
}

/* Lange deutsche Wörter (Datenschutzerklärung) im Seitenkopf trennen statt überlaufen. */
.bo-pagehead .bo-title {
    hyphens: auto;
}

/* Helle Domains: Kachelbild nur unten abdunkeln, damit die Motive leuchten; Schrift bleibt lesbar. */
[data-theme="light"] .bo-genre::before,
:is([data-theme="kinder"],[data-theme="mini"]) .bo-genre::before,
[data-theme="romance"] .bo-genre::before,
[data-theme="sachbuch"] .bo-genre::before {
    background: linear-gradient(0deg,
        color-mix(in srgb, var(--night-100) 90%, transparent) 0%,
        color-mix(in srgb, var(--night-100) 45%, transparent) 38%,
        transparent 68%);
}

.bo-genre b,
.bo-genre span {
    text-shadow: 0 1px 8px color-mix(in srgb, var(--night-100) 70%, transparent);
}

/* ===== Reihen (handgepflegte Listen, z. B. Kinder): Karte mit aufgefächerten Covern ===== */
.bo-series {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
    gap: var(--space-4);
}

.bo-series__card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--bo-radius);
    background: var(--surface-100);
    color: inherit;
    text-decoration: none;
    transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}

.bo-series__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 36px -24px color-mix(in srgb, var(--ink) 75%, transparent);
}

/* Drei Bände wie ein aufgefächerter Stapel */
.bo-series__covers {
    position: relative;
    display: block;
    width: 170px;
    height: 170px;
}

.bo-series__covers .bo-cover {
    position: absolute;
    bottom: 0;
    width: 96px;
    font-size: 10px;
}

.bo-series__covers .bo-cover:nth-child(1) {
    left: 0;
    z-index: 3;
    transform: rotate(-6deg);
}

.bo-series__covers .bo-cover:nth-child(2) {
    left: 37px;
    z-index: 2;
    transform: rotate(2deg) translateY(-6px);
}

.bo-series__covers .bo-cover:nth-child(3) {
    left: 74px;
    z-index: 1;
    transform: rotate(9deg) translateY(-10px);
}

.bo-series__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.bo-series__text b {
    font-family: var(--font-serif);
    font-size: 24px;
    line-height: 30px;
    color: var(--ink);
}

.bo-series__meta {
    font-size: 13px;
    line-height: 20px;
    font-weight: 600;
    color: var(--accent-ink);
}

/* Only locally (app.curated.show_hidden): a hidden list awaiting the publisher's permission. */
.bo-series__hidden {
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink);
}

.bo-series__lead {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 15px;
    line-height: 23px;
    color: var(--ink-body);
}

@media (max-width: 760px) {
    .bo-series__card {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bo-series__card {
        transition: none;
    }

    .bo-series__card:hover {
        transform: none;
    }
}

/* Error pages (templates/bundles/TwigBundle/Exception): a large status code above the page head. */
.bo-error__code {
    margin: 0 0 var(--space-2);
    font-family: var(--font-serif);
    font-size: clamp(72px, 14vw, 160px);
    font-weight: 700;
    line-height: 1;
    color: var(--accent-ink);
}

.bo-error__status {
    margin: var(--space-2) 0 0;
    font-size: 13px;
    color: var(--ink-muted);
}

.bo-error__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
}
