/* ========================================
   BLOG / LEARNING CENTER STYLES
   Heritage Life Solutions
   ======================================== */

/* ========================================
   LIST PAGE - HERO SECTION
   ======================================== */
.blog-hero {
    position: relative;
    min-height: 350px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.blog-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(30, 58, 95, 0.85) 0%, rgba(30, 58, 95, 0.6) 50%, rgba(30, 58, 95, 0.4) 100%);
    z-index: 1;
}

.blog-hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.blog-hero-content {
    max-width: 650px;
    text-align: left;
}

.blog-hero-title {
    font-family: var(--font-family);
    font-size: var(--h1-size);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-hero-subtitle {
    font-family: var(--font-family);
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--color-white);
    line-height: 1.6;
    opacity: 0.95;
}

/* ========================================
   BLOG GRID
   ======================================== */
.blog-section {
    padding: 4rem 0;
    background: var(--color-light-grey);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.blog-card {
    background: var(--color-white);
    border-radius: var(--button-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.blog-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.blog-card-title {
    font-family: var(--font-family);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.blog-card-title a {
    color: var(--color-navy);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: var(--color-primary);
}

.blog-card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 1rem;
}

.blog-card-readtime::before {
    content: "•";
    margin-right: 1rem;
}

.blog-card-link {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-link:hover {
    color: var(--color-navy);
}

.blog-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    font-size: 1.1rem;
}

.blog-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--color-white);
    border-radius: var(--button-radius);
    color: #666;
    font-size: 1.1rem;
}

.blog-no-results a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ========================================
   BLOG CTA SECTION
   ======================================== */
.blog-cta-section {
    padding: 4rem 0;
    background: var(--color-primary);
    text-align: center;
}

.blog-cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.blog-cta-title {
    font-family: var(--font-family);
    font-size: var(--h2-size);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.blog-cta-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
}

/* ========================================
   SINGLE ARTICLE - HERO
   ======================================== */
.article-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.article-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(30, 58, 95, 0.9) 0%, rgba(30, 58, 95, 0.75) 50%, rgba(30, 58, 95, 0.5) 100%);
    z-index: 1;
}

.article-hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.article-hero-content {
    max-width: 750px;
    text-align: left;
}

.article-category {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.article-hero-title {
    font-family: var(--font-family);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

.article-readtime::before {
    content: "•";
    margin-right: 1.5rem;
}

/* ========================================
   SINGLE ARTICLE - CONTENT
   ======================================== */
.article-section {
    padding: 4rem 0;
    background: var(--color-white);
}

.article-content {
    max-width: 750px;
    margin: 0 auto;
}

.article-content h2 {
    font-family: var(--font-family);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-family: var(--font-family);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-navy);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 0.5rem;
}

.article-content strong {
    color: var(--color-navy);
}

.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: var(--color-navy);
}

/* Inline Article Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--button-radius);
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--color-light-grey);
    border-left: 4px solid var(--color-primary);
    font-size: 1.1rem;
    font-style: italic;
    color: #555;
}

.article-content blockquote p {
    margin-bottom: 0;
}

/* ========================================
   AUTHOR BOX
   ======================================== */
.article-author-box {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 750px;
    margin: 3rem auto 0;
    padding: 2rem;
    background: var(--color-light-grey);
    border-radius: var(--button-radius);
}

.author-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info {
    flex-grow: 1;
}

.author-label {
    font-size: 0.85rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.author-name {
    font-family: var(--font-family);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-navy);
    margin: 0.25rem 0 0.75rem;
}

.author-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1rem;
}

.btn-small {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

/* ========================================
   BACK LINK
   ======================================== */
.article-back {
    max-width: 750px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.article-back a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-back a:hover {
    color: var(--color-navy);
}

/* ========================================
   ARTICLE CTA SECTION
   ======================================== */
.article-cta-section {
    padding: 4rem 0;
    background: var(--color-primary);
    text-align: center;
}

.article-cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.article-cta-title {
    font-family: var(--font-family);
    font-size: var(--h2-size);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.article-cta-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
}

.article-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--color-white);
    color: var(--color-white);
}

