/* ═══════════════════════════════════════════════════════════════
   BLOG.CSS — Saddam Adil
   Used by: /blog (archive.php)
   Brand: Terracotta + Teal + Cream
═══════════════════════════════════════════════════════════════ */

:root {
    --terracotta:   #C8553D;
    --terracotta-d: #A64328;
    --terracotta-l: #E57A5F;
    --teal:         #2E7D7A;
    --teal-d:       #1F5E5C;
    --teal-l:       #4FA39F;
    --deep-brown:   #2B1F1A;
    --cream:        #F6F1E9;
    --sand:         #E8DCC4;
    --sand-d:       #D4C4A4;
    --white:        #FFFFFF;
    --gray-light:   #8B8178;
    --gray-mid:     #5C544D;
    --gray:         #6B6359;
    --border:       rgba(43,31,26,.10);
    --shadow-sm:    0 2px 8px rgba(43,31,26,.05);
    --shadow-md:    0 6px 20px rgba(43,31,26,.08);
    --shadow-lg:    0 16px 40px rgba(43,31,26,.12);
    --font-head:    'Playfair Display', Georgia, serif;
    --font-body:    'Instrument Sans', system-ui, sans-serif;
    --max-w:        1200px;
    --radius:       8px;
    --transition:   all 0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--deep-brown);
    background: var(--cream);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--deep-brown);
    line-height: 1.25;
    font-weight: 600;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── HEADER ─────────────────────────────────── */
header {
    background: rgba(246,241,233,.95);
    backdrop-filter: blur(10px);
    padding: 18px 0;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid rgba(43,31,26,.06);
}
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo-img { height: 44px; width: auto; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-links a {
    font-size: .92rem;
    color: var(--deep-brown);
    position: relative;
    padding: 6px 0;
}
.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    width: 0; height: 1px;
    background: var(--terracotta);
    bottom: 0; left: 0;
    transition: width .3s ease;
}
.nav-links a:not(.nav-cta).active::after,
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
    background: var(--terracotta);
    color: var(--white) !important;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 500;
    font-size: .88rem;
}
.nav-cta:hover {
    background: var(--terracotta-d);
    transform: translateY(-1px);
}
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--deep-brown);
    cursor: pointer;
}

/* ─── PAGE HEAD ──────────────────────────────── */
.page-head {
    padding: 72px 0 48px;
    background: linear-gradient(180deg, var(--cream) 0%, var(--sand) 100%);
}
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--gray-light);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--terracotta); }
.breadcrumbs a:hover { color: var(--terracotta-d); }
.breadcrumbs i { font-size: .7rem; }
.section-label {
    display: inline-block;
    color: var(--teal);
    letter-spacing: .18em;
    font-size: .78rem;
    text-transform: uppercase;
    margin-bottom: 14px;
    font-weight: 500;
}
.page-head h1 {
    font-size: 3rem;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
    max-width: 800px;
}
.page-head p {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 720px;
    line-height: 1.7;
}

/* ─── FILTER BAR ─────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 0;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}
.filter-bar form {
    display: flex;
    gap: 0;
    flex: 1;
    max-width: 480px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.filter-bar input[type="text"] {
    flex: 1;
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: var(--deep-brown);
    font-family: inherit;
    font-size: .94rem;
    outline: none;
}
.filter-bar input[type="text"]::placeholder { color: var(--gray-light); }
.filter-bar button[type="submit"] {
    padding: 12px 22px;
    background: var(--terracotta);
    color: var(--white);
    border: none;
    font-size: .9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.filter-bar button[type="submit"]:hover { background: var(--terracotta-d); }
.clear-link {
    color: var(--gray);
    font-size: .88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.clear-link:hover { color: var(--terracotta); }

/* ─── BLOG LAYOUT (posts + sidebar) ──────────── */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 56px;
    padding-bottom: 80px;
    align-items: start;
}

/* ─── POSTS GRID ─────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}

/* ─── BLOG CARD ──────────────────────────────── */
.blog-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--terracotta-l);
}
.blog-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
    background: var(--sand);
}
.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.blog-card:hover .blog-img img { transform: scale(1.04); }
.blog-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sand) 0%, var(--sand-d) 100%);
    color: var(--terracotta);
    font-size: 3rem;
}
.blog-trending {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--white);
    color: var(--deep-brown);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}
