/* Post Section */
.post-section {
    padding: clamp(80px, 15vh, 120px) 0 clamp(60px, 10vh, 80px);
    min-height: 100vh;
}

.post-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Post Content */
.post-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: clamp(25px, 5vw, 40px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(20px, 4vw, 30px);
    font-size: clamp(12px, 2vw, 14px);
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    word-break: break-word;
}

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

.breadcrumb i {
    font-size: clamp(10px, 1.8vw, 12px);
    flex-shrink: 0;
}

.breadcrumb span {
    color: var(--text-primary);
    word-break: break-word;
}

/* Post Header */
.post-header {
    margin-bottom: clamp(20px, 4vw, 30px);
}

.post-category {
    display: inline-block;
    padding: clamp(5px, 1vw, 6px) clamp(12px, 2.5vw, 16px);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px;
    font-size: clamp(11px, 2vw, 13px);
    font-weight: 500;
    margin-bottom: 15px;
}

.post-title {
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-meta {
    display: flex;
    gap: clamp(15px, 4vw, 30px);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: clamp(12px, 2vw, 14px);
}

.meta-item i {
    color: var(--primary-color);
    flex-shrink: 0;
}

/* Featured Image */
.post-featured-image {
    margin-bottom: clamp(25px, 5vw, 40px);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

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

/* Post Body */
.post-body {
    color: var(--text-primary);
    line-height: 1.8;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.lead-paragraph {
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: clamp(20px, 4vw, 30px);
    line-height: 1.7;
}

.post-body h2 {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 700;
    color: var(--text-primary);
    margin: clamp(30px, 5vw, 40px) 0 clamp(15px, 3vw, 20px);
    word-wrap: break-word;
}

.post-body h3 {
    font-size: clamp(18px, 3.5vw, 24px);
    font-weight: 600;
    color: var(--text-primary);
    margin: clamp(20px, 4vw, 30px) 0 clamp(12px, 2.5vw, 15px);
    word-wrap: break-word;
}

.post-body p {
    margin-bottom: clamp(15px, 3vw, 20px);
    font-size: clamp(15px, 2.5vw, 17px);
    color: var(--text-secondary);
    line-height: 1.8;
}

.post-body ul, .post-body ol {
    margin: clamp(15px, 3vw, 20px) 0;
    padding-left: clamp(20px, 4vw, 30px);
}

.post-body li {
    margin-bottom: clamp(10px, 2vw, 12px);
    font-size: clamp(15px, 2.5vw, 17px);
    color: var(--text-secondary);
    line-height: 1.7;
}

.post-body li strong {
    color: var(--text-primary);
}

.post-body blockquote {
    margin: clamp(20px, 4vw, 30px) 0;
    padding: clamp(15px, 3vw, 20px) clamp(20px, 4vw, 30px);
    border-left: 4px solid var(--primary-color);
    background: var(--bg-secondary);
    font-style: italic;
    font-size: clamp(15px, 2.8vw, 18px);
    color: var(--text-secondary);
    line-height: 1.7;
}

.code-block {
    margin: clamp(20px, 4vw, 30px) 0;
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.code-block pre {
    margin: 0;
    padding: clamp(15px, 3vw, 20px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: clamp(12px, 2vw, 14px);
    color: #d4d4d4;
    line-height: 1.6;
    word-break: break-all;
}

/* Post Footer */
.post-footer {
    margin-top: clamp(30px, 6vw, 50px);
    padding-top: clamp(20px, 4vw, 30px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.post-tags i {
    color: var(--primary-color);
    font-size: clamp(16px, 2.5vw, 18px);
    flex-shrink: 0;
}

.tag {
    padding: clamp(5px, 1vw, 6px) clamp(12px, 2.5vw, 14px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: clamp(11px, 2vw, 13px);
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

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

.post-share {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-share span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: clamp(13px, 2vw, 15px);
}

.share-btn {
    width: clamp(36px, 6vw, 38px);
    height: clamp(36px, 6vw, 38px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
    flex-shrink: 0;
}

.share-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Author Box */
.author-box {
    margin-top: clamp(30px, 6vw, 50px);
    padding: clamp(20px, 4vw, 30px);
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    gap: clamp(15px, 4vw, 25px);
    align-items: center;
    flex-wrap: wrap;
}

.author-image {
    width: clamp(80px, 15vw, 100px);
    height: clamp(80px, 15vw, 100px);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    flex-shrink: 0;
}

.author-info {
    flex: 1;
    min-width: 200px;
}

.author-info h3 {
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    word-wrap: break-word;
}

.author-info p {
    font-size: clamp(13px, 2.2vw, 15px);
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.author-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.author-social a {
    width: clamp(34px, 6vw, 36px);
    height: clamp(34px, 6vw, 36px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
    flex-shrink: 0;
}

.author-social a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Related Posts */
.related-posts {
    margin-top: clamp(30px, 6vw, 50px);
    padding-top: clamp(25px, 5vw, 40px);
    border-top: 1px solid var(--border-color);
}

.related-posts h3 {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: clamp(20px, 4vw, 25px);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: clamp(20px, 4vw, 25px);
}

.related-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s;
    display: block;
}

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

.related-card img {
    width: 100%;
    height: clamp(150px, 30vw, 180px);
    object-fit: cover;
    display: block;
}

.related-content {
    padding: clamp(15px, 3vw, 20px);
}

.related-category {
    display: inline-block;
    padding: clamp(3px, 1vw, 4px) clamp(10px, 2vw, 12px);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px;
    font-size: clamp(10px, 1.8vw, 11px);
    font-weight: 500;
    margin-bottom: 10px;
}

.related-content h4 {
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    word-wrap: break-word;
}

.related-date {
    font-size: clamp(11px, 2vw, 13px);
    color: var(--text-secondary);
}

/* Sidebar Adjustments for Post Page */
.post-container .latest-news-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

/* Tablet Landscape */
@media (max-width: 1200px) {
    .post-container {
        gap: 30px;
    }
}

/* Tablet Portrait */
@media (max-width: 1024px) {
    .post-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .post-container .latest-news-sidebar {
        position: static;
        order: 2;
    }

    .post-content {
        order: 1;
    }

    .related-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    }
}

/* Mobile Landscape and Small Tablets */
@media (max-width: 768px) {
    .post-section {
        padding-top: 80px;
        padding-bottom: 50px;
    }

    .post-container {
        padding: 0 15px;
        gap: 30px;
    }

    .post-content {
        padding: 20px;
        border-radius: 12px;
    }

    .breadcrumb {
        margin-bottom: 20px;
    }

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

    .post-title {
        margin-bottom: 15px;
    }

    .post-meta {
        gap: 12px;
    }

    .post-body h2 {
        margin-top: 25px;
        margin-bottom: 15px;
    }

    .post-body h3 {
        margin-top: 20px;
        margin-bottom: 12px;
    }

    .related-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .author-box {
        padding: 20px;
    }

    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .post-share {
        width: 100%;
        justify-content: flex-start;
    }

    /* Improve readability on mobile */
    .post-body p,
    .post-body li {
        text-align: left;
    }

    .code-block {
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 0;
    }

    .code-block pre {
        padding: 15px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .post-section {
        padding-top: 70px;
        padding-bottom: 40px;
    }

    .post-container {
        padding: 0 10px;
    }

    .post-content {
        padding: 18px;
    }

    .post-category {
        font-size: 11px;
        padding: 5px 12px;
    }

    .breadcrumb {
        font-size: 11px;
        gap: 6px;
    }

    .post-meta {
        gap: 10px;
    }

    .meta-item {
        font-size: 12px;
    }

    .author-box {
        text-align: center;
        padding: 18px;
    }

    .author-info {
        width: 100%;
        text-align: center;
    }

    .author-social {
        justify-content: center;
    }

    .post-tags {
        gap: 8px;
    }

    .tag {
        font-size: 11px;
        padding: 5px 10px;
    }

    .share-btn {
        width: 36px;
        height: 36px;
    }

    .related-card img {
        height: 160px;
    }

    .related-content {
        padding: 15px;
    }

    /* Better spacing for small screens */
    .post-body ul,
    .post-body ol {
        padding-left: 20px;
    }

    .post-body blockquote {
        padding: 12px 15px;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .post-container {
        padding: 0 8px;
    }

    .post-content {
        padding: 15px;
    }

    .post-title {
        font-size: 22px;
    }

    .post-body h2 {
        font-size: 20px;
    }

    .post-body h3 {
        font-size: 17px;
    }

    .author-image {
        width: 70px;
        height: 70px;
    }

    .code-block {
        margin-left: -15px;
        margin-right: -15px;
    }

    .related-card img {
        height: 140px;
    }
}

/* Landscape Orientation for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .post-section {
        padding-top: 60px;
        padding-bottom: 30px;
    }

    .post-featured-image {
        margin-bottom: 20px;
    }

    .author-box {
        margin-top: 25px;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .share-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .author-social a {
        min-width: 44px;
        min-height: 44px;
    }

    .tag {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Disable hover effects on touch devices */
    .related-card:hover {
        transform: none;
    }

    .share-btn:hover,
    .author-social a:hover {
        transform: none;
    }

    .tag:hover {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .post-featured-image img {
        image-rendering: -webkit-optimize-contrast;
    }

    .author-image {
        image-rendering: -webkit-optimize-contrast;
    }

    .related-card img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print Styles */
@media print {
    .post-section {
        padding: 20px 0;
    }

    .post-container {
        grid-template-columns: 1fr;
    }

    .latest-news-sidebar,
    .post-share,
    .author-social,
    .related-posts {
        display: none;
    }

    .post-content {
        box-shadow: none;
        padding: 0;
    }

    .post-body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .post-body a {
        color: #000;
        text-decoration: underline;
    }

    .code-block {
        page-break-inside: avoid;
    }

    .author-box {
        page-break-inside: avoid;
    }
}