/* =====================
   Базовые стили
   ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    color: #050505;
    background-color: #ebebe8;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    color: #066e64;
    text-decoration: none;
}

a:hover {
    color: #5bc9d6;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================
   Шапка
   ===================== */
#header {
    background: #f2f2f2;
    border-bottom: 1px solid #ddd;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: #a3a3a3;
    color: #fff;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-top a {
    color: #fff;
    margin-left: 16px;
}

.header-top a:first-child {
    margin-left: 0;
}

.header-top a:hover {
    color: #b2e1f5;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.04em;
}

.logo-desc {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.main-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    flex: 1;
    justify-content: center;
}

.main-menu a {
    padding: 6px 10px;
    font-size: 13px;
    text-transform: uppercase;
    color: #000;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.main-menu a:hover {
    background: #e0e0e0;
    color: #000;
}

.main-menu a.active {
    background: #066e64;
    color: #fff;
}

.search-box {
    flex-shrink: 0;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    outline: none;
}

.search-box input:focus {
    border-color: #066e64;
}

/* =====================
   Тулбар
   ===================== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title {
    font-size: 24px;
    border-bottom: 2px solid #066e64;
    padding-bottom: 8px;
    color: #000;
    flex: 1;
    min-width: 200px;
}

.per-page-label {
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.per-page-label select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.per-page-label select:focus {
    border-color: #066e64;
}

/* =====================
   Сетка новостей
   ===================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #eee;
}

.news-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card .category {
    display: inline-block;
    background: #066e64;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    align-self: flex-start;
}

.news-card h3 {
    font-size: 17px;
    line-height: 23px;
    margin-bottom: 8px;
    color: #000;
}

.news-card:hover h3 {
    color: #066e64;
}

.news-card .excerpt {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
    flex: 1;
}

.news-card time {
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

/* =====================
   Пагинация
   ===================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.page-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

.page-btn.active {
    background: #066e64;
    color: #fff;
    border-color: #066e64;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-dots {
    padding: 0 4px;
    color: #999;
    font-size: 14px;
}

/* =====================
   Статические страницы
   ===================== */
.page {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    margin: 30px auto;
    max-width: 900px;
}

.page h1 {
    font-size: 32px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #066e64;
    color: #000;
}

.page h2 {
    font-size: 22px;
    margin: 28px 0 12px;
    color: #000;
}

.page-content p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 14px;
    color: #333;
}

.page-content a {
    color: #066e64;
    text-decoration: underline;
}

.page-content a:hover {
    color: #5bc9d6;
}

.page-content strong {
    color: #000;
}

/* =====================
   Страница новости
   ===================== */
#article-container {
    max-width: 860px;
    margin: 0 auto;
}

.article-full {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin: 30px 0;
}

.article-header {
    margin-bottom: 20px;
}

.article-full .category {
    display: inline-block;
    background: #066e64;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.article-full h1 {
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.25;
    color: #000;
    margin-bottom: 12px;
}

.article-full .meta {
    font-size: 13px;
    color: #888;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

/* Обложка — не на всю страницу */
.article-cover {
    margin: 0 auto 24px;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f2f2;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.article-cover img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 640px;     /* ограничение по высоте, чтобы вертикальные не растягивались */
    width: auto;            /* ← ключевое: не растягиваем на всю ширину */
    object-fit: contain;    /* ← ключевое: показываем целиком, без обрезки */
    object-position: center;
}

/* Текст статьи */
.post-content {
    font-size: 17px;
    line-height: 1.7;
    color: #2b2b2b;
}

.post-content p {
    margin-bottom: 1em;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}

.post-content h2,
.post-content h3 {
    margin: 1.4em 0 0.6em;
    line-height: 1.3;
    color: #000;
}

.post-content a {
    color: #066e64;
    text-decoration: underline;
}

.post-content blockquote {
    margin: 1.2em 0;
    padding: 8px 16px;
    border-left: 4px solid #066e64;
    background: #f4faf9;
    color: #555;
    font-style: italic;
}

/* Теги */
.tags {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 13px;
    background: #f0f0f0;
    color: #444;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.15s;
}

.tags a:hover {
    background: #e0e0e0;
    color: #000;
}

/* =====================
   Похожие новости
   ===================== */
.related-section {
    margin: 40px 0;
}

.related-section h3 {
    font-size: 22px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #066e64;
    color: #000;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* =====================
   Футер
   ===================== */
#footer {
    background: #404040;
    color: #fff;
    margin-top: 40px;
    padding: 30px 0;
}

.footer-menu {
    text-align: center;
    margin-bottom: 16px;
}

.footer-menu a {
    color: #fff;
    margin: 0 15px;
    font-size: 14px;
}

.footer-menu a:hover {
    color: #79d7ff;
}

.footer-text {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    line-height: 1.6;
}

/* =====================
   Адаптив
   ===================== */
@media (max-width: 900px) {
    .header-main {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .logo {
        align-items: flex-start;
    }

    .main-menu {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 5px;
    }

    .search-box input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page {
        padding: 20px;
    }
    .page h1 {
        font-size: 24px;
    }
    .article-full {
        padding: 20px;
    }
    .article-cover {
        max-height: 280px;
    }
    .article-cover img {
        max-height: 280px;
    }
}

@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .section-title {
        font-size: 20px;
    }

    .header-top {
        font-size: 12px;
    }

    .header-top a {
        margin-left: 10px;
    }

    .post-content {
        font-size: 16px;
    }

    .article-cover {
        max-height: 220px;
    }
    .article-cover img {
        max-height: 220px;
    }
	/* =====================
   Лоадер страницы
   ===================== */
#page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

.loader-inner {
    text-align: center;
    max-width: 320px;
    width: 90%;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #e0e0e0;
    border-top-color: #066e64;
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.loader-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 999px;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    width: 0;
    background: #066e64;
    border-radius: 999px;
    transition: width 0.3s;
}
}