/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

}

:root {
    --primary-color: #ff2442;
    --secondary-color: #333333;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #9e9e9e;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--secondary-color);
    background-color: var(--light-gray);
    line-height: 1.6;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header Styles */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

/* Sticky header enhancement for mobile */
.header.header-sticky {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 5px 0;
}

/* Ensure the menu button is always accessible */
.mobile-menu-toggle {
    z-index: 101;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s;
}

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

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--light-gray);
    border-radius: 20px;
    padding: 6px 16px;
    width: 250px;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    padding: 4px 0;
}

.search-button {
    background: transparent;
    border: none;
    color: var(--dark-gray);
}

/* Main Content Styles */
.main-content {
    padding: 20px 0 60px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    border-radius: var(--radius);
    padding: 60px 40px;
    margin-bottom: 40px;
    color: var(--white);
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-description {
    font-size: 16px;
    max-width: 600px;
}

/* Category Section */
.category-section {
    margin-bottom: 60px;
}

.category-header {
    margin-bottom: 20px;
}

.category-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.category-link {
    color: var(--secondary-color);
    transition: color 0.3s;
}

.category-link:hover {
    color: var(--primary-color);
}

.category-description {
    color: var(--dark-gray);
    margin-bottom: 16px;
}

/* Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.post-card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.post-image-container {
    position: relative;
    padding-bottom: 120%; /* Slightly adjusted aspect ratio for better visual */
    overflow: hidden;
}

.post-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.post-content {
    padding: 12px;
}

.post-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--dark-gray);
}

.post-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 6px;
    object-fit: cover;
}

.author-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.post-stats {
    display: flex;
    gap: 8px;
}

.post-likes, .post-comments {
    display: flex;
    align-items: center;
}

.post-likes i, .post-comments i {
    margin-right: 4px;
}

.category-footer {
    margin-top: 20px;
    text-align: right;
}

.view-more-link {
    color: var(--primary-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.view-more-link i {
    margin-left: 4px;
}

/* Category Page Styles */
.category-header-section {
    margin-bottom: 30px;
    text-align: center;
}

.category-page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.category-page-description {
    color: var(--dark-gray);
    max-width: 800px;
    margin: 0 auto;
}

.posts-grid-section {
    margin-bottom: 40px;
}

.loading-indicator {
    text-align: center;
    padding: 30px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--medium-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Post Detail Page Styles */
.post-detail-section {
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-detail-container {
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    overflow: hidden;
}

/* 桌面端布局 - 图片和内容各占一半，右侧内容超出时可滚动 */
/* 基础样式 - 确保图片容器结构完整 */
.post-image-carousel {
    position: relative;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f5f5f5;
    margin: 0 !important;
    padding: 0 !important;
}

/* 已在上方统一定义，此处移除重复样式 */

/* 桌面端布局 - 使用Grid布局确保稳定显示 */
@media (min-width: 768px) {
    .post-detail-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        position: relative;
        margin: 0;
        padding: 0;
    }
    
    .post-image-carousel {
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 0;
    }
    
    /* 为桌面端的carousel-container设置3:4宽高比 */
    .carousel-container {
        position: relative;
        width: 100%;
        min-height: 500px; /* 保底最小高度，确保图片始终可见 */
        overflow: hidden;
        background-color: #f5f5f5;
        margin: 0;
        padding: 0;
    }
    
    /* 确保carousel-slide在桌面端与3:4宽高比容器配合良好 */
    .carousel-slide,
    #main-carousel-slide {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* 桌面端.carousel-item样式 - 使用display属性控制显示/隐藏 */
    .carousel-item {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        display: none;
    }
    
    /* 确保.active的carousel-item可见 */
    .carousel-item.active {
        display: block;
    }
    
    /* 确保.carousel-image在3:4宽高比容器中正确显示 */
    .carousel-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .post-content-container {
        width: 50%;
        overflow-y: auto;
        height: 100%;
        position: relative;
        padding: 20px;
        margin: 0;
    }
    
    .carousel-thumbnails {
        flex-shrink: 0;
        padding: 10px;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        background-color: #f5f5f5;
        min-height: 80px;
        position: relative;
        z-index: 2;
        margin: 0;
    }
    
    /* 缩略图样式 */
    .thumbnail-item {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
        cursor: pointer;
        overflow: hidden;
        border: 2px solid transparent;
    }
    
    .thumbnail-item.active {
        border-color: #333;
    }
    
    .thumbnail-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

/* 保留悬停效果 */
.carousel-item:hover .carousel-image {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.3s;
}

.carousel-control:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.prev {
    left: 15px;
}

.next {
    right: 15px;
}

.carousel-thumbnails {
    display: flex;
    padding: 10px;
    gap: 10px;
    overflow-x: auto;
    width: 100%;
    background-color: #f5f5f5;
}

.thumbnail-item {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
}

.thumbnail-item.active {
    opacity: 1;
    transform: scale(1.05);
    border: 2px solid white;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.post-header {
    margin-bottom: 32px;
}

.post-author {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
}

.author-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 16px;
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.author-meta {
    font-size: 14px;
    color: var(--dark-gray);
}

/* Hide Follow button and post stats as requested */
.follow-button {
    display: none;
}

.post-stats {
    display: none;
}

.post-stats i {
    margin-right: 6px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.post-tag {
    background-color: var(--light-gray);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--secondary-color);
    transition: background-color 0.3s, color 0.3s;
    font-weight: 500;
}

.post-tag:hover {
    background-color: var(--medium-gray);
    color: var(--secondary-color);
}

.post-description {
    font-size: 16px;
    line-height: 1.8;
    word-break: break-word;
    margin-bottom: 32px;
}

/* Enhance text content readability */
.post-description p {
    margin-bottom: 1.2em;
    letter-spacing: 0.2px;
}

.post-description img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 16px 0;
    display: block;
}

/* Rich Text Support for Post Description */
.post-description h1,
.post-description h2,
.post-description h3,
.post-description h4,
.post-description h5,
.post-description h6 {
    margin: 1.5em 0 0.8em;
    font-weight: 600;
    color: var(--secondary-color);
}

.post-description h1 {
    font-size: 1.8em;
}

.post-description h2 {
    font-size: 1.6em;
}

.post-description h3 {
    font-size: 1.4em;
}

.post-description h4 {
    font-size: 1.2em;
}

.post-description h5,
.post-description h6 {
    font-size: 1.1em;
}

.post-description p {
    margin-bottom: 1.2em;
}

.post-description strong {
    font-weight: 600;
}

.post-description em {
    font-style: italic;
}

.post-description ul,
.post-description ol {
    margin: 1em 0 1em 1.5em;
}

.post-description ul {
    list-style-type: disc;
}

.post-description ol {
    list-style-type: decimal;
}

.post-description ul ul,
.post-description ol ol {
    margin-top: 0.5em;
}

.post-description a {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-description a:hover {
    color: #e01f3a;
}

.post-description blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background-color: var(--light-gray);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
}

.post-description code {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--light-gray);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-description pre {
    background-color: var(--light-gray);
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.post-description pre code {
    background-color: transparent;
    padding: 0;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--medium-gray);
}

.action-button {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--dark-gray);
    font-size: 13px;
    font-weight: 500;
}

.action-button i {
    font-size: 24px;
    margin-bottom: 6px;
}

.action-button:hover {
    color: var(--primary-color);
}

.post-comments {
    margin-top: 20px;
}

/* CTA Buttons */
.post-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
    text-align: center;
}

.cta-button:hover {
    background-color: #e01f3a;
}

.comments-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.comment-form {
    display: flex;
    margin-bottom: 20px;
}

.comment-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--medium-gray);
    border-radius: 20px;
    outline: none;
}

