/* =================================================================
   BLOG PAGE - STYLES
   Teal / Emerald colour scheme to distinguish from Courses (purple)
   ================================================================= */

/* =================================================================
   HERO SECTION
   ================================================================= */

/* Mobile header spacing */
@media (max-width: 900px) {
    .blog-page { padding-top: 180px; }
}

@media (max-width: 480px) {
    .blog-page { padding-top: 200px; }
}

.blog-hero {
    width: 100%;
    margin: 4rem 0 0 0;
    padding: 3rem 0;
    background: rgba(255, 255, 255, 0.04);
}

.blog-hero-wrapper {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 0.5fr 0.5fr;
    gap: 2.5rem;
    align-items: center;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
}

/* Pill badge */
.blog-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.34rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.7);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 214, 160, 0.3));
    color: #6ee7b7;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
}

.blog-hero-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.8);
    animation: blog-pill-ping 1.8s infinite;
    flex-shrink: 0;
}

@keyframes blog-pill-ping {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.8); }
    50%       { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.blog-hero-content h1 {
    margin: 0;
    margin-top: 1.5rem;
    font-size: clamp(2.4rem, 3.8vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.blog-hero-content p {
    margin: 1.2rem 0 0;
    color: rgba(255, 255, 255, 0.7);
    max-width: 100%;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* CTA buttons */
.blog-hero-ctas {
    margin-top: 1.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.blog-hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.blog-hero-cta-primary {
    background: linear-gradient(135deg, #10b981, #06d6a0);
    color: #0a0e13;
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.25);
}

.blog-hero-cta-primary:hover {
    color: #0a0e13;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.35);
    filter: brightness(1.08);
}

.blog-hero-cta-secondary {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.blog-hero-cta-secondary:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #34d399;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 40px rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

/* Decorative preview grid */
.blog-hero-visual {
    position: relative;
}

.blog-hero-grid-mock {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 55%),
        radial-gradient(circle at bottom right, rgba(6, 214, 160, 0.1), transparent 60%),
        rgba(10, 14, 19, 0.95);
    padding: 1.4rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.blog-hero-card {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.2rem 0.8rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.blog-hero-card--1 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(6, 214, 160, 0.08));
}
.blog-hero-card--2 {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(34, 211, 238, 0.08));
}
.blog-hero-card--3 {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.08));
}
.blog-hero-card--4 {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(251, 146, 60, 0.08));
}

.blog-hero-card-icon {
    font-size: 2rem;
    line-height: 1;
    animation: blog-icon-float 3s ease-in-out infinite;
}

.blog-hero-card--2 .blog-hero-card-icon { animation-delay: 0.5s; }
.blog-hero-card--3 .blog-hero-card-icon { animation-delay: 1s; }
.blog-hero-card--4 .blog-hero-card-icon { animation-delay: 1.5s; }

@keyframes blog-icon-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-4px) scale(1.1); }
}

.blog-hero-card-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

/* Hero responsive */
@media (max-width: 900px) {
    .blog-hero {
        padding: 0;
        margin: 0;
        margin-bottom: 1.5rem;
    }

    .blog-hero-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
        margin: 0;
    }

    .blog-hero-content {
        order: 2;
        padding: 2rem 1.75rem;
    }

    .blog-hero-visual {
        order: 1;
    }

    .blog-hero-grid-mock {
        border-radius: 0;
        border: none;
        box-shadow: none;
        aspect-ratio: auto;
    }
}

@media (max-width: 768px) {
    .blog-hero-content h1 {
        font-size: clamp(2rem, 5vw, 2.5rem);
        margin-top: 1rem;
    }

    .blog-hero-content p {
        font-size: 0.95rem;
        margin-top: 1rem;
    }

    .blog-hero-content {
        padding: 1.75rem 1.25rem;
    }

    .blog-hero-card-icon {
        font-size: 1.6rem;
    }

    .blog-hero-card-label {
        font-size: 0.72rem;
    }
}

/* =================================================================
   BLOG CARDS
   ================================================================= */

/* Blog Card Container */
.blog-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #06d6a0 50%, #34d399 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.25),
                0 0 40px rgba(6, 214, 160, 0.15);
}

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

/* Featured Image */
.blog-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Badges */
.blog-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px 20px 8px;
    min-height: 44px;
    align-items: flex-start;
}

.blog-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Topic badge – teal accent */
.badge-blog-topic {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-blog-topic:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

/* Category badge – cyan accent */
.badge-blog-category {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-blog-category:hover {
    background: rgba(6, 182, 212, 0.25);
    border-color: rgba(6, 182, 212, 0.5);
}

/* Card Content */
.blog-content {
    flex: 1;
    padding: 12px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--secondary-bg);
}

/* Card Header (title + bookmark) */
.blog-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* Title */
.blog-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8rem;
    flex: 1;
}

/* Bookmark button on cards */
.blog-bookmark-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.blog-bookmark-btn .blog-bookmark-icon {
    font-size: 1rem;
    line-height: 1;
    filter: grayscale(1);
    opacity: 0.5;
    transition: all 0.2s ease;
}

.blog-bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.blog-bookmark-btn:hover .blog-bookmark-icon {
    filter: grayscale(0);
    opacity: 0.8;
}

.blog-bookmark-btn[aria-pressed="true"],
.blog-bookmark-btn.bookmarked {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.blog-bookmark-btn[aria-pressed="true"] .blog-bookmark-icon,
.blog-bookmark-btn.bookmarked .blog-bookmark-icon {
    filter: grayscale(0);
    opacity: 1;
    color: #ef4444;
}

/* Meta row (author, date) */
.blog-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 2px 0;
}

/* Excerpt */
.blog-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Actions */
.blog-actions {
    display: flex;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-blog-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #06d6a0 100%);
    color: #0a0e13;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.btn-blog-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #34d399 0%, #2dd4bf 100%);
    color: #0a0e13;
}

.btn-blog-primary:active {
    transform: translateY(0);
}

.btn-blog-primary .btn-icon {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.btn-blog-primary:hover .btn-icon {
    transform: translateX(3px);
}

/* Entrance animation */
.blog-card {
    animation: blogFadeInUp 0.6s ease-out forwards;
}

@keyframes blogFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card:nth-child(1) { animation-delay: 0.05s; }
.blog-card:nth-child(2) { animation-delay: 0.1s; }
.blog-card:nth-child(3) { animation-delay: 0.15s; }
.blog-card:nth-child(4) { animation-delay: 0.2s; }
.blog-card:nth-child(5) { animation-delay: 0.25s; }
.blog-card:nth-child(6) { animation-delay: 0.3s; }

/* =================================================================
   BLOG-PAGE SCOPED OVERRIDES
   Tint shared components (checkmarks, pagination active, etc.)
   ================================================================= */

.blog-page .filter-checkbox input:checked ~ .checkmark {
    background-color: #10b981;
    border-color: #10b981;
}

.blog-page .filter-checkbox:hover input ~ .checkmark {
    border-color: #10b981;
}

.blog-page .pagination-number.active {
    background: linear-gradient(135deg, #10b981, #06d6a0);
    border-color: #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.blog-page .pagination-number:hover {
    border-color: #10b981;
    color: #34d399;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.blog-page .pagination-btn:hover {
    border-color: #10b981;
    color: #34d399;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.blog-page .search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.blog-page .sort-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.blog-page .clear-filters:hover {
    border-color: #10b981;
}

.blog-page .tools-count span {
    color: #34d399;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 768px) {
    .blog-card {
        border-radius: 16px;
    }

    .blog-content {
        padding: 12px 16px 20px;
        gap: 10px;
    }

    .blog-title {
        font-size: 1.1rem;
    }

    .blog-meta-row {
        gap: 6px;
    }

    .blog-excerpt {
        font-size: 0.85rem;
    }

    .blog-actions {
        padding: 14px 16px;
    }

    .btn-blog-primary {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .blog-card-image {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .blog-badges {
        padding: 10px 12px 6px;
    }

    .blog-badges .badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .blog-title {
        font-size: 1rem;
    }

    .blog-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-card-image {
        height: 130px;
    }
}

/* =================================================================
   DARK MODE SUPPORT
   ================================================================= */

@media (prefers-color-scheme: dark) {
    .blog-card {
        background: linear-gradient(135deg, rgba(20, 20, 30, 0.6) 0%, rgba(15, 15, 25, 0.8) 100%);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .blog-card:hover {
        background: linear-gradient(135deg, rgba(25, 25, 35, 0.7) 0%, rgba(20, 20, 30, 0.9) 100%);
        border-color: rgba(16, 185, 129, 0.5);
    }

    .blog-actions {
        background: rgba(0, 0, 0, 0.3);
    }
}
