/* Professional Blog Post Layout - Nail Canvas */

/* ===== LAZY LOADING FIXES ===== */
/* Fix lazy loading to show images properly */

/* Lazy Loading Styles - Fixed */
img[loading="lazy"] {
    opacity: 1; /* Changed from 0 to 1 to show images */
    transition: opacity 0.3s ease-in-out;
    /* Add loading placeholder */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

img[loading="lazy"].loaded {
    opacity: 1;
    background: none;
    animation: none;
}

/* Placeholder for lazy images */
img[loading="lazy"]:not([src]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* Ensure all images are visible by default */
img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Only hide images that are truly loading */
img.loading {
    opacity: 0.7;
}

img.loaded {
    opacity: 1;
}

/* ===== REFLOW PREVENTION STYLES ===== */
/* Support for forced reflow prevention script */

/* AdSense container optimization */
.adsbygoogle,
[id*="google_ads"],
[class*="adsbygoogle"] {
    /* Prevent layout shifts during loading */
    min-height: 90px;
    min-width: 728px;
    display: block;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* AdSense loading state */
.ad-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* AdSense loaded state */
.ad-loaded {
    opacity: 1;
    pointer-events: auto;
    background: none;
    animation: none;
}

/* Responsive AdSense containers */
@media (max-width: 768px) {
    .adsbygoogle,
    [id*="google_ads"],
    [class*="adsbygoogle"] {
        min-width: 320px;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .adsbygoogle,
    [id*="google_ads"],
    [class*="adsbygoogle"] {
        min-width: 300px;
        min-height: 50px;
    }
}

/* Prevent layout shifts for dynamic content */
.gallery-grid,
.related-posts,
.social-share,
.table-of-contents {
    /* Reserve space to prevent layout shifts */
    contain: layout style paint;
    will-change: auto;
}

/* Optimize font loading to prevent reflows */
.fonts-loading {
    /* Only hide text content, not images */
}

.fonts-loading h1,
.fonts-loading h2,
.fonts-loading h3,
.fonts-loading h4,
.fonts-loading h5,
.fonts-loading h6,
.fonts-loading p,
.fonts-loading span,
.fonts-loading div:not(img),
.fonts-loading a {
    visibility: hidden;
}

.fonts-loaded {
    visibility: visible;
}

.fonts-loaded h1,
.fonts-loaded h2,
.fonts-loaded h3,
.fonts-loaded h4,
.fonts-loaded h5,
.fonts-loaded h6,
.fonts-loaded p,
.fonts-loaded span,
.fonts-loaded div,
.fonts-loaded a {
    visibility: visible;
}

/* Prevent layout shifts for images during loading */
img {
    /* Use contain to prevent layout shifts */
    contain: layout style paint;
    will-change: auto;
}

/* Optimize scroll performance */
* {
    /* Prevent scroll-triggered reflows */
    scroll-behavior: auto;
}

/* Batch layout operations */
.layout-batch {
    /* Group layout operations */
    contain: layout style;
}

/* Prevent forced reflows for common elements */
.blog-post-container,
.post-content,
.gallery-item,
.related-post {
    /* Use contain to optimize layout */
    contain: layout style paint;
}

/* ===== CLS (CUMULATIVE LAYOUT SHIFT) FIXES ===== */
/* Prevent layout shifts by setting proper dimensions */

/* Blog post container - prevent layout shifts */
.blog-post-container {
    /* Ensure container has proper dimensions */
    min-height: 100vh;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Prevent layout shifts for images */
.blog-post-container img,
.post-content img,
.featured-image,
.gallery-item img {
    /* Set aspect ratio to prevent layout shifts */
    aspect-ratio: 16/9;
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    /* Prevent layout shifts during loading */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* Remove loading animation when image is loaded */
.blog-post-container img.loaded,
.post-content img.loaded,
.featured-image.loaded,
.gallery-item img.loaded {
    background: none;
    animation: none;
}

/* Specific aspect ratios for different image types */
.featured-image {
    aspect-ratio: 16/9;
    min-height: 300px;
}

.gallery-item img {
    aspect-ratio: 1/1;
    min-height: 200px;
}

.post-content img:not(.featured-image) {
    aspect-ratio: 16/9;
    min-height: 250px;
}

/* Prevent layout shifts for text content */
.post-title,
.post-excerpt,
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content p {
    /* Reserve space for text to prevent shifts */
    min-height: 1.2em;
    line-height: 1.6;
}

.post-title {
    min-height: 2.4em;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.post-excerpt {
    min-height: 3.2em;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Prevent layout shifts for meta information */
.post-meta {
    min-height: 2em;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.post-date,
.post-read-time {
    min-height: 1.2em;
    font-size: 0.9rem;
    color: #888;
}

/* Prevent layout shifts for gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    /* Reserve space for grid */
    min-height: 300px;
}

.gallery-item {
    aspect-ratio: 1/1;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* Prevent layout shifts for social share buttons */
.social-share {
    min-height: 60px;
    margin: 2rem 0;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 40px;
}

.share-btn {
    min-height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prevent layout shifts for related posts */
.related-posts {
    min-height: 200px;
    margin: 3rem 0;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    min-height: 150px;
}

.related-post {
    min-height: 150px;
    aspect-ratio: 16/9;
}

.related-post img {
    aspect-ratio: 16/9;
    min-height: 120px;
}

/* Prevent layout shifts for breadcrumbs */
.breadcrumb-nav {
    min-height: 40px;
    margin-bottom: 2rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 20px;
}

/* Prevent layout shifts for table of contents */
.table-of-contents {
    min-height: 100px;
    margin: 2rem 0;
}

.toc-list {
    min-height: 50px;
}

.toc-list li {
    min-height: 1.5em;
}

/* Loading animation for images */
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Ensure fonts are loaded to prevent layout shifts */
body {
    font-display: swap;
}

/* Prevent layout shifts for custom fonts */
.fonts-loading {
    visibility: hidden;
}

.fonts-loaded {
    visibility: visible;
}

/* ===== SEARCH OVERLAY FIX ===== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #ff4757;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #666;
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    color: #666;
    display: none;
}

.search-input:not(:placeholder-shown) + .search-clear {
    display: block;
}

.search-btn {
    padding: 1rem 2rem;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #e63946;
}

/* ===== BLOG POST LAYOUT ===== */
/* ===== POST HEADER ===== */
.post-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-category {
    background: linear-gradient(135deg, #e8f4f8, #d4e6f1);
    color: #2c3e50;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.post-date, .post-read-time {
    color: #666;
    font-size: 0.875rem;
}

.post-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: #2f3542;
    margin-bottom: 1rem;
    line-height: 1.2;
    font-family: 'Playfair Display', serif;
}

.post-excerpt {
    font-size: 1.2rem;
    color: #57606f;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== FEATURED IMAGE ===== */
.featured-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* ===== POST CONTENT ===== */
.post-content {
    font-size: 1.1rem;
    color: #2f3542;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2f3542;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.post-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0;
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 600;
    border-bottom: 2px solid #ff4757;
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.post-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #57606f;
}

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

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #57606f;
}

.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-left: 4px solid #ff4757;
    border-radius: 8px;
    font-style: italic;
    font-size: 1.1rem;
    color: #57606f;
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.gallery-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 450px;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-caption h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.gallery-caption p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* ===== POST CONTENT IMAGES ===== */
/* ===== ENHANCED POST CONTENT IMAGES - LARGER FOR DESKTOP ===== */
.post-content img:not(.featured-image) {
    width: 100%;
    max-width: 900px; /* Same as featured image */
    height: auto;
    object-fit: cover; /* Same as featured image */
    object-position: center;
    border-radius: 16px; /* Same as featured image */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Same as featured image */
    margin: 30px auto; /* Same as featured image */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block; /* Ensure proper centering */
}

.post-content img:not(.featured-image):hover {
    transform: scale(1.02); /* Same as featured image */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); /* Same as featured image */
}

/* Enhanced gallery images */
.gallery-item img {
    width: 100%;
    height: 100%; /* Fill the entire gallery item */
    object-fit: cover;
    object-position: center;
    border-radius: 0; /* Remove border radius to eliminate white space */
    transition: transform 0.3s ease;
    cursor: pointer; /* Show pointer cursor to indicate clickable */
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Enhanced gallery grid for larger images */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 0; /* No gap - eliminate white space */
    margin: 0; /* No margin - eliminate white space */
}

.gallery-item {
    background: #fff;
    border-radius: 0; /* Remove border radius to eliminate white space */
    overflow: hidden;
    box-shadow: none; /* Remove shadow to eliminate white space */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 350px; /* Responsive height */
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* Featured image enhancement */
.featured-image {
    width: 100%;
    max-width: 900px; /* Increased from default */
    height: auto;
    object-fit: cover;
    object-position: center;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin: 30px auto;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; /* Show pointer cursor to indicate clickable */
}

.featured-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Image gallery container enhancement */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 0; /* No gap - eliminate white space */
    margin: 0; /* No margin - eliminate white space */
}

.image-gallery img {
    width: 100%;
    height: 100%; /* Fill the entire container */
    max-height: none; /* Remove max-height restriction */
    object-fit: cover;
    object-position: center;
    border-radius: 0; /* Remove border radius to eliminate white space */
    box-shadow: none; /* Remove shadow to eliminate white space */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; /* Show pointer cursor to indicate clickable */
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

/* Full Image Lightbox Styles */
.full-image-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    cursor: pointer;
}

.full-image-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 95%;
    cursor: default;
}

.full-image {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.full-image-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.full-image-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.full-image-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    color: white;
    font-size: 1rem;
    text-align: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 4px;
}

/* Gallery images should also match featured image size */
.gallery-image {
    width: 100%;
    max-width: 900px; /* Same as featured image */
    height: auto;
    object-fit: cover; /* Same as featured image */
    object-position: center;
    border-radius: 16px; /* Same as featured image */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Same as featured image */
    margin: 30px auto; /* Same as featured image */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.gallery-image:hover {
    transform: scale(1.02); /* Same as featured image */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); /* Same as featured image */
}

/* ===== SOCIAL SHARE ===== */
.social-share {
    text-align: center;
    margin: 3rem 0 4rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.social-share h3 {
    margin-bottom: 1.5rem;
    color: #2f3542;
    font-size: 1.3rem;
}

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

.share-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
}

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

.pinterest-btn { 
    background: #e60023; 
}

.pinterest-btn:hover { 
    background: #d1001f; 
}

.facebook-btn { 
    background: #1877f2; 
}

.facebook-btn:hover { 
    background: #166fe5; 
}

.twitter-btn { 
    background: #1da1f2; 
}

.twitter-btn:hover { 
    background: #1a91da; 
}

/* ===== RELATED POSTS ===== */
.related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #f0f0f0;
}

.related-posts h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2f3542;
    font-family: 'Playfair Display', serif;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-post {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.related-post:hover {
    transform: translateY(-5px);
}

.related-post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

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

.related-post-content h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #2f3542;
}

.related-post-content p {
    color: #57606f;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.related-post-link {
    color: #ff4757;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.related-post-link:hover {
    text-decoration: underline;
}

/* ===== BREADCRUMB NAVIGATION ===== */
.breadcrumb-nav {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    z-index: 10;
    margin-top: 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.breadcrumb-item {
    margin-right: 0.5rem;
}

.breadcrumb-item a {
    color: #57606f;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #ff4757;
}

.breadcrumb-separator {
    color: #ccc;
    margin: 0 0.5rem;
}

.breadcrumb-current {
    color: #2f3542;
    font-weight: 600;
}

/* ===== TABLE OF CONTENTS ===== */
.table-of-contents {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 4px solid #ff4757;
}

.table-of-contents h2 {
    margin-top: 0;
    color: #2f3542;
    font-size: 1.5rem;
}

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

.toc-list li {
    margin-bottom: 0.75rem;
}

.toc-list a {
    color: #57606f;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 0.5rem 0;
}

.toc-list a:hover {
    color: #ff4757;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .blog-post-container {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-excerpt {
        font-size: 1rem;
    }
    
    .featured-image {
        height: 300px;
    }
    
    .post-content h1 {
        font-size: 2rem;
    }
    
    .post-content h2 {
        font-size: 1.75rem;
    }
    
    .post-content h3 {
        font-size: 1.4rem;
    }
    
    .post-content h4 {
        font-size: 1.2rem;
    }
    
    .post-content p {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item {
        height: 280px;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .post-content img:not(.featured-image) {
        height: 250px;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 200px;
        text-align: center;
    }
    
    .breadcrumb-list {
        padding: 0 0.5rem;
    }
    
    .search-container {
        padding: 1rem;
        width: 95%;
    }
    
    .search-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.75rem;
    }
    
    .featured-image {
        height: 250px;
    }
    
    .post-content h1 {
        font-size: 1.75rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
    
    .post-content h4 {
        font-size: 1.1rem;
    }
    
    .gallery-item {
        height: 260px;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .post-content img:not(.featured-image) {
        height: 200px;
    }
    
    .related-post img {
        height: 150px;
    }
} 

/* Mobile-specific image enhancements */
@media (max-width: 768px) {
    /* Blog post container fixes */
    .blog-post-container {
        width: 100%;
        margin: 0;
        padding: 0;
        display: block;
        grid-template-columns: 1fr;
        gap: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .blog-post-main {
        width: 100%;
        margin: 0;
        padding: 0 15px;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .blog-post-sidebar {
        width: 100%;
        margin: 0;
        padding: 15px;
        position: static;
        box-sizing: border-box;
    }
    
    /* Post content fixes */
    .post-content {
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        text-align: center;
    }
    
    .post-content p {
        text-align: left;
        width: 100%;
        margin: 0 0 15px 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .post-content h1,
    .post-content h2,
    .post-content h3,
    .post-content h4 {
        text-align: left;
        width: 100%;
        margin: 0 0 15px 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* Post header fixes */
    .post-header {
        width: 100%;
        margin: 0 0 20px 0;
        padding: 0;
        text-align: center;
        box-sizing: border-box;
    }
    
    .post-meta {
        width: 100%;
        margin: 0 0 15px 0;
        padding: 0;
        text-align: center;
        box-sizing: border-box;
    }
    
    .post-title {
        width: 100%;
        margin: 0 0 15px 0;
        padding: 0;
        text-align: center;
        box-sizing: border-box;
    }
    
    .post-excerpt {
        width: 100%;
        margin: 0 0 15px 0;
        padding: 0;
        text-align: center;
        box-sizing: border-box;
    }
    
    /* Image fixes */
    .post-content img:not(.featured-image),
    .gallery-image {
        max-width: 100%;
        width: 100%;
        margin: 20px 0;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        object-fit: contain;
        display: block;
        box-sizing: border-box;
    }
    
    .featured-image {
        max-width: 100%;
        width: 100%;
        margin: 20px 0;
        border-radius: 8px;
        object-fit: contain;
        display: block;
        box-sizing: border-box;
    }
    
    .gallery-item img {
        height: 100%;
        object-fit: cover;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .gallery-item {
        height: 300px;
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .image-gallery img {
        height: 100%;
        max-height: none;
        object-fit: cover;
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    /* Social share fixes */
    .social-share {
        width: 100%;
        margin: 30px 0;
        padding: 20px 15px;
        text-align: center;
        box-sizing: border-box;
    }
    
    .social-share h3 {
        width: 100%;
        margin: 0 0 15px 0;
        text-align: center;
        box-sizing: border-box;
    }
    
    .share-buttons {
        width: 100%;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
        box-sizing: border-box;
    }
    
    .share-btn {
        width: auto;
        min-width: 120px;
        margin: 0;
        box-sizing: border-box;
    }
    
    /* Breadcrumb fixes */
    .breadcrumb-nav {
        width: 100%;
        margin: 0;
        padding: 15px;
        box-sizing: border-box;
    }
    
    .breadcrumb-list {
        width: 100%;
        margin: 0;
        padding: 0;
        justify-content: center;
        flex-wrap: wrap;
        box-sizing: border-box;
    }
    
    .breadcrumb-item {
        margin: 0 5px;
        box-sizing: border-box;
    }
    
    /* Table of contents fixes */
    .table-of-contents {
        width: 100%;
        margin: 20px 0;
        padding: 15px;
        text-align: left;
        box-sizing: border-box;
    }
    
    .table-of-contents h3 {
        width: 100%;
        margin: 0 0 10px 0;
        text-align: center;
        box-sizing: border-box;
    }
    
    .toc-list {
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .toc-list li {
        width: 100%;
        margin: 5px 0;
        box-sizing: border-box;
    }
    
    .toc-list a {
        width: 100%;
        display: block;
        padding: 8px 0;
        box-sizing: border-box;
    }
    
    /* Global mobile fixes */
    * {
        box-sizing: border-box;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    html {
        overflow-x: hidden;
        width: 100%;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .blog-post-main {
        padding: 0 10px;
    }
    
    .blog-post-sidebar {
        padding: 10px;
    }
    
    .post-content img:not(.featured-image),
    .gallery-image {
        margin: 15px 0;
    }
    
    .featured-image {
        margin: 15px 0;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .social-share {
        padding: 15px 10px;
        margin: 20px 0;
    }
    
    .share-buttons {
        gap: 8px;
    }
    
    .share-btn {
        min-width: 100px;
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .breadcrumb-nav {
        padding: 10px;
    }
    
    .table-of-contents {
        padding: 10px;
        margin: 15px 0;
    }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
    .blog-post-main {
        padding: 0 8px;
    }
    
    .blog-post-sidebar {
        padding: 8px;
    }
    
    .post-content img:not(.featured-image),
    .gallery-image {
        margin: 10px 0;
    }
    
    .featured-image {
        margin: 10px 0;
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .social-share {
        padding: 10px 8px;
        margin: 15px 0;
    }
    
    .share-btn {
        min-width: 90px;
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .breadcrumb-nav {
        padding: 8px;
    }
    
    .table-of-contents {
        padding: 8px;
        margin: 10px 0;
    }
} 

/* ===== POPULAR POSTS WIDGET STYLES ===== */
/* Popular Posts Grid Layout */
.popular-posts-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.popular-post-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
}

.popular-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.popular-post-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.popular-post-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

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

.popular-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.popular-post-overlay .read-more {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary-color);
    border-radius: var(--radius-md);
    text-decoration: none;
}

.popular-post-content {
    padding: var(--spacing-lg);
}

.popular-post-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

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

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

.popular-post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.popular-post-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

/* Popular Posts Header */
.popular-posts-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.popular-posts-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.popular-posts-icon svg {
    width: 100%;
    height: 100%;
}

.popular-posts-widget h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive styles for popular posts */
@media (max-width: 1024px) {
    .popular-post-image-wrapper {
        height: 180px;
    }
    
    .popular-post-content {
        padding: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .popular-post-image-wrapper {
        height: 160px;
    }
    
    .popular-post-content {
        padding: var(--spacing-sm);
    }
    
    .popular-post-title {
        font-size: 0.9rem;
    }
    
    .popular-post-excerpt {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .popular-post-image-wrapper {
        height: 140px;
    }
    
    .popular-post-content {
        padding: var(--spacing-sm);
    }
    
    .popular-post-title {
        font-size: 0.85rem;
    }
    
    .popular-post-excerpt {
        font-size: 0.75rem;
    }
    
    .popular-post-meta {
        font-size: 0.7rem;
    }
} 