/* CSS Reset & Variables */
:root {
    --bg-color: #f0f5fa;
    --text-color: #333333;
    --text-light: #666666;
    --accent-color: #f47b7b;
    --accent-hover: #e06060;
    --white: #ffffff;
    --border-color: #e5e5e5;
    --blue-btn: #1a65d6;
    --blue-btn-hover: #124da3;
    --font-main: 'Open Sans', sans-serif;
    --font-heading: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

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

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

/* Header */
.site-header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 15px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.main-nav a:hover {
    color: var(--accent-color);
}

/* Ticker Section */
.ticker-section {
    background-color: var(--bg-color);
    padding: 20px 0;
}

.ticker-inner {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ticker-label {
    background-color: #777;
    color: var(--white);
    padding: 12px 20px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.ticker-content {
    flex-grow: 1;
    padding: 0 20px;
    font-size: 14px;
}

.ticker-title {
    font-weight: 600;
}

.ticker-date {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

.ticker-controls {
    display: flex;
    padding-right: 15px;
    gap: 10px;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    opacity: 0.5;
}
.ctrl-btn:hover { opacity: 1; }

/* Top Grid */
.top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card-small, .card-large {
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-small:hover, .card-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.card-img-wrapper {
    position: relative;
}

.card-small .card-img-wrapper img {
    height: 150px;
    width: 100%;
    object-fit: cover;
}

.category-tag {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--accent-color);
    color: var(--white);
    font-size: 10px;
    padding: 4px 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.category-outline {
    background-color: transparent;
    border: 1px solid #ccc;
    color: #777;
    top: 20px;
    left: 20px;
}

.card-small .card-title {
    font-size: 14px;
    margin: 15px;
    line-height: 1.4;
}

.card-small .card-date {
    display: block;
    font-size: 11px;
    color: #999;
    margin: 0 15px 15px;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

.main-posts {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.card-large .card-img-wrapper img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.card-content {
    padding: 30px;
}

.post-title {
    font-family: var(--font-heading);
    font-size: 28px;
    margin-bottom: 10px;
}

.post-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 20px;
}

.btn-read-more {
    display: inline-block;
    border: 1px solid var(--text-color);
    padding: 8px 15px;
    font-size: 12px;
    font-weight: bold;
}

.btn-read-more:hover {
    background: var(--text-color);
    color: var(--white);
}

/* Sidebar */
.sidebar-widget {
    background: var(--white);
    padding: 25px;
    border-radius: 6px;
}

.widget-title {
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.sidebar-list img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.list-info h4 {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.list-info span {
    font-size: 11px;
    color: #999;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 1px solid #ccc;
    background: var(--white);
    font-size: 14px;
}

.page-num.active, .page-num:hover {
    background: var(--text-color);
    color: var(--white);
    border-color: var(--text-color);
}
.page-num img { width: 12px; }

/* Pre-Footer Welcome */
.pre-footer-welcome {
    padding: 50px 0;
    background-color: var(--bg-color);
}

.welcome-box {
    background: var(--white);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.welcome-box h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.welcome-box p {
    color: var(--text-light);
    font-size: 15px;
}

/* Footer */
.site-footer {
    background-color: #eef2f6;
    color: var(--text-color);
}

.footer-top {
    padding: 60px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-col p {
    font-size: 14px;
    color: var(--text-light);
}

.footer-col h4 {
    font-size: 16px;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    font-size: 14px;
    color: var(--accent-color);
}

.footer-col ul a:hover {
    text-decoration: underline;
}

.footer-bottom {
    background-color: var(--accent-color);
    color: var(--white);
    text-align: center;
    padding: 20px 0;
}

.footer-bottom p {
    font-size: 14px;
    margin-bottom: 5px;
}

.footer-bottom .disclaimer {
    font-size: 11px;
    opacity: 0.9;
    max-width: 800px;
    margin: 5px auto 0;
}

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.cookie-modal.hidden {
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
}

.cookie-modal h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.cookie-modal p {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-buttons button {
    flex: 1;
    padding: 8px 0;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--blue-btn);
    color: var(--blue-btn);
}

.btn-outline:hover {
    background: #f0f5ff;
}

.btn-solid {
    background: var(--blue-btn);
    border: 1px solid var(--blue-btn);
    color: var(--white);
}

.btn-solid:hover {
    background: var(--blue-btn-hover);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 390px; /* Offset to not overlap with cookie banner if both are visible */
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 999;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-to-top img {
    width: 40px;
    height: 40px;
}

.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* Responsive */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .back-to-top {
        right: 20px;
        bottom: 90px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .cookie-modal {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 20px;
    }
    .cookie-buttons {
        flex-direction: column;
    }
}

/* Inner page styles */

/* =========================================
   INNER PAGE SPECIFIC STYLES
   ========================================= */

.inner-page-layout {
    margin-top: 40px;
}

.single-article {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    padding: 40px;
    margin-bottom: 40px;
}

.article-h1 {
    font-family: var(--font-heading);
    font-size: 38px;
    color: var(--text-color);
    line-height: 1.2;
    margin-bottom: 15px;
}

.article-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 30px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.category-tag-inline {
    color: var(--accent-color);
    font-weight: bold;
}

/* Article Images */
.article-main-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 30px;
}

.article-inline-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* Article Typography */
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    font-family: var(--font-heading);
    color: var(--text-color);
    margin: 35px 0 15px 0;
    line-height: 1.3;
}

.article-body h2 { font-size: 28px; }
.article-body h3 { font-size: 24px; }
.article-body h4 { font-size: 20px; }
.article-body h5 { font-size: 18px; }
.article-body h6 { font-size: 16px; }

.article-body p {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}

.highlight-text {
    background-color: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    color: #856404;
}

/* Table of Contents (Оглавление) */
.toc-box {
    background-color: var(--bg-color);
    border-left: 4px solid var(--accent-color);
    padding: 25px;
    margin: 0 0 30px 0;
    border-radius: 0 6px 6px 0;
}

.toc-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 10px;
}

.toc-list a {
    color: var(--blue-btn);
    font-weight: 600;
    text-decoration: none;
}

.toc-list a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Lists within article */
.article-ul,
.article-ol {
    margin: 0 0 25px 25px;
    padding: 0;
    color: #444;
}

.article-ul li,
.article-ol li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.article-ul li::marker {
    color: var(--accent-color);
}

/* Table Styling */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: var(--white);
}

.article-table th,
.article-table td {
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: left;
    font-size: 15px;
}

.article-table th {
    background-color: var(--bg-color);
    font-weight: bold;
    color: var(--text-color);
}

.article-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* Related Articles Section */
.related-articles-section {
    margin-bottom: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.section-title-small {
    font-family: var(--font-heading);
    font-size: 24px;
    margin-bottom: 25px;
}

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

.related-grid .card-small h4 {
    font-size: 15px;
    margin: 15px;
    line-height: 1.4;
    font-family: var(--font-main);
}

/* Forms Styling (Comments & Contact) */
.interaction-form-section {
    background: var(--white);
    padding: 35px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    margin-bottom: 40px;
}

.form-subtitle {
    font-size: 13px;
    color: #777;
    margin-bottom: 25px;
}

.custom-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 15px;
    background: #fafafa;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.form-submit-btn {
    padding: 12px 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    width: max-content;
    transition: background-color 0.3s, color 0.3s;
}

/* Responsive Adjustments for Inner Page */
@media (max-width: 768px) {
    .single-article {
        padding: 20px;
    }
    .article-h1 {
        font-size: 28px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .article-table th, .article-table td {
        padding: 10px;
        font-size: 14px;
    }
}
.ticker-section {
    overflow: hidden;
}

.ticker-inner {
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
}

.ticker-label {
    flex: 0 0 auto;
    position: relative;
    z-index: 5;
}

.ticker-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 34px;
    width: max-content;
    min-width: max-content;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 22s linear infinite;
}

.ticker-track.is-paused {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    color: inherit;
    text-decoration: none;
}

.ticker-title {
    font-weight: 600;
}

.ticker-date {
    opacity: 0.6;
    font-size: 13px;
}

.ticker-controls {
    flex: 0 0 auto;
    position: relative;
    z-index: 5;
}

@keyframes ticker-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}