/**
 * Magazine-Style Blog CSS
 * 
 * This stylesheet provides all the styling for the blog section
 * It uses blog-specific classes to avoid conflicts with existing theme styles
 * Uses CSS variables from base.css for consistency
 * 
 * Structure:
 * 1. Layout & Grid
 * 2. Blog Homepage (Featured Posts & Category Sections)
 * 3. Single Post Styles
 * 4. Archive Styles
 * 5. Sidebar Styles
 * 6. Responsive Styles
 */

/* ============================================================
   1. LAYOUT & GRID
   ============================================================ */

.blog-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--forum-container-bg);
}

.blog-home {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}


.blog-main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.blog-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

/* Content areas - let grid control width */
.archive-primary-content,
.post-content-area {
    width: 100%;
}

/* ============================================================
   2. BLOG HOMEPAGE - FEATURED POSTS
   ============================================================ */

.blog-featured-posts {
    margin-bottom: 4rem;
}

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

/* Large featured post spans full width */
.featured-large {
    grid-column: 1 / -1;
}

.featured-post {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    transition: box-shadow var(--transition);
}

.featured-post:hover {
    box-shadow: var(--shadow-hover);
}

/* Featured link wrapper - makes entire card clickable */
.featured-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.featured-thumbnail {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.featured-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.featured-post:hover .featured-thumbnail img {
    transform: scale(1.05);
}

/* Overlay that sits on top of image */
.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    transition: background var(--transition);
}

.featured-post:hover .featured-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.1) 100%);
}

/* Content within the overlay */
.featured-content {
    width: 100%;
}

.featured-title {
    font-size: 1.5rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin: 0;
    color: #fff;
}

.featured-large .featured-title {
    font-size: 2.25rem;
    font-weight: var(--font-weight-bold);
}

.featured-excerpt {
    font-size: 1rem;
    line-height: var(--line-height-relaxed);
    color: rgba(255, 255, 255, 0.9);
    margin: 1rem 0;
}

.read-more {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: color var(--transition);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 2px;
}

.featured-post:hover .read-more {
    border-bottom-color: #fff;
}

/* Featured Video Support */
.featured-video {
    position: relative;
}

.featured-video-element {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.featured-post:hover .featured-video-element {
    transform: scale(1.05);
}

/* Play indicator for smaller video tiles (not the large autoplay one) */
.featured-post:not(.featured-large) .video-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    pointer-events: none;
    opacity: 0.9;
    transition: all var(--transition);
    z-index: 1;
}

