@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* Общие стили для body и контейнера */
body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #3f51b5; /* Темно-синий, солидный цвет */
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 1.8em;
    font-weight: bold;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo span {
    white-space: nowrap;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #e0e0e0;
}

/* Main Content - Общие стили для секций статей */
main {
    padding: 30px 0;
}

.content-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.08);
    margin-bottom: 30px; /* Отступы между секциями */
}

h1, h2, h3 {
    color: #303f9f; /* Цвет заголовков */
    margin-top: 0;
    margin-bottom: 15px;
}

h1 { font-size: 2.5em; text-align: center; }
h2 { font-size: 1.8em; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-top: 25px; }
h3 { font-size: 1.4em; }

p {
    font-size: 1.05em;
    margin-bottom: 1em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-caption {
    font-size: 0.9em;
    color: #555;
    text-align: center;
    margin-top: -10px; /* Приблизить к изображению */
    margin-bottom: 20px;
}

/* Стили для ссылок в тексте */
a {
    color: #3f51b5;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #263238; /* Очень темный серый */
    color: white;
    padding: 25px 0;
    text-align: center;
    font-size: 0.9em;
    margin-top: 30px;
}

footer a {
    color: #90CAF9;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
    color: #bbdefb;
}

/* Адаптивность */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    nav ul {
        flex-direction: column;
        margin-top: 15px;
    }
    nav ul li {
        margin: 5px 0;
    }
    .logo {
        font-size: 1.5em;
    }
    h1 { font-size: 2em; }
    h2 { font-size: 1.5em; }
    .content-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 30px;
    }
    .logo span {
        font-size: 0.9em;
    }
    h1 { font-size: 1.7em; }
    h2 { font-size: 1.3em; }
}

/* --- Специфичные стили для главной страницы (index.html) --- */
.hero-section {
    text-align: center;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.hero-section img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hero-section h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.2em;
    color: #555;
    max-width: 700px;
    margin: 0 auto 30px auto;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.article-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
}

.article-card img {
    width: 100%;
    height: 180px; /* Фиксированная высота для превью */
    object-fit: cover; /* Обрезка изображений */
    border-bottom: 1px solid #eee;
    margin: 0;
    border-radius: 8px 8px 0 0;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #303f9f;
}

.card-content p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    max-height: 4.5em; /* Ограничить количество строк */
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    display: inline-block;
    background-color: #5c6bc0; /* Синяя кнопка */
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: #3f51b5;
    text-decoration: none;
}