/* News Detail Page Styles */

/* News Detail Section */
.news-detail-section {
    padding: 40px 0 60px;
    background: #f8f9fa;
    min-height: 70vh;
}

.news-detail-section.document-mode {
    background: #e8e8e8;
}

.news-detail-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.news-detail-section.document-mode .container {
    max-width: 210mm;
}

/* News Detail Wrapper */
.news-detail-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Article Header */
.news-detail-header {
    padding: 40px 40px 30px;
    border-bottom: 1px solid #e9ecef;
}

/* Category Badge */
.news-detail-category {
    margin-bottom: 20px;
}

.news-detail-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%);
    color: #fff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
}

/* Title */
.news-detail-title {
    font-size: 2.5rem;
    color: #2c5aa0;
    margin: 0 0 25px;
    line-height: 1.3;
    font-weight: 700;
}

/* Meta Information */
.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    color: #666;
    font-size: 0.95rem;
}

/* Article Content */
.news-detail-content {
    padding: 40px;
}

/* Excerpt/Summary */
.news-detail-excerpt {
    font-size: 1.25rem;
    font-weight: 500;
    color: #444;
    margin: 0 0 35px;
    line-height: 1.8;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #ff6b35;
    border-radius: 5px;
}

/* Main Content */
.news-detail-main-content {
    line-height: 1.9;
    color: #333;
    font-size: 1.05rem;
}

.news-detail-main-content img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: block;
}

.news-detail-main-content p {
    margin-bottom: 1.2em;
}

.news-detail-main-content h2,
.news-detail-main-content h3,
.news-detail-main-content h4 {
    color: #2c5aa0;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

/* Video and iframe responsive styles */
.news-detail-main-content iframe,
.news-detail-main-content video,
.news-detail-main-content embed {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 25px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Responsive video wrapper */
.news-detail-main-content .video-wrapper {
    position: relative;
    padding-bottom: 60%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 25px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #000;
}

.news-detail-main-content .video-wrapper iframe,
.news-detail-main-content .video-wrapper video,
.news-detail-main-content .video-wrapper embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    margin: 0;
}

.news-detail-main-content iframe:not(.video-wrapper iframe) {
    aspect-ratio: 16 / 10;
    min-height: 450px;
    max-height: 650px;
}

.news-detail-main-content video {
    max-width: 100%;
    height: auto;
    min-height: 350px;
    max-height: 650px;
    background: #000;
}

/* Back Button */
.news-detail-back {
    padding: 30px 40px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    margin-top: 20px;
    border-radius: 10px;
}

.news-detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
}

.news-detail-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4);
    color: #fff;
}

/* Document Format Styles */
.document-wrapper {
    background: #fff;
    margin: 0 auto;
    padding: 40mm 30mm;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    min-height: 297mm;
    position: relative;
    border: 1px solid #ddd;
    font-family: 'Times New Roman', Times, serif;
}

.document-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
}

.document-header-title {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: 'Times New Roman', Times, serif;
}

.document-header-subtitle {
    font-size: 12pt;
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'Times New Roman', Times, serif;
}

.document-header-line {
    font-size: 11pt;
    margin-top: 20px;
    font-family: 'Times New Roman', Times, serif;
}

.document-title {
    text-align: center;
    margin-bottom: 30px;
}

.document-title h1 {
    font-size: 16pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

.document-meta {
    margin-bottom: 30px;
    font-size: 12pt;
    font-family: 'Times New Roman', Times, serif;
}

.document-meta-item {
    margin-bottom: 10px;
}

.document-content {
    font-size: 12pt;
    line-height: 1.6;
    text-align: justify;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

.document-content p {
    margin-bottom: 1em;
    text-indent: 0;
}

.document-content img {
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    display: block;
}

.document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 12pt;
}

.document-content table td,
.document-content table th {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
}

.document-content h2,
.document-content h3,
.document-content h4 {
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    color: #000;
}

.document-footer {
    margin-top: 60px;
    text-align: right;
    font-size: 12pt;
    font-family: 'Times New Roman', Times, serif;
}

.document-signature {
    margin-bottom: 40px;
}

.document-signature-title {
    font-weight: bold;
    margin-bottom: 60px;
}

.document-signature-note {
    font-weight: bold;
}

/* Document Back Button */
.document-back {
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
}

/* Related Section */
.related-section {
    margin-top: 30px;
}

.related-header {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%);
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    text-align: center;
}

.related-header h2 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.related-carousel-wrapper {
    background: #fff;
    padding: 10px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.related-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(44, 90, 160, 0.8);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-nav-btn.related-nav-prev {
    left: 4px;
}

.related-nav-btn.related-nav-next {
    right: 4px;
}

.related-nav-btn:hover {
    background: rgba(44, 90, 160, 1);
    transform: translateY(-50%) scale(1.1);
}

.related-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.related-carousel-container {
    overflow: hidden;
    margin: 0 35px;
    max-width: 100%;
}

.related-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.related-carousel-item {
    width: calc(50% - 8px);
    margin-right: 16px;
    flex-shrink: 0;
    max-width: calc(50% - 8px);
}

.related-item {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-height: 240px;
}

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

.related-item a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-image-wrapper {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s;
    display: block;
}

.related-item:hover .related-image-wrapper img {
    transform: scale(1.05);
}

.related-date-box {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #fff;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.related-date-day {
    font-size: 16px;
    font-weight: 700;
    color: #2c5aa0;
    line-height: 1;
}

.related-date-month {
    font-size: 7px;
    color: #666;
    line-height: 1;
    margin-top: 1px;
}

.related-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}

.related-content h3 {
    color: #2c5aa0;
    margin: 0 0 6px;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}

.related-content p {
    color: #666;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

/* Print styles for documents */
@media print {
    .news-detail-section {
        background: #fff !important;
        padding: 0 !important;
    }
    
    .document-wrapper {
        box-shadow: none !important;
        border: none !important;
        padding: 20mm 25mm !important;
        min-height: auto !important;
        margin: 0 !important;
    }
    
    .related-section,
    .news-detail-back,
    .document-back {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .news-detail-header {
        padding: 25px 20px;
    }
    
    .news-detail-title {
        font-size: 1.8rem;
    }
    
    .news-detail-content {
        padding: 25px 20px;
    }
    
    .news-detail-main-content img {
        max-height: 300px;
    }
    
    .news-detail-main-content iframe,
    .news-detail-main-content video,
    .news-detail-main-content embed {
        min-height: 250px;
        max-height: 400px;
    }
    
    .related-carousel-item {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        margin-right: 0;
    }
    
    .related-carousel-container {
        margin: 0 35px;
    }
    
    .related-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .related-item {
        max-height: 260px;
    }
    
    .related-image-wrapper {
        max-height: 150px;
    }
}