.featured-post:not(.featured-large):hover .video-play-indicator {
    background: var(--primary-color);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* ============================================================
   3. BLOG HOMEPAGE - CATEGORY SECTIONS
   ============================================================ */

.blog-category-section {
    margin-bottom: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 1.75rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.category-title a {
    color: var(--text-color);
    text-decoration: none;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.view-all:hover,
.view-all:focus {
    color: var(--primary-hover);
    text-decoration: underline;
}

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

.category-post {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-secondary);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.category-post:hover {
    box-shadow: var(--shadow-hover);
}

.category-thumbnail {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.category-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-post:hover .category-thumbnail img {
    transform: scale(1.05);
}


/* Featured Video in Category Posts */
.category-video {
    position: relative;
}

.category-video-element {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-post:hover .category-video-element {
    transform: scale(1.05);
}

/* Play indicator for videos */
.video-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    pointer-events: none;
    opacity: 0.9;
    transition: all var(--transition);
}

.category-post:hover .video-play-indicator {
    background: var(--primary-color);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Auto-play video on hover */
.category-post:hover .category-video-element {
    /* Video will be controlled by JavaScript for better performance */
}


.category-post-content {
    padding: 1.5rem;
    font-size: 0.8rem;
}

.category-post-title {
    font-size: 1.5rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 0.5rem 0;
}

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

.category-post-title a:hover,
.category-post-title a:focus {
    color: var(--primary-color);
    text-decoration: underline;
}

.category-post-excerpt {
    font-size: 0.9rem;
    line-height: var(--line-height-relaxed);
    color: var(--text-colour);
    margin-top: 0.75rem;
}

/* ============================================================
   4. SINGLE POST STYLES
   ============================================================ */

.single-post {
    width: 100%;
}

/* Hero Header Style */
.post-header-hero {
    position: relative;
    margin-bottom: 3rem;
    /* Full width - break out of container */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    /* Also need to break out at the top to cover site header area if needed */
    margin-top: -2rem;
}

/* Force white text on site header when hero is present */
.single-post .post-header-hero ~ * .site-header,
body.single-format-image .site-header,
body.single-format-image header.site-header,
body.single-format-image header.site-header *,
body.single-format-image .site-header a {
    color: #fff !important;
}

.hero-image {
    width: 100%;
    position: relative;
}

/* Dark tint overlay */
.hero-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    /* backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); */
}

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

.hero-video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: none !important; 
    padding-bottom: 0 !important;
}

.hero-content-inner {
    margin-top: 150px;
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    text-align: left;
}

.post-meta {
    margin-bottom: 0.5rem;
}

.post-category {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: calc(var(--border-radius) / 2);
    text-decoration: none;
    font-size: 1rem;
    margin: 0 auto;
    margin-right: 5px;
    transition: background var(--transition);
}

.post-header-hero .post-category:hover,
.post-header-hero .post-category:focus {
    background: var(--primary-color);
    color: var(--secondary-color);
    text-shadow: none;
}

.post-header-hero .post-title {
    font-size: 3.5rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: #fff;
    margin: 1rem 0 0;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 1);
}

/*
.post-header-hero .post-title span {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0.8rem;
} */


.post-header-hero .post-intro p {
    font-size: 1.3rem;
    font-weight: 500;
}


.post-header-hero .post-intro  p span{
    background: rgba(0, 0, 0, 0.5);
    padding: 0.4rem 0.6rem;
}

.post-header-hero .post-date {
    color: rgba(255, 255, 255, 0.9);
}

.post-header-hero .post-info {
    margin-top: 50px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.post-header-hero .post-comments {
    color: rgba(255, 255, 255, 0.9);
}

/* Featured Overlay Header Style (Standard format) */
.post-header-featured {
    margin-bottom: 3rem;
}

.single-featured-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.single-featured-thumbnail {
    width: 100%;
    overflow: hidden;
    position: relative;
}

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

/* Video support for featured overlay */
.single-featured-video {
    position: relative;
}

.single-featured-video-element {
    width: 100%;
    height: auto;
    display: block;
}

/* Overlay that sits on top of image/video */
.single-featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
   /* backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);*/
}

/* Content within the overlay */
.single-featured-content {
    width: 100%;
}

.single-featured-content .post-info {
    margin-bottom: 0.75rem;
}

.single-featured-content .post-category {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    display: inline-block;
    margin-right: 0.5rem;
    transition: background var(--transition);
}

.single-featured-content .post-category:hover,
.single-featured-content .post-category:focus {
    background: rgba(255, 255, 255, 0.3);
}

.single-featured-content .post-date,
.single-featured-content .post-comments {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.single-featured-title {
    font-size: 2.25rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 0.5rem 0;
    color: #fff;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 1);
}

.single-featured-excerpt {
    font-size: 1rem;
    line-height: var(--line-height-relaxed);
    color: rgba(255, 255, 255, 0.9);
    margin: 1rem 0 0;
}

.single-featured-excerpt p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Classic Header Style */
.post-header-classic {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    max-width: 650px;
}

.classic-content {
    margin-bottom: 1.5rem;
}

.post-header-classic .post-category {
    background: var(--bg-secondary);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: calc(var(--border-radius) / 2);
    text-decoration: none;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    transition: background var(--transition);
    float: none !important; 
    display: inline-block;
}

.post-header-classic .post-category:hover,
.post-header-classic .post-category:focus {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.post-header-classic .post-title {
    font-size: 3.5rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 1rem 0;
}

.post-header-classic .post-info {
    margin-top: 50px;
}

.post-header-classic .post-intro p {
    font-size: 1.3rem;
    font-weight: 400;
}

/* Classic thumbnail - same width as content (800px max) */
.classic-thumbnail {
    max-width: 650px;
    margin-bottom: 2rem;
}

.classic-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

.classic-video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Make sure the video containers are positioned */
.hero-image,
.classic-thumbnail {
    position: relative;
}

/* Video Play/Pause Button */
.video-control-btn {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.video-control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.video-control-btn.playing {
    background: rgba(255, 255, 255, 0.2);
}

.video-control-btn.playing:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-control-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}




/* Post Content */
.post-content {
    max-width: 650px;
    font-size: 1.125rem;
    line-height: var(--line-height-relaxed);
    color: var(--text-color);
    font-family: var(--font-family-primary);
}



.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-family: var(--font-family-title);
    line-height: var(--line-height-tight);
}

.post-content h2 {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
}

.post-content h4 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border: 8px solid var(--photo-frame);
    filter: drop-shadow(1px 1px 8px rgba(0, 0, 0, 0.3));
}

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

.post-content li {
    margin-bottom: 0.75rem;
}

.post-content blockquote {
    margin: 2rem 0;
    padding: 0.4rem 1.8rem 0.1rem;
    background: var(--secondary-color);
    border-left: 4px solid var(--border-color);
    font-weight: 500;
    width: 95%;
}

.post-content a {
    color: var(--primary-color);
    transition: color var(--transition);
}

.post-content a:hover {
    color: var(--primary-hover);
}

/* Post Footer */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.post-tags {
    font-size: 0.9rem;
}

.tags-label {
    font-weight: var(--font-weight-semibold);
    margin-right: 0.5rem;
}

.post-tags a {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: calc(var(--border-radius) / 2);
    text-decoration: none;
    margin: 0.25rem;
    transition: all var(--transition);
}

.post-tags a:hover,
.post-tags a:focus {
    background: var(--primary-color);
    color: var(--secondary-color);
}

/* Post Pagination (for multi-page posts) */
.post-pagination {
    margin: 2rem 0;
    text-align: center;
    font-size: 1rem;
}

.post-pagination a,
.post-pagination .current {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    background: var(--bg-secondary);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition);
}

.post-pagination .current {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.post-pagination a:hover,
.post-pagination a:focus {
    background: var(--primary-color);
    color: var(--secondary-color);
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}


/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.comments-area {
    max-width: 800px;
}

.comments-title {
    font-size: 1.75rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 3rem;
}

.comment-list .children {
    list-style: none;
    padding-left: 2rem;
}

.comment-body {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-author img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
}

.comment-author .fn {
    font-weight: var(--font-weight-semibold);
    font-style: normal;
    font-size: 1.125rem;
}

.comment-metadata {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.comment-metadata a {
    color: var(--text-muted);
    text-decoration: none;
}

.comment-metadata a:hover {
    color: var(--primary-color);
}

.comment-content {
    margin: 1rem 0;
    line-height: var(--line-height-relaxed);
}

.comment-content p {
    margin-bottom: 1rem;
}

.comment-awaiting-moderation {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    margin: 1rem 0;
}

.comment-reply {
    margin-top: 1rem;
}

.comment-reply a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: calc(var(--border-radius) / 2);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    transition: all var(--transition);
}

.comment-reply a:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.no-comments {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--text-muted);
}

/* Comment Form */
.comment-respond {
    margin-top: 3rem;
}

.comment-reply-title {
    font-size: 1.5rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1.5rem;
}

.comment-form {
    max-width: 800px;
}

.comment-form p {
    margin-bottom: 1.5rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-medium);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family-primary);
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color var(--transition);
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-form .required {
    color: var(--accent-color);
}

