/**
 * Стили для блога и отдельных постов
 * 
 * @package MedEquip_Aggregator
 */

/* ==========================================================================
   Переменные
   ========================================================================== */

   :root {
    --blog-primary: #12356a;
    --blog-text: #374151;
    --blog-heading: #111827;
    --blog-meta: #6b7280;
    --blog-border: #e5e7eb;
    --blog-bg-light: #f9fafb;
}

/* ==========================================================================
   Отдельный пост - Hero Header
   ========================================================================== */

.blog-post-single {
    background: #ffffff;
}

.post-header {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
    padding: 32px 0 48px 0;
    margin-bottom: 32px;
}

.post-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.post-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.post-category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--blog-heading);
    margin: 0 0 16px 0;
    max-width: 900px;
}

.post-subtitle {
    font-size: 20px;
    line-height: 1.6;
    color: var(--blog-meta);
    margin: 0 0 24px 0;
    max-width: 800px;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid var(--blog-border);
    border-bottom: 1px solid var(--blog-border);
    margin-bottom: 24px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--blog-heading);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-name:hover {
    color: var(--blog-primary);
}

.post-date,
.post-updated,
.post-reading-time,
.post-views {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--blog-meta);
}

.post-date i,
.post-updated i,
.post-reading-time i,
.post-views i {
    font-size: 16px;
}

/* Social Share */
.post-social-share {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--blog-meta);
}

.social-buttons {
    display: flex;
    gap: 8px;
}

.social-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--blog-border);
    color: var(--blog-meta);
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn i {
    font-size: 18px;
}

.social-vk:hover {
    background: #0077ff;
    border-color: #0077ff;
    color: #ffffff;
}

.social-telegram:hover {
    background: #0088cc;
    border-color: #0088cc;
    color: #ffffff;
}

.social-whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
    color: #ffffff;
}

.social-copy:hover {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #ffffff;
}

/* Social Share Bottom (with text) */
.post-social-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    background: var(--blog-bg-light);
    border-radius: 12px;
    margin-top: 48px;
}

.post-social-bottom .social-buttons {
    width: 100%;
    justify-content: flex-start;
}

.post-social-bottom .social-btn {
    width: auto;
    padding: 0 20px;
    height: 44px;
    border-radius: 8px;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.post-social-bottom .social-btn span {
    display: inline;
}

/* ==========================================================================
   Featured Media
   ========================================================================== */

.post-featured-media {
    margin-bottom: 48px;
}

.post-featured-image {
    margin: 0;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.image-caption {
    text-align: center;
    font-size: 14px;
    color: var(--blog-meta);
    font-style: italic;
    margin-top: 12px;
}

.post-video-wrapper {
    margin-bottom: 32px;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Content Layout
   ========================================================================== */

.post-content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    padding: 0 0 64px 0;
}

/* ==========================================================================
   Table of Contents (TOC)
   ========================================================================== */

.post-toc {
    background: var(--blog-bg-light);
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    position: relative;
}

.toc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--blog-heading);
    margin: 0 0 16px 0;
}

.toc-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--blog-meta);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.toc-toggle.collapsed {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.toc-item {
    counter-increment: toc-counter;
    margin-bottom: 8px;
}

.toc-item a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    color: var(--blog-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.toc-item a::before {
    content: counter(toc-counter) ".";
    font-weight: 600;
    color: var(--blog-primary);
    min-width: 24px;
}

.toc-item a:hover {
    background: #ffffff;
    color: var(--blog-primary);
}

.toc-item.active a {
    background: #ffffff;
    color: var(--blog-primary);
    font-weight: 600;
}

.toc-level-3 {
    padding-left: 24px;
}

.toc-level-3 a {
    font-size: 13px;
}

/* ==========================================================================
   Post Content Body
   ========================================================================== */

.post-content-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--blog-text);
}

.post-content-body h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--blog-heading);
    margin: 48px 0 24px 0;
    line-height: 1.3;
    scroll-margin-top: 100px; /* Для якорных ссылок */
}

.post-content-body h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--blog-heading);
    margin: 36px 0 16px 0;
    line-height: 1.4;
    scroll-margin-top: 100px;
}

.post-content-body h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--blog-heading);
    margin: 24px 0 12px 0;
}

.post-content-body p {
    margin: 0 0 24px 0;
}

