/* ==========================================================================
   blogs.css — Blog Landing Page (blog-list.php) specific styles
   (hero, featured blog, search + filter toolbar, card grid, editorial CTA)
   Shared base tokens, header, footer, buttons and the .blog-card live in
   main.css which is loaded globally by includes/header.php.
   ========================================================================== */

/* Header stays solid white at all scroll positions, matching blog.css. */
#header:not(.sticky-active) {
    background-color: #fff !important;
    position: relative !important;
}
#header:not(.sticky-active) .header-inner,
#header:not(.sticky-active) #header-wrap {
    background-color: #fff !important;
}

/* ------------------------------- Hero ----------------------------------- */
.hero-banner {
    position: relative;
    background-color: var(--brand-navy) !important;
    color: #fff;
    padding: 11rem 2rem 14rem !important;
    text-align: center;
    overflow: hidden;
}
.hero-actions .btn-primary {
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
    background-color: var(--brand-navy) !important;
    color: #fff !important;
}
.hero-actions .btn-primary:hover {
    border-color: var(--brand-teal) !important;
    color: var(--brand-teal) !important;
    box-shadow: 0 6px 20px rgba(0, 168, 150, 0.3) !important;
    background-color: var(--brand-navy) !important;
}
/* Subtle dotted texture overlay */
.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image: radial-gradient(circle at 2px 2px, #fff 1px, transparent 0);
    background-size: 24px 24px;
}
/* Soft teal glow accent */
.hero-banner::after {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(0, 168, 150, 0.35), transparent 70%);
    pointer-events: none;
}
.hero-content {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    z-index: 2;
}
.hero-tag {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--brand-gold);
    margin-bottom: 1.25rem;
    display: inline-block;
}
.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 3.95rem); /* Increased font size */
    line-height: 1.15;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff !important;
}
.hero-content p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-bottom: 2.25rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.featured-section {
    max-width: 1200px;
    margin: -11rem auto 0;
    padding: 0;
    position: relative;
    z-index: 3;
    border-radius: var(--radius-lg) !important;
}
.featured-card {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: var(--bg-white);
    border: 1.5px solid #cbd5e1 !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 0 !important;
    padding: 0 !important;
    height: 420px; /* Fixed height on desktop to keep it compact */
}
.featured-media {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: var(--bg-muted);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg) !important;
}
.featured-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg) !important;
    transition: transform 0.4s ease;
}
.featured-card:hover .featured-media img { transform: scale(1.04); }
.featured-body {
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center; /* Vertically center content to eliminate bottom whitespace */
    gap: 0.6rem;
    height: 100%;
    box-sizing: border-box;
}
.featured-body .btn-teal {
    margin-top: 0.4rem;
}
.featured-flag {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--brand-gold);
}
.featured-title {
    font-size: clamp(1.6rem, 2.8vw, 2.2rem); /* Increased title font size */
    line-height: 1.2;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.01em;
}
.featured-title a { color: var(--brand-navy) !important; }
.featured-title a:hover { color: var(--brand-teal) !important; }
.featured-excerpt {
    color: var(--text-light);
    font-size: 1.1rem; /* Increased excerpt font size */
    line-height: 1.6;
}
.featured-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}
.featured-meta .author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-soft);
}
.featured-meta .meta-text { display: flex; flex-direction: column; line-height: 1.3; }
.featured-meta .author-name { font-weight: 700; color: var(--brand-navy); font-size: 0.95rem; }
.featured-meta .meta-line { color: var(--text-light); font-size: 0.85rem; }
.featured-meta .dot { margin: 0 0.35rem; }

/* --------------------------- Section head ------------------------------- */
.blog-section { padding: 4rem 2rem 1rem; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.25rem; }
.section-head h2 {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.01em;
}
.section-sub { color: var(--text-light); margin-top: 0.6rem; font-size: 1.05rem; }

/* ----------------------- Search + filter toolbar ----------------------- */
.blog-toolbar {
    max-width: var(--maxw);
    margin: 0 auto 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}

