/* ==========================================================================
   ERL Spectra - Blog Page Styles
   ========================================================================== */

body {
    font-family: "Montserrat", sans-serif;
    background-color: #f8f9fa;
    color: #333333;
    padding-top: 95px;
    overflow-x: hidden;
}

/* Reset Bootstrap container to prevent landing-page.css interference */
.container {
    display: block !important;
}

main.container {
    display: block !important;
    width: 100% !important;
    max-width: 1200px;
    margin-top: 15px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px;
    padding-right: 15px;
}

/* Navbar Scrolled State */
.navbar {
    position: fixed;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    padding-top: 5px;
    padding-bottom: 15px;
    transition: all 0.3s ease-in-out;
}

.navbar.scrolled {
    padding: 0.2rem 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    width: 292px;
    height: 70px;
}

.nav-item {
    margin-right: 15px;
}

.nav-link {
    color: #000000;
    font-weight: 500 !important;
    font-size: 18px;
    margin-top: 3px;
    text-decoration: none;
    position: relative;
}

.navbar .navbar-nav .nav-link:hover,
.nav-link.active {
    color: #00569e !important;
}

.nav-link:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #00569e;
    transition: width 0.3s ease;
}

.nav-link:not(.dropdown-toggle):hover::after,
.nav-link:not(.dropdown-toggle).active::after {
    width: 100%;
}

/* Dropdowns */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border: none;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 15px;
}

.dropdown-item:hover {
    background-color: #e9f2fb;
    color: #00569e;
}

/* Submenu on Desktop */
@media all and (min-width: 992px) {
    .dropdown-menu li {
        position: relative;
    }
    .dropdown-menu .submenu {
        display: none;
        position: absolute;
        left: 100%;
        top: -7px;
        width: 300px;
    }
    .dropdown-menu > li:hover > .submenu {
        display: block;
    }
}

/* Blog Hero Banner */
.blog-hero {
    background: linear-gradient(135deg, #0f2744 0%, #00569e 100%);
    color: #ffffff;
    padding: 60px 0 50px 0;
    margin-bottom: 50px;
}

.blog-hero h1 {
    font-family: "Raleway", sans-serif;
    font-weight: 700;
    font-size: 2.6rem;
    margin-bottom: 12px;
    color: #ffffff !important;
}

.blog-hero p {
    font-family: "Poppins", sans-serif;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95) !important;
    max-width: 650px;
}

/* Blog Cards Grid */
#blog-posts-container {
    width: 100%;
}

/* Single card centered layout (when only 1 post exists) */
#blog-posts-container.single-post-card,
#blog-posts-container:has(> :only-child),
#related-posts-container.single-post-card,
#related-posts-container:has(> :only-child) {
    justify-content: center !important;
}

#blog-posts-container.single-post-card > [class*="col-"],
#blog-posts-container > [class*="col-"]:only-child,
#related-posts-container.single-post-card > [class*="col-"],
#related-posts-container > [class*="col-"]:only-child {
    width: 100%;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.blog-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.blog-card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
    background-color: #e2e8f0;
}

.blog-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
    transition: transform 0.35s ease;
}

.blog-card:hover .blog-card-img-wrapper img {
    transform: scale(1.02);
}

.blog-card-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
}

.blog-card-title {
    font-family: "Poppins", sans-serif;
    font-size: 1.05rem;
    font-weight: 100;
    color: #000000;
    line-height: 1.4;
    height: 4.2em;
    min-height: 4.2em;
    max-height: 4.2em;
    margin: 0 0 14px 0;
    padding: 0 !important;
    text-align: left !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    width: 100%;
    transition: color 0.2s ease;
}

.blog-card:hover .blog-card-title {
    color: #00569e;
}

.blog-card-meta {
    font-family: "Montserrat", sans-serif;
    font-size: 0.85rem;
    color: #666666;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    text-align: left;
    width: 100%;
}

.blog-card-meta .meta-divider {
    color: #cbd5e1;
    font-weight: 300;
}

/* Storyblok Config Notice Badge */
.storyblok-status-banner {
    background: #eef6fc;
    border: 1px solid #bce1f7;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 35px;
    font-size: 0.95rem;
    color: #0f4471;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.storyblok-status-banner code {
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    color: #d63384;
}

/* Footer Styling */
footer {
    background-color: #f1f3f5;
    margin-top: 80px;
    padding-top: 40px;
}