.submit-button {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-family-primary);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background var(--transition);
}

.submit-button:hover,
.submit-button:focus {
    background: var(--primary-hover);
}

/* Comment Navigation */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
}

.comment-navigation a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.comment-navigation a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}



/* ============================================================
   5. ARCHIVE STYLES
   ============================================================ */

.archive-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.archive-title {
    font-size: 2.5rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-bold);
    margin: 0 0 1rem;
}

.archive-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: var(--line-height-relaxed);
}

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

.archive-post {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.archive-post:hover {
    box-shadow: var(--shadow-hover);
}

.archive-thumbnail {
    width: 100%;
    overflow: hidden;
}

.archive-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.archive-post:hover .archive-thumbnail img {
    transform: scale(1.05);
}

.archive-post-content {
    padding: 1.5rem;
}

.archive-post-title {
    font-size: 1.5rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin: 0.5rem 0;
}

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

.archive-post-title a:hover,
.archive-post-title a:focus {
    color: var(--primary-color);
    text-decoration: underline;
}

.archive-post-excerpt {
    font-size: 1rem;
    line-height: var(--line-height-relaxed);
    color: var(--text-muted);
    margin: 1rem 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination .current {
    display: inline-block;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition);
}

.pagination .current {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.pagination a:hover,
.pagination a:focus {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.pagination .prev,
.pagination .next {
    font-weight: var(--font-weight-semibold);
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 4rem 2rem;
}

.no-posts h1 {
    font-size: 2rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-bold);
    margin-bottom: 1rem;
}

.no-posts p {
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* ============================================================
   6. SIDEBAR STYLES
   ============================================================ */

.blog-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    margin-bottom: 3rem;
}

.sidebar-heading {
    font-size: 1.25rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Popular Posts */
.popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.popular-post-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    align-items: start;
}

.popular-thumbnail {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

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

.popular-post-item:hover .popular-thumbnail img {
    transform: scale(1.1);
}

.popular-post-details .post-date {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.popular-post-title {
    font-size: 1rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    margin: 0;
}

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

.popular-post-title a:hover,
.popular-post-title a:focus {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Categories */
.categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 0.75rem;
}

.category-item a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color var(--transition);
}

.category-item a:hover,
.category-item a:focus {
    color: var(--primary-color);
}

.post-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* ============================================================
   6. RELATED POSTS & NAVIGATION IN SINGLE POSTS
   ============================================================ */

/* These sections should stay within the main content area, not span full width */
.post-content-area .related-topics-section,
.post-content-area .post-navigation-tiles,
.blog-primary-content .related-topics-section,
.blog-primary-content .post-navigation-tiles {
    background-color: transparent;
    border: none;
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.post-content-area .related-topics-section,
.blog-primary-content .related-topics-section {
    margin-top: 3rem;
    padding-top: 2rem;
}

.post-content-area .post-navigation-tiles,
.blog-primary-content .post-navigation-tiles {
    margin-top: 2rem;
    padding-top: 2rem;
}

/* Section headers */
.post-content-area .section-header h3,
.blog-primary-content .section-header h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-title);
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
}

/* Related topics grid - 3 columns within content area */
.post-content-area .related-topics-grid,
.blog-primary-content .related-topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Topic cards */
.post-content-area .topic-card,
.blog-primary-content .topic-card {
    background-color: var(--card-bg);
   /* border: 1px solid var(--border-color);*/
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.post-content-area .topic-card:hover ,
.blog-primary-content .topic-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.post-content-area .topic-link ,
.blog-primary-content .topic-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Topic media - constrain image height */
.post-content-area .topic-media ,
.blog-primary-content .topic-media {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-secondary);
}

.post-content-area .topic-thumbnail,
.post-content-area .topic-video-container ,
.blog-primary-content .topic-video-container {
    width: 100%;
    height: 100px !important;
    overflow: hidden;
}

.post-content-area .topic-thumbnail img,
.post-content-area .topic-video-preview ,
.blog-primary-content .topic-video-preview {
    width: 100%;
    height: 100px;
    display: block;
    object-fit:cover !important;
    transition: transform 0.3s ease;
}

.post-content-area .topic-card:hover .topic-thumbnail img,
.post-content-area .topic-card:hover .topic-video-preview ,
.blog-primary-content .topic-card:hover .topic-video-preview {
    transform: scale(1.05);
}

/* Placeholder for posts without images */
.post-content-area .topic-placeholder ,
.blog-primary-content .topic-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-color) 100%);
}

