/* ═══════════════════════════════════════════════════════════════
   blog.css — Blog Listing Page
   Extracted from Components/Pages/Blog.razor
   Dark-mode overrides for blog classes live in app.css
═══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════
   Blog Details Hero
══════════════════════════════════ */
.blog-hero {
    background: linear-gradient(180deg, var(--brand-light) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    padding: 44px 0 36px;
    transition: background .3s;
}

.blog-header {
    max-width: 760px;
}

.blog-hero-title {
    font-size: clamp(26px, 3.5vw, 42px);
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.blog-hero-sub {
    font-size: 16px;
    color: var(--text-2);
    line-height: 1.7;
    margin: 0 0 28px;
    max-width: 600px;
}

/* ── Search Bar ── */
.blog-search-wrap {
    display: flex;
    align-items: center;
    max-width: 560px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
    transition: border-color .15s, box-shadow .15s;
}

.blog-search-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11,116,209,.15);
}

.search-icon {
    padding: 0 12px 0 16px;
    color: var(--text-3);
    flex-shrink: 0;
}

.blog-search-input {
    flex: 1;
    border: none;
    padding: 13px 8px;
    font-size: 14px;
    background: transparent;
    color: var(--text);
    outline: none;
    font-family: var(--font-body);
    min-width: 0;
}

.blog-search-input::placeholder { color: var(--text-3); }

.search-clear-btn {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 16px;
    padding: 0 8px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}

.blog-search-btn {
    padding: 13px 20px;
    background: var(--brand);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background .15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.blog-search-btn:hover { background: var(--brand-dark); }

/* ══════════════════════════════════
   Metadata — Category Pills & Filter Bar
══════════════════════════════════ */

/* ── Category Pills ── */
.blog-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
    font-family: var(--font-body);
}

.pill-logo {
    width: 17px;
    height: 17px;
    object-fit: contain;
    border-radius: 3px;
}

.cat-pill:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.cat-pill--active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, .22);
}


/* ── Filter Bar ── */
.filter-bar-wrap {
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(255,255,255,.10);
    position: sticky;
    top: 63px;
    z-index: 50;
    box-shadow: 0 4px 24px rgba(0,0,0,.20);
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.filter-select-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 8px 12px;
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: border-color .15s, box-shadow .15s, background .3s;
}

.filter-select-wrap:hover {
    border-color: var(--text-3);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.filter-select-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11,116,209,.18);
    color: var(--text);
}

.filter-select {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 16px;
}

.filter-select option {
    background: var(--surface);
    color: var(--text);
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-filter-count {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255,255,255,.70);
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    padding: 4px 12px;
    border-radius: 999px;
}

.filter-reset-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.60);
    font-size: 11.5px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all .15s;
}

.filter-reset-btn:hover {
    background: rgba(239,68,68,.18);
    border-color: rgba(239,68,68,.45);
    color: #fca5a5;
}

/* ══════════════════════════════════
   Blog Content — Article Grid
══════════════════════════════════ */
.blog-grid-section { padding: 48px 0 80px; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 26px;
}

/* ── State Boxes ── */
.state-box {
    text-align: center;
    padding: 80px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.state-icon { font-size: 54px; margin-bottom: 18px; }
.state-box h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.state-box p  { color: var(--text-2); margin-bottom: 24px; font-size: 15px; }

/* ══════════════════════════════════
   Blog Image — Skeleton Loading
══════════════════════════════════ */
.article-card-skeleton {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.sk-img { height: 190px; background: var(--border); animation: sk-pulse 1.6s ease-in-out infinite; }
.sk-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }

.sk-line {
    height: 11px;
    border-radius: 6px;
    background: var(--border);
    animation: sk-pulse 1.6s ease-in-out infinite;
}

.w-25 { width: 25%; } .w-45 { width: 45%; }
.w-70 { width: 70%; } .w-85 { width: 85%; }

/* ══════════════════════════════════
   Related Blogs — Pagination
══════════════════════════════════ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 56px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: var(--font-body);
}

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

.page-btn:disabled { opacity: .3; cursor: default; }

.page-numbers { display: flex; gap: 6px; }

.page-num {
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: var(--font-body);
}

.page-num:hover { border-color: var(--brand); color: var(--brand); }

.page-num--active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ══════════════════════════════════
   Animations
══════════════════════════════════ */
.card-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .5s ease, transform .5s ease;
}

.card-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@keyframes sk-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .4; }
}

/* ══════════════════════════════════
   Responsive Design
══════════════════════════════════ */
@media (max-width: 768px) {
    .blog-hero { padding: 32px 0 28px; }
    .blog-hero-title { font-size: 26px; }
    .blog-hero-sub { font-size: 15px; }
    .blog-search-wrap { max-width: 100%; }
    .blog-category-pills { gap: 6px; }
    .cat-pill { padding: 7px 13px; font-size: 12px; }
    .blog-grid { grid-template-columns: 1fr; }
    .page-numbers { display: none; }
    .filter-bar { padding: 12px 0; gap: 8px; }
    .filter-left { gap: 8px; }
    .filter-select-wrap { padding: 7px 10px; }
}

@media (max-width: 480px) {
    .blog-hero { padding: 28px 0 24px; }
    .blog-hero-title { font-size: 22px; }
    .blog-search-wrap { border-radius: 10px; }
    .blog-search-btn { padding: 13px 14px; font-size: 12px; }
    .filter-left { width: 100%; }
    .filter-right { width: 100%; justify-content: flex-end; }
}
