/* 
 * HIMABISDIG - Berita Detail Styles (CLEAN & MINIMALIST)
 * Version: 1.0
 */

/* ===== HERO SECTION ===== */
.detail-hero {
    position: relative;
    background: linear-gradient(135deg, #0A2463, #3E92CC);
    padding: 10rem 0 5rem;
    color: white;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.breadcrumb-nav {
    margin-bottom: 2rem;
}

.breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    margin: 0;
    display: inline-flex;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: white;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: rgba(255, 255, 255, 0.6);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.detail-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.detail-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
}

.meta-item i {
    font-size: 1.125rem;
}

/* ===== ARTICLE SECTION ===== */
.article-section {
    padding: 4rem 0;
    background: #ffffff;
}

.article-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.featured-image {
    margin-bottom: 2rem;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    background: #f7fafc;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 600px;
    margin: 0 auto;
}

.article-body {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #4a5568;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    color: #1a202c;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-body h2 {
    font-size: 1.75rem;
}

.article-body h3 {
    font-size: 1.5rem;
}

.article-body h4 {
    font-size: 1.25rem;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    background: #f7fafc;
    padding: 0.5rem;
}

/* Memastikan gambar dalam figure atau div container tampil sempurna */
.article-body figure {
    margin: 2rem 0;
    text-align: center;
}

.article-body figure img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.article-body figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #718096;
    font-style: italic;
}

/* Memastikan gambar dalam paragraph atau div tampil sempurna */
.article-body p img,
.article-body div img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 2rem auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    background: #f7fafc;
    padding: 0.5rem;
}

/* Memastikan gambar tidak terpotong pada berbagai ukuran */
.article-body img[style*="width"],
.article-body img[style*="height"] {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.article-body ul,
.article-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.75rem;
}

.article-body blockquote {
    border-left: 4px solid #0A2463;
    padding: 1rem 1.5rem;
    background: #f7fafc;
    margin: 2rem 0;
    border-radius: 0.5rem;
    font-style: italic;
    color: #4a5568;
}

.article-body a {
    color: #0A2463;
    text-decoration: underline;
}

.article-body a:hover {
    color: #3E92CC;
}

/* ===== TAGS ===== */
.article-tags {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.tags-label {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.9375rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.tag:hover {
    background: #0A2463;
    color: white;
    border-color: #0A2463;
}

/* ===== SHARE BUTTONS ===== */
.article-share {
    margin-top: 2rem;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 1rem;
    text-align: center;
}

.article-share h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.email {
    background: #718096;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 1.25rem;
    letter-spacing: -0.01em;
}

/* ===== RELATED ARTICLES ===== */
.related-articles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-item {
    display: flex;
    gap: 0.875rem;
    padding: 0;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.related-item:hover {
    opacity: 0.8;
}

.related-item:hover .related-title {
    color: #0A2463;
}

.related-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f1f5f9;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 0.375rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.related-date {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
    font-weight: 400;
}

/* ===== KATEGORI WIDGET ===== */
.kategori-widget {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.kategori-widget .widget-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0A2463;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kategori-widget .widget-title i {
    color: #3E92CC;
    font-size: 1.1rem;
}

.kategori-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kategori-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #334155;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.kategori-item:hover {
    background: linear-gradient(135deg, #0A2463, #3E92CC);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(10, 36, 99, 0.2);
    border-color: #0A2463;
}

.kategori-item.active {
    background: linear-gradient(135deg, #0A2463, #3E92CC);
    color: white;
    border-color: #0A2463;
    font-weight: 600;
}

.kategori-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.kategori-count {
    background: rgba(10, 36, 99, 0.1);
    color: #0A2463;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.kategori-item:hover .kategori-count,
.kategori-item.active .kategori-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ===== POPULAR ARTICLES WIDGET ===== */
.popular-widget {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border: 1px solid #fed7d7;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.popular-widget .widget-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #c53030;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-widget .widget-title i {
    color: #f56565;
    font-size: 1.1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.popular-articles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #fed7d7;
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.popular-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #f56565, #c53030);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.popular-item:hover::before {
    transform: scaleY(1);
}

.popular-item:hover {
    background: #fff5f5;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.15);
    border-color: #f56565;
}

.popular-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

.popular-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.popular-item:hover .popular-image img {
    transform: scale(1.1);
}

.popular-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f56565, #c53030);
    color: white;
    font-size: 1.5rem;
}

.popular-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popular-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.popular-item:hover .popular-title {
    color: #c53030;
}

.popular-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.popular-date {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.popular-date i {
    font-size: 0.65rem;
}

.popular-category {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    background: linear-gradient(135deg, #f56565, #c53030);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

/* ===== RELATED WIDGET ENHANCEMENT ===== */
.related-widget {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid #bfdbfe;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.related-widget .widget-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0A2463;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-widget .widget-title i {
    color: #3E92CC;
    font-size: 1.1rem;
}

.related-item {
    background: white;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.related-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #0A2463, #3E92CC);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.related-item:hover::before {
    transform: scaleY(1);
}

.related-item:hover {
    background: #f0f9ff;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(10, 36, 99, 0.15);
    border-color: #3E92CC;
}

.related-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0A2463, #3E92CC);
    color: white;
    font-size: 1.5rem;
}

.related-image img {
    transition: transform 0.3s ease;
}

.related-item:hover .related-image img {
    transform: scale(1.1);
}

/* ===== BACK BUTTON ===== */
.btn-back-list {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #0A2463, #3E92CC);
    color: white;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-back-list:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(10, 36, 99, 0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .detail-hero {
        padding: 8rem 0 4rem;
    }
    
    .detail-title {
        font-size: 2rem;
    }
    
    .detail-meta {
        gap: 1rem;
    }
    
    .sidebar {
        position: static;
        margin-top: 3rem;
    }
}

@media (max-width: 767.98px) {
    .detail-hero {
        padding: 7rem 0 3rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    .share-buttons {
        gap: 0.75rem;
    }
    
    .share-btn {
        width: 45px;
        height: 45px;
        font-size: 1.125rem;
    }
    
    /* Perbaikan gambar untuk mobile */
    .featured-image img {
        max-height: 400px;
    }
    
    .article-body img {
        margin: 1.5rem auto;
        padding: 0.25rem;
    }
}

/* Memastikan gambar tidak overflow pada semua ukuran */
@media (max-width: 575.98px) {
    .featured-image img {
        max-height: 300px;
    }
    
    .article-body img {
        margin: 1rem auto;
    }
    
    /* Responsive Related Articles */
    .related-item {
        gap: 0.75rem;
        padding: 0.875rem 0;
    }
    
    .related-image {
        width: 80px;
        height: 80px;
    }
    
    .related-title {
        font-size: 0.875rem;
    }
    
    .related-date {
        font-size: 0.75rem;
    }
    
    /* Responsive Kategori & Popular */
    .kategori-item,
    .popular-item {
        padding: 0.625rem;
    }
    
    .kategori-name,
    .popular-title {
        font-size: 0.8rem;
    }
    
    .popular-image,
    .related-image {
        width: 70px;
        height: 70px;
    }
    
    .widget-title {
        font-size: 1rem;
    }
}