:root {
    --royal-blue: #4169E1;
    --royal-dark: #2a47a0;
    --bg-gray: #f4f6f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px; /* Узкий универсальный контейнер, идеальный для смартфонов и аккуратный на ПК */
    margin: 0 auto;
    padding: 0 12px;
}

/* Header */
.main-header {
    background-color: var(--royal-blue);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.logo a {
    color: white;
    text-decoration: none;
    display: block;
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.logo span {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Навигация с горизонтальной прокруткой для телефонов */
.main-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
}

.main-nav::-webkit-scrollbar {
    display: none; /* Chrome / Safari */
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    white-space: nowrap;
    transition: background 0.2s;
}

.main-nav a:hover, .main-nav a:active {
    background-color: var(--royal-dark);
}

/* Main Content */
.content {
    flex: 1;
    padding-top: 16px;
    padding-bottom: 30px;
}

/* Grid & Cards (Единый вертикальный поток) */
.grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card img, .card video {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tag {
    align-self: flex-start;
    background: #e8edfb;
    color: var(--royal-blue);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-color);
    line-height: 1.4;
}

.card-title a {
    color: inherit;
    text-decoration: none;
}

.card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 14px;
}

.btn-more {
    margin-top: auto;
    display: block;
    padding: 10px 16px;
    background: var(--royal-blue);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-more:active {
    background: var(--royal-dark);
}

/* Single Post */
.post-detail {
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}

.post-media {
    margin: 15px 0;
    text-align: center;
}

.post-media img, .post-media video {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.post-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    word-break: break-word;
}

/* Forms (Admin & Login) */
.form-box {
    background: white;
    width: 100%;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: #fafafa;
}

.btn-submit {
    background: var(--royal-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.btn-submit:active {
    background: var(--royal-dark);
}

/* Footer */
.main-footer {
    background: #222;
    color: #aaa;
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.4;
}

