/* ==========================================================================
   Block: Blog, Category Archives & Single Article Experience (SchoolAttestation)
   Light Brand Palette: #614D8F (Deep Purple), #7F67B4 (Primary Purple),
   #F96E33 (Accent Orange), #F2ECFF (Soft Purple), #2D3748 (Charcoal Text)
   ========================================================================== */

/* Baseline Background for Blog & Article Pages */
body:not(.home) {
    background-color: #ffffff;
    background-image: none;
    color: #2D3748;
}

/* Reading Progress Bar (Fixed Top) */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: linear-gradient(90deg, #F96E33 0%, #7F67B4 100%);
    z-index: 99999;
    transition: width 0.08s ease-out;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Blog Archive Header
   -------------------------------------------------------------------------- */
.blog-header {
    text-align: left;
    padding-top: 8px;
    padding-bottom: 28px;
}

.blog-header__title {
    font-family: var(--font-title);
    font-size: var(--font-size-h1);
    font-weight: 700;
    line-height: 1.15;
    color: var(--sa-purple);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0 0 16px 0;
}

.blog-header__badge-wrap {
    display: none;
}

.blog-header__subtitle {
    display: none;
}

/* --------------------------------------------------------------------------
   Category Navigation Filter List
   -------------------------------------------------------------------------- */
.blog-categories {
    margin-top: 0;
    display: flex;
    justify-content: flex-start;
}

.blog-categories__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-categories__item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-categories__link {
    display: inline-block;
    padding: 0;
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--sa-text);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.blog-categories__link:hover {
    color: var(--sa-orange);
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.blog-categories__link--active,
.blog-categories__link--active:hover {
    color: var(--sa-purple) !important;
    font-weight: 700;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

@media (max-width: 768px) {
    .blog-header {
        padding-top: 4px;
        padding-bottom: 20px;
    }

    .blog-header__title {
        font-size: clamp(1.75rem, 5vw, 2.25rem);
        margin-bottom: 12px;
    }

    .blog-categories__list {
        gap: 12px 20px;
    }

    .blog-categories__link {
        font-size: 1rem;
    }
}

/* --------------------------------------------------------------------------
   Blog Cards Grid (3 Columns)
   -------------------------------------------------------------------------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 48px;
}

.post-card {
    background: #ffffff;
    border: 1px solid rgba(127, 103, 180, 0.12);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(97, 77, 143, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: rgba(127, 103, 180, 0.32);
    box-shadow: 0 16px 36px rgba(97, 77, 143, 0.14);
}

.post-card__thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #F2ECFF;
}

.post-card__thumb-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-decoration: none;
}

.post-card__thumb-link--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #614D8F 0%, #7F67B4 100%);
}

.post-card__placeholder-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.post-card__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .post-card__thumb-img {
    transform: scale(1.05);
}

.post-card__category-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #614D8F;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 9999px;
    text-decoration: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background-color 0.2s, color 0.2s;
}

.post-card__category-badge:hover {
    background-color: #7F67B4;
    color: #ffffff;
}

.post-card__body {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.8125rem;
    color: #718096;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.post-card__icon {
    color: #7F67B4;
    flex-shrink: 0;
}

.post-card__title {
    font-family: var(--font-heading);
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
}

.post-card__title-link {
    color: #2D3748;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card__title-link:hover {
    color: #7F67B4;
}

.post-card__excerpt {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #5B5B5B;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.post-card__readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #F96E33;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.post-card__readmore:hover {
    color: #E85D22;
    gap: 10px;
}

.post-card__arrow-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.post-card__readmore:hover .post-card__arrow-icon {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Load More Button & Pagination
   -------------------------------------------------------------------------- */
.load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 60px;
}

.btn-load-more {
    background-color: #F96E33;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 14px 38px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(249, 110, 51, 0.3);
}

.btn-load-more:hover {
    background-color: #E85D22;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 110, 51, 0.4);
}

.btn-load-more.is-loading {
    opacity: 0.65;
    pointer-events: none;
    cursor: wait;
}

.blog-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.125rem;
    color: #718096;
    background: #F8F6FD;
    border-radius: 20px;
    margin-bottom: 60px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(127, 103, 180, 0.2);
    color: #2D3748;
    font-weight: 600;
    text-decoration: none;
}

.pagination .page-numbers.current {
    background: #7F67B4;
    border-color: #7F67B4;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Single Article 2-Column Layout
   -------------------------------------------------------------------------- */
.single-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 44px;
    align-items: flex-start;
    padding-bottom: 80px;
}

.single-article-layout__content {
    min-width: 0;
}

.single-article {
    background: #ffffff;
    border: 1px solid rgba(127, 103, 180, 0.12);
    border-radius: 24px;
    padding: 44px;
    box-shadow: 0 6px 24px rgba(97, 77, 143, 0.05);
}

.single-article__category-wrap {
    margin-bottom: 16px;
}

.single-article__category-badge {
    display: inline-block;
    padding: 5px 16px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #614D8F;
    background-color: #F2ECFF;
    border-radius: 9999px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.single-article__category-badge:hover {
    background-color: #7F67B4;
    color: #ffffff;
}

.single-article__title {
    font-family: var(--font-title);
    font-size: clamp(1.85rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--sa-purple);
    text-transform: uppercase;
    margin-bottom: 18px;
}

.single-article__meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 28px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.single-article__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.single-article__meta-icon {
    color: #7F67B4;
}

.single-article__thumb {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 36px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.single-article__thumb-img {
    width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   Post Content Typography (.entry-content)
   -------------------------------------------------------------------------- */
.entry-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #3B3B3B;
}

.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    line-height: var(--line-height-heading);
}

.entry-content h2 {
    font-family: var(--font-title);
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 700;
    color: var(--sa-purple);
    text-transform: uppercase;
    margin-top: 2em;
    margin-bottom: 0.75em;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sa-purple-bg);
}

.entry-content h3 {
    font-family: var(--font-heading);
    font-size: 1.3125rem;
    font-weight: 600;
    color: var(--sa-orange);
    margin-top: 1.75em;
    margin-bottom: 0.6em;
}

.entry-content h4 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sa-text-dark);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.entry-content a {
    color: #7F67B4;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.entry-content a:hover {
    color: #F96E33;
}

