﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-body: #F0F0F0;
    --header-bg: #878b91;
    --nav-bg: #b86565eb;
    --nav-bg-desktop: #b86565d9;
    --main-bg: #fff;
    --aside-bg: #cfcbbe;
    --footer-bg: #2d4059;
    --text-primary: #2d2a24;
    --text-light: #fff;
    --text-dark: #222;
    --active-overlay: #ffffff40;
    --nav-width: 280px;
    --transition-menu: 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Georgia', serif;
    line-height: 1.5;
    min-height: 100dvh;
    transition: margin-left 0.2s ease;
    margin: 0;
}

#menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 80vw;
    height: 100dvh;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    z-index: 1001;
    padding: 1rem;
    overflow-y: auto;
    box-shadow: 2px 0 12px #0000004d;
    visibility: hidden;
    opacity: 0;
    transform: translateX(-100%);
    transition: visibility 0.3s, opacity 0.3s, transform var(--transition-menu);
    pointer-events: none;

    &.open {
        visibility: visible;
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    & ul {
        list-style: none;
        margin-top: 3rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    float: right;
    margin-bottom: 1.5rem;
    display: block;
    line-height: 1;
    text-decoration: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    background: #ffffff1a;
    transition: background 0.2s;

    &.active, &:hover {
        background: var(--active-overlay);
        backdrop-filter: blur(4px);
        box-shadow: inset 0 0 0 1px #ffffff33;
    }
}

.menu-emoji {
    font-size: 1.5rem;
    min-width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.menu-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hamburger {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    background: var(--header-bg);
    border: none;
    color: white;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px #00000033;
    text-decoration: none;
    transition: background 0.2s;

    &:hover {
        background: #6c6f75;
    }
}

.overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00000099;
    backdrop-filter: blur(2px);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    pointer-events: none;

    &.open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
}

.page {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "header"
        "main"
        "aside"
        "footer";
    gap: 0.6rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem;
}

header {
    grid-area: header;
    background: var(--header-bg);
    color: var(--text-light);
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1.3rem;
    background: #00000033;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    color: #CCCCCC;
    min-width: 190px;

    & img {
        max-height: 60px;
    }
}

main {
    grid-area: main;
    background: var(--main-bg);
    color: var(--text-dark);
    padding: 1rem;
    border-radius: 12px;
}

aside {
    grid-area: aside;
    background: var(--aside-bg);
    padding: 1rem;
    border-radius: 12px;

    & h2 {
        font-size: 1.3rem;
        margin: 0 0 0.8rem 0;
        font-weight: 600;
    }

    & .as-links {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 0.8rem;

        & a {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.7rem 0.3rem;
            background: #878b9126;
            border-radius: 40px;
            text-decoration: none;
            font-weight: 500;
            color: var(--text-primary);
            transition: 0.2s;
            text-align: center;

            &:hover {
                background: #4f5b66;
                color: white;
            }
        }
    }
}

footer {
    grid-area: footer;
    background: var(--footer-bg);
    color: var(--text-light);
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
    font-size: 0.9rem;

    & a {
        color: var(--text-light);
    }
}

.hero {
    text-align: center;
    margin-bottom: 2rem;

    & .hero-title {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
        color: #5e2e5a;
        margin-bottom: 0.6rem;
    }

    & .hero-sub {
        font-size: 1.1rem;
        color: #6b5b7b;
        margin: 0 auto 1.5rem;
        max-width: 600px;
    }

    & .cats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }

    & .cat-card {
        background: #fff;
        border-radius: 16px;
        padding: 1.5rem 1rem;
        text-decoration: none;
        box-shadow: 0 4px 12px #0000000f;
        transition: box-shadow 0.2s, border-color 0.2s;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        text-align: center;
        border: 2px solid transparent;
        color: var(--text-dark);

        &:hover {
            box-shadow: 0 8px 20px #0000001a;
            border-color: #ce93d8;
        }
    }

    & .cat-emoji {
        font-size: 2.2rem;
    }

    & .cat-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: #3e2a3e;
    }

    & .cat-desc {
        font-size: 0.85rem;
        color: #7b6b8a;
        line-height: 1.4;
    }

    & .feats {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    & .feat-item {
        background: #fbf5ff;
        border-radius: 12px;
        padding: 1rem 1.2rem;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        transition: background 0.2s;
        color: #3e2a3e;

        &:hover {
            background: #f2e6ff;
        }
    }

    & .feat-emoji {
        font-size: 1.8rem;
    }

    & .feat-title {
        font-weight: 700;
        font-size: 0.95rem;
    }

    & .feat-desc {
        font-size: 0.8rem;
        color: #5e4e6e;
    }

    & .cta {
        display: flex;
        justify-content: center;
    }

    & .btn {
        text-decoration: none;
        padding: 0.8rem 1.5rem;
        border-radius: 40px;
        font-weight: 700;
        font-size: 0.95rem;
        transition: background 0.2s;

        &.btn-primary {
            background: #7b1fa2;
            color: #fff;

            &:hover {
                background: #6a1b9a;
            }
        }
    }

    @media (max-width: 600px) {
        & .cats {
            grid-template-columns: 1fr;
        }

        & .feats {
            flex-direction: column;
            align-items: center;
        }
    }
}