.post-content-area .placeholder-icon ,
.blog-primary-content .placeholder-icon {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Video play indicator */
.post-content-area .video-play-indicator ,
.blog-primary-content .video-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    pointer-events: none;
    z-index: 2;
}

/* Topic info section - with proper padding */
.post-content-area .topic-info ,
.blog-primary-content .topic-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.post-content-area .topic-header ,
.blog-primary-content .topic-header {
    flex: 1;
}

.post-content-area .topic-title ,
.blog-primary-content .topic-title {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-title);
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.post-content-area .topic-excerpt ,
.blog-primary-content .topic-excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.post-content-area .topic-meta ,
.blog-primary-content .topic-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}

.post-content-area .topic-category ,
.blog-primary-content .topic-category {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color var(--transition);
}

.post-content-area .topic-category:hover ,
.blog-primary-content .topic-category:hover {
    background-color: var(--primary-hover);
}

.post-content-area .topic-stats ,
.blog-primary-content .topic-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-content-area .stat-item ,
.blog-primary-content .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-content-area .stat-item .material-icon ,
.blog-primary-content .stat-item .material-icon {
    font-size: 0.875rem;
}

/* Navigation - Side-by-side with Featured Image Backgrounds */
.post-content-area .post-navigation,
.blog-primary-content .post-navigation {
    margin-top: 3rem;
    margin-bottom: 3rem;
    max-width: none;
    display: block !important; 
}

