/* ===== Blog Hero ===== */
.blog-hero {
    background: linear-gradient(135deg, #0b0f1a 0%, #1a1040 50%, #0b0f1a 100%);
}

.blog-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(79, 124, 255, 0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(0, 191, 255, 0.1) 0%, transparent 50%);
    z-index: 0;
}

/* ===== Blog Toolbar ===== */
.blog-toolbar {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.blog-search {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.blog-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
}

.blog-search input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font-body);
    transition: var(--transition);
}

.blog-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.1);
}

.blog-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 18px;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}

.filter-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-white);
}

.filter-chip.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(79, 124, 255, 0.3);
}

/* ===== Blog Grid ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* ===== Blog Card ===== */
.blog-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.blog-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 20px 60px rgba(79, 124, 255, 0.2), 0 0 40px rgba(79, 124, 255, 0.05);
    border-color: rgba(79, 124, 255, 0.4);
}

.blog-card:hover::before {
    opacity: 0.03;
}

.blog-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.08);
}

.blog-card-image .card-category {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(11, 15, 26, 0.8);
    backdrop-filter: blur(10px);
    color: var(--primary-light);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(79, 124, 255, 0.2);
}

.blog-card-image .card-media-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.blog-card-image .media-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(11, 15, 26, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 12px;
    border: 1px solid rgba(79, 124, 255, 0.2);
}

.blog-card-placeholder {
    height: 220px;
    background: linear-gradient(135deg, rgba(79, 124, 255, 0.08) 0%, rgba(0, 191, 255, 0.04) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-placeholder i {
    font-size: 48px;
    color: rgba(79, 124, 255, 0.2);
}

.blog-card-body {
    padding: 28px;
    position: relative;
    z-index: 1;
}

.blog-card-body h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-white);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-body p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 20px;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.blog-card-footer .card-date {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-footer .card-read {
    font-size: 13px;
    color: var(--primary-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.blog-card:hover .card-read {
    gap: 10px;
}

/* ===== Blog Loading ===== */
.blog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 0;
}

.blog-loading .loader-ring {
    width: 40px;
    height: 40px;
}

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

/* ===== Blog Empty State ===== */
.blog-empty {
    text-align: center;
    padding: 80px 20px;
}

.blog-empty i {
    font-size: 64px;
    color: rgba(79, 124, 255, 0.2);
    margin-bottom: 24px;
}

.blog-empty h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-white);
    margin-bottom: 12px;
}

.blog-empty p {
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto;
}

/* ===== Blog Pagination ===== */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.blog-pagination .page-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
}

.blog-pagination .page-btn:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.blog-pagination .page-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(79, 124, 255, 0.3);
}

/* ===== Post Article View ===== */
.post-article {
    padding-top: 0;
}

.post-hero {
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: flex-end;
    padding: 60px 0;
    padding-top: 160px;
    background: linear-gradient(135deg, #0b0f1a 0%, #1a1040 100%);
    overflow: hidden;
}

.post-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(11, 15, 26, 0.95) 100%);
    z-index: 1;
}

.post-hero-content {
    position: relative;
    z-index: 2;
}

.post-category {
    display: inline-block;
    background: rgba(79, 124, 255, 0.15);
    color: var(--primary-light);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    border: 1px solid rgba(79, 124, 255, 0.25);
}

.post-hero-content h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-white);
    margin-bottom: 20px;
    max-width: 800px;
}

.post-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 14px;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-meta i {
    color: var(--primary);
}

.post-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 0;
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
}

.post-body h2, .post-body h3 {
    font-family: var(--font-heading);
    color: var(--text-white);
    margin: 40px 0 16px;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body img {
    width: 100%;
    border-radius: var(--radius-lg);
    margin: 30px 0;
    box-shadow: var(--shadow-md);
}

.post-body video, .post-body audio {
    width: 100%;
    border-radius: var(--radius-md);
    margin: 30px 0;
}

.post-body .youtube-responsive,
.post-body .youtube-embed .youtube-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin: 30px 0;
    background: #000;
}

.post-body .youtube-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.post-body iframe[src*="youtube"] {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    margin: 30px 0;
    border: none;
}

.post-body blockquote {
    background: rgba(79, 124, 255, 0.06);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 30px 0;
    font-style: italic;
}

.post-tags {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.post-tags .tag {
    padding: 6px 14px;
    background: rgba(79, 124, 255, 0.08);
    border: 1px solid rgba(79, 124, 255, 0.15);
    border-radius: 20px;
    color: var(--primary-light);
    font-size: 12px;
    font-weight: 500;
}

.post-share {
    max-width: 800px;
    margin: 30px auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.post-share span {
    color: var(--text-light);
    font-size: 14px;
}

.post-share a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 16px;
    transition: var(--transition);
}

.post-share a:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--text-white);
    transform: translateY(-3px);
}

