/* ===================================
   Clean News Detail Styles
   Compatible with Dark & Light Mode
   =================================== */

/* Article Container */
.news-article {
  padding: 5rem 0 2rem 0; /* Menambah jarak dari navbar lebih besar */
}

/* Article Header */
.article-header {
  margin-bottom: 3rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  text-align: center; /* Judul rata tengah */
}

/* Article Meta - Center Aligned */
.article-meta {
  font-size: 0.9375rem;
  color: var(--bs-body-color);
  opacity: 0.8;
  justify-content: center; /* Meta rata tengah */
}

.meta-separator {
  opacity: 0.5;
}

.meta-author {
  font-weight: 500;
}

/* Featured Image */
.article-featured-image {
  position: relative;
  width: 110%; /* 110% dari lebar container */
  margin-left: -5%; /* Center the wider image */
  margin-right: -5%;
  margin-bottom: 2rem;
}

.article-featured-image img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.image-caption {
  font-size: 0.875rem;
  color: var(--bs-secondary);
  font-style: italic;
  padding: 0.75rem 1rem;
  text-align: center;
}

/* Article Content */
.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--bs-body-color);
  text-align: justify; /* Rata kanan kiri */
}

.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.article-content h2 {
  font-size: 2rem;
}

.article-content h3 {
  font-size: 1.75rem;
}

.article-content h4 {
  font-size: 1.5rem;
}

.article-content p {
  margin-bottom: 1.5rem;
}

