/* =========================================
   СТИЛІ ДЛЯ БЛОГУ
   ========================================= */

.blog-header-section {
    padding: 60px 0 40px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.blog-header-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
}

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

/* Сітка статей */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Картка статті */
.blog-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
}

.blog-image-placeholder {
    width: 100%;
    height: 200px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-category {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.blog-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #94a3b8;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* =========================================
   ПАГІНАЦІЯ
   ========================================= */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    background-color: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
}

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 12px;
}

/* =========================================
   СТИЛІ ДЛЯ СТОРІНКИ СТАТТІ (SINGLE ARTICLE)
   ========================================= */

.single-article {
    padding: 60px 0;
    background-color: var(--bg-main);
}

.article-container {
    max-width: 800px; /* Звужуємо контейнер для комфортного читання */
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.article-meta-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.back-to-blog {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-right: auto;
}

.back-to-blog:hover {
    text-decoration: underline;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 32px;
    color: var(--text-dark);
}

.article-hero-image {
    margin-bottom: 40px;
    border-radius: 16px;
    overflow: hidden;
}

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

/* Оформлення контенту (типографіка) */
.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
}

.article-content p {
    margin-bottom: 24px;
}

.article-content .lead-text {
    font-size: 1.25rem;
    color: #475569;
    font-weight: 500;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 48px 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-main);
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 32px 0 16px;
}

.article-content ul, .article-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 12px;
}

.article-content code {
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #0f172a;
}

/* CTA Блок у статті */
.article-cta-block {
    background-color: #f8fafc;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    border: 2px dashed var(--primary-color);
    margin: 48px 0;
}

.article-cta-block h3 {
    margin-top: 0;
    color: var(--text-dark);
}

.article-cta-block p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Оформлення FAQ (акордеон на чистому HTML/CSS) */
.faq-accordion {
    margin-bottom: 48px;
}

.faq-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.faq-item summary {
    padding: 20px 24px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    list-style: none; /* Ховаємо стандартний трикутник */
    position: relative;
    color: var(--text-dark);
}

/* Кастомний іконка для FAQ */
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 24px;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.2s;
}
.faq-item[open] summary::after {
    content: "−";
    transform: rotate(180deg);
}

.faq-content {
    padding: 0 24px 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 16px;
}

.faq-content p:last-child {
    margin-bottom: 0;
}

.article-footer-links {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.article-footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.article-footer-links a:hover {
    text-decoration: underline;
}

/* Адаптивність для статті */
@media (max-width: 768px) {
    .article-container { padding: 24px; border-radius: 0; border: none;}
    .article-title { font-size: 2rem; }
    .cta-actions { flex-direction: column; }
    .cta-actions .btn { width: 100%; }
}

/* =========================================
   СТИЛІ ДЛЯ СТОРІНКИ СТАТТІ (SINGLE ARTICLE)
   ========================================= */

.single-article {
    padding: 60px 0;
    background-color: var(--bg-main);
}

.article-container {
    max-width: 800px;
    margin: 0 auto; /* Центрування статті */
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.article-meta-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.back-to-blog {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-right: auto;
}

.back-to-blog:hover {
    text-decoration: underline;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 32px;
    color: var(--text-dark);
}

.article-hero-image {
    margin-bottom: 40px;
    border-radius: 16px;
    overflow: hidden;
}

.responsive-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

/* Оформлення контенту (типографіка) */
.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
}

.article-content p { margin-bottom: 24px; }
.article-content .lead-text { font-size: 1.25rem; color: #475569; font-weight: 500; }
.article-content h2 { font-size: 1.75rem; font-weight: 700; color: var(--text-dark); margin: 48px 0 24px; padding-bottom: 12px; border-bottom: 2px solid var(--bg-main); }
.article-content h3 { font-size: 1.35rem; font-weight: 700; color: var(--text-dark); margin: 32px 0 16px; }
.article-content ul, .article-content ol { margin-bottom: 24px; padding-left: 24px; }
.article-content li { margin-bottom: 12px; }

/* CTA Блок у статті */
.article-cta-block {
    background-color: #f8fafc;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    border: 2px dashed var(--primary-color);
    margin: 48px 0;
}

.article-cta-block h3 { margin-top: 0; color: var(--text-dark); }
.article-cta-block p { color: var(--text-muted); margin-bottom: 24px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Оформлення FAQ (акордеон на чистому HTML/CSS) */
.faq-accordion { margin-bottom: 48px; }
.faq-item { background: #ffffff; border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.faq-item summary { padding: 20px 24px; font-weight: 600; font-size: 1.1rem; cursor: pointer; list-style: none; position: relative; color: var(--text-dark); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 24px; font-size: 1.5rem; color: var(--primary-color); transition: transform 0.2s; }
.faq-item[open] summary::after { content: "−"; transform: rotate(180deg); }
.faq-content { padding: 0 24px 24px; border-top: 1px solid var(--border-color); margin-top: 16px; padding-top: 16px; }

.article-footer-links { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-color); }
.article-footer-links a { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.article-footer-links a:hover { text-decoration: underline; }

/* Адаптивність для мобільних */
@media (max-width: 768px) {
    .article-container { padding: 24px; border-radius: 0; border-left: none; border-right: none;}
    .article-title { font-size: 2rem; }
    .cta-actions { flex-direction: column; }
    .cta-actions .btn { width: 100%; }
}