footer hr {
    width: 60px;
    background-color: #00569e;
    height: 2px;
    opacity: 1;
}

footer a {
    text-decoration: none;
    color: #333333;
}

footer a:hover {
    color: #00569e;
}

.copyright {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Blog Detail Screen Styles
   ========================================================================== */
.blog-detail-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 10px auto 60px auto;
}

.blog-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #00569e;
    text-decoration: none;
    margin-bottom: 25px;
    transition: all 0.2s ease;
}

.blog-back-btn:hover {
    color: #0f2744;
    transform: translateX(-3px);
}

.blog-detail-featured-img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    margin-bottom: 30px;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.blog-detail-title {
    font-family: "Raleway", sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: #14274a !important;
    line-height: 1.35;
    margin-bottom: 22px;
    text-align: left;
    padding: 0;
}

.blog-detail-meta {
    font-family: "Montserrat", sans-serif;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 35px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e2e8f0;
}

.blog-detail-meta .author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #14274a;
}

.blog-detail-meta .author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #00569e;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.blog-detail-meta .meta-divider {
    color: #cbd5e1;
}

.blog-detail-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-detail-content {
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    line-height: 1.8;
    color: #3c3c3c;
    text-align: left;
    margin-bottom: 30px; /* Reduced from 50px to gently tighten space above bottom nav */
}

.blog-detail-content p {
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #3c3c3c !important;
    text-align: left;
}

.blog-detail-content h1,
.blog-detail-content h2, 
.blog-detail-content h3,
.blog-detail-content h4,
.blog-detail-content h5,
.blog-detail-content h6 {
    font-family: "Raleway", sans-serif;
    color: #14274a !important;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: left;
    padding: 0;
}

.blog-detail-content h1 {
    font-size: 2rem;
}

.blog-detail-content h2 {
    font-size: 1.65rem;
}

.blog-detail-content h3 {
    font-size: 1.35rem;
}

/* ==========================================================================
   Sticky "Share this" Sidebar
   ========================================================================== */
.sticky-share-box {
    position: sticky;
    top: 130px; /* Sits comfortably below the fixed navbar */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    z-index: 10;
}

.share-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.share-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.05rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.22s ease-in-out;
    cursor: pointer;
}

.share-btn:hover {
    border-color: #00569e;
    color: #00569e;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 86, 158, 0.15);
}

.share-btn.share-linkedin:hover {
    border-color: #0a66c2;
    color: #0a66c2;
    box-shadow: 0 6px 14px rgba(10, 102, 194, 0.25);
}

.share-btn:active {
    transform: scale(0.95);
}

/* Mobile horizontal share bar */
.mobile-share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background-color: #f1f5f9;
    border-radius: 12px;
    margin-bottom: 30px;
}

.mobile-share-bar .share-buttons-list {
    flex-direction: row;
    gap: 10px;
}

/* Storyblok RichText Tables & Elements */
.blog-detail-content table {
    width: 100%;
    margin: 1.8rem 0;
    border-collapse: collapse;
}

.blog-detail-content th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.blog-detail-content th,
.blog-detail-content td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
}

.blog-detail-content blockquote {
    border-left: 4px solid #00569e;
    padding-left: 18px;
    margin: 1.8rem 0;
    color: #475569;
    font-style: italic;
}

.blog-detail-content ul,
.blog-detail-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-detail-content li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Full-Width Post Navigation Bar (Previous Story / Home / Next Story)
   ========================================================================== */
.post-navigation-bar {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    border-top: 1px solid #dbe2ea;
    border-bottom: 1px solid #dbe2ea;
    background-color: #ffffff;
    margin-top: 45px;
    margin-bottom: 0;
}

/* Ensure global .container styles from landing-page.css do not add unwanted top margins */
.post-navigation-bar .container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: block !important;
    max-width: 1200px;
    padding-left: 15px;
    padding-right: 15px;
}