/* Gambar dalam content - Sedikit lebih lebar dari konten */
.article-content img {
  max-width: none;
  width: 110%; /* 110% dari lebar konten */
  height: auto;
  margin-left: -5%; /* Center the wider image */
  margin-right: -5%;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

/* Figure element untuk gambar dengan caption */
.article-content figure {
  margin-left: -5%;
  margin-right: -5%;
  width: 110%;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.article-content figure img {
  margin: 0;
  width: 100%;
  border-radius: 0.5rem;
}

.article-content figcaption {
  font-size: 0.875rem;
  color: var(--bs-secondary);
  font-style: italic;
  padding: 0.75rem 1rem;
  text-align: center;
}

.article-content ul,
.article-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-content li {
  margin-bottom: 0.75rem;
}

.article-content blockquote {
  border-left: 4px solid var(--bs-primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  opacity: 0.9;
}

.article-content a {
  color: var(--bs-primary);
  text-decoration: underline;
}

.article-content a:hover {
  text-decoration: none;
}

.article-content pre {
  background: var(--bs-light);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}

.article-content code {
  background: var(--bs-light);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

/* Article Footer */
.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bs-border-color);
}

/* Tags */
.article-tags .badge {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

/* Share Buttons */
.article-share {
  margin-top: 2rem;
}

.share-buttons .btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

/* Article Info */
.article-info {
  margin-top: 2rem;
  padding: 1.5rem;
  background: transparent;
  border-radius: 0.5rem;
}

/* Related Articles */
.related-articles {
  padding-top: 3rem;
  margin-top: 3rem;
  border-top: 1px solid var(--bs-border-color);
}

.related-articles h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.related-articles .card {
  border: none;
  background: transparent;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.related-articles .card:hover {
  transform: translateY(-4px);
}

.related-articles .card-img-top {
  height: 200px;
  object-fit: cover;
}

/* Glassmorphism Badge on Image */
.related-articles .card > a {
  position: relative;
  display: block;
}

.related-articles .card .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff !important;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
}

.related-articles .card-body {
  padding: 1.25rem;
}

.related-articles .card-body .badge {
  display: none; /* Hide badge in card body since it's now on image */
}

.related-articles .card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--bs-body-color);
  margin-bottom: 0.75rem;
}

.related-articles a {
  color: inherit;
  text-decoration: none;
}

/* ===================================
   DARK MODE - COLOR CONSISTENCY
   =================================== */

/* Body Background - Sama dengan News List */
[data-bs-theme="dark"] body {
  background-color: #24293c !important;
}

/* Container Background */
[data-bs-theme="dark"] .container-xxl {
  background-color: #24293c !important;
}

/* Article Title */
[data-bs-theme="dark"] .article-title {
  color: #d9dbe6 !important;
}

/* Article Meta */
[data-bs-theme="dark"] .article-meta {
  color: #b4b7c5 !important;
}

[data-bs-theme="dark"] .meta-separator {
  color: #3a3c52 !important;
}

/* Image Caption */
[data-bs-theme="dark"] .image-caption {
  color: #7a7e96 !important;
}

/* Article Content */
[data-bs-theme="dark"] .article-content {
  color: #d9dbe6 !important;
}

[data-bs-theme="dark"] .article-content h2,
[data-bs-theme="dark"] .article-content h3,
[data-bs-theme="dark"] .article-content h4,
[data-bs-theme="dark"] .article-content h5,
[data-bs-theme="dark"] .article-content h6 {
  color: #d9dbe6 !important;
}

[data-bs-theme="dark"] .article-content blockquote {
  color: #b4b7c5 !important;
  border-left-color: #696cff !important;
}

[data-bs-theme="dark"] .article-content a {
  color: #696cff !important;
}

/* Code Blocks */
[data-bs-theme="dark"] .article-content pre {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #d9dbe6 !important;
}

[data-bs-theme="dark"] .article-content code {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #d9dbe6 !important;
}

/* Tags - Sama dengan News List */
[data-bs-theme="dark"] .article-tags .badge {
  background-color: rgba(105, 108, 255, 0.16) !important;
  color: #696cff !important;
}

/* Share Section */
[data-bs-theme="dark"] .article-share .text-muted {
  color: #7a7e96 !important;
}

/* Share Buttons - Sama dengan News List */
[data-bs-theme="dark"] .btn-label-primary {
  background: rgba(105, 108, 255, 0.16) !important;
  color: #696cff !important;
}

[data-bs-theme="dark"] .btn-label-dark {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #d9dbe6 !important;
}

[data-bs-theme="dark"] .btn-label-success {
  background: rgba(40, 199, 111, 0.16) !important;
  color: #28c76f !important;
}

[data-bs-theme="dark"] .btn-label-info {
  background: rgba(0, 207, 232, 0.16) !important;
  color: #00cfe8 !important;
}

[data-bs-theme="dark"] .btn-label-secondary {
  background: rgba(130, 134, 139, 0.16) !important;
  color: #82868b !important;
}

/* Article Info */
[data-bs-theme="dark"] .article-info {
  background: transparent !important;
}

[data-bs-theme="dark"] .article-info small {
  color: #7a7e96 !important;
}

[data-bs-theme="dark"] .article-info .fw-medium {
  color: #d9dbe6 !important;
}

/* Divider */
[data-bs-theme="dark"] hr {
  border-color: #3a3c52 !important;
  opacity: 1 !important;
}

/* Related Articles */
[data-bs-theme="dark"] .related-articles {
  border-top-color: #3a3c52 !important;
}

[data-bs-theme="dark"] .related-articles h3 {
  color: #d9dbe6 !important;
}

/* Related Articles Card - Background sama dengan News List */
[data-bs-theme="dark"] .related-articles .card {
  background: #24293c !important;
}

[data-bs-theme="dark"] .related-articles .card-title {
  color: #d9dbe6 !important;
}

[data-bs-theme="dark"] .related-articles .card-title:hover {
  color: #696cff !important;
}

[data-bs-theme="dark"] .related-articles .text-muted {
  color: #7a7e96 !important;
}

/* Glassmorphism Badge - Tetap sama tidak terpengaruh dark mode */
[data-bs-theme="dark"] .related-articles .card .badge {
  background: rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff !important;
}

/* Responsive Design */
@media (max-width: 991px) {
  .news-article {
    padding: 3rem 0 2rem 0;
  }

  .article-title {
    font-size: 2rem;
  }

  .article-content {
    font-size: 1.0625rem;
  }

  .article-content h2 {
    font-size: 1.75rem;
  }

  .article-content h3 {
    font-size: 1.5rem;
  }

  .article-content h4 {
    font-size: 1.25rem;
  }
}

@media (max-width: 767px) {
  .news-article {
    padding: 2rem 0 1rem 0;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .article-meta {
    font-size: 0.8125rem; /* Sedikit lebih kecil */
    flex-direction: row !important; /* Paksa 1 baris */
    flex-wrap: nowrap;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  /* Tetap tampilkan separator di mobile */
  .meta-separator {
    display: inline;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .article-content h3 {
    font-size: 1.375rem;
  }

  .article-content h4 {
    font-size: 1.125rem;
  }

  .article-featured-image {
    width: 105%; /* Kurangi overflow di mobile */
    margin-left: -2.5%;
    margin-right: -2.5%;
  }

  .article-featured-image img {
    max-height: 300px;
  }

  .article-content img {
    width: 105%;
    margin-left: -2.5%;
    margin-right: -2.5%;
  }

  .article-content figure {
    width: 105%;
    margin-left: -2.5%;
    margin-right: -2.5%;
  }

  .share-buttons {
    justify-content: flex-start !important;
    width: 100%;
  }

  .related-articles .card-img-top {
    height: 150px;
  }
}

@media (max-width: 575px) {
  .news-article {
    padding: 1.5rem 0 1rem 0;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .article-meta {
    flex-direction: column;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .meta-separator {
    display: none;
  }
}

/* Print Styles */
@media print {
  .article-share,
  .related-articles {
    display: none;
  }

  .article-content {
    font-size: 12pt;
    line-height: 1.6;
  }

  .article-featured-image img,
  .article-content img {
    max-height: 400px;
    page-break-inside: avoid;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background: var(--bs-primary);
  color: #fff;
}

::-moz-selection {
  background: var(--bs-primary);
  color: #fff;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* Loading State */
.article-featured-image img,
.article-content img {
  background: var(--bs-light);
}

[data-bs-theme="dark"] .article-featured-image img,
[data-bs-theme="dark"] .article-content img {
  background: rgba(255, 255, 255, 0.05);
}
