/* ============================================================
   Claritas Academics — Blog Stylesheet (Directory & Post Layout)
   ============================================================ */

/* ---------------- Page Header (Blogs Directory) ---------------- */
.page-header {
    padding: 12rem 5% 5rem;
    text-align: center;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.page-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.page-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--light-text);
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.8;
}

.breadcrumb-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.breadcrumb-back:hover {
    color: var(--primary);
}

/* ---------------- Filter Bar ---------------- */
.filter-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5% 3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.filter-pill {
    border: 1.5px solid rgba(15, 76, 117, 0.2);
    background: var(--white);
    color: var(--accent);
    padding: 0.65rem 1.4rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-pill:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.filter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(15, 76, 117, 0.25);
}

/* ---------------- Blog Grid ---------------- */
.blog-section {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 5% 7rem;
}

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

.blog-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.14);
}

.blog-card.is-hidden {
    display: none;
}

.blog-card-image {
    height: 190px;
    position: relative;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.blog-card-image.gold-bg {
    background: linear-gradient(135deg, #d4af37 0%, var(--gold) 55%, #8b6b23 100%);
}

.blog-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
}

.blog-card-icon {
    font-size: 3.2rem;
    z-index: 1;
    opacity: 0.9;
}

.blog-card-icon-img {
    max-height: 115px;
    max-width: 75%;
    object-fit: contain;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-icon-img {
    transform: scale(1.06);
}

.blog-card-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.9rem;
    border-radius: 15px;
    z-index: 2;
    text-transform: uppercase;
}

.blog-card-body {
    padding: 1.75rem;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--light-text);
    margin-bottom: 0.8rem;
}

.blog-card-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--light-text);
}

.blog-card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.7rem;
    line-height: 1.3;
}

.blog-card-excerpt {
    font-size: 0.92rem;
    color: var(--light-text);
    line-height: 1.65;
    margin-bottom: 1.4rem;
}

.blog-card-byline {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding-top: 1.2rem;
    border-top: 1px solid #f0f0f0;
}

.byline-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
}

.byline-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.byline-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--light-text);
    font-size: 1.05rem;
    display: none;
}

.empty-state.visible {
    display: block;
}

/* ---------------- Post Article Layout & Typography ---------------- */
.post-top-space {
    height: 7rem;
}

.post-article {
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem 5% 5rem;
}

.post-article-header {
    margin-bottom: 2.5rem;
}

.post-article-tag {
    display: inline-block;
    background: linear-gradient(135deg, rgba(15, 76, 117, 0.1) 0%, rgba(201, 169, 97, 0.1) 100%);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-radius: 15px;
    margin-bottom: 1.2rem;
}

.post-article-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.post-article-byline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.post-article-byline .byline-avatar {
    width: 48px;
    height: 48px;
}

.byline-text-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.byline-text-meta {
    font-size: 0.82rem;
    color: var(--light-text);
}

.post-article-body h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
    margin: 2.5rem 0 1rem;
}

.post-article-body h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    margin: 2rem 0 0.8rem;
}

.post-article-body p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 1.3rem;
}

.post-article-body ul,
.post-article-body ol {
    margin: 0 0 1.3rem 1.3rem;
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.8;
}

.post-article-body li {
    margin-bottom: 0.5rem;
}

.post-article-body strong {
    color: var(--accent);
    font-weight: 600;
}

.post-pullquote {
    border-left: 4px solid var(--gold);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-style: italic;
    color: var(--primary);
    line-height: 1.6;
}

.post-cta-box {
    margin-top: 3rem;
    background: linear-gradient(135deg, rgba(15, 76, 117, 0.05) 0%, rgba(201, 169, 97, 0.05) 100%);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
}

.post-cta-box p {
    margin-bottom: 1.2rem;
    color: var(--text);
    font-size: 1rem;
}

.post-cta-btn {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.post-cta-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

/* ---------------- Related Posts ---------------- */
.related-posts {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 5% 6rem;
}

.related-posts-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2rem;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
    justify-content: center;
    gap: 2rem;
}

/* ---------------- Responsive Styles (Blog) ---------------- */
@media (max-width: 768px) {
    .page-header {
        padding: 10rem 5% 3rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .post-top-space {
        height: 5.5rem;
    }

    .post-article {
        padding: 2rem 5% 3rem;
    }
}