/* Magazine book — shared styles (unit-book + Hausaufgabe modal) */
.hw-magazine {
    --mag-color: #ec4899;
    --mag-bg: #eef0f8;
    --mag-page-bg: #ffffff;
    --mag-page-bg-alt: #f8fafc;
    --mag-border: rgba(0, 0, 0, 0.08);
    --mag-r-lg: 18px;
    --mag-fs-sm: clamp(0.72rem, 0.9vw, 0.9rem);
    --mag-fs-base: clamp(0.82rem, 1.1vw, 1.05rem);
    --mag-fs-lg: clamp(1rem, 1.4vw, 1.3rem);
    --mag-fs-xl: clamp(1.3rem, 2vw, 2rem);
    --mag-fs-xxl: clamp(1.8rem, 3vw, 3rem);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--mag-bg);
}

.hw-magazine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.hw-magazine-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh 4vw;
    min-height: 0;
}

.hw-magazine .magazine-wrapper {
    width: 100%;
    height: 100%;
    max-height: 100%;
    position: relative;
    perspective: 3500px;
    border-radius: var(--mag-r-lg);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 10px 40px rgba(0, 0, 0, 0.12),
        0 20px 0 -8px #fff,
        0 20px 0 -7px rgba(0, 0, 0, 0.04);
    background: var(--mag-page-bg);
}

.hw-magazine .base-page {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    padding: clamp(1rem, 2.5vw, 2.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hw-magazine .base-page.left {
    left: 0;
    border-radius: var(--mag-r-lg) 0 0 var(--mag-r-lg);
    background: linear-gradient(to right, #fff 88%, var(--mag-page-bg-alt) 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.07);
}

.hw-magazine .base-page.right {
    right: 0;
    border-radius: 0 var(--mag-r-lg) var(--mag-r-lg) 0;
    background: linear-gradient(to left, #fff 88%, var(--mag-page-bg-alt) 100%);
}

.hw-magazine .leaf {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition: transform 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.hw-magazine .leaf.turned {
    transform: rotateY(-180deg);
}

.hw-magazine .face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    padding: clamp(1rem, 2.5vw, 2.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hw-magazine .face.front {
    border-radius: 0 var(--mag-r-lg) var(--mag-r-lg) 0;
    background: linear-gradient(to left, #fff 88%, var(--mag-page-bg-alt) 100%);
    transform: rotateY(0deg);
    border-left: 1px solid rgba(0, 0, 0, 0.06);
}

.hw-magazine .face.back {
    border-radius: var(--mag-r-lg) 0 0 var(--mag-r-lg);
    background: linear-gradient(to right, #fff 88%, var(--mag-page-bg-alt) 100%);
    transform: rotateY(180deg);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.hw-magazine .page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

.hw-magazine .page-folio {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--mag-border);
    font-size: var(--mag-fs-sm);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.hw-magazine .nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(38px, 4vw, 52px);
    height: clamp(38px, 4vw, 52px);
    background: #fff;
    border: 1px solid var(--mag-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.25s;
    color: var(--mag-color);
}

.hw-magazine .nav-arrow:hover:not(.disabled) {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 28px rgba(236, 72, 153, 0.2);
    border-color: var(--mag-color);
}

.hw-magazine .nav-arrow.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

.hw-magazine .nav-arrow.prev { left: 0.5vw; }
.hw-magazine .nav-arrow.next { right: 0.5vw; }

.hw-magazine .cover-left {
    background: linear-gradient(135deg, var(--mag-color) 0%, color-mix(in srgb, var(--mag-color), #000 25%) 100%);
    border-radius: var(--mag-r-lg) 0 0 var(--mag-r-lg);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(1.5rem, 3vw, 3rem);
    color: #fff;
    height: 100%;
}

.hw-magazine .cover-title-de {
    font-size: var(--mag-fs-xxl);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    font-family: 'Exo 2', sans-serif;
}

.hw-magazine .cover-title-en {
    font-size: var(--mag-fs-lg);
    opacity: 0.85;
    margin-bottom: 1rem;
}

.hw-magazine .cover-level-badge {
    font-size: var(--mag-fs-sm);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 0.75rem;
}

.hw-magazine .toc-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--mag-border);
    font-size: var(--mag-fs-base);
}

.hw-magazine .toc-item:last-child { border-bottom: none; }

.hw-magazine .toc-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(236, 72, 153, 0.08);
    flex-shrink: 0;
}

.hw-magazine .exercise-page-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.hw-magazine .exercise-mount {
    flex: 1;
    min-height: 0;
}

.hw-magazine .exercise-check-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    background: var(--mag-color);
    color: #fff;
    font-weight: 700;
    font-size: var(--mag-fs-sm);
    cursor: pointer;
    align-self: flex-start;
}

.hw-magazine-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