.comment-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 20px;
    margin-left: 10px;
    font-weight: 500;
}

.comment-item {
    display: flex;
    margin-bottom: 16px;
}

.commenter-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.comment-content {
    flex: 1;
    background-color: var(--white);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.commenter-name {
    font-weight: 600;
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: var(--dark-gray);
}

.comment-text {
    font-size: 14px;
}

.comment-actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.comment-like, .comment-reply {
    background: transparent;
    border: none;
    color: var(--dark-gray);
    font-size: 12px;
    display: flex;
    align-items: center;
}

.comment-like i, .comment-reply i {
    margin-right: 4px;
}

/* Related Posts Section */
.related-posts-section {
    margin-top: 30px;
    margin-bottom: 20px;
    padding: 16px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.comments-section {
    margin-top: 40px;
    margin-bottom: 30px;
    padding: 24px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.related-posts-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.related-posts-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Related Posts Grid - Responsive layout */
.related-posts-section .post-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Footer Styles */
.footer {
    background-color: var(--white);
    padding: 40px 0;
    border-top: 1px solid var(--medium-gray);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    grid-column: 1;
}

.footer-logo .logo {
    margin-bottom: 16px;
    display: inline-block;
}

.footer-description {
    color: var(--dark-gray);
    font-size: 14px;
    margin-bottom: 20px;
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-link-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: var(--dark-gray);
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--light-gray);
    color: var(--secondary-color);
    transition: background-color 0.3s, color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    color: var(--dark-gray);
    font-size: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

/* Error Page Styles */
.error-section {
    text-align: center;
    padding: 80px 0;
}

.error-title {
    font-size: 72px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.error-subtitle {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.error-description {
    color: var(--dark-gray);
    max-width: 500px;
    margin: 0 auto 30px;
}

.error-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.error-button:hover {
    background-color: #e01f3a;
}

/* Mobile Menu Toggle - Hidden by default */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--secondary-color);
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .post-detail-container {
        grid-template-columns: 3fr 2fr;
    }
}

@media (max-width: 768px) {
    /* Responsive container */
    .container {
        padding: 0 16px;
    }

    /* Navigation adjustments */
    .nav-links {
        gap: 16px;
    }

    .search-container {
        width: 180px;
    }

    /* Mobile menu implementation */
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        order: 3;
        width: 100%;
        margin-top: 10px;
        display: none;
    }

    .main-nav.active {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 0;
    }

    /* Touch target optimization */
    .nav-link,
    .action-button,
    .comment-action,
    .social-link {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    /* Grid layout adjustments */
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Post detail layout */
    .post-detail-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Post image carousel adjustments for mobile */
    .carousel-container {
        padding-bottom: 133.33%; /* 3:4宽高比 */
        height: 0;
        position: relative;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    
    #main-carousel-slide {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }
    
    .carousel-item {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        display: none;
    }
    
    .carousel-item.active {
        display: block;
    }
    
    .carousel-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        margin: 0;
        padding: 0;
        display: block;
    }
    
    .post-content-container {
        max-height: none !important;
        overflow-y: auto !important;
        padding: 16px !important;
        margin: 0 !important;
    }
    
    /* 修复移动端图片底部空白问题 */
    .post-image-carousel {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .carousel-container::after {
        content: '';
        display: block;
        clear: both;
    }

    .carousel-control {
        width: 36px;
        height: 36px;
    }

    .carousel-thumbnails {
        padding: 8px 6px;
        gap: 6px;
    }

    .thumbnail-item {
        flex: 0 0 50px;
        height: 50px;
    }

    /* Text content adjustments */
    .post-description {
        font-size: 15px;
        line-height: 1.7;
    }

    .post-description {
        font-size: 15px;
        line-height: 1.7;
    }

    /* Section padding adjustments */
    .hero-section {
        padding: 40px 20px;
    }

    .main-content {
        padding: 16px 0 40px;
    }

    /* Footer layout */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Comment form adjustments */
    .comment-form {
        flex-direction: column;
        gap: 10px;
    }

    .comment-submit {
        margin-left: 0;
        padding: 10px 20px;
    }

    /* Related posts mobile layout */
    .related-posts-section .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 576px) {
    /* Header adjustments for mobile */
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
    }

    .logo {
        margin-bottom: 10px;
    }

    /* Mobile menu implementation */
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        order: 3;
        width: 100%;
        margin-top: 10px;
        display: none;
    }

    .main-nav.active {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 0;
    }

    /* Touch target optimization */
    .nav-link,
    .action-button,
    .comment-action,
    .social-link {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    /* Grid layout adjustments */
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Typography adjustments */
    .hero-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .post-title-lg {
        font-size: 18px;
        line-height: 1.4;
    }

    .post-description {
        font-size: 15px;
        line-height: 1.7;
    }

    /* Post detail specific adjustments */
    .post-detail-container {
        padding: 0;
        gap: 0;
    }

    .carousel-container {
        padding-bottom: 133.33%; /* 3:4 Aspect Ratio */
        max-height: 600px;
    }
    
    .post-image-carousel {
        width: 100%;
    }
    
    .post-content-container {
        width: 100%;
        padding: 20px;
    }

    .carousel-control {
        width: 36px;
        height: 36px;
    }

    .carousel-thumbnails {
        padding: 8px 6px;
        gap: 6px;
    }

    .thumbnail-item {
        flex: 0 0 50px;
        height: 50px;
    }

    /* Section padding adjustments */
    .hero-section {
        padding: 40px 20px;
    }

    .main-content {
        padding: 16px 0 40px;
    }

    /* Footer layout */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Comment form adjustments */
    .comment-form {
        flex-direction: column;
        gap: 10px;
    }

    .comment-submit {
        margin-left: 0;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    /* Two column layout for smallest screens */
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Further touch target optimization */
    .post-card {
        margin-bottom: 16px;
        box-shadow: var(--shadow);
    }

    .post-content {
        padding: 16px;
    }

    /* Image optimization */
    .post-image-container {
        padding-bottom: 133%; /* 3:4 Aspect Ratio for better mobile display */
    }

    /* Post detail specific optimizations for very small screens */
    .post-detail-container {
        padding: 0;
        gap: 12px;
    }

    .carousel-container {
        padding-bottom: 133%; /* 3:4 Aspect Ratio for better mobile display */
    }

    .carousel-image {
        object-fit: cover;
        max-height: 300px;
    }

    .carousel-control {
        width: 32px;
        height: 32px;
    }

    .post-content-container {
        padding: 12px;
    }

    .post-description {
        font-size: 14px;
        line-height: 1.6;
        letter-spacing: 0.3px;
    }

    .post-description p {
        margin-bottom: 1em;
    }

    .post-description img {
        max-width: 100%;
        height: auto;
        margin: 12px 0;
    }

    /* Typography adjustments for smallest screens */
    .post-title-lg {
        font-size: 17px;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    /* Form elements optimization */
    .search-input,
    .comment-input {
        padding: 12px 16px;
        font-size: 16px;
    }
    /* Button optimization */
    .follow-button,
    .comment-submit,
    .view-more-link {
        padding: 10px 24px;
        font-size: 16px;
        min-height: 48px;
    }

    /* Related posts mobile layout for smallest screens */
    .related-posts-section .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}