:root {
    --bg-body: #f5f5f7;
    --bg-panel: #ffffff;
    --bg-card: #ffffff;
    --accent: #2b4c7e;
    --accent-soft: rgba(43, 76, 126, 0.08);
    --text-main: #111111;
    --text-muted: #6b7280;
    --border-subtle: #e5e7eb;
    --font-main: "Optima", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
}

/* PAGE LAYOUT */

.page {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

/* COLUMNS */

.column {
    background: var(--bg-panel);
    border-radius: 14px;
    padding: 1.25rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.06);
}

.column-main {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* NAV COLUMN */

.column-nav {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.brand-logo {
    width: 120px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.brand-text h1 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}

.brand-text p {
    margin: 0.15rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.brand-text {
    text-align: center;
}

/* NAV DIVIDER & MENU */

.nav-divider {
    margin: 0.75rem 0 0.75rem 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--border-subtle),
        transparent
    );
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-menu a {
    color: var(--text-main);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.1s ease, transform 0.1s ease, color 0.1s ease;
}

.nav-menu a::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent-soft);
}

.nav-menu a:hover {
    background: #edf2ff;
    color: #111827;
    transform: translateX(1px);
}

.nav-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* CARDS */

.card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.25rem 1.3rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
}

.card p {
    margin-top: 0.4rem;
    line-height: 1.6;
    font-size: 0.96rem;
}

/* BOOKS COLUMN */

.column-books .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.small-muted {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.small-muted code {
    background: #f3f4f6;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* BOOK LIST STYLING */

.books-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.25rem;
}

.book-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease, box-shadow 0.12s ease,
        transform 0.08s ease;
}

.book-item:hover {
    background: #eef2ff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.book-thumb-wrapper {
    flex: 0 0 auto;
}

.book-thumb {
    width: 56px;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.15);
}

.book-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.book-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.book-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.books-error {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #b91c1c;
}

/* LISTS */

.bullet-list {
    padding-left: 1.1rem;
    margin-top: 0.25rem;
}

.bullet-list li {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

/* FOOTER */

.site-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* RESPONSIVE */

@media (max-width: 960px) {
    .page {
        grid-template-columns: 220px 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "nav main"
            "nav books";
    }

    .column-nav {
        grid-area: nav;
    }

    .column-main {
        grid-area: main;
    }

    .column-books {
        grid-area: books;
    }
}

@media (max-width: 720px) {
    .page {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "nav"
            "main"
            "books";
        gap: 1rem;
    }

    .column-nav {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .nav-brand {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .brand-text {
        text-align: left;
    }

    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-footer {
        display: none;
    }
}