/* Search box — icon on the LEFT, text padded away from icon */
.search-box {
    position: relative;
    flex: 0 0 300px;
    width: 300px;
    margin: 0;
}
.search-icon {
    position: absolute !important;
    left: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1rem !important;
    height: 1rem !important;
    color: var(--text-light);
    pointer-events: none;
    z-index: 2;
    display: block;
    stroke: currentColor;
    fill: none;
}
.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.4rem !important;
    font-size: 0.9rem;
    color: var(--brand-navy);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    box-sizing: border-box;
    margin: 0 !important;
}
.search-box input::placeholder { color: var(--text-light); }
.search-box input:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.15);
}

/* Filter buttons (flat pill group) */
.filter-container {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-soft);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.filter-btn {
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.filter-btn:hover { color: var(--brand-navy); }

/* Active filter color states */
.filter-btn.active[data-filter="all"] { background: var(--brand-navy); color: #fff; }
.filter-btn.active[data-filter="logistics"] { background: var(--brand-teal); color: #fff; }
.filter-btn.active[data-filter="multifamily"] { background: var(--brand-coral); color: #fff; }
.filter-btn.active[data-filter="developers"] { background: var(--brand-gold); color: var(--brand-navy); }

/* ------------------------------ Grid ------------------------------------ */
.grid-container {
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 2rem;
}
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 3rem 1rem;
    font-size: 1.05rem;
}

/* --------------------------- Editorial CTA ------------------------------ */
.editorial-row {
    background-color: var(--bg-soft);
    padding: 5rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.editorial-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.editorial-tag { color: var(--brand-teal); margin-bottom: 0.75rem; }
.editorial-text h2 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1.2;
    margin-bottom: 1.25rem;
    text-wrap: balance;
}
.editorial-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}
.editorial-graphic {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}
.editorial-graphic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------------------------- Responsive --------------------------------- */
@media (max-width: 860px) {
    .editorial-container { grid-template-columns: 1fr; gap: 2rem; }
    .editorial-graphic { order: -1; }
    
    /* Stack layout and adjust border-radius of the image */
    .featured-card { 
        grid-template-columns: 1fr; 
        height: auto !important; 
    }
    .featured-media { 
        aspect-ratio: 16 / 10 !important; 
        height: auto !important; 
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    }
    .featured-media img {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    }
    .blog-toolbar { justify-content: space-between; }
}

@media (max-width: 768px) {
    /* Hero */
    .hero-banner { padding: 7rem 1.25rem 5.5rem !important; }
    .hero-actions { flex-direction: column; gap: 0.75rem; align-items: center !important; }
    .hero-actions .btn { width: 100%; max-width: 280px; text-align: center; }

    /* Featured card */
    .featured-section { padding: 0 1rem; margin-top: -3.5rem !important; }
    .featured-media { aspect-ratio: 4 / 3 !important; }
    .featured-body { padding: 1.5rem; gap: 0.6rem; }
    .featured-title { font-size: 1.4rem !important; }
    .featured-excerpt { font-size: 0.95rem; line-height: 1.5; }
    .featured-meta { margin-top: 0.1rem; }

    /* Blog section */
    .blog-section { padding: 1.25rem 1rem 1rem !important; }
    .section-head { margin-bottom: 1rem !important; }

    /* Toolbar: stack filter + search, no extra gap */
    .blog-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.6rem !important;
        margin-bottom: 1.25rem !important;
    }
    .filter-container { justify-content: center; width: 100%; flex-wrap: wrap; }

    /* Search box: full width, no extra height/margin */
    .search-box {
        flex: none !important;
        width: 100% !important;
        margin: 0 !important;
    }
    .search-box input { font-size: 0.9rem; }

    /* Grid */
    .grid-container { grid-template-columns: 1fr; gap: 1.25rem; }
}

@media (max-width: 480px) {
    .hero-banner { padding: 6rem 1rem 4.5rem !important; }
    .featured-section { padding: 0 0.75rem; margin-top: -2.5rem !important; }
    .featured-media { aspect-ratio: 3 / 2 !important; }
    .featured-body { padding: 1.25rem; }
    .featured-title { font-size: 1.25rem !important; }
    .blog-section { padding: 1rem 0.75rem !important; }
}

