@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f5f5f0;
    color: #1a1a1a;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "content"
        "footer";
}

/* ── Header ── */
.site-header {
    grid-area: header;
    background: #fff;
    border-bottom: 1px solid #e0e0d8;
    display: grid;
    grid-template-columns: 160px 1fr auto;
    align-items: center;
}

.lang-switcher {
    padding: 0 20px;
}

.lang-switcher select {
    appearance: none;
    background: #f5f5f0;
    border: 1px solid #e0e0d8;
    border-radius: 4px;
    padding: 5px 28px 5px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23888' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s, color 0.15s;
}

.lang-switcher select:hover {
    border-color: #aaa;
    color: #1a1a1a;
}

.site-logo {
    padding: 4px;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    border-right: 1px solid #e0e0d8;
    text-decoration: none;
    color: inherit;
    display: block;
}
.site-logo img {
    max-width: 100%;
    height: auto;
}

.site-nav {
    padding: 0 24px;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

.site-nav a, .site-nav .lang-switcher {
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    padding: 20px 0;
    display: block;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}
.site-nav ul .nav-right {
    margin-left: auto;
}
.site-nav .nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    padding: 20px 0;
    display: block;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}
.site-nav .nav-btn:hover {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

/* ── Page wrapper ── */
.site-content {
    grid-area: content;
    display: grid;
    grid-template-columns: 1fr 240px;
    grid-template-areas: "main aside";
    border-bottom: 1px solid #e0e0d8;
}

.site-main {
    grid-area: main;
    padding: 32px 24px;
    border-right: 1px solid #e0e0d8;
}

/* ── Aside ── */
.site-aside {
    grid-area: aside;
    padding: 24px 20px;
}

.aside-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 16px;
}

.news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.news-list li a {
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    line-height: 1.4;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0d8;
}

.news-list li:last-child a {
    border-bottom: none;
}

.news-list li a:hover {
    color: #1a1a1a;
}

/* ── Auth pages ── */
.auth-content {
    grid-area: content;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    background: #fff;
    border: 1px solid #e0e0d8;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 28px;
}

.auth-card form > div {
    margin-bottom: 18px;
}

.auth-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d0c8;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fafaf8;
    transition: border-color 0.15s;
}

.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="text"]:focus {
    outline: none;
    border-color: #888;
    background: #fff;
}

.auth-card input[type="email"].is-invalid,
.auth-card input[type="password"].is-invalid,
.auth-card input[type="text"].is-invalid {
    border-color: #c0392b;
}

.auth-card span {
    display: block;
    font-size: 0.8rem;
    color: #c0392b;
    margin-top: 4px;
}

.auth-card .remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-card .remember-row label {
    margin-bottom: 0;
    font-weight: 400;
    color: #555;
    cursor: pointer;
}

.auth-card button[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.auth-card button[type="submit"]:hover {
    background: #333;
}

.auth-card > p {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.auth-card > p a {
    color: #1a1a1a;
    font-weight: 500;
}

/* ── Hamburger button (hidden on desktop) ── */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-right: 12px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.is-open span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav item shown only on small screens */
.nav-news-mobile {
    display: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .site-header {
        grid-template-columns: 1fr auto;
        position: relative;
    }

    .nav-hamburger {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #e0e0d8;
        z-index: 100;
        padding: 0 24px;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .site-nav ul .nav-right {
        margin-left: 0;
    }

    /* Show mobile-only News link, hide desktop one */
    .nav-news-mobile {
        display: block;
    }
    .nav-news-desktop {
        display: none;
    }

    /* Collapse aside — News column removed */
    .site-content {
        grid-template-columns: 1fr;
        grid-template-areas: "main";
    }

    .site-aside {
        display: none;
    }

    .site-main {
        border-right: none;
    }
}

/* ── Footer ── */
.site-footer {
    grid-area: footer;
    background: #fff;
    border-top: 1px solid #e0e0d8;
    padding: 20px 24px;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}