/* Grid: 50/50 split, no gap */
.post-content-area .post-nav-grid,
.blog-primary-content .post-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10;  /* or whatever gap you prefer */
    width: 100%;
}

/* Individual navigation item */
.post-content-area .post-nav-item,
.blog-primary-content .post-nav-item {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 0;  /* Important: allows grid item to shrink */
    aspect-ratio: 16 / 9;
    text-decoration: none;
    color: #fff;
    transition: transform var(--transition);
}

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

.post-content-area .post-nav-item:hover,
.blog-primary-content .post-nav-item:hover {
    transform: scale(1.02);
    z-index: 1;
}

/* Background image */
.post-content-area .post-nav-bg,
.blog-primary-content .post-nav-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.post-content-area .post-nav-item:hover .post-nav-bg,
.blog-primary-content .post-nav-item:hover .post-nav-bg {
    transform: scale(1.05);
}

/* Dark overlay - same as featured post overlay */
.post-content-area .post-nav-overlay,
.blog-primary-content .post-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    transition: background var(--transition);
}

.post-content-area .post-nav-item:hover .post-nav-overlay,
.blog-primary-content .post-nav-item:hover .post-nav-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.1) 100%);
}

/* Content within overlay */
.post-content-area .post-nav-content,
.blog-primary-content .post-nav-content {
    width: 100%;
}