.post-navigation-bar .row {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.post-nav-inner {
    display: flex;
    align-items: stretch;
    min-height: 90px;
    width: 100%;
}

/* Previous Story Column (Right-aligned to center Home divider) */
.post-nav-col.post-nav-prev {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(50% - 45px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding: 24px 35px 24px 20px;
}

/* Next Story Column (Left-aligned starting from center Home divider) */
.post-nav-col.post-nav-next {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(50% - 45px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding: 24px 20px 24px 35px;
}

/* Center Home Box (Bordered by vertical divider lines on left and right) */
.post-nav-col.post-nav-center {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #dbe2ea;
    border-right: 1px solid #dbe2ea;
}

.post-nav-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.post-nav-link {
    display: inline-flex;
    color: #14274a;
    font-family: "Poppins", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.2s ease;
    max-width: 100%;
}

.post-nav-prev .post-nav-link {
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
}

.post-nav-next .post-nav-link {
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
}

.post-nav-link:hover {
    color: #00569e;
}

.post-nav-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    min-width: 0;
    line-height: 1.35;
    text-align: left;
}

.post-nav-arrow {
    flex-shrink: 0;
    font-size: 1.2rem;
    line-height: 1.35;
    transition: transform 0.2s ease;
}

.post-nav-prev .post-nav-link:hover .post-nav-arrow {
    transform: translateX(-4px);
}

.post-nav-next .post-nav-link:hover .post-nav-arrow {
    transform: translateX(4px);
}

.post-nav-home {
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.post-nav-home svg {
    width: 24px;
    height: 24px;
}

.post-nav-home:hover {
    color: #00569e;
    transform: scale(1.15);
    background-color: #f8fafc;
}

/* Disabled State for Previous / Next Story Navigation */
.post-nav-col.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
    user-select: none;
}

.post-nav-col.disabled .post-nav-label {
    color: #94a3b8;
}

.post-nav-col.disabled .post-nav-link {
    pointer-events: none;
    cursor: not-allowed;
    color: #94a3b8 !important;
}

.post-nav-col.disabled .post-nav-arrow {
    opacity: 0.4;
}

.post-nav-col.disabled:hover .post-nav-arrow {
    transform: none !important;
}

@media (max-width: 768px) {
    .blog-detail-title {
        font-size: 1.8rem;
    }
    .blog-detail-featured-img {
        max-height: none;
        aspect-ratio: 16 / 9;
        height: auto;
    }
    .post-nav-inner {
        flex-direction: column;
        min-height: auto;
    }
    .post-nav-col.post-nav-prev {
        align-items: flex-start;
        text-align: left;
        padding: 16px 12px;
        order: 1;
        max-width: 100%;
    }
    .post-nav-col.post-nav-prev .post-nav-link {
        justify-content: flex-start;
        text-align: left;
    }
    .post-nav-col.post-nav-center {
        width: 100%;
        height: 50px;
        border-left: none;
        border-right: none;
        border-top: 1px solid #dbe2ea;
        border-bottom: 1px solid #dbe2ea;
        order: 2;
    }
    .post-nav-col.post-nav-next {
        padding: 16px 12px;
        order: 3;
        max-width: 100%;
        align-items: flex-start;
        text-align: left;
    }
    .post-nav-next .post-nav-link {
        justify-content: flex-start;
    }
    .post-nav-link {
        font-size: 1.05rem;
    }
}

/* ==========================================================================
   Related Stories Section ("You May Also Like")
   ========================================================================== */
.related-stories-section {
    display: block;
    width: 100% !important;
    padding: 35px 0 40px 0;
    margin-top: 0 !important;
}

#related-posts-container {
    width: 100%;
}

.related-stories-header {
    margin-bottom: 30px;
}

.related-stories-title {
    font-family: "Raleway", sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #14274a;
    margin-top: 0 !important;
    padding: 0 !important;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.related-stories-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 14px;
}

.related-accent-bar {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #d81b60, #e11d48);
    border-radius: 3px;
    margin: 0 auto;
}

.related-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: transform 0.25s ease;
}

.related-card:hover {
    color: inherit;
    transform: translateY(-4px);
}

.related-card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e2e8f0;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.related-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
    transition: transform 0.35s ease;
}

.related-card:hover .related-card-img-wrapper img {
    transform: scale(1.02);
}

.related-card-badge {
    display: inline-block;
    align-self: flex-start;
    background-color: #e11d48;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    text-transform: capitalize;
    letter-spacing: 0.2px;
}

.related-card-title {
    font-family: "Poppins", sans-serif;
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.45;
    color: #14274a;
    margin-bottom: 0;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card:hover .related-card-title {
    color: #00569e;
}

@media (max-width: 768px) {
    .related-stories-title {
        font-size: 1.7rem;
    }
    .related-card-img-wrapper {
        aspect-ratio: 16 / 9;
        height: auto;
    }
}

