/* Erlebnisdrache - first draft styles. Palette derived from the live erlebnisdrache.com theme
   (primary/secondary/tertiary) plus the orange accent from the company logo. */

:root {
    --color-primary: #381d92;     /* theme violet (headings)            */
    --color-secondary: #1c0a63;   /* theme dark indigo                 */
    --color-tertiary: #f2f2fa;    /* theme light lavender (surfaces)   */
    --color-text: #0b0620;        /* theme foreground text             */
    --color-accent: #ff6900;      /* dragon-logo orange (accents)      */
    --color-accent-blue: #1f5fa6; /* dragon-logo blue (links)          */
    --color-bg: #ffffff;
    --maxw: 1100px;
    --font-body: "Hind", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.25rem;
}

a { color: var(--color-accent-blue); }

/* Notice banner at the top of every page ("im Aufbau"). */
.site-notice {
    background: var(--color-accent);
    color: #fff;
    text-align: center;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--color-tertiary);
    padding: 0.75rem 0;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-logo img {
    height: 64px;
    width: auto;
    display: block;
}

.site-nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    font-weight: 600;
    color: var(--color-secondary);
}

.site-nav a:hover { color: var(--color-accent); }

/* Hero */
.hero {
    background: var(--color-tertiary);
    text-align: center;
    /* Top/bottom chosen so the visible space above the title and below the subtitle
       matches the visible gap between title and subtitle (line-height half-leading included). */
    padding: 15px 1.25rem 22px;
}

.hero__title {
    margin: 0 0 0.5rem;
    font-size: 2.4rem;
    color: var(--color-primary);
}

.hero__subtitle {
    margin: 0;
    font-size: 1.2rem;
    color: var(--color-secondary);
}

/* Books */
.books { padding: 3rem 0; }

.section-title {
    text-align: center;
    color: var(--color-primary);
    font-size: 1.8rem;
    margin: 0 0 2rem;
}

.books__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.book-card {
    border: 1px solid var(--color-tertiary);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(11, 6, 32, 0.05);
    display: flex;
    flex-direction: column;
}

.book-card__media {
    background: var(--color-tertiary);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 1.5rem;
}

.book-card__media img {
    display: block;
    width: auto;
    height: 220px;
    max-width: 100%;
    object-fit: contain;
}

.book-card__body { padding: 1.5rem; }

/* Title/subtitle line with a right-aligned link (e.g. "über den Autor"). */
.book-card__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.book-card__link { white-space: nowrap; }

.book-card__title {
    margin: 0;
    color: var(--color-primary);
    font-size: 1.4rem;
}

.book-card__subtitle {
    margin: 0.25rem 0 0.75rem;
    font-style: italic;
    color: var(--color-secondary);
}

.book-card__age {
    margin: 0 0 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
}

.book-card__desc { margin: 0 0 1rem; }

.book-card__variants {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--color-tertiary);
}

.book-card__variants li {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-tertiary);
}

.variant__name {
    font-weight: 600;
    margin-right: auto;
}

/* Footer */
.site-footer {
    background: var(--color-secondary);
    color: #fff;
    padding: 2rem 0;
    margin-top: 2rem;
    font-size: 0.95rem;
}

.site-footer a { color: #fff; }

.site-footer__name {
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.site-footer p { margin: 0.2rem 0; }

/* Sub pages (e.g. author page) */
.page { padding: 2rem 0; }

.page__back { margin: 0 0 1.5rem; }

.page__back:last-child { margin: 1.5rem 0 0; }

.page__title {
    margin: 0 0 1rem;
    color: var(--color-primary);
    font-size: 1.8rem;
}

.author {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.author__photo {
    display: block;
    width: 300px;
    height: auto;
    flex-shrink: 0;
}

.author__text p { margin: 0 0 1rem; }

.page__text h2,
.facts__title {
    margin: 1.5rem 0 0.75rem;
    color: var(--color-primary);
    font-size: 1.3rem;
}

.page__text p { margin: 0 0 1rem; }

/* Book data: one block for the book, below it one block per variant side by side. */
.facts { margin-top: 1rem; }

.facts__variants {
    display: flex;
    gap: 2rem;
}

.facts__variants .facts__block { flex: 1; }

.facts__table {
    width: 100%;
    border-collapse: collapse;
}

.facts__table th,
.facts__table td {
    text-align: left;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--color-tertiary);
    vertical-align: top;
}

.facts__table th {
    width: 45%;
    font-weight: 600;
    background: var(--color-tertiary);
}

/* "Blick ins Buch": 3D book left, description right */
.preview-top {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
}

.preview-top__book {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
}

.btn {
    margin-top: 2.5rem;
    padding: 0.6rem 1.6rem;
    border: 0;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover { background: var(--color-secondary); }

/* Rotating 3D book. --w/--h: cover size, --t: thickness (spine width). */
.book3d {
    --w: 230px;
    --h: calc(var(--w) * 1123 / 794);
    --t: 12px;
    width: var(--w);
    height: var(--h);
    perspective: 1400px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.book3d__body {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: book3d-spin 16s linear infinite;
}

.book3d.is-paused .book3d__body { animation-play-state: paused; }

@keyframes book3d-spin {
    from { transform: rotateX(-8deg) rotateY(0deg); }
    to { transform: rotateX(-8deg) rotateY(360deg); }
}

.book3d__face {
    position: absolute;
    background-size: 100% 100%;
}

.book3d__front,
.book3d__back {
    inset: 0;
}

.book3d__front { transform: translateZ(calc(var(--t) / 2)); }

.book3d__back { transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); }

.book3d__spine,
.book3d__edge {
    top: 0;
    left: calc((var(--w) - var(--t)) / 2);
    width: var(--t);
    height: 100%;
}

.book3d__spine { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }

.book3d__edge {
    transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
    background: repeating-linear-gradient(90deg, #f6f3ea 0 1px, #ddd8ca 1px 2px);
}

.book3d__top,
.book3d__bottom {
    left: 0;
    top: calc((var(--h) - var(--t)) / 2);
    width: 100%;
    height: var(--t);
    background: repeating-linear-gradient(0deg, #f6f3ea 0 1px, #ddd8ca 1px 2px);
}

.book3d__top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }

.book3d__bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); }

/* "Reinlesen" overlay */
.reader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 6, 32, 0.88);
}

.reader[hidden] { display: none; }

.reader__page {
    background: #fff;
    overflow: hidden;
}

.reader__page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.reader__btn {
    position: absolute;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
}

.reader__btn:hover { color: var(--color-accent); }

.reader__close { top: 0.5rem; right: 0.75rem; }

.reader__prev { left: 0.25rem; top: 50%; transform: translateY(-50%); }

.reader__next { right: 0.25rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
    .hero__title { font-size: 1.8rem; }
    .author { flex-direction: column; }
    .author__photo { width: 100%; max-width: 300px; }
    .facts__variants { flex-direction: column; gap: 0; }
    .preview-top { flex-direction: column; align-items: center; gap: 1rem; }
    .preview-top__book { flex-basis: auto; }
}
