:root {
    --primary: #c0007a;
    --primary-hover: #9c0063;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --bg-light: #f4f5f7;
    --bg-white: #ffffff;
    --footer-bg: #2c3e50;
    --footer-dark: #111827;
    --border-color: #e5e7eb;
    
    --tag-blue: #6366f1;
    --tag-teal: #14b8a6;
    --tag-purple: #a855f7;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

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

ul {
    list-style: none;
}

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

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

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

.flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

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

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* Top Bar */
.top-bar {
    background-color: #2c3e50;
    color: #e2e8f0;
    font-size: 0.85rem;
    padding: 8px 0;
}

.icon-sm {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
}

.icon-xs {
    width: 12px;
    height: 12px;
    display: inline-block;
    vertical-align: middle;
}

.icon {
    width: 20px;
    height: 20px;
}

/* Header */
.main-header {
    background-color: var(--bg-white);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: cursive; /* Approximating the stylized font */
}

.main-nav ul {
    display: flex;
    gap: 25px;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions button {
    background: none;
    border: none;
    cursor: pointer;
}

/* Ticker */
.ticker-wrap {
    background-color: #fce7f3;
    padding: 10px 0;
    border-bottom: 1px solid #fbcfe8;
}

.ticker-label {
    background-color: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ticker {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Hero Section */
.hero {
    margin-bottom: 40px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.hero-card {
    height: 450px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    color: white;
}

.tags {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    color: white;
}

.tag-blue { background-color: var(--tag-blue); }
.tag-teal { background-color: var(--tag-teal); }
.tag-purple { background-color: var(--tag-purple); }

.hero-content h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.meta, .meta-sm {
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* Main Content */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* Articles Area */
.article-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.card-body {
    padding: 20px;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-body .meta {
    color: var(--text-gray);
    margin-bottom: 15px;
}

.card-body p {
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.read-more {
    font-weight: 600;
    color: var(--text-dark);
}

.read-more:hover {
    color: var(--primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
}

.page-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: 50%;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-item.active {
    background: var(--primary);
    color: white;
}

.page-item:not(.active):hover {
    background: #f1f5f9;
}

/* Recommended Section */
.recommended {
    background: var(--bg-white);
    padding: 30px;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

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

.rec-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.rec-tags {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    position: relative;
    margin-top: -25px;
    padding-left: 5px;
}

.rec-card h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.meta-sm {
    color: var(--text-gray);
    font-size: 0.75rem;
}

/* Sidebar */
.widget {
    background: var(--bg-white);
    padding: 25px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.search-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    border-radius: 4px;
}

.search-form button {
    width: 100%;
}

/* Welcome Text (Pre-Footer) */
.welcome-text {
    margin-bottom: 40px;
}

.welcome-box {
    background: var(--bg-white);
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.welcome-box h2 {
    color: var(--primary);
    margin-bottom: 20px;
}

.welcome-box p {
    color: var(--text-gray);
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* Sponsor */
.sponsor-section {
    margin-bottom: 40px;
}

.sponsor-box {
    background: var(--bg-white);
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.sponsor-box h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sponsor-img {
    height: 60px;
    margin: 0 auto 20px;
}

.sponsor-box p {
    color: var(--text-gray);
    font-size: 0.9rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
.main-footer {
    background-color: var(--footer-bg);
    color: #e2e8f0;
    border-top: 4px solid var(--primary);
}

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

.footer-col h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

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

.footer-col ul li a {
    color: #cbd5e1;
}

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

.disclaimer p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.7;
}

.sub-footer {
    background-color: var(--footer-dark);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    background: var(--bg-white);
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 9999;
    transform: translateY(0);
    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: 1.1rem;
}

.cookie-modal p {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 20px;
}

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

.cookie-buttons .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    flex: 1;
    text-align: center;
}

/* Dark Mode Styles */
body.dark-mode {
    --bg-light: #121212;
    --bg-white: #1e1e1e;
    --text-dark: #f3f4f6;
    --text-gray: #9ca3af;
    --border-color: #374151;
}

body.dark-mode .top-bar {
    background-color: #000;
}

body.dark-mode .ticker-wrap {
    background-color: #310a22;
    border-color: #4a0f33;
}

body.dark-mode .page-item:not(.active) {
    background: #374151;
    color: white;
}

/* Responsive */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav ul {
        display: none; /* simple hide for mobile in this template */
    }
    
    .article-cards {
        grid-template-columns: 1fr;
    }
    
    .recommended-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .cookie-modal {
        width: calc(100% - 40px);
        bottom: 20px;
        right: 20px;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
}
/* Inner page styles */
/* Single Article Styles */
.single-article {
    background: var(--bg-white);
    padding: 35px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

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

.article-title {
    font-size: 2.4rem;
    color: var(--text-dark);
    margin: 15px 0;
    line-height: 1.25;
    font-weight: 700;
}

.article-meta {
    color: var(--text-gray);
    font-size: 0.9rem;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Article Images */
.article-hero-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
}

.in-article-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* Table of Contents (Оглавление) */
.toc {
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    padding: 25px;
    margin-bottom: 35px;
    border-radius: 0 8px 8px 0;
}

.toc-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

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

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

.toc a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Article Typography & Elements */
.article-body h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: var(--text-dark);
    font-weight: 700;
}

.article-body h3 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
    color: var(--text-dark);
}

.article-body h4, 
.article-body h5, 
.article-body h6 {
    margin: 25px 0 15px;
    color: var(--text-dark);
}

.article-body p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.article-body span.highlight {
    background-color: #fef08a;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Lists */
.article-body ul {
    list-style-type: disc;
    margin: 0 0 25px 25px;
    padding-left: 15px;
}

.article-body ol {
    list-style-type: decimal;
    margin: 0 0 25px 25px;
    padding-left: 15px;
}

.article-body li {
    margin-bottom: 12px;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.article-body th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
}

.article-body tr:nth-child(even) {
    background-color: var(--bg-light);
}

/* Comment Form Styles */
.comments-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.comments-title {
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.comment-form {
    display: grid;
    gap: 20px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
}

.comment-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.comment-form input, 
.comment-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-form textarea {
    resize: vertical;
    min-height: 150px;
}

.comment-form input:focus, 
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192, 0, 122, 0.15);
}

/* Contact Form Widget Styles */
.contact-widget {
    background: var(--bg-white);
}

.contact-widget .form-group {
    margin-bottom: 15px;
}

.contact-widget input, 
.contact-widget textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.contact-widget textarea {
    min-height: 100px;
    resize: vertical;
}

.contact-widget input:focus, 
.contact-widget textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.contact-widget button {
    width: 100%;
    font-size: 1rem;
}

/* Dark Mode Overrides for Internal Page */
body.dark-mode .single-article,
body.dark-mode .article-body table {
    background: var(--bg-white);
    border-color: var(--border-color);
}

body.dark-mode .toc,
body.dark-mode .comment-form {
    background: #1f2937;
}

body.dark-mode .toc {
    border-left-color: var(--primary);
}

body.dark-mode .article-body tr:nth-child(even) {
    background-color: #111827;
}

body.dark-mode .article-body th {
    border-color: #374151;
}

body.dark-mode .article-body td {
    border-color: #374151;
}

body.dark-mode .article-body span.highlight {
    background-color: #854d0e;
    color: #fef08a;
}

body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea,
body.dark-mode .contact-widget input,
body.dark-mode .contact-widget textarea {
    background: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}

body.dark-mode .comment-form input:focus,
body.dark-mode .comment-form textarea:focus,
body.dark-mode .contact-widget input:focus,
body.dark-mode .contact-widget textarea:focus {
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .single-article {
        padding: 20px;
    }
    .article-title {
        font-size: 1.8rem;
    }
    .toc {
        padding: 15px;
    }
}