.post-back {
    display: inline-flex;
    margin: 30px auto 60px;
    max-width: 800px;
}

.post-loading {
    display: flex;
    justify-content: center;
    padding: 60px;
}

/* ===== Responsive Blog ===== */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

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

    .blog-search {
        min-width: unset;
    }

    .post-hero {
        min-height: 350px;
        padding-top: 120px;
    }

    .post-body {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .blog-card-image {
        height: 180px;
    }

    .blog-card-body {
        padding: 20px;
    }
}

/* ===== Post Gallery ===== */
.post-gallery {
    position: relative;
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
}

/* Slider mode */
.gallery-slider-mode {
    position: relative;
}

.gallery-slider-mode .gallery-images {
    display: flex;
    transition: transform 0.4s ease;
    width: 100%;
}

.gallery-slider-mode .gallery-images img {
    min-width: 100%;
    max-width: 100%;
    height: 420px;
    object-fit: contain;
    background: #111;
    flex-shrink: 0;
}

.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 5;
    transition: background 0.2s;
}

.gallery-prev:hover, .gallery-next:hover {
    background: rgba(79, 124, 255, 0.8);
}

.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 14px 0;
    background: rgba(0, 0, 0, 0.3);
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* Grid mode (Instagram style) */
.gallery-grid-mode .gallery-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.gallery-grid-mode .gallery-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gallery-grid-mode .gallery-images img:hover {
    opacity: 0.85;
}

/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gallery-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.gallery-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .gallery-slider-mode .gallery-images img {
        height: 280px;
    }

    .gallery-grid-mode .gallery-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Post Comments ===== */
.post-comments {
    max-width: 800px;
    margin: 40px auto 0;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.comments-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-white);
    margin-bottom: 24px;
}

.comments-title i { color: var(--primary); margin-right: 8px; }

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.comment-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

.comment-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-item-header .comment-author {
    font-weight: 600;
    color: var(--text-white);
    font-size: 14px;
}

.comment-item-header .comment-time {
    color: var(--text-light);
    font-size: 12px;
    margin-left: auto;
}

.comment-item-body {
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

.comment-form-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.comment-form-wrapper h4 {
    font-family: var(--font-heading);
    color: var(--text-white);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

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

.comment-form .form-group { margin-bottom: 12px; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-section);
    color: var(--text);
    transition: border-color 0.2s;
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: var(--text-light);
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.1);
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-question {
    background: rgba(79, 124, 255, 0.1);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--primary-light);
    font-size: 14px;
    white-space: nowrap;
    border: 1px solid rgba(79, 124, 255, 0.2);
}

.captcha-row input { flex: 1; }

.btn-captcha-refresh {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    transition: var(--transition);
}

.btn-captcha-refresh:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.comment-status {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    display: none;
}

.comment-status.success {
    display: block;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.comment-status.error {
    display: block;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.comments-empty {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    font-style: italic;
}

@media (max-width: 768px) {
    .comment-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Newsletter Subscription ===== */
.newsletter-section {
    padding: 60px 0 80px;
}

.newsletter-box {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(135deg, rgba(79, 124, 255, 0.06), rgba(79, 124, 255, 0.02));
    border: 1px solid rgba(79, 124, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
}

.newsletter-box::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    background: rgba(79, 124, 255, 0.08);
    border-radius: 50%;
}

.newsletter-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), #6b9bff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter-icon i {
    font-size: 24px;
    color: #fff;
}

.newsletter-box h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 10px;
}

.newsletter-box > p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.newsletter-form {
    max-width: 460px;
    margin: 0 auto;
}

.newsletter-input-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.newsletter-input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 15px;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.3s;
}

.newsletter-input-group input:focus {
    border-color: var(--primary);
}

.newsletter-btn {
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    transition: background 0.3s;
    white-space: nowrap;
}

.newsletter-btn:hover {
    background: #3d6ae0;
}

.newsletter-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.newsletter-status {
    margin-top: 12px;
    font-size: 14px;
    min-height: 20px;
    transition: all 0.3s;
}

.newsletter-status.success {
    color: #22c55e;
}

.newsletter-status.error {
    color: #ef4444;
}

.newsletter-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.7;
}

.newsletter-note i {
    margin-right: 4px;
}

@media (max-width: 480px) {
    .newsletter-box {
        padding: 36px 20px;
    }
    .newsletter-input-group {
        flex-direction: column;
        border-radius: var(--radius-md);
    }
    .newsletter-input-group input {
        border-right: 1px solid var(--border);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        border-bottom: none;
    }
    .newsletter-btn {
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        justify-content: center;
    }
}