.post-content-body a {
    color: var(--blog-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.post-content-body a:hover {
    color: #1d4ed8;
    text-decoration-thickness: 2px;
}

.post-content-body ul,
.post-content-body ol {
    margin: 0 0 24px 0;
    padding-left: 32px;
}

.post-content-body li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.post-content-body blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    background: var(--blog-bg-light);
    border-left: 4px solid var(--blog-primary);
    border-radius: 0 8px 8px 0;
    font-size: 20px;
    font-style: italic;
    color: var(--blog-text);
}

.post-content-body blockquote p:last-child {
    margin-bottom: 0;
}

.post-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
}

.post-content-body figure {
    margin: 32px 0;
}

.post-content-body figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--blog-meta);
    margin-top: 8px;
    font-style: italic;
}

.post-content-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 32px 0;
    font-size: 14px;
    line-height: 1.6;
}

.post-content-body code {
    background: var(--blog-bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content-body pre code {
    background: transparent;
    padding: 0;
}

.post-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-size: 16px;
}

.post-content-body table th {
    background: var(--blog-bg-light);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid var(--blog-border);
}

.post-content-body table td {
    padding: 12px 16px;
    border: 1px solid var(--blog-border);
}

.post-content-body table tr:hover {
    background: var(--blog-bg-light);
}

/* WordPress alignment classes */
.alignleft {
    float: left;
    margin: 8px 24px 24px 0;
}

.alignright {
    float: right;
    margin: 8px 0 24px 24px;
}

.aligncenter {
    display: block;
    margin: 32px auto;
}

/* ==========================================================================
   Post Components
   ========================================================================== */

/* Source Block */
.post-source-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--blog-bg-light);
    border-left: 4px solid var(--blog-primary);
    border-radius: 0 8px 8px 0;
    margin-top: 48px;
    font-size: 14px;
}

.source-label {
    font-weight: 600;
    color: var(--blog-meta);
}

.source-link {
    color: var(--blog-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.source-link:hover {
    text-decoration: underline;
}

/* Tags */
.post-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--blog-border);
}

.post-tags i {
    color: var(--blog-meta);
    font-size: 18px;
}

.post-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--blog-bg-light);
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--blog-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tag:hover {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* CTA Box */
.post-cta-box {
    margin-top: 48px;
    padding: 48px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 16px;
    text-align: center;
}

.cta-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--blog-heading);
    margin: 0 0 12px 0;
}

.cta-content p {
    font-size: 16px;
    color: var(--blog-meta);
    margin: 0 0 24px 0;
}

/* Author Bio */
.post-author-bio {
    display: flex;
    gap: 24px;
    padding: 32px;
    background: var(--blog-bg-light);
    border-radius: 12px;
    margin-top: 48px;
}

.author-bio-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-bio-content {
    flex: 1;
}

.author-bio-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.author-bio-name a {
    color: var(--blog-heading);
    text-decoration: none;
}

.author-bio-name a:hover {
    color: var(--blog-primary);
}

.author-bio-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--blog-text);
    margin: 0 0 12px 0;
}

.author-all-posts {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: 600;
}

.author-all-posts:hover {
    text-decoration: underline;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 48px;
    padding-top: 48px;
    border-top: 2px solid var(--blog-border);
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--blog-bg-light);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-nav-link:hover {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.nav-label {
    font-size: 13px;
    color: var(--blog-meta);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--blog-heading);
    line-height: 1.4;
}

.post-nav-next {
    text-align: right;
}

/* Related Posts */
.related-posts {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 2px solid var(--blog-border);
}

.related-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--blog-heading);
    margin: 0 0 32px 0;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.related-post-card {
    background: #ffffff;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.related-post-image {
    display: block;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 20px;
}

.related-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
}

.related-post-category {
    padding: 4px 10px;
    background: var(--blog-bg-light);
    border-radius: 12px;
    color: var(--blog-primary);
    font-weight: 600;
}

.related-post-date {
    color: var(--blog-meta);
}

.related-post-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.related-post-title a {
    color: var(--blog-heading);
    text-decoration: none;
}

.related-post-title a:hover {
    color: var(--blog-primary);
}

.related-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--blog-meta);
    margin: 0;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.post-sidebar {
    position: sticky;
    top: 24px;
    height: fit-content;
}

.sidebar-sticky {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Reading Progress */
.reading-progress-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--blog-bg-light);
    border-radius: 12px;
}

.progress-circle {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 4;
}

.progress-bar {
    fill: none;
    stroke: var(--blog-primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 163.36; /* 2 * PI * 26 */
    stroke-dashoffset: 163.36;
    transition: stroke-dashoffset 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
    color: var(--blog-primary);
}

.progress-label {
    font-size: 13px;
    color: var(--blog-meta);
    text-align: center;
}

/* Sidebar TOC Mobile */
.sidebar-toc-mobile {
    display: none;
}

/* Sidebar Widget */
.sidebar-widget {
    background: #ffffff;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    padding: 24px;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--blog-heading);
    margin: 0 0 20px 0;
}

/* Popular Posts */
.popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popular-post-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--blog-border);
}