.blog-content {
    padding: 24px 24px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cat-tag {
    display: inline-block;
    color: var(--teal);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
}
.blog-title {
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 10px;
}
.blog-title a {
    color: var(--deep-brown);
    transition: color .2s ease;
}
.blog-card:hover .blog-title a { color: var(--terracotta); }
.blog-excerpt {
    font-size: .92rem;
    color: var(--gray);
    line-height: 1.65;
    margin-bottom: 18px;
    flex: 1;
}
.blog-meta {
    display: flex;
    gap: 16px;
    font-size: .8rem;
    color: var(--gray-light);
    margin-bottom: 14px;
}
.blog-meta i {
    color: var(--terracotta);
    margin-right: 4px;
}
.blog-read-more {
    color: var(--terracotta);
    font-size: .88rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap .2s ease;
    margin-top: auto;
}
.blog-read-more:hover {
    gap: 10px;
    color: var(--terracotta-d);
}

/* ─── EMPTY STATE ────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-state i {
    font-size: 3rem;
    color: var(--terracotta-l);
    margin-bottom: 18px;
    display: block;
}
.empty-state h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}
.empty-state p {
    color: var(--gray);
    font-size: 1rem;
}

/* ─── PAGINATION ─────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--deep-brown);
    font-size: .9rem;
    border-radius: 6px;
    transition: var(--transition);
}
.page-link:hover:not(.disabled):not(.active) {
    border-color: var(--terracotta);
    color: var(--terracotta);
}
.page-link.active {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: var(--white);
}
.page-link.disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* ─── SIDEBAR ────────────────────────────────── */
.sidebar {
    position: sticky;
    top: 100px;
}
.sidebar-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.sidebar-title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    color: var(--deep-brown);
    font-weight: 600;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-title i { color: var(--terracotta); }
.cat-list { padding: 0; }
.cat-list li { margin-bottom: 4px; }
.cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: .92rem;
    color: var(--deep-brown);
    transition: var(--transition);
}
.cat-list a:hover {
    background: var(--cream);
    color: var(--terracotta);
}
.cat-list a.active {
    background: var(--cream);
    color: var(--terracotta);
    font-weight: 500;
}
.cat-count {
    background: var(--sand);
    color: var(--gray);
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 26px;
    text-align: center;
}
.cat-list a.active .cat-count {
    background: var(--terracotta);
    color: var(--white);
}

/* ─── SIDEBAR CTA CARD ───────────────────────── */
.sidebar-cta {
    background: linear-gradient(135deg, var(--deep-brown) 0%, #3b2b25 100%);
    color: var(--white);
    border-color: var(--deep-brown);
}
.sidebar-cta .sidebar-title { color: var(--white); }
.sidebar-cta p {
    color: rgba(255,255,255,.8);
    font-size: .92rem;
    line-height: 1.6;
    margin-bottom: 18px;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--terracotta);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 500;
    transition: var(--transition);
}
.cta-btn:hover {
    background: var(--terracotta-l);
    transform: translateY(-1px);
}

/* ─── FOOTER ─────────────────────────────────── */
footer {
    background: var(--deep-brown);
    color: rgba(255,255,255,.75);
    padding: 70px 0 30px;
    margin-top: 40px;
}
footer h4 {
    color: var(--white);
    font-size: .95rem;
    letter-spacing: .04em;
    margin-bottom: 18px;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
}
footer ul { padding: 0; }
footer li { margin-bottom: 10px; }
footer a {
    color: rgba(255,255,255,.7);
    font-size: .9rem;
}
footer a:hover { color: var(--terracotta-l); }
footer p {
    color: rgba(255,255,255,.6);
    font-size: .92rem;
    margin-bottom: 22px;
    line-height: 1.7;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
}
.social-links {
    display: flex;
    gap: 14px;
}
.social-links a {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}
.social-links a:hover {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: var(--white);
    transform: translateY(-2px);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 24px;
    text-align: center;
    font-size: .85rem;
    color: rgba(255,255,255,.5);
}

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .sidebar { position: static; }
}

@media (max-width: 880px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .page-head h1 { font-size: 2.2rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .mobile-toggle { display: block; }
    .nav-links {
        position: fixed;
        top: 78px;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: calc(100vh - 78px);
        background: var(--cream);
        flex-direction: column;
        align-items: flex-start;
        padding: 30px;
        gap: 22px;
        transition: right .3s ease;
        border-left: 1px solid var(--border);
    }
    .nav-links.active { right: 0; }
}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar form { max-width: none; }
    .page-head h1 { font-size: 1.8rem; }
}