/* mana-Buch – Gestaltung angelehnt an das bisherige WordPress-Theme „Responsive“
   (roter Hintergrund, weiße Inhaltskarte, dunkelgraue Menüleiste). */

:root {
    --brand: #e03333;
    --text: #555;
    --heading: #333;
    --link: #06c;
    --link-hover: #444;
    --card: #fff;
    --card-border: #e5e5e5;
    --menu-top: #585858;
    --menu-bottom: #3d3d3d;
    --menu-active: #343434;
}

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

html { height: 100%; }

body {
    margin: 0;
    background-color: var(--brand);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a { color: var(--link); text-decoration: none; }
a:hover, a:focus, a:active { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.625em; margin: .5em 0; }
h2 { font-size: 1.875em; margin: .857em 0 .5em; }
h3 { font-size: 1.875em; margin: .857em 0; }
h4 { font-size: 1.15em; margin: 1.2em 0 .4em; }
h1:focus { outline: none; }

p { margin: 0 0 1.5em; }
.justify { text-align: justify; }

/* Hervorgehobener Absatz in einem hellgrauen Kasten */
.info-box {
    background: #f2f2f2;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1em 1.2em;
}

ul.bullets { margin: -1em 0 1.5em; padding-left: 1.5em; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Gerüst ---------- */

#container, #footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 25px;
}

#wrapper {
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    margin: 20px auto;
    padding: 0 20px 20px;
    overflow-wrap: break-word;
}

/* ---------- Kopfbereich ---------- */

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 20px 0 15px;
}

#logo { display: block; line-height: 0; }

.search-form { display: flex; gap: 4px; }
.search-form .field {
    width: 180px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font: inherit;
}
.search-form .submit {
    padding: 6px 12px;
    border: 1px solid #3d3d3d;
    border-radius: 3px;
    background: linear-gradient(#585858, #3d3d3d);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.search-form .submit:hover { background: linear-gradient(#808080, #363636); }

/* ---------- Hauptmenü ---------- */

.main-nav { position: relative; }

.menu-toggle {
    display: none;
    width: 100%;
    padding: 0 1em;
    height: 45px;
    border: 0;
    border-radius: 4px;
    background: linear-gradient(var(--menu-top), var(--menu-bottom));
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.menu, .menu ul { list-style: none; margin: 0; padding: 0; }

.menu {
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(var(--menu-top), var(--menu-bottom));
    border-radius: 4px;
}

.menu > li { position: relative; }

.menu a {
    display: block;
    height: 45px;
    line-height: 45px;
    padding: 0 .9em;
    border-left: 1px solid var(--menu-top);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.menu > li:first-child > a { border-left: 0; border-radius: 4px 0 0 4px; }
.menu a:hover, .menu a:focus { background: linear-gradient(#808080, #363636); color: #fff; }
.menu > li > a.active { background: var(--menu-active); }

.menu .has-children > a::after { content: " ▾"; font-size: 10px; }

.menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 15em;
    margin-top: 1px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, .15);
    visibility: hidden;
    opacity: 0;
    transition: opacity .15s;
}
.menu .has-children:hover > .sub-menu,
.menu .has-children:focus-within > .sub-menu { visibility: visible; opacity: 1; }

.menu .sub-menu a {
    height: auto;
    line-height: 1.5;
    padding: .6em 1em;
    border: 0;
    border-bottom: 1px solid #eee;
    background: transparent;
    color: #444;
    font-size: 12px;
    font-weight: 400;
}
.menu .sub-menu li:last-child a { border-bottom: 0; }
.menu .sub-menu a:hover, .menu .sub-menu a:focus { background: #f5f5f5; color: #484848; }
.menu .sub-menu a.active { font-weight: 700; }

/* ---------- Bücher ---------- */

.book-list { display: flex; flex-direction: column; }

.book {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5em;
    padding: 1.5em 0;
    border-bottom: 1px solid #eee;
    scroll-margin-top: 10px;
}
.book:last-child { border-bottom: 0; }

.book-cover a { display: block; }
.book-cover .cover { display: block; width: 100%; max-width: 200px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.book-cover .amazon-badge { display: block; margin-top: 8px; width: 200px; }

.book-title { margin: 0 0 .4em; font-size: 1.15em; line-height: 1.4; }
.book-text p { text-align: justify; }

.category-list { padding-left: 1.5em; }
.category-list li { margin: .4em 0; font-size: 1.1em; }

.notice { padding: 1em 0; color: #777; }

/* ---------- Fußbereich ---------- */

#footer { padding-bottom: 20px; color: #333; }
#footer a { color: #333; }
#footer a:hover { color: #fff; }

.footer-menu ul { display: flex; flex-wrap: wrap; gap: 0 1.5em; margin: 0 0 .5em; padding: 0; list-style: none; }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; }

.scroll-top {
    border: 0;
    background: none;
    color: #333;
    font-size: 1.6em;
    cursor: pointer;
    padding: 0 .2em;
}
.scroll-top:hover { color: #fff; }

/* ---------- Mobil ---------- */

@media (max-width: 650px) {
    #container, #footer { padding: 0 10px; }
    #wrapper { padding: 0 14px 14px; }
    h1 { font-size: 2em; }
    h3 { font-size: 1.5em; }

    .search-form, .search-form .field { flex: 1 1 0; width: auto; min-width: 0; }
    .search-form { flex-basis: 220px; }
    .header-top { padding: 12px 0; }

    .menu-toggle { display: block; }
    .menu { display: none; flex-direction: column; margin-top: 4px; }
    .menu.open { display: flex; }
    .menu a { border-left: 0; border-top: 1px solid var(--menu-top); }
    .menu > li:first-child > a { border-top: 0; }

    .menu .sub-menu {
        position: static; visibility: visible; opacity: 1;
        margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent;
    }
    .menu .sub-menu a { color: #eee; padding-left: 2em; border-bottom: 0; font-size: 13px; }
    .menu .sub-menu a:hover, .menu .sub-menu a:focus { background: #4a4a4a; color: #fff; }
    .menu .has-children > a::after { content: none; }

    .book { grid-template-columns: 1fr; gap: 1em; }
    .book-cover { max-width: 200px; }
}

/* ---------- Ladeanzeige, Fehler, noscript ---------- */

.app-loading { position: relative; min-height: 60vh; text-align: center; padding-top: 10vh; }
.app-loading img { background: #fff; padding: 10px 16px; border-radius: 4px; }

.loading-progress {
    position: absolute;
    display: block;
    width: 6rem;
    height: 6rem;
    inset: calc(10vh + 90px) 0 auto 0;
    margin: 0 auto;
}
.loading-progress circle {
    fill: none;
    stroke: rgba(255, 255, 255, .35);
    stroke-width: .5rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: #fff;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray .05s ease-in-out;
}
.loading-progress-text {
    position: absolute;
    inset: calc(10vh + 90px + 2.4rem) 0 auto 0;
    color: #fff;
    font-weight: 700;
    text-align: center;
}
.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Wird geladen"); }

.noscript { max-width: 640px; margin: 2em auto; padding: 1em 2em; background: #fff; border-radius: 4px; }

#blazor-error-ui {
    color-scheme: light only;
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: .6rem 1.25rem .7rem;
    background: lightyellow;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
}
#blazor-error-ui .dismiss {
    position: absolute;
    right: .75rem;
    top: .5rem;
    border: 0;
    background: none;
    cursor: pointer;
}

.blazor-error-boundary { background: #b32121; padding: 1rem; color: #fff; }
.blazor-error-boundary::after { content: "Es ist ein Fehler aufgetreten."; }