.popular-post-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.popular-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blog-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 8px;
    flex-shrink: 0;
}

.popular-post-content {
    flex: 1;
}

.popular-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px 0;
}

.popular-post-title a {
    color: var(--blog-heading);
    text-decoration: none;
}

.popular-post-title a:hover {
    color: var(--blog-primary);
}

.popular-post-meta {
    font-size: 12px;
    color: var(--blog-meta);
}

/* Categories List */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 8px;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--blog-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.categories-list a:hover {
    background: var(--blog-bg-light);
    color: var(--blog-primary);
}

.category-count {
    font-size: 12px;
    color: var(--blog-meta);
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.newsletter-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blog-primary);
    color: #ffffff;
    border-radius: 50%;
    font-size: 28px;
    margin: 0 auto 16px auto;
}

.newsletter-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--blog-text);
    text-align: center;
    margin-bottom: 16px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-input {
    padding: 12px 16px;
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    font-size: 14px;
}

.newsletter-submit {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blog-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.newsletter-submit:hover {
    background: #1d4ed8;
}

.newsletter-privacy {
    font-size: 11px;
    color: var(--blog-meta);
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
}

.newsletter-privacy a {
    color: var(--blog-primary);
    text-decoration: none;
}

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    text-align: center;
}

.cta-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blog-primary);
    color: #ffffff;
    border-radius: 16px;
    font-size: 32px;
    margin: 0 auto 16px auto;
}

.cta-widget h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--blog-heading);
    margin: 0 0 8px 0;
}

.cta-widget p {
    font-size: 14px;
    color: var(--blog-text);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

/* ==========================================================================
   Archive Page
   ========================================================================== */

.blog-archive-page {
    background: #ffffff;
}

.archive-hero {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
    padding: 48px 0;
    margin-bottom: 48px;
}

.archive-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--blog-heading);
    margin: 0 0 16px 0;
}

.archive-description {
    font-size: 18px;
    line-height: 1.7;
    color: var(--blog-meta);
    max-width: 800px;
}

.blog-stats {
    display: flex;
    gap: 48px;
    margin-top: 32px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--blog-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--blog-meta);
}

/* Featured Posts Section */
.featured-posts-section {
    padding: 48px 0;
    background: var(--blog-bg-light);
    margin-bottom: 48px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--blog-heading);
    margin: 0 0 32px 0;
}

.featured-posts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.featured-main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.featured-post-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.featured-post-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.featured-image {
    position: relative;
    display: block;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-secondary .featured-image img {
    height: 200px;
}

.featured-post-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
}

.featured-badge {
    padding: 6px 14px;
    background: rgba(37, 99, 235, 0.95);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-content {
    padding: 24px;
}

.featured-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--blog-bg-light);
    color: var(--blog-primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    margin-bottom: 12px;
}

.featured-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.featured-secondary .featured-title {
    font-size: 18px;
}

.featured-title a {
    color: var(--blog-heading);
    text-decoration: none;
}

.featured-title a:hover {
    color: var(--blog-primary);
}

.featured-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--blog-text);
    margin: 0 0 16px 0;
}

.featured-secondary .featured-excerpt {
    font-size: 14px;
}

.featured-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--blog-meta);
}

.meta-date,
.meta-reading {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Archive Layout */
.archive-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 48px;
    padding-bottom: 64px;
}

/* Archive Sidebar */
.archive-sidebar {
    position: sticky;
    top: 24px;
    height: fit-content;
}

.search-widget .blog-search-form {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    font-size: 14px;
}

.search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blog-primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Categories Detailed */
.categories-list-detailed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-item a:hover,
.category-item.active a {
    background: var(--blog-bg-light);
}

.category-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 20px;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--blog-text);
}

.category-item a:hover .category-name,
.category-item.active .category-name {
    color: var(--blog-primary);
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-block;
    padding: 6px 14px;
    background: var(--blog-bg-light);
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    color: var(--blog-text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

.tag-lg {
    font-size: 15px;
    font-weight: 600;
}

.tag-md {
    font-size: 14px;
}

.tag-sm {
    font-size: 12px;
}

/* Archive Main */
.archive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    margin-bottom: 32px;
}

.posts-count {
    font-size: 14px;
    color: var(--blog-meta);
}

.posts-count strong {
    color: var(--blog-heading);
    font-weight: 600;
}

.view-switcher {
    display: flex;
    gap: 4px;
    border: 1px solid var(--blog-border);
    border-radius: 6px;
    padding: 4px;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--blog-meta);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: var(--blog-bg-light);
    color: var(--blog-heading);
}

