/* Mereküla Veinikelder — client skin. Full light, no content card. */

:root {
    --bg-primary: #f6f5f2;
    --bg-secondary: #e9e7e2;
    --bg-content: transparent;
    --accent: #1f2525;
    --light: #fdd1b0;
    --text-primary: #3a3a3a;
    --text-heading: #1f2525;
    --text-link: #1f2525;
    --text-meta: #7a7a78;
    --icon-color: rgba(31, 37, 37, 0.28);
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.07);
    --menu-item-color: #1f2525;
    --menu-icon-color: #1f2525;
    --transition-logo-color: #1f2525;
    --transition-logo-opacity: 0.12;
}

.sidebar {
    background: rgba(255, 255, 255, 0.33);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border-right: 1px solid var(--border-color);
}

/* floating panel, 30px off the edge */
@media (min-width: 769px) {
    .sidebar {
        --inset: calc(30px / var(--sidebar-scale));
        top: var(--inset);
        left: var(--inset);
        bottom: var(--inset);
        border: 1px solid rgba(255, 255, 255, 0.7);
        border-radius: 20px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
                    0 10px 30px var(--shadow-color);
    }

    .main-content {
        margin-left: calc(280px * var(--sidebar-scale) + 30px);
        padding-bottom: 30px;
        display: flex;
        flex-direction: column;
    }

    /* prev/next sits on the sidebar's bottom line; 1500px cap on wide screens */
    .content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
        width: 100%;
        max-width: 1500px;
    }

    #page-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .content-wrapper .page-nav { margin-top: auto; padding-top: 64px; }
}

.content-wrapper .page-nav-btn { gap: 11px; padding: 13px 20px; border-radius: 999px; }

.content-wrapper .download-btn,
.content-wrapper .download-all-btn,
.content-wrapper .link-btn { border-radius: 999px; }

.content-wrapper .download-btn:hover,
.content-wrapper .download-all-btn:hover,
.content-wrapper .link-btn:hover,
.content-wrapper .page-nav-btn:hover { background: #fff; }
.content-wrapper .page-nav-arrow { font-size: 1.2rem; }
.content-wrapper .page-nav-label { font-size: 0.8rem; }

.sidebar::after { border-top-color: #1f2525; }

/* round emblem, half the slot */
#brand-logo[data-logo="mark"] {
    width: 57.5%;
    height: 57.5%;
}

.sidebar-menu a {
    justify-content: center;
    padding: 13px 20px;
    font-size: 1.1em;
}

.sidebar-menu a:hover { color: var(--text-meta); }

.content-wrapper {
    background: transparent;
    box-shadow: none;
}

.content-wrapper .home-lead { text-align: center; }
.content-wrapper h1.home-lead { line-height: 0.84; }

.entry-content .home-mark { margin: 40px auto 0; width: 100%; max-width: 504px; }

@media (min-width: 769px) {
    .entry-content .home-mark { margin: auto; transform: translateY(-20%); }
}

.content-wrapper h1 { letter-spacing: -0.01em; }
.content-wrapper h1 .h1-light {
    display: block;
    margin-top: 0.2em;
    font-weight: 100;
    letter-spacing: 0.08em;
}

@media (max-width: 768px) {
    .content-wrapper h1 .h1-light { font-size: 0.85em; }
}
.content-wrapper h2 { letter-spacing: 0; font-weight: 300; }

/* wallpaper behind the page: always there, blurred; a page change lifts it
   20vh, sharpens it on the way and blurs it again at the end. The blur sits on
   the outer box — a filter on the masked box itself is cut off by its own mask.
   In-flow, not fixed: a translucent fixed layer on the screen edge goes black
   behind iOS Safari's bars. */
body { position: relative; }

.transition-logo,
body.is-home .transition-logo {
    position: absolute;
    inset: 0;
    width: auto;
    aspect-ratio: auto;
    transform: none;
    opacity: var(--transition-logo-opacity);
    filter: blur(10px);
}

.transition-logo > div {
    position: absolute;
    inset: 0;
    background: var(--transition-logo-color);
    -webkit-mask: url(../images/elements/mk-wallpaper.png) center 0 / max(100vw, 900px) auto repeat-y;
    mask: url(../images/elements/mk-wallpaper.png) center 0 / max(100vw, 900px) auto repeat-y;
}

.transition-logo.show { animation: rise 4s ease-in-out both; }
.transition-logo.show > div { animation: lift 4s ease-in-out both; }

@keyframes rise {
    0%   { filter: blur(10px); }
    35%  { filter: blur(0); }
    75%  { filter: blur(0); }
    100% { filter: blur(10px); }
}

@keyframes lift {
    0% {
        -webkit-mask-position: center 20vh;
        mask-position: center 20vh;
        animation-timing-function: ease-out;
    }
    75%, 100% {
        -webkit-mask-position: center 0;
        mask-position: center 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .transition-logo.show,
    .transition-logo.show > div { animation: none; }
}

/* phone: closed menu is a centred pill with the arrow; open menu gets the big emblem */
@media (max-width: 768px) {
    .sidebar { transition: none; }

    .sidebar:not(.menu-open) {
        top: 12px;
        left: 50%;
        right: auto;
        width: 64px;
        height: 40px;
        transform: translateX(-50%);
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.7);
        box-shadow: 0 6px 20px var(--shadow-color);
    }

    .sidebar:not(.menu-open)::after {
        left: 50%;
        right: auto;
        top: 50%;
        transform: translate(-50%, -30%);
    }

    .sidebar.menu-open .logo-placeholder {
        width: 220px;
        height: 220px;
    }

    .sidebar.menu-open { animation: menu-down 0.45s ease-out both; }

    @keyframes menu-down {
        from { clip-path: inset(0 0 100% 0); }
        to   { clip-path: inset(0); }
    }

    @media (prefers-reduced-motion: reduce) {
        .sidebar.menu-open { animation: none; }
    }
}
