/* =========================================================
   CouponsArena – Blog listing (blog.css)
   ========================================================= */
:root {
    --brand-primary: #7e22ce;
    --brand-primary-dark: #4c1d95;
    --brand-primary-light: #a855f7;
    --brand-accent: #ec4899;
    --brand-deep-purple: #3b0764;
    --bg-body: #f9fafb;
    --bg-surface: #ffffff;
    --bg-dark: #0a0a0a;
    --bg-dark-accent: #1a0b2e;
    --text-main: #111827;
    --text-body: #4b5563;
    --text-muted: #9ca3af;
    --text-light-muted: #d1d5db;
    --border-light: #e5e7eb;
    --gradient-brand: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    --gradient-dark-bg: linear-gradient(180deg, #0a0a0a 0%, #3b0764 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-brand: 0 4px 14px 0 rgba(126, 34, 206, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
}

.blog-listing-page { background: var(--bg-body); color: var(--text-body); }

/* ---------- Hero ---------- */
.blog-hero {
    position: relative;
    display: flex; align-items: center;
    min-height: 52vh;
    padding: 3rem 0 5rem;
    color: #fff;
    background:
        radial-gradient(60% 70% at 85% 0%, rgba(236,72,153,.28) 0%, transparent 60%),
        radial-gradient(50% 60% at 10% 100%, rgba(168,85,247,.35) 0%, transparent 60%),
        var(--gradient-dark-bg);
}
.hero-background { position: absolute; inset: 0; overflow: hidden; }
.hero-pattern {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
}
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .45rem 1.1rem; margin-bottom: 1.4rem;
    font-size: .85rem; font-weight: 600; color: var(--text-light-muted);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}
.hero-badge i { color: var(--brand-accent); }
.blog-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: #fff;
    margin-bottom: 1rem;
}
.blog-hero h1 span {
    background: var(--gradient-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.blog-hero .hero-sub { color: var(--text-light-muted); font-size: 1.15rem; margin-bottom: 2.2rem; }

.hero-stats { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.stat-item {
    min-width: 130px; padding: 1rem 1.4rem;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}
.stat-number {
    font-size: 1.9rem; font-weight: 800; line-height: 1.1;
    background: var(--gradient-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light-muted); }

.scroll-indicator {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
    width: 42px; height: 42px; display: grid; place-items: center;
    color: #fff; text-decoration: none;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    backdrop-filter: blur(6px);
    animation: bounce 2s infinite;
    transition: background .3s ease;
    z-index: 2;
}
.scroll-indicator:hover { background: var(--gradient-brand); color: #fff; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: inline-flex;
    margin-bottom: 0;
    padding: .55rem 1.1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    font-size: .88rem;
}
.breadcrumb-item a { color: var(--brand-primary); font-weight: 600; text-decoration: none; }
.breadcrumb-item a:hover { color: var(--brand-primary-dark); }
.breadcrumb-item.active { color: var(--text-body); font-weight: 600; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ---------- Toolbar ---------- */
.blog-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: .7rem .8rem .7rem 1.1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.toolbar-search {
    flex: 1 1 260px;
    display: flex; align-items: center; gap: .7rem;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: .15rem 1rem;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.toolbar-search:focus-within {
    background: #fff; border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 4px rgba(168,85,247,.15);
}
.toolbar-search i { color: var(--text-muted); }
.toolbar-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    padding: .6rem 0; color: var(--text-main); font-size: .95rem;
}
.toolbar-count { color: var(--text-body); font-size: .88rem; display: inline-flex; align-items: center; gap: .45rem; }
.toolbar-count i { color: var(--brand-primary); }

/* ---------- Blog cards ---------- */
.blog-card {
    position: relative;
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.blog-card:hover {
    transform: translateY(-6px);
    border-color: var(--brand-primary-light);
    box-shadow: var(--shadow-lg), var(--shadow-brand);
}
.blog-card.is-hidden { display: none; }

.blog-image-wrapper {
    position: relative; flex: 0 0 38%; max-width: 38%;
    min-height: 240px; overflow: hidden; background: var(--border-light);
}
.blog-image-wrapper a, .blog-image-wrapper img { display: block; width: 100%; height: 100%; }
.blog-image { object-fit: contain; transition: transform .6s ease; }
.blog-card:hover .blog-image { transform: scale(1.07); }
.blog-image-wrapper::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent 60%, rgba(10,10,10,.35) 100%);
}
.blog-category-badge {
    position: absolute; top: 14px; left: 14px; z-index: 2;
    padding: .3rem .85rem;
    background: var(--gradient-brand); color: #fff;
    font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    border-radius: 999px; box-shadow: var(--shadow-brand);
}

.blog-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 1.6rem 1.7rem; }
.blog-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-bottom: .7rem; }
.meta { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-muted); }
.meta i { color: var(--brand-primary-light); }

.blog-title { font-size: 1.3rem; font-weight: 800; line-height: 1.35; margin: 0 0 .6rem; letter-spacing: -.01em; }
.blog-title a { color: var(--text-main); text-decoration: none; transition: color .2s ease; }
.blog-card:hover .blog-title a { color: var(--brand-primary); }

.blog-excerpt {
    flex: 1; margin-bottom: 1.2rem; color: var(--text-body); font-size: .95rem; line-height: 1.65;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-actions {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1rem; border-top: 1px solid var(--border-light);
}
.read-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.3rem;
    background: var(--gradient-brand); color: #fff;
    font-size: .85rem; font-weight: 600; border-radius: 999px;
    box-shadow: var(--shadow-brand);
    transition: gap .2s ease, filter .2s ease;
}
.blog-card:hover .read-btn { gap: .85rem; filter: brightness(1.08); }
.blog-stats { display: flex; gap: 1rem; }

