:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #162033;
    --muted: #5a667a;
    --primary: #1f4f8f;
    --primary-dark: #173b6c;
    --border: #d7dee8;
    --border-strong: #c4cedb;
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.05);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7f8fa 0%, #eef2f6 100%);
}

a {
    color: inherit;
}

.container {
    width: min(1180px, 92vw);
    margin: 0 auto;
}

.hero {
    padding: 24px 0 0;
}

.hero-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 28px 28px;
    box-shadow: var(--shadow-soft);
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.site-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    padding: 5px;
}

.auth-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.94rem;
}

.logout-form {
    margin: 0;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 360px);
    gap: 24px;
    align-items: start;
    padding-top: 24px;
}

.hero-content-single {
    grid-template-columns: 1fr;
}

.hero-main {
    max-width: 760px;
}

.hero-kicker {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hero-subtitle,
.hero-summary {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.hero-summary {
    max-width: 62ch;
}

.main-content {
    flex: 1;
    display: grid;
    gap: 18px;
    padding: 18px 0 32px;
}

.section-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: var(--shadow-soft);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.28rem;
    letter-spacing: -0.01em;
}

.section-hint {
    color: var(--muted);
    font-size: 0.92rem;
}

.news-grid,
.services-grid,
.guest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.news-card,
.service-card,
.guest-grid article {
    display: grid;
    gap: 10px;
    min-height: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    background: var(--surface);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.news-card:hover,
.service-card:hover,
.guest-grid article:hover {
    border-color: var(--border-strong);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.news-card time {
    color: var(--muted);
    font-size: 0.87rem;
}

.news-card h3,
.service-card h3,
.guest-grid h3 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
}

.news-card p,
.service-card p,
.guest-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.58;
}

.service-card {
    align-content: start;
}

.empty-state {
    margin: 0;
    color: var(--muted);
}

.guest-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
}

.footer-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-link img {
    border-radius: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-primary,
.btn-secondary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-secondary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
}

@media (max-width: 980px) {
    .hero-content {
        grid-template-columns: 1fr;
    }

    .news-grid,
    .services-grid,
    .guest-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .container {
        width: min(1180px, 94vw);
    }

    .hero-shell,
    .section-block {
        padding: 18px;
        border-radius: 14px;
    }

    .top-row {
        padding-bottom: 16px;
    }

    .hero-content {
        padding-top: 18px;
    }

    .news-grid,
    .services-grid,
    .guest-grid {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: flex-start;
    }

    .btn,
    .user-chip {
        width: 100%;
    }

    .auth-block {
        width: 100%;
    }

    .logout-form {
        width: 100%;
    }
}
