/* ========== RESET & БАЗА ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f5f5f0;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== ШАПКА ========== */
header {
    background: #0a1f2e;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 3px solid #e63946;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 2px;
}

.logo a:hover {
    color: #e63946;
}

nav {
    margin-top: 15px;
}

nav a {
    color: #ddd;
    text-decoration: none;
    margin-right: 25px;
    font-size: 16px;
    transition: color 0.3s;
}

nav a:hover {
    color: #e63946;
}

nav a.admin-link {
    color: #e63946;
    font-weight: bold;
}

/* ========== ДВУХКОЛОНОЧНЫЙ МАКЕТ ========== */
.content-wrapper {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.main-content {
    flex: 3;
    min-width: 0;
}

.sidebar {
    flex: 1;
    min-width: 200px;
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
main {
    flex: 1;
    padding: 40px 0;
}

h1 {
    font-size: 36px;
    margin-bottom: 30px;
    color: #0a1f2e;
    border-left: 4px solid #e63946;
    padding-left: 20px;
}

h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

/* ========== НОВОСТИ (СПИСОК) ========== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.news-item {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.news-item h2 a {
    color: #0a1f2e;
    text-decoration: none;
}

.news-item h2 a:hover {
    color: #e63946;
}

.news-date {
    color: #888;
    font-size: 14px;
    margin-bottom: 15px;
}

.news-preview {
    color: #444;
    line-height: 1.7;
}

/* ========== СТРАНИЦА НОВОСТИ ========== */
.news-full h1 {
    font-size: 32px;
    margin-bottom: 15px;
    line-height: 1.3;
    width: 100%;
}

.news-date {
    color: #888;
    font-size: 14px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.news-image {
    float: left;
    width: 180px;
    margin-right: 20px;
    margin-bottom: 15px;
}

.news-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.news-content {
    overflow: hidden;
    font-size: 16px;
    line-height: 1.7;
}

.news-content p {
    margin-bottom: 20px;
}

.news-back {
    clear: both;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.news-back a {
    color: #e63946;
    text-decoration: none;
}

/* ========== САЙДБАР ========== */
.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar-widget h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e63946;
    color: #0a1f2e;
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget li {
    margin-bottom: 12px;
}

.sidebar-widget li a {
    color: #333;
    text-decoration: none;
}

.sidebar-widget li a:hover {
    color: #e63946;
}

.sidebar-widget .date {
    font-size: 12px;
    color: #999;
    display: block;
}

/* ========== ПОДВАЛ ========== */
footer {
    background: #0a1f2e;
    color: #888;
    text-align: center;
    padding: 25px 0;
    margin-top: 40px;
    font-size: 14px;
}

/* ========== АДМИНКА ========== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.btn {
    background: #0a1f2e;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #e63946;
    color: white;
}

.btn-danger {
    background: #dc3545;
}

.btn-success {
    background: #28a745;
}

.admin-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th {
    background: #0a1f2e;
    color: white;
    padding: 12px;
    text-align: left;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
    background: #f9f9f9;
}

.edit-link {
    color: #28a745;
    text-decoration: none;
    margin-right: 10px;
}

.delete-link {
    color: #dc3545;
    text-decoration: none;
}

.login-form {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    background: #e63946;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
}

.error {
    background: #ffe6e6;
    color: #e63946;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* ========== АДАПТИВ ========== */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        order: -1;
    }
    
    h1 {
        font-size: 28px;
    }
    
    nav a {
        margin-right: 15px;
        font-size: 14px;
    }
}