/* News Theme Styles */
:root {
    --theme-primary: #dc3545;
    --theme-secondary: #6c757d;
    --theme-accent: #ffc107;
    --theme-bg: #ffffff;
    --theme-text: #212529;
    --theme-border: #dee2e6;
}

[data-theme="dark"] {
    --theme-bg: #1a1a1a;
    --theme-text: #e0e0e0;
    --theme-border: #333333;
}

[data-theme="dark"] body {
    background-color: var(--theme-bg);
    color: var(--theme-text);
}

/* Breaking News Banner */
.breaking-news-banner {
    background: var(--theme-primary);
    color: white;
    padding: 0.75rem 0;
    position: relative;
    z-index: 1000;
}

.breaking-news-banner .breaking-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.breaking-news-banner .breaking-label {
    font-weight: bold;
    white-space: nowrap;
    font-size: 0.875rem;
}

.breaking-news-banner .breaking-link {
    color: white;
    text-decoration: none;
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaking-news-banner .breaking-link:hover {
    text-decoration: underline;
}

.breaking-news-banner .breaking-dismiss {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

.breaking-news-banner .breaking-dismiss:hover {
    opacity: 0.8;
}

/* News Ticker */
.news-ticker {
    background: #f8f9fa;
    border-bottom: 1px solid var(--theme-border);
    padding: 0.5rem 0;
    overflow: hidden;
}

.news-ticker .ticker-label {
    background: var(--theme-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-right: 1rem;
    display: inline-block;
}

.news-ticker .ticker-content {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: calc(100% - 100px);
    vertical-align: middle;
}

.news-ticker .ticker-list {
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.news-ticker .ticker-list li {
    display: inline-block;
    margin-right: 2rem;
    padding-right: 2rem;
    border-right: 1px solid var(--theme-border);
}

.news-ticker .ticker-list li:last-child {
    border-right: none;
}

.news-ticker .ticker-list a {
    color: var(--theme-text);
    text-decoration: none;
    font-weight: 500;
}

.news-ticker .ticker-list a:hover {
    color: var(--theme-primary);
}

.news-ticker .ticker-time {
    color: var(--theme-secondary);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* Featured Hero Section - Symmetric 4-Story Grid */
.featured-hero {
    padding: 2rem 0;
    border-bottom: 2px solid var(--theme-border);
}

.featured-hero .row {
    align-items: stretch; /* Make columns equal height */
}

.featured-side-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.featured-side-item-wrapper {
    flex: 1;
    display: flex;
    min-height: 0; /* Allow flex items to shrink below content size */
}

.featured-side-item-wrapper .post-card {
    width: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Reduce padding in featured side cards */
.featured-hero .featured-side-item-wrapper .post-card .card-body {
    padding: 0.875rem 1rem !important;
}

.featured-hero .featured-side-item-wrapper .post-card .post-card-title {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.featured-hero .featured-side-item-wrapper .post-card .post-card-excerpt {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.featured-hero .featured-side-item-wrapper .post-card .post-card-meta {
    font-size: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Ensure featured post card matches height of side grid */
.featured-hero .col-lg-6:first-child .featured-post-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-hero .col-lg-6:first-child .featured-post-image-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.featured-hero .col-lg-6:first-child .featured-post-image-link {
    flex: 1;
    display: flex;
    min-height: 0;
}

.featured-hero .col-lg-6:first-child .featured-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex: 1;
}

/* Remove fixed height from featured post image in hero section */
.featured-hero .featured-post-image-wrapper .featured-post-image {
    height: auto !important;
    min-height: 350px;
    max-height: 450px;
}

/* Responsive adjustments for symmetric layout */
@media (max-width: 991px) {
    .featured-side-grid {
        margin-top: 1rem;
    }
    
    .featured-hero .featured-post-image-wrapper .featured-post-image {
        min-height: 250px;
        max-height: 300px;
    }
    
    .featured-hero .row {
        align-items: flex-start; /* Reset alignment on mobile */
    }
}

.featured-main {
    position: relative;
}

.featured-main .featured-image {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    aspect-ratio: 16/9;
}

.featured-main .featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-main .featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 33.33%; /* Bottom 1/3 of image */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0) 100%);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    animation: slideUpFadeIn 0.6s ease-out forwards;
}

.featured-main .category-badge {
    background: var(--theme-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.featured-main .featured-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.featured-main .featured-title a {
    color: #ffffff !important;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: opacity 0.2s ease;
}

.featured-main .featured-title a:hover {
    opacity: 0.9;
    text-decoration: none;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-main .featured-excerpt {
    font-size: 1rem;
    margin: 0.5rem 0;
    opacity: 0.95;
}

.featured-main .featured-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.featured-side-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--theme-border);
    padding-bottom: 1.5rem;
}

.featured-side-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.featured-side-image {
    overflow: hidden;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    aspect-ratio: 16/9;
}

.featured-side-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-side-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.featured-side-title a {
    color: var(--theme-text);
    text-decoration: none;
}

.featured-side-title a:hover {
    color: var(--theme-primary);
}

.featured-side-meta {
    font-size: 0.875rem;
    color: var(--theme-secondary);
}

/* Category Sections */
.category-section {
    padding: 2rem 0;
    border-bottom: 1px solid var(--theme-border);
}

.section-title {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--theme-text);
    border-left: 4px solid var(--theme-primary);
    padding-left: 1rem;
}

/* Post Cards - Modern Tab-Style Design */
.post-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    background: var(--theme-bg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--theme-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
    border-color: var(--theme-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.post-card:hover::before {
    transform: scaleX(1);
}

.post-card-image-wrapper {
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.post-card-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-card-image-wrapper::after {
    opacity: 1;
}

.post-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

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

.post-card .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.75rem 0;
    color: var(--theme-text);
}

.post-card-title a {
    color: var(--theme-text);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

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

.post-card-excerpt {
    color: var(--theme-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--theme-secondary);
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--theme-border);
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-card-meta i {
    font-size: 0.875rem;
}

.post-card-meta a {
    color: var(--theme-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card-meta a:hover {
    color: var(--theme-primary);
}

.post-card-tags {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-card-tags .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.post-card-tags .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-badge {
    background: var(--theme-primary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Recent Posts Section */
.recent-posts {
    padding: 2rem 0;
}

.load-more-section {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
}

/* Enhanced Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--theme-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
    color: var(--theme-text);
}

/* Improved Spacing */
.featured-hero,
.category-section,
.recent-posts {
    padding: 2.5rem 0;
}

@media (max-width: 768px) {
    .featured-hero,
    .category-section,
    .recent-posts {
        padding: 1.5rem 0;
    }
}

/* Enhanced Card Shadows and Transitions - Updated for tab-style design */
.featured-side-item,
.related-post-card {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.related-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Better Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--theme-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Improved Button Styling */
.btn {
    transition: all 0.2s ease;
    font-weight: 500;
    border-radius: 0.375rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* Enhanced Link Styling */
a {
    transition: color 0.2s ease;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Better Form Inputs */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid var(--theme-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

/* Enhanced Breaking News Banner */
.breaking-news-banner {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Improved News Ticker */
.news-ticker {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Better Featured Hero Section */
.featured-main .featured-image {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.featured-main .featured-content {
    backdrop-filter: blur(4px);
}

/* Enhanced Category Badge */
.category-badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 992px) {
    .featured-main .featured-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.625rem;
    }
    
    .post-title {
        font-size: 1.0625rem;
    }
}

@media (max-width: 768px) {
    .featured-main .featured-content {
        position: relative;
        background: var(--theme-bg);
        color: var(--theme-text);
        padding: 1rem 0;
    }
    
    .featured-main .featured-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .featured-main .featured-excerpt {
        font-size: 0.9375rem;
    }
    
    .news-ticker .ticker-content {
        width: calc(100% - 80px);
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .post-header .post-title {
        font-size: 2rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .featured-side-title {
        font-size: 1rem;
    }
    
    .post-title {
        font-size: 1rem;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .author-avatar,
    .author-initials {
        margin: 0 auto 1rem;
    }
}

@media (max-width: 576px) {
    .featured-main .featured-title {
        font-size: 1.375rem;
    }
    
    .section-title {
        font-size: 1.375rem;
    }
    
    .post-header .post-title {
        font-size: 1.75rem;
    }
    
    .breaking-news-banner {
        padding: 0.5rem 0;
    }
    
    .breaking-news-banner .breaking-label {
        font-size: 0.8125rem;
    }
    
    .breaking-news-banner .breaking-link {
        font-size: 0.875rem;
    }
}

/* Single Post Styles */
.single-post {
    padding: 2rem 0;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--theme-border);
}

.post-header .post-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 1rem 0;
    line-height: 1.2;
    color: var(--theme-text);
}

.post-header .post-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--theme-secondary);
    margin-top: 1rem;
}

.post-header .post-meta span {
    display: flex;
    align-items: center;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-featured-image .image-caption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--theme-secondary);
    font-style: italic;
    text-align: center;
}

.post-content,
.page-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--theme-text);
    margin-bottom: 2rem;
}

.post-content h1,
.post-content h2,
.page-content h1,
.page-content h2 {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 2rem 0 1rem;
    color: var(--theme-text);
}

.post-content h3,
.page-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--theme-text);
}

.post-content h4,
.page-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: var(--theme-text);
}

/* Image sizing in post content - respect data-size attribute */
.post-content img,
.page-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
}

.post-content img[data-size="thumbnail"],
.page-content img[data-size="thumbnail"] {
    max-width: 150px !important;
    width: auto;
    height: auto;
}

.post-content img[data-size="small"],
.page-content img[data-size="small"] {
    max-width: 200px !important;
    width: auto;
    height: auto;
}

.post-content img[data-size="medium"],
.page-content img[data-size="medium"] {
    max-width: 350px !important;
    width: auto;
    height: auto;
}

.post-content img[data-size="large"],
.page-content img[data-size="large"] {
    max-width: 500px !important;
    width: auto;
    height: auto;
}

.post-content img[data-size="full"],
.page-content img[data-size="full"] {
    max-width: 100% !important;
    width: 100%;
    height: auto;
}

/* Respect explicit width/height attributes */
.post-content img[style*="width"],
.page-content img[style*="width"] {
    /* Inline styles take precedence */
}

/* Image alignment */
.post-content img.alignLeft,
.post-content .alignLeft img,
.page-content img.alignLeft,
.page-content .alignLeft img {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.post-content img.alignRight,
.post-content .alignRight img,
.page-content img.alignRight,
.page-content .alignRight img {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.post-content img.alignCenter,
.post-content .alignCenter img,
.page-content img.alignCenter,
.page-content .alignCenter img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-content img.alignFull,
.post-content .alignFull img,
.page-content img.alignFull,
.page-content .alignFull img {
    width: 100%;
    max-width: 100%;
}

/* Remove figure/figcaption for provider images */
.post-content figure[data-provider-url] figcaption,
.post-content img[data-provider-url] + figcaption,
.post-content figure figcaption:has(+ img[data-provider-url]),
.page-content figure[data-provider-url] figcaption,
.page-content img[data-provider-url] + figcaption,
.page-content figure figcaption:has(+ img[data-provider-url]) {
    display: none !important;
}

/* Also hide any figcaption that follows a provider image */
.post-content img[data-provider-url] ~ figcaption,
.page-content img[data-provider-url] ~ figcaption {
    display: none !important;
}

/* Hide figcaptions for Unsplash images (by URL pattern) - comprehensive rules */
/* Hide figcaptions that are siblings of Unsplash images */
.post-content img[src*="unsplash.com"] ~ figcaption,
.post-content img[src*="unsplash.com"] + figcaption,
.page-content img[src*="unsplash.com"] ~ figcaption,
.page-content img[src*="unsplash.com"] + figcaption {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    opacity: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide figcaptions inside figures that contain Unsplash images (using :has() for modern browsers) */
.post-content figure:has(img[src*="unsplash.com"]) figcaption,
.page-content figure:has(img[src*="unsplash.com"]) figcaption {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    opacity: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Fallback: Hide figcaptions that are direct children of figures containing Unsplash images */
.post-content figure img[src*="unsplash.com"] + figcaption,
.page-content figure img[src*="unsplash.com"] + figcaption {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    opacity: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide ALL figcaptions inside figures that are in H2 tags (common structure) */
/* This catches the case where figure is nested inside H2 */
h2 figure figcaption,
.post-content h2 figure figcaption,
.page-content h2 figure figcaption,
.post-content h2 > figure > figcaption,
.page-content h2 > figure > figcaption {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    opacity: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    text-indent: -9999px !important;
}

/* Ensure images wrapped in links maintain their size */
.post-content a > img,
.page-content a > img {
    display: block;
}

.post-content p,
.page-content p {
    margin-bottom: 1.5rem;
}

.post-content img,
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    margin: 1.5rem 0;
}

.post-content blockquote,
.page-content blockquote {
    border-left: 4px solid var(--theme-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--theme-secondary);
}

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content li,
.page-content li {
    margin-bottom: 0.5rem;
}

.post-content strong,
.page-content strong {
    font-weight: bold;
}

.post-content em,
.page-content em {
    font-style: italic;
}

.post-content a,
.page-content a {
    color: var(--theme-primary);
    text-decoration: underline;
}

.post-content a:hover,
.page-content a:hover {
    color: var(--theme-accent);
}

.post-content hr,
.page-content hr {
    border: none;
    border-top: 2px solid var(--theme-border);
    margin: 2rem 0;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--theme-border);
}

.post-tags {
    margin-bottom: 1.5rem;
}

.post-tags .tag-link {
    display: inline-block;
    background: #f8f9fa;
    color: var(--theme-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.post-tags .tag-link:hover {
    background: var(--theme-primary);
    color: white;
}

.social-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--theme-border);
    background: var(--theme-bg);
    color: var(--theme-text);
}

.share-btn:hover {
    background: var(--theme-primary);
    color: white;
    border-color: var(--theme-primary);
}

.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin: 3rem 0;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
}

.author-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.author-bio {
    color: var(--theme-secondary);
    margin-bottom: 0.5rem;
}

.author-link {
    color: var(--theme-primary);
    text-decoration: none;
    font-weight: 500;
}

.author-link:hover {
    text-decoration: underline;
}

.related-posts {
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 2px solid var(--theme-border);
}

.related-post-card {
    height: 100%;
}

.related-post-image {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    aspect-ratio: 16/9;
    background-color: #f8f9fa;
}

.related-post-image a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.related-post-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.related-post-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.related-post-title a {
    color: var(--theme-text);
    text-decoration: none;
}

.related-post-title a:hover {
    color: var(--theme-primary);
}

.related-post-meta {
    font-size: 0.75rem;
    color: var(--theme-secondary);
}

.post-navigation {
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 2px solid var(--theme-border);
}

.nav-link {
    display: block;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--theme-primary);
    color: white;
}

.nav-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--theme-secondary);
}

.nav-link:hover .nav-label {
    color: rgba(255, 255, 255, 0.8);
}

.nav-title {
    display: block;
    font-weight: 600;
    color: var(--theme-text);
}

.nav-link:hover .nav-title {
    color: white;
}

.nav-next {
    text-align: right;
}

/* Table of Contents */
.table-of-contents {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.table-of-contents h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

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

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-item a {
    color: #212529 !important; /* Black text for light theme */
    text-decoration: none;
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    background: transparent !important; /* Ensure no background by default */
    background-color: transparent !important; /* Ensure no background by default */
}

/* Override any theme-primary usage for TOC - use header/footer colors */
/* Use maximum specificity to override Bootstrap and theme styles */
/* These styles will be overridden by inline styles in _Layout.cshtml if blogConfig colors are set */
.table-of-contents .toc-item a:hover,
.table-of-contents .toc-item a.active,
.table-of-contents .toc-list .toc-item a:hover,
.table-of-contents .toc-list .toc-item a.active,
article.single-post .table-of-contents .toc-item a:hover,
article.single-post .table-of-contents .toc-item a.active,
.toc-item a:hover,
.toc-item a.active {
    /* Use header/footer primary color - override any red (#dc3545) or theme-primary */
    background-color: var(--blog-primary-color, #007bff) !important;
    background: var(--blog-primary-color, #007bff) !important;
    /* Use header/footer secondary color - override any blue or other colors */
    color: var(--blog-secondary-color, #ffffff) !important;
    /* Explicitly prevent theme-primary red color from being applied */
    background-image: none !important;
    /* Explicitly override theme-primary, Bootstrap, and any other conflicting styles */
    border-color: var(--blog-primary-color, #007bff) !important;
    /* Prevent any color inheritance */
    border-left-color: var(--blog-primary-color, #007bff) !important;
    border-right-color: var(--blog-primary-color, #007bff) !important;
    border-top-color: var(--blog-primary-color, #007bff) !important;
    border-bottom-color: var(--blog-primary-color, #007bff) !important;
    /* Ensure no text color inheritance */
    text-decoration-color: var(--blog-secondary-color, #ffffff) !important;
    /* Override Bootstrap primary color */
    --bs-primary-rgb: inherit;
}

.toc-h3 {
    padding-left: 1rem;
}

/* Enhanced Navbar Styling */
.navbar {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    opacity: 0.8;
}

.navbar-nav .nav-link {
    transition: color 0.2s ease, background-color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    margin: 0 0.25rem;
    background-color: transparent; /* Override general .nav-link background for navbar links */
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle white overlay on hover */
}

.navbar-text {
    font-size: 0.875rem;
    color: var(--theme-secondary);
}

/* Enhanced Footer Styling */
.footer {
    padding: 2rem 0;
    margin-top: 4rem;
    background-color: #f8f9fa;
    border-top: 1px solid var(--theme-border);
}

.footer a {
    color: var(--theme-secondary);
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--theme-primary);
    text-decoration: none;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card,
.featured-side-item,
.related-post-card {
    animation: fadeIn 0.4s ease-out;
}

/* Dark Mode Support */
[data-theme="dark"] .news-ticker {
    background: #2a2a2a;
}

[data-theme="dark"] .navbar {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .navbar-brand,
[data-theme="dark"] .navbar-nav .nav-link {
    color: #e0e0e0 !important;
    background-color: transparent !important; /* Match light mode - no black buttons */
}

[data-theme="dark"] .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .footer {
    background-color: #222222;
    border-color: #333333;
    color: #e0e0e0;
}

[data-theme="dark"] .post-card {
    background: #222222;
    border-radius: 0.5rem;
    padding: 1rem;
}

[data-theme="dark"] .category-section {
    border-bottom-color: #333333;
}

[data-theme="dark"] .author-box {
    background: #222222;
}

[data-theme="dark"] .nav-link {
    background: #222222;
}

[data-theme="dark"] .table-of-contents {
    background: #1a1a1a; /* Black background for dark theme */
}

[data-theme="dark"] .toc-item a {
    color: #e0e0e0 !important; /* White text for dark theme */
    background: transparent !important; /* Ensure no background by default */
}

[data-theme="dark"] .table-of-contents .toc-item a:hover,
[data-theme="dark"] .table-of-contents .toc-item a.active,
[data-theme="dark"] .table-of-contents .toc-list .toc-item a:hover,
[data-theme="dark"] .table-of-contents .toc-list .toc-item a.active,
[data-theme="dark"] .toc-item a:hover,
[data-theme="dark"] .toc-item a.active {
    /* Use header/footer primary color - override any red (#dc3545) or theme-primary */
    background-color: var(--blog-primary-color, #007bff) !important;
    background: var(--blog-primary-color, #007bff) !important;
    /* Use header/footer secondary color - override any blue or other colors */
    color: var(--blog-secondary-color, #ffffff) !important;
    /* Explicitly prevent theme-primary red color from being applied */
    background-image: none !important;
    /* Explicitly override theme-primary, Bootstrap, and any other conflicting styles */
    border-color: var(--blog-primary-color, #007bff) !important;
    /* Prevent any color inheritance */
    border-left-color: var(--blog-primary-color, #007bff) !important;
    border-right-color: var(--blog-primary-color, #007bff) !important;
    border-top-color: var(--blog-primary-color, #007bff) !important;
    border-bottom-color: var(--blog-primary-color, #007bff) !important;
    /* Ensure no text color inheritance */
    text-decoration-color: var(--blog-secondary-color, #ffffff) !important;
}

[data-theme="dark"] .post-tags .tag-link {
    background: #333333;
    color: #e0e0e0;
}

[data-theme="dark"] .share-btn {
    background: #222222;
    border-color: #333333;
    color: #e0e0e0;
}

/* Social Media Links */
.social-media-links {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.social-media-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.social-media-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: inherit;
}

.social-media-link i {
    font-size: 1.1rem;
}

[data-theme="dark"] .social-media-link {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .social-media-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Featured Post Card Styles - Enhanced Tab-Style Design */
.featured-post-card {
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    background: var(--theme-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
}

.featured-post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--theme-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.featured-post-card:hover {
    border-color: var(--theme-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.featured-post-card:hover::before {
    transform: scaleX(1);
}

.featured-post-image-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
}

.featured-post-image-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    z-index: 1;
    overflow: visible; /* Allow overlay to be visible */
}

.featured-post-image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-post-card:hover .featured-post-image {
    transform: scale(1.03);
}

.featured-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.featured-post-card:hover .featured-post-overlay {
    opacity: 1;
}

/* Featured Post Title Overlay */
.featured-post-image-wrapper .featured-post-title-overlay,
.featured-post-image-link .featured-post-title-overlay,
.featured-post-title-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 33.33% !important; /* Bottom 1/3 of image */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0) 100%) !important;
    display: flex !important;
    align-items: flex-end !important;
    padding: 1.5rem !important;
    opacity: 0;
    animation: slideUpFadeIn 0.6s ease-out 0.1s forwards !important;
    z-index: 100 !important;
    pointer-events: none !important;
    visibility: visible !important;
}

.featured-post-title-overlay-content {
    width: 100%;
    pointer-events: auto;
}

.featured-post-title-overlay-text {
    margin: 0;
    font-size: 1.75rem;
    font-weight: bold;
    line-height: 1.3;
    color: #ffffff !important; /* Ensure text is white */
    display: block !important;
    width: 100%;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Additional specificity to override any theme or Bootstrap styles */
.featured-post-title-overlay-text,
.featured-post-title-overlay-text *,
.featured-post-title-overlay-text h2,
.featured-post-title-overlay-text h2 *,
.featured-post-title-overlay h2,
.featured-post-title-overlay h2 * {
    color: #ffffff !important;
}

/* Force white text for all elements in featured post title overlay */
.featured-post-title-overlay-text,
.featured-post-title-overlay-text h2,
.featured-post-title-overlay h2,
.featured-post-title-overlay-content h2,
.featured-post-title-overlay *,
.featured-post-title-overlay-content * {
    color: #ffffff !important;
}

/* Override any Bootstrap or theme text color classes - use maximum specificity */
.featured-post-title-overlay-text a,
.featured-post-title-overlay-text a.text-white,
.featured-post-title-overlay a,
.featured-post-title-overlay-content a,
.featured-post-title-overlay-content a.text-white,
.featured-post-title-overlay-text a.text-muted,
.featured-post-title-overlay-text a.text-secondary,
.featured-post-title-overlay a.text-muted,
.featured-post-title-overlay a.text-secondary,
.featured-post-title-overlay-text a.text-decoration-none,
.featured-post-title-overlay-content a.text-decoration-none,
a.text-white.featured-post-title-overlay-text,
a.text-decoration-none.featured-post-title-overlay-text {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    transition: opacity 0.2s ease;
    display: block;
    width: 100%;
    pointer-events: auto;
    text-decoration: none !important;
}

.featured-post-title-overlay-text a:hover,
.featured-post-title-overlay-text a.text-white:hover,
.featured-post-title-overlay a:hover,
.featured-post-title-overlay-content a:hover,
.featured-post-title-overlay-content a.text-white:hover,
.featured-post-title-overlay-text a.text-muted:hover,
.featured-post-title-overlay-text a.text-secondary:hover,
.featured-post-title-overlay a.text-muted:hover,
.featured-post-title-overlay a.text-secondary:hover {
    opacity: 0.9;
    color: #ffffff !important; /* Keep white on hover */
}

/* Featured Post Card Body Styles - Tab-Style Design */
.featured-post-card .card-body {
    border-top: 1px solid var(--theme-border);
}

/* Reduce padding in featured hero section cards */
.featured-hero .featured-post-card .card-body {
    padding: 0.75rem 1rem !important;
}

.featured-post-card .card-body .category-badge {
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-post-card .card-body .category-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.featured-post-card .card-body .featured-post-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    color: var(--theme-text);
}

.featured-post-card .card-body .featured-post-title a {
    color: var(--theme-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-post-card .card-body .featured-post-title a:hover {
    color: var(--theme-primary);
}

.featured-post-card .card-body .featured-post-excerpt {
    color: var(--theme-secondary);
    font-size: 0.8125rem;
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
}

.featured-post-card .card-body .featured-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--theme-secondary);
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--theme-border);
}

.featured-post-card .card-body .featured-post-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.featured-post-card .card-body .featured-post-meta i {
    font-size: 0.875rem;
}

.featured-post-card .card-body .featured-post-meta a {
    color: var(--theme-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-post-card .card-body .featured-post-meta a:hover {
    color: var(--theme-primary);
}

/* Header Ad Styles */
.header-ad-container {
    width: 100%;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.header-ad-top {
    /* Top location - above navigation */
    order: -1;
}

.header-ad-below-nav {
    /* BelowNav location - below navigation */
    margin-top: 0;
}

.header-ad-content {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
}

.header-ad-content iframe,
.header-ad-content ins,
.header-ad-content div[data-ad] {
    margin: 0 auto;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-ad-content {
        padding: 0.25rem 0;
    }
}