/* Arrow */
.post-content-area .post-nav-arrow,
.blog-primary-content .post-nav-arrow {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

/* Label text - "Previous post" / "Next post" */
.post-content-area .post-nav-label,
.blog-primary-content .post-nav-label {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

/* Post title */
.post-content-area .post-nav-title,
.blog-primary-content .post-nav-title {
    font-size: 1.25rem;
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin: 0;
    color: #fff;
}

/* Empty state (no previous/next post) */
.post-content-area .post-nav-empty,
.blog-primary-content .post-nav-empty {
    background: var(--bg-secondary);
    cursor: default;
}

.post-content-area .post-nav-empty:hover,
.blog-primary-content .post-nav-empty:hover {
    transform: none;
}

.post-content-area .post-nav-empty .post-nav-overlay,
.blog-primary-content .post-nav-empty .post-nav-overlay {
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-content-area .post-nav-empty .post-nav-label,
.blog-primary-content .post-nav-empty .post-nav-label {
    color: var(--text-muted);
    opacity: 0.6;
    margin: 0;
}


/* ============================================================
   7. RESPONSIVE STYLES
   ============================================================ */

/* Tablets and smaller */
@media (max-width: 1024px) {
    .blog-content-wrapper {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }
    
    .popular-post-item {
        grid-template-columns: 80px 1fr;
        gap: 0.75rem;
    }
    
    .popular-thumbnail {
        width: 80px;
        height: 80px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    .blog-main, .post-header {
        padding: 0rem 0 1rem;
        margin: 0;
    }


    .blog-content-wrapper {
        display: grid;
        grid-template-columns: 1fr 350px;
        gap: 1rem;
        align-items: start;
    }


    .post-header-hero {
        position: relative;
        margin-bottom: 0rem;
        width: 100%;
        margin-left: 0 !important;
        margin-right:0 !important;
        margin-top: -2rem;
    }

 

    .post-header {padding-top:0 !important;}

    .hero-image {padding: 0;}

    .hero-image img,
    .hero-video-element {
        aspect-ratio: 1 / 1;   
        object-fit: cover;
        width: 100%;
        height: auto;
        margin: 0 !important;
    }

    .hero-content { padding: 0 !important; width: 100%; max-width: auto;}

  
    .hero-content-inner {
    margin-top: 0px;
    max-width: 100%;
    width: 100%;
    padding: 2rem;
    text-align: left;
    }


    /* Featured overlay style */
    .single-featured-wrapper {
        border-radius: 0;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
        padding: 0 !important;
    }

    .single-featured-thumbnail img,
    .single-featured-video-element {
        aspect-ratio: 1 / 1;  
        object-fit: cover;
        width: 100%;
        height: auto;
        margin: 0 !important;
    }

    .single-featured-overlay {
        padding: 1rem 1.25rem;
    }

    /* Classic style */
    .classic-thumbnail {
        max-width: 100%;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
        border-radius: 0;
    }

    .classic-thumbnail img,
    .classic-video-element {
        aspect-ratio: 1 / 1;  
        object-fit: cover;
        width: 100%;
        height: auto;
        border-radius: 0;
    }

    /* ── Hide post intro (excerpt) on mobile ── */
    .post-intro, .single-featured-excerpt {
        display: none;
    }
    
    /* Stack sidebar below content on mobile */
    .blog-content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-sidebar {
        position: static;
        order: 2;
    }
    
    /* Related posts - 2 columns on tablet, 1 on mobile */
    .post-content-area .related-topics-grid ,
    .blog-primary-content .related-topics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    
    /* Navigation - stack vertically on mobile */
    .post-content-area .post-nav-grid,
    .blog-primary-content .post-nav-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post-content-area .post-nav-overlay,
    .blog-primary-content .post-nav-overlay {
        padding: 1rem;
    }
    
    .post-content-area .post-nav-title,
    .blog-primary-content .post-nav-title {
        font-size: 1.1rem;
    }
    
    
    /* Featured posts - single column */
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .featured-large {
        grid-column: 1;
    }
    
    .featured-overlay {
        padding: 1.5rem;
    }
    
    .featured-title {
        font-size: 1.25rem;
    }
    
    .featured-large .featured-title {
        font-size: 1.75rem;
    }
    
    .featured-excerpt {
        font-size: 0.95rem;
    }
    
    /* Category sections - single column */
    .category-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Archive - single column */
    .archive-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    } 
    
    .post-header-hero .post-title {
        font-size: 2rem;}

    .single-featured-wrapper {
        position: relative;
        overflow: hidden;
    }

    .single-featured-thumbnail {
        width: 100%;
        overflow: hidden;
        position: relative;
    }

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

    /* Video support for featured overlay */
    .single-featured-video {
        position: relative;
    }

    .single-featured-video-element {
        width: 100%;
        height: auto;
        display: block;
    }

    /* Overlay that sits on top of image/video */
    .single-featured-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
        display: flex;
        align-items: flex-end;
        padding: 2rem;
    }

    /* Content within the overlay */
    .single-featured-content {
        width: 100%;
    }

    .single-featured-content .post-info {
        margin-bottom: 0.75rem;
    }

    .single-featured-content .post-category {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
        padding: 0.25rem 0.75rem;
        font-size: 0.875rem;
        border-radius: var(--border-radius-sm);
        text-decoration: none;
        display: inline-block;
        margin-right: 0.5rem;
        transition: background var(--transition);
    }

    .single-featured-content .post-category:hover,
    .single-featured-content .post-category:focus {
        background: rgba(255, 255, 255, 0.3);
    }

    .single-featured-content .post-date,
    .single-featured-content .post-comments {
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.875rem;
    }

    .single-featured-title {
        font-size: 2.25rem;
        font-family: var(--font-family-title);
        font-weight: var(--font-weight-bold);
        line-height: var(--line-height-tight);
        margin: 0.5rem 0;
        color: #fff;
    }

    .single-featured-excerpt {
        font-size: 1rem;
        line-height: var(--line-height-relaxed);
        color: rgba(255, 255, 255, 0.9);
        margin: 1rem 0 0;
    }

    .single-featured-excerpt p {
        margin: 0;
        color: rgba(255, 255, 255, 0.9);
    }

    /* Classic Header Style */
    .post-header-classic {
        margin-top: 0rem;
        max-width: 100%;
    }

    .classic-content {
        margin-bottom: 1rem;
    }

    .post-header-classic .post-category {
        padding: 0.25rem 0.75rem;
        font-size: 0.875rem;
        margin-right: 0;
    }

    .post-header-classic .post-title {
        font-size: 4rem;
    }

    .post-header-classic .post-info {
        margin-top: 0px;
    }

    .post-header-classic .post-intro p {
        font-size: 1rem;
        font-weight: 600;
    }
    
    .post-content, .post-footer, .post-navigation, .related-topics-grid, .blog-sidebar {
        padding: 0 1.5rem;
    }
     
    .post-content p {
        font-size: 1.1rem;   
    }

    .post-content h2 {
        font-size: 1.8rem;   
    }

    .related-topics-section h3 {
        text-align: center;
    }

}

/* Small mobile */
@media (max-width: 480px) {
    .post-header-hero .post-title {
        font-size: 2rem;
    }
    
    .post-header-classic .post-title {
        font-size: 2rem;
    }
    
    /* Featured overlay header small mobile */
    .single-featured-overlay {
        padding: 1rem;
    }
    
    .single-featured-title {
        font-size: 1.5rem;
    }
    
    .single-featured-excerpt {
        font-size: 0.9rem;
        margin: 0.75rem 0 0;
    }
    
    /* Related posts - single column on small mobile */
    .post-content-area .related-topics-grid ,
    .blog-primary-content .related-topics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    
    /* Navigation - smaller text on small mobile */
    .post-content-area .post-nav-arrow,
    .blog-primary-content .post-nav-arrow {
        font-size: 1.25rem;
    }
    
    .post-content-area .post-nav-label,
    .blog-primary-content .post-nav-label {
        font-size: 0.75rem;
    }
    
    .post-content-area .post-nav-title,
    .blog-primary-content .post-nav-title {
        font-size: 1rem;
    }
    
    
    .featured-overlay {
        padding: 1rem;
    }
    
    .featured-title {
        font-size: 1.1rem;
    }
    
    .featured-large .featured-title {
        font-size: 1.5rem;
    }
    
    .featured-excerpt {
        font-size: 0.9rem;
        margin: 0.75rem 0;
    }
    
    /* Single column for mobile sidebar */
    .popular-posts-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   8. ACCESSIBILITY ENHANCEMENTS
   ============================================================ */

/* Screen reader only text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
.blog-main a:focus,
.blog-main button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip link (add to header if needed) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}