.story {
    margin-top: 2rem;

    & h2 {
        font-size: 2rem;
        color: #5e2e5a;
        margin-bottom: 0.5rem;
    }

    & .rating {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 1rem;
        background: #00000008;
        padding: 0.6rem 1rem;
        border-radius: 40px;
        margin-bottom: 1.5rem;

        & .rating-label {
            font-weight: 600;
        }

        & .stars {
            color: gold;
            font-size: 1.3rem;
            letter-spacing: 2px;
        }

        & .rating-value {
            background: #2c3e50;
            color: white;
            padding: 0.2rem 0.6rem;
            border-radius: 20px;
            font-size: 0.9rem;
        }
    }

    & .story-content {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 2rem;

        & p {
            margin-bottom: 0.5rem;
            font-size: 1.05rem;
        }

        & figure {
            margin: 0;

            & img {
                max-width: 100%;
                height: auto;
                border-radius: 12px;
                display: block;
            }

            & figcaption {
                font-size: 0.9rem;
                color: #555;
                margin-top: 0.3rem;
                font-style: italic;
            }
        }
    }

    & .morale-conclusions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }

    & .morale,
    & .conclusions {
        background: #eef2f5;
        padding: 0.8rem 1.2rem;
        border-radius: 20px;

        & h3 {
            margin: 0 0 0.5rem;
            font-size: 1.2rem;
        }

        & p {
            margin: 0;
        }
    }

    
}

@media (min-width: 1025px) {
    #menu {
        visibility: visible;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        position: fixed;
        left: 0;
        top: 0;
        width: var(--nav-width);
        height: 100dvh;
        background: var(--nav-bg-desktop);
        backdrop-filter: blur(12px);
        box-shadow: 2px 0 10px #0000001a;
        border-right: 1px solid #ffffff33;
        z-index: 100;
    }

    .hamburger, .close-menu, .overlay {
        display: none !important;
    }

    body {
        margin-left: var(--nav-width);
    }

    .page {
        grid-template-columns: 1fr 260px;
        grid-template-areas:
            "header header"
            "main   aside"
            "footer footer";
        max-width: 1400px;
    }
}
.popular {
    & h3 {
        font-size: 1.4rem;
        margin: 1rem 0 0.8rem;
    }

    & .popular-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.8rem;
    }

    & .popular-card {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 30px;
        padding: 0.6rem 1rem;
        text-align: center;
        text-decoration: none;
        color: #1a1a1a;
        font-weight: 500;
        transition: 0.2s;

        &:hover {
            background: #e9ecef;
            transform: translateY(-2px);
        }
    }
}
@media print {
    body {
        background: white;
        margin: 0;
    }

    #menu, .hamburger, .overlay, header, aside, footer, .hero, .popular {
        display: none !important;
    }

    .page {
        display: block;
        max-width: 100%;
        padding: 0;
    }

    main {
        background: none;
        padding: 0;
        border-radius: 0;
    }

    .story {
        & .rating, & .morale-conclusions {
            background: none;
            padding: 0;
        }

        & .story-content figure img {max-width: 80%;}
    }

    a {
        text-decoration: none;
        color: black;
    }
}
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cud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DI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}