.entry-content strong,
.entry-content b {
    color: #2D3748;
    font-weight: 700;
}

.entry-content blockquote {
    margin: 2em 0;
    padding: 22px 28px;
    background-color: #F8F6FD;
    border-left: 4px solid #7F67B4;
    border-radius: 0 16px 16px 0;
    color: #2D3748;
    font-size: 1.0625rem;
    font-style: italic;
    line-height: 1.7;
}

.entry-content blockquote p {
    margin-bottom: 0.5em;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content ul,
.entry-content ol {
    margin: 1.5em 0;
    padding-left: 1.75em;
}

.entry-content li {
    margin-bottom: 0.6em;
    color: #3B3B3B;
}

.entry-content li > ul,
.entry-content li > ol {
    margin: 0.5em 0;
}

.entry-content img {
    border-radius: 14px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2em auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.entry-content table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid rgba(127, 103, 180, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.entry-content th,
.entry-content td {
    padding: 12px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.entry-content th {
    background-color: #F2ECFF;
    color: #614D8F;
    font-weight: 700;
    font-size: 0.9375rem;
}

.entry-content tr:last-child td {
    border-bottom: none;
}

.entry-content tr:hover td {
    background-color: #F8F6FD;
}

/* --------------------------------------------------------------------------
   Sidebar & Widgets
   -------------------------------------------------------------------------- */
.single-article-layout__sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-widget {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(127, 103, 180, 0.12);
    box-shadow: 0 4px 20px rgba(97, 77, 143, 0.06);
}

.sidebar-widget--cta {
    background: linear-gradient(145deg, #614D8F 0%, #7F67B4 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 30px rgba(97, 77, 143, 0.25);
}

.sidebar-widget--cta .sidebar-widget__badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    margin-bottom: 12px;
}

.sidebar-widget--cta .sidebar-widget__title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    font-family: var(--font-heading);
}

.sidebar-widget--cta .sidebar-widget__text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 16px;
}

.sidebar-widget__features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8125rem;
}

.sidebar-widget__features li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.sidebar-widget__features svg {
    color: #F96E33;
    flex-shrink: 0;
}

.sidebar-widget__cta-btn {
    width: 100%;
    background-color: #F96E33;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 13px 20px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(249, 110, 51, 0.35);
    text-align: center;
}

.sidebar-widget__cta-btn:hover {
    background-color: #E85D22;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(249, 110, 51, 0.45);
}

.sidebar-widget__heading {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: #2D3748;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #F2ECFF;
}

.sidebar-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-post-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sidebar-post-item__thumb-link {
    flex-shrink: 0;
    width: 76px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #F2ECFF;
    display: block;
}

.sidebar-post-item__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-post-item__content {
    min-width: 0;
    flex-grow: 1;
}

.sidebar-post-item__title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-post-item__title a {
    color: #2D3748;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-post-item__title a:hover {
    color: #7F67B4;
}

.sidebar-post-item__date {
    display: block;
    font-size: 0.75rem;
    color: #718096;
}

/* --------------------------------------------------------------------------
   Responsive Adaptations
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .single-article-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .single-article-layout__sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .blog-header {
        padding-top: 16px;
        padding-bottom: 32px;
    }

    .blog-header__title {
        font-size: 1.875rem;
    }

    .single-article {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .single-article__title {
        font-size: 1.625rem;
    }

    .entry-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .entry-content h2 {
        font-size: 1.375rem;
    }

    .entry-content h3 {
        font-size: 1.1875rem;
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-categories__link {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
}