/* Empty state */
.empty-state {
    text-align: center; padding: 3rem 1rem;
    background: var(--bg-surface);
    border: 1.5px dashed var(--border-light);
    border-radius: var(--radius);
}
.empty-state i { font-size: 2.4rem; color: var(--brand-primary-light); margin-bottom: .8rem; display: block; }
.empty-state h4 { color: var(--text-main); font-weight: 700; }
.empty-state p { color: var(--text-body); margin: 0; }

/* ---------- Pagination (Bootstrap markup) ---------- */
.pagination { gap: .35rem; justify-content: center; flex-wrap: wrap; }
.pagination .page-link {
    border: 1px solid var(--border-light); border-radius: 10px !important;
    min-width: 40px; text-align: center;
    color: var(--text-body); font-weight: 600; background: var(--bg-surface);
    transition: all .2s ease;
}
.pagination .page-link:hover { color: var(--brand-primary); border-color: var(--brand-primary-light); background: rgba(126,34,206,.06); }
.pagination .page-item.active .page-link {
    color: #fff; border-color: transparent; background: var(--gradient-brand); box-shadow: var(--shadow-brand);
}
.pagination .page-item.disabled .page-link { color: var(--text-muted); background: var(--bg-body); }

/* ---------- Sidebar ---------- */
.sidebar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.sidebar-head { padding: 1.2rem 1.5rem 0; }
.sidebar-title { font-size: 1.2rem; font-weight: 800; color: var(--text-main); margin: 0 0 .5rem; display: flex; align-items: center; gap: .6rem; }
.sidebar-title i { color: var(--brand-primary); }
.header-accent { width: 44px; height: 4px; border-radius: 4px; background: var(--gradient-brand); margin-bottom: .8rem; }

.cat-list { padding: .4rem .8rem 1rem; }
.cat-item {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .7rem .8rem; margin-bottom: .2rem;
    border-radius: var(--radius-sm);
    color: var(--text-main); font-weight: 500; text-decoration: none;
    transition: background .2s ease, color .2s ease;
}
.cat-item .cat-name { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.cat-item .cat-icon {
    width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
    background: rgba(126,34,206,.09); color: var(--brand-primary);
    border-radius: 10px; transition: all .2s ease;
}
.cat-item .cat-count {
    min-width: 28px; text-align: center; padding: .15rem .55rem;
    background: var(--bg-body); color: var(--text-body);
    font-size: .75rem; font-weight: 700; border-radius: 999px;
}
.cat-item:hover { background: rgba(126,34,206,.06); color: var(--brand-primary); }
.cat-item:hover .cat-icon { background: var(--gradient-brand); color: #fff; }
.cat-item:hover .cat-count { background: var(--brand-primary); color: #fff; }

.newsletter-card {
    position: relative; overflow: hidden;
    padding: 1.8rem 1.5rem; text-align: center;
    background: var(--bg-dark-accent); color: #fff;
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.newsletter-card::before {
    content: ''; position: absolute; width: 200px; height: 200px; right: -70px; top: -70px;
    background: var(--gradient-brand); opacity: .4; filter: blur(45px); border-radius: 50%;
}
.newsletter-card > * { position: relative; }
.newsletter-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem; display: grid; place-items: center;
    background: var(--gradient-brand); border-radius: 18px; font-size: 1.6rem; box-shadow: var(--shadow-brand);
}
.newsletter-card h5 { font-weight: 800; margin-bottom: .4rem; }
.newsletter-card p { color: var(--text-light-muted); font-size: .88rem; margin-bottom: 1.1rem; }
.newsletter-form .nl-row { display: flex; gap: .5rem; }
.newsletter-form input {
    flex: 1; min-width: 0; padding: .65rem 1rem; color: #fff; outline: 0;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 999px;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.55); }
.newsletter-form input:focus { border-color: var(--brand-primary-light); }
.newsletter-form button {
    width: 46px; flex: 0 0 46px; border: 0; border-radius: 50%; color: #fff;
    background: var(--gradient-brand); box-shadow: var(--shadow-brand);
    transition: transform .2s ease;
}
.newsletter-form button:hover { transform: scale(1.08); }
.newsletter-form button.is-done { background: #16a34a; }
.newsletter-note { display: block; margin-top: .8rem; font-size: .75rem; color: var(--text-light-muted); }

/* ---------- Toast ---------- */
.blog-toast {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 9999;
    display: flex; align-items: center; gap: .7rem;
    min-width: 250px; max-width: 350px; padding: .9rem 1.1rem;
    background: var(--bg-dark-accent); color: #fff;
    border-left: 4px solid var(--brand-accent);
    border-radius: 12px; box-shadow: var(--shadow-lg);
    animation: slideUp .45s ease;
}
.blog-toast.success { border-left-color: #22c55e; }
.blog-toast.success > i { color: #22c55e; }
.blog-toast.leaving { animation: slideDown .45s ease forwards; }
.blog-toast .toast-close { margin-left: auto; background: none; border: 0; color: var(--text-light-muted); font-size: 1.2rem; line-height: 1; }

/* ---------- Animations ---------- */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100px); opacity: 0; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.blog-card { animation: fadeInUp .55s ease both; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .sidebar { position: static !important; margin-top: 1rem; }
}
@media (max-width: 767px) {
    .blog-hero { min-height: auto; padding: 2.5rem 0 4.5rem; }
    .stat-item { min-width: 100px; padding: .8rem 1rem; }
    .blog-card { flex-direction: column; }
    .blog-image-wrapper { flex: none; max-width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
    .blog-body { padding: 1.3rem; }
    .blog-title { font-size: 1.15rem; }
    .blog-excerpt { -webkit-line-clamp: 2; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}