.view-btn.active {
    background: var(--blog-primary);
    color: #ffffff;
}

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.post-card {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    background: #ffffff;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.post-card-image {
    display: block;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 24px 24px 24px 0;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.post-card-category {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.post-card-date,
.post-card-reading {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--blog-meta);
}

.post-card-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--blog-heading);
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--blog-primary);
}

.post-card-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--blog-text);
    margin: 0 0 16px 0;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--blog-border);
}

.post-author-small {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--blog-meta);
}

.post-author-small img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.post-stats {
    display: flex;
    gap: 16px;
}

.stat-views,
.stat-comments {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--blog-meta);
}

.post-read-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--blog-primary);
    text-decoration: none;
}

.post-read-more:hover {
    text-decoration: underline;
}

/* Grid View */
.posts-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.posts-list.grid-view .post-card {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 1fr;
}

.posts-list.grid-view .post-card-content {
    padding: 20px;
}

/* Pagination */
.archive-pagination {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.archive-pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-pagination li {
    margin: 0;
}

.archive-pagination a,
.archive-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--blog-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.archive-pagination a:hover {
    border-color: var(--blog-primary);
    color: var(--blog-primary);
    background: var(--blog-bg-light);
}

.archive-pagination .current {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #ffffff;
}

/* No Posts Found */
.no-posts-found {
    text-align: center;
    padding: 80px 40px;
}

.no-posts-icon {
    font-size: 72px;
    color: #d1d5db;
    margin-bottom: 24px;
}

.no-posts-found h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--blog-heading);
    margin: 0 0 12px 0;
}

.no-posts-found p {
    font-size: 16px;
    color: var(--blog-meta);
    margin: 0 0 32px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .post-content-layout {
        grid-template-columns: 1fr;
    }
    
    .post-sidebar {
        position: static;
    }
    
    .sidebar-toc-mobile {
        display: block;
    }
    
    .archive-layout {
        grid-template-columns: 1fr;
    }
    
    .archive-sidebar {
        position: static;
        order: 2;
    }
    
    .archive-main {
        order: 1;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 32px;
    }
    
    .post-subtitle {
        font-size: 18px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .post-content-body {
        font-size: 16px;
    }
    
    .post-content-body h2 {
        font-size: 26px;
    }
    
    .post-content-body h3 {
        font-size: 20px;
    }
    
    .post-author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-main {
        grid-column: auto;
        grid-row: auto;
    }
    
    .post-card {
        grid-template-columns: 1fr;
    }
    
    .post-card-image img {
        height: 200px;
    }
    
    .post-card-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 26px;
    }
    
    .archive-title {
        font-size: 32px;
    }
    
    .post-cta-box {
        padding: 32px 24px;
    }
    
    .blog-stats {
        gap: 24px;
    }
}

/* ==========================================================================
   Уведомления
   ========================================================================== */

   .blog-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 320px;
    max-width: 420px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 12222220;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-success .notification-icon {
    color: #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-error .notification-icon {
    color: #ef4444;
}

.notification-warning {
    border-left: 4px solid #f59e0b;
}

.notification-warning .notification-icon {
    color: #f59e0b;
}

.notification-info {
    border-left: 4px solid #3b82f6;
}

.notification-info .notification-icon {
    color: #3b82f6;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.notification-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ==========================================================================
   Code Copy Button
   ========================================================================== */

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.code-copy-btn i {
    font-size: 14px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Posts Loader */
.posts-loader {
    text-align: center;
    padding: 48px 0;
    font-size: 16px;
    color: #6b7280;
}

.posts-loader i {
    display: inline-block;
    font-size: 24px;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Lazy Loading Images
   ========================================================================== */

img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* Placeholder для изображений */
img[data-src]:not(.loaded) {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Smooth Scrolling
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* Отключить для пользователей с prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Focus States (Accessibility)
   ========================================================================== */

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #12356a;
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .post-sidebar,
    .post-social-share,
    .post-navigation,
    .related-posts,
    .post-comments-section,
    .archive-sidebar,
    .archive-toolbar,
    .archive-pagination {
        display: none !important;
    }
    
    .post-content-layout {
        grid-template-columns: 1fr;
    }
    
    .post-content-body {
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .post-content-body a {
        text-decoration: underline;
        color: #222222;
    }
    
    .post-content-body a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666666;
    }
}