/* =====================================================
   BLOG PAGE - Dedicated Blog Listing Page
   CloudCare Portal
   ===================================================== */

/* =====================================================
   HERO
   ===================================================== */
.blog-hero {
    position: relative;
    padding: 160px 0 80px;
    overflow: hidden;
    background: linear-gradient(160deg, #060F18 0%, #0D1B2A 40%, #112240 100%);
}

.blog-hero__bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 70% 30%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse 60% 50% at 20% 70%, rgba(36, 134, 239, 0.06) 0%, transparent 50%);
}

.blog-hero__overlay {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, #f8fafc 0%, transparent 100%);
    z-index: 1;
}

.blog-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.blog-hero__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #00D4FF;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

.blog-hero__label svg {
    opacity: 0.7;
}

.blog-hero__title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.1s forwards;
}

.blog-hero__title span {
    background: linear-gradient(135deg, #00D4FF 0%, #2486EF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero__subtitle {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.2s forwards;
}

/* Search Bar */
.blog-search {
    display: flex;
    align-items: center;
    max-width: 520px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 60px;
    padding: 6px 6px 6px 20px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.3s forwards;
}

.blog-search:focus-within {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
}

.blog-search__icon {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.blog-search__input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    padding: 12px 14px;
    font-family: inherit;
}

.blog-search__input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.blog-search__btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2486EF 0%, #00D4FF 100%);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.blog-search__btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(36, 134, 239, 0.4);
}

/* =====================================================
   CONTENT LAYOUT
   ===================================================== */
.blog-content {
    padding: 0 0 80px;
    background: #f8fafc;
}

.blog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.blog-sidebar {
    position: sticky;
    top: 100px;
    padding-top: 20px;
}

.blog-sidebar__close {
    display: none;
}

.blog-filter {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(18, 41, 64, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.blog-filter__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0D1B2A;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-filter__title svg {
    color: #2486EF;
}

/* Tags */
.blog-filter__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-chip:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.tag-chip.active {
    background: linear-gradient(135deg, #2486EF 0%, #00D4FF 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(36, 134, 239, 0.3);
}

.tag-chip__count {
    font-size: 11px;
    opacity: 0.6;
    font-weight: 400;
}

.tag-chip.active .tag-chip__count {
    opacity: 0.8;
}

/* Date Inputs */
.blog-filter__dates {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-filter__date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-filter__date-field label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.blog-filter__date-input {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: #334155;
    background: #f8fafc;
    transition: border-color 0.2s ease;
    outline: none;
    width: 100%;
}

.blog-filter__date-input:focus {
    border-color: #2486EF;
    background: #fff;
}

.blog-filter__apply {
    width: 100%;
    margin-top: 14px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #2486EF;
    background: #e0f2fe;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-filter__apply:hover {
    background: #2486EF;
    color: #fff;
}

/* Active Filters */
.blog-filter__active {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(18, 41, 64, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #0369a1;
    background: #e0f2fe;
    border-radius: 16px;
    margin: 0 6px 6px 0;
}

.filter-chip button {
    background: none;
    border: none;
    color: #0369a1;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-family: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.filter-chip button:hover {
    opacity: 1;
}

.blog-filter__clear {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 0;
    font-size: 12px;
    font-weight: 500;
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.blog-filter__clear:hover {
    opacity: 0.7;
}

.blog-filter__loading,
.blog-filter__empty {
    font-size: 13px;
    color: #94a3b8;
    padding: 8px 0;
}

/* =====================================================
   BLOG MAIN
   ===================================================== */
.blog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 24px;
}

.blog-toolbar__filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-toolbar__filter-btn:hover {
    border-color: #2486EF;
    color: #2486EF;
}

.blog-toolbar__info {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* =====================================================
   BLOG GRID - Cards
   ===================================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.blog-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(18, 41, 64, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    opacity: 0;
    animation: cardFadeIn 0.5s ease forwards;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(18, 41, 64, 0.12);
}

.blog-card__link-wrap {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card__image-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.blog-card:hover .blog-card__img {
    transform: scale(1.06);
}

.blog-card__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13, 27, 42, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.blog-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0D1B2A 0%, #1B2B3E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card__body {
    padding: 24px;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.blog-card__date {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.blog-card__author {
    font-size: 12px;
    color: #94a3b8;
    position: relative;
    padding-left: 16px;
}

.blog-card__author::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 50%;
}

.blog-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0D1B2A;
    line-height: 1.4;
    margin-bottom: 10px;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card:hover .blog-card__title {
    color: #2486EF;
}

.blog-card__excerpt {
    font-size: 14px;
    color: #64748b;
    line-height: 1.65;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.blog-card__tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    background: #f0f7ff;
    color: #2486EF;
    border-radius: 12px;
}

.blog-card__read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #2486EF;
    transition: gap 0.2s ease;
}

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

/* Loading */
.blog-grid__loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.blog-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #2486EF;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.blog-empty h3 {
    font-size: 1.125rem;
    color: #334155;
    margin: 16px 0 8px;
    font-weight: 600;
}

.blog-empty p {
    font-size: 14px;
    color: #94a3b8;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 0 0;
}

.blog-page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 8px;
}

.blog-page-btn:hover:not(:disabled):not(.active) {
    border-color: #2486EF;
    color: #2486EF;
    background: #f0f7ff;
}

.blog-page-btn.active {
    background: linear-gradient(135deg, #2486EF 0%, #1a6fd4 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(36, 134, 239, 0.3);
}

.blog-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.blog-page-dots {
    font-size: 14px;
    color: #94a3b8;
    padding: 0 4px;
}

/* =====================================================
   CTA
   ===================================================== */
.blog-cta {
    padding: 0 0 80px;
    background: #f8fafc;
}

.blog-cta__card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0D1B2A 0%, #112240 100%);
    border-radius: 24px;
    padding: 64px 40px;
    text-align: center;
}

.blog-cta__glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.12) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    pointer-events: none;
}

.blog-cta__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.blog-cta__text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: #f8fafc;
        z-index: 1100;
        padding: 24px;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    }

    .blog-sidebar.open {
        left: 0;
    }

    .blog-sidebar__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        cursor: pointer;
        margin-bottom: 20px;
        margin-left: auto;
        color: #334155;
        transition: background 0.2s;
    }

    .blog-sidebar__close:hover {
        background: #f1f5f9;
    }

    .blog-toolbar__filter-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 130px 0 60px;
    }

    .blog-hero__subtitle {
        font-size: 0.9375rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-card__image-wrap {
        height: 180px;
    }

    .blog-cta__card {
        padding: 48px 24px;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 120px 0 50px;
    }

    .blog-search {
        padding: 4px 4px 4px 16px;
    }

    .blog-search__input {
        font-size: 14px;
        padding: 10px 10px;
    }

    .blog-search__btn {
        width: 38px;
        height: 38px;
    }

    .blog-card__body {
        padding: 20px;
    }

    .blog-page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}