.btn-outline-primary:hover {
    background: var(--color-white);
    color: var(--color-primary);
}

/* ========================================
   BLOG LIST - SIDEBAR LAYOUT
   ======================================== */
.blog-layout {
    display: flex;
    gap: 2rem;
}

.blog-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 20px;
}

.blog-content {
    flex-grow: 1;
    min-width: 0;
}

/* With sidebar, use 2 columns */
.blog-layout .blog-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* ========================================
   ARTICLE - SIDEBAR LAYOUT
   ======================================== */
.article-layout {
    display: flex;
    gap: 3rem;
}

.article-main {
    flex-grow: 1;
    max-width: 750px;
}

.article-sidebar {
    width: 300px;
    flex-shrink: 0;
    align-self: flex-start;
    height: fit-content;
}

.article-sidebar .sidebar-sticky {
    position: -webkit-sticky; /* Safari support */
    position: sticky;
    top: 100px; /* Account for fixed header */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* ========================================
   SIDEBAR COMPONENTS
   ======================================== */
.sidebar-section {
    background: var(--color-white);
    border-radius: var(--button-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

.sidebar-search {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--button-radius);
    font-family: var(--font-family);
    font-size: 0.9rem;
}

.sidebar-search:focus {
    outline: none;
    border-color: var(--color-primary);
}

.category-list,
.category-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li,
.category-nav li {
    margin-bottom: 0.35rem;
}

.category-list a,
.category-nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.65rem;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.category-list a:hover,
.category-nav a:hover {
    background: var(--color-light-grey);
    color: var(--color-navy);
}

.category-list a.active {
    background: var(--color-primary);
    color: white;
}

.category-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.category-list a.active .category-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar CTA Box */
.sidebar-cta {
    background: var(--color-navy);
    color: white;
    text-align: center;
}

.sidebar-cta h4 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: white;
}

.sidebar-cta p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.sidebar-cta-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--button-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.sidebar-cta-button:hover {
    background: #2b9fc4;
    color: white;
}

/* Related Articles */
.related-article {
    display: flex;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    align-items: center;
}

.related-article:last-child {
    border-bottom: none;
}

.related-thumb {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: cover;
}

.related-thumb-placeholder {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--color-navy), var(--color-primary));
}

.related-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-navy);
    line-height: 1.3;
}

.related-article:hover .related-title {
    color: var(--color-primary);
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */
@media (max-width: 1100px) {
    .article-layout {
        flex-direction: column;
    }

    .article-sidebar {
        width: 100%;
        align-self: stretch;
    }

    .article-sidebar .sidebar-sticky {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .article-sidebar .sidebar-section {
        flex: 1;
        min-width: 250px;
        margin-bottom: 0;
    }

    .article-sidebar .sidebar-cta {
        min-width: 100%;
        order: -1;
    }
}

@media (max-width: 992px) {
    .blog-layout {
        flex-direction: column;
    }

    .blog-sidebar {
        width: 100%;
    }

    .sidebar-sticky {
        position: static;
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .sidebar-section {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
    }

    .sidebar-cta {
        min-width: 100%;
    }

    .blog-layout .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero,
    .article-hero {
        min-height: 300px;
    }

    .blog-section,
    .article-section {
        padding: 3rem 0;
    }

    .blog-grid,
    .blog-layout .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-hero-title {
        font-size: 1.75rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.2rem;
    }

    .article-content p,
    .article-content li {
        font-size: 1rem;
    }

    .article-author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .article-cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .article-cta-buttons .btn {
        width: 100%;
        max-width: 280px;
    }

    .blog-cta-section,
    .article-cta-section {
        padding: 3rem 0;
    }
}
