/* ═══════════════════════════════════════════════════
   Blogs Listing — Premium Real Estate Design
   ═══════════════════════════════════════════════════ */

/* Variables now centralized in color-palette.css */

/* ─────────────  HERO  ───────────── */
.blog-hero {
    position: relative;
    background: var(--gradient-brand);
    padding: 90px 0 72px;
    overflow: hidden;
}

.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 70%, rgba(253, 51, 88, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(108, 96, 254, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

.blog-hero-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.blog-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: #fff;
}

.blog-shape-1 {
    width: 400px;
    height: 400px;
    top: -120px;
    right: -80px;
    animation: blogShapeDrift 12s ease-in-out infinite;
}

.blog-shape-2 {
    width: 250px;
    height: 250px;
    bottom: -60px;
    left: -40px;
    animation: blogShapeDrift 10s ease-in-out infinite reverse;
}

.blog-shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 60%;
    animation: blogShapeDrift 8s ease-in-out infinite 2s;
}

@keyframes blogShapeDrift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -30px) scale(1.05);
    }
}

.blog-hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 18px;
    animation: bdFadeDown .6s ease;
}

.blog-hero-title {
    color: #fff;
    font-size: 46px;
    font-weight: 800;
    margin-bottom: 14px;
    animation: bdFadeDown .6s ease .1s both;
}

.blog-hero-subtitle {
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
    max-width: 500px;
    margin: 0 auto 28px;
    animation: bdFadeDown .6s ease .2s both;
}

@keyframes bdFadeDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─────────────  SEARCH  ───────────── */
.blog-search-wrapper {
    animation: bdFadeDown .6s ease .3s both;
}

.blog-search-box {
    position: relative;
    max-width: 540px;
    margin: 0 auto;
}

.blog-search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 16px;
    z-index: 1;
}

.blog-search-input {
    width: 100%;
    padding: 16px 46px 16px 52px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    color: var(--text);
    font-family: inherit;
    height: auto !important;
    border-color: transparent !important;
}

.blog-search-input:focus {
    outline: none;
    box-shadow: 0 8px 40px rgba(108, 96, 254, 0.25);
    transform: scale(1.02);
    background: var(--surface) !important;
}

.blog-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: var(--transition);
    padding: 0;
}

.blog-search-clear:hover {
    background: #e82a4a;
    transform: translateY(-50%) scale(1.1);
}

/* ─────────────  STATS  ───────────── */
.blog-stats {
    display: flex;
    align-items: center;
    gap: 28px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 14px 36px;
    animation: bdFadeDown .6s ease .4s both;
}

.blog-stat {
    text-align: center;
}

.blog-stat-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
}

.blog-stat-lbl {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-stat-div {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
}

/* ─────────────  FILTER BAR  ───────────── */
.blog-filter-bar {
    background: var(--surface);
    padding: 24px 0 18px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.blog-filter-row {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.blog-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.blog-filter-label i {
    color: var(--primary);
    margin-right: 4px;
}

.blog-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.blog-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.blog-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--bg);
    transform: translateY(-2px);
}

.blog-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(108, 96, 254, 0.25);
}

.blog-pill i {
    font-size: 11px;
}

/* ─────────────  CONTENT SECTION  ───────────── */
.blog-content-section {
    background: var(--bg);
    padding: 36px 0 64px;
    min-height: 400px;
}

/* Result bar */
.blog-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.blog-result-text {
    font-size: 14px;
    color: var(--text-muted);
}

.blog-view-toggle {
    display: flex;
    gap: 4px;
}

.blog-view-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    padding: 0;
}

.blog-view-btn.active,
.blog-view-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ─────────────  LOADING  ───────────── */
.blog-loading {
    text-align: center;
    padding: 60px 0;
}

.blog-loading p {
    color: var(--text-muted);
    margin-top: 16px;
}

.blog-loader {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.blog-loader span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    animation: blogBounce .6s infinite alternate;
}

.blog-loader span:nth-child(2) {
    animation-delay: .2s;
    background: var(--accent);
}

.blog-loader span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes blogBounce {
    to {
        transform: translateY(-16px);
        opacity: .4;
    }
}

/* ─────────────  EMPTY  ───────────── */
.blog-empty {
    text-align: center;
    padding: 60px 0;
}

.blog-empty-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    background: rgba(108, 96, 254, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary);
}

.blog-empty h4 {
    color: var(--dark);
    margin-bottom: 8px;
}

.blog-empty p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.blog-reset-btn {
    background: var(--primary);
    color: #fff;
    border-radius: 50px;
    padding: 10px 26px;
    font-weight: 600;
    transition: var(--transition);
}

.blog-reset-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
}

/* ─────────────  BLOG GRID  ───────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-grid.list-view {
    grid-template-columns: 1fr;
}

/* ─────────────  BLOG CARD  ───────────── */
.blog-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    transition: var(--transition);
    animation: blogCardIn .5s ease both;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(108, 96, 254, 0.15);
}

@keyframes blogCardIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card-img {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.blog-card:hover .blog-card-img img {
    transform: scale(1.08);
}

.blog-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    z-index: 1;
}

.blog-card-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.blog-card-badge-type {
    background: rgba(253, 51, 88, 0.9);
    color: #fff;
}

.blog-card-badge-cat {
    background: rgba(108, 96, 254, 0.9);
    color: #fff;
}

.blog-card-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition);
}

.blog-card:hover .blog-card-img-overlay {
    opacity: 1;
}

.blog-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.blog-card:hover .blog-card-title {
    color: var(--primary);
}

.blog-card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: #aaa;
}

.blog-card-date i,
.blog-card-views i {
    margin-right: 4px;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.blog-card-link:hover {
    color: var(--accent);
    gap: 8px;
}

.blog-card-link i {
    font-size: 10px;
    transition: inherit;
}

/* ─────────────  LIST VIEW  ───────────── */
.blog-grid.list-view .blog-card {
    flex-direction: row;
}

.blog-grid.list-view .blog-card-img {
    width: 280px;
    min-width: 280px;
    height: auto;
    min-height: 200px;
}

.blog-grid.list-view .blog-card-body {
    padding: 24px;
}

.blog-grid.list-view .blog-card-title {
    font-size: 20px;
    -webkit-line-clamp: 2;
}

.blog-grid.list-view .blog-card-excerpt {
    -webkit-line-clamp: 3;
}

/* ─────────────  PAGINATION  ───────────── */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.blog-page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    padding: 0;
}

.blog-page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.blog-page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(108, 96, 254, 0.25);
}

.blog-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

/* ─────────────  RESPONSIVE  ───────────── */
@media (max-width: 991px) {
    .blog-hero {
        padding: 72px 0 56px;
    }

    .blog-hero-title {
        font-size: 34px;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid.list-view .blog-card-img {
        width: 220px;
        min-width: 220px;
    }
}

@media (max-width: 767px) {
    .blog-hero {
        padding: 56px 0 44px;
    }

    .blog-hero-title {
        font-size: 28px;
    }

    .blog-hero-subtitle {
        font-size: 14px;
    }

    .blog-stats {
        gap: 16px;
        padding: 10px 20px;
    }

    .blog-stat-num {
        font-size: 20px;
    }

    .blog-filter-bar {
        padding: 16px 0 12px;
    }

    .blog-filter-row {
        gap: 14px;
        flex-direction: column;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-grid.list-view .blog-card {
        flex-direction: column;
    }

    .blog-grid.list-view .blog-card-img {
        width: 100%;
        min-width: auto;
        height: 200px;
    }

    .blog-card-img {
        height: 180px;
    }

    .blog-view-toggle {
        display: none;
    }
}