/* =========================================
   SINGLE POST - RS PUSPA HUSADA
   ========================================= */

body.single-post .site-main {
  padding: 48px 20px 64px;
}

body.single-post .site-main > .content-container {
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
}

body.single-post .article-post {
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
  color: #334155;
  overflow-wrap: anywhere;
}

/* Judul */
body.single-post .article-post__header {
  margin-bottom: 24px;
  text-align: center;
}

body.single-post .article-post__title {
  margin: 0 0 12px;
  color: #243b5a;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.6px;
}

/* Tanggal */
body.single-post .article-post__meta {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

/* Gambar ukuran sedang */
body.single-post .article-post__thumbnail {
  width: 100%;
  max-width: 640px;
  margin: 0 auto 32px;
  padding: 0;
}

body.single-post .article-post__thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 760px;
  margin-inline: auto;
  object-fit: contain;
  border-radius: 10px;
}

/* Isi artikel */
body.single-post .article-post__content {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  color: #334155;
  font-size: 17px;
  line-height: 1.85;
}

body.single-post .article-post__content p {
  margin: 0 0 20px;
}

body.single-post .article-post__content h2 {
  margin: 36px 0 16px;
  color: #243b5a;
  font-size: 28px;
  line-height: 1.35;
}

body.single-post .article-post__content h3 {
  margin: 28px 0 12px;
  color: #243b5a;
  font-size: 22px;
  line-height: 1.4;
}

body.single-post .article-post__content ul,
body.single-post .article-post__content ol {
  margin-bottom: 24px;
  padding-left: 28px;
}

body.single-post .article-post__content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

body.single-post .article-post__content a {
  color: #078a9b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Navigasi halaman artikel */
body.single-post .article-post__pagination {
  max-width: 760px;
  margin: 24px auto 0;
}

/* Tampilan HP */
@media (max-width: 767px) {
  body.single-post .site-main {
    padding: 28px 16px 40px;
  }

  body.single-post .article-post__header {
    margin-bottom: 20px;
  }

  body.single-post .article-post__title {
    font-size: clamp(25px, 7vw, 32px);
    letter-spacing: -0.3px;
  }

  body.single-post .article-post__thumbnail {
    margin-bottom: 24px;
  }

  body.single-post .article-post__thumbnail img {
    border-radius: 7px;
  }

  body.single-post .article-post__content {
    font-size: 16px;
    line-height: 1.8;
  }

  body.single-post .article-post__content h2 {
    font-size: 24px;
  }

  body.single-post .article-post__content h3 {
    font-size: 20px;
  }
}

/* =========================================
   LAYOUT ARTIKEL + SIDEBAR POSTINGAN TERBARU
   ========================================= */

body.single-post .article-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: start;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

/* Artikel utama */
body.single-post .article-post-layout > .article-post {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
}

body.single-post .article-post-layout .article-post__header {
  text-align: center;
}

body.single-post .article-post-layout .article-post__thumbnail {
  max-width: 560px;
}

/* Sidebar */
body.single-post .recent-posts-sidebar {
  min-width: 0;
  padding: 22px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

body.single-post .recent-posts-sidebar__title {
  margin: 0 0 20px;
  padding-bottom: 14px;
  color: #243b5a;
  font-size: 21px;
  line-height: 1.4;
  border-bottom: 2px solid #0ea5a3;
}

body.single-post .recent-posts-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body.single-post .recent-post-item {
  margin: 0;
  padding: 0 0 18px;
  border-bottom: 1px solid #e2e8f0;
}

body.single-post .recent-post-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

body.single-post .recent-post-item__link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

body.single-post .recent-post-item__thumbnail {
  flex: 0 0 88px;
  width: 88px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 7px;
  background: #e2e8f0;
}

body.single-post .recent-post-item__thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.single-post .recent-post-item__details {
  flex: 1;
  min-width: 0;
}

body.single-post .recent-post-item__title {
  margin: 0 0 8px;
  color: #243b5a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.single-post .recent-post-item__link:hover .recent-post-item__title {
  color: #078a9b;
}

body.single-post .recent-post-item__date {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

/* Tablet dan HP */
@media (max-width: 900px) {
  body.single-post .article-post-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  body.single-post .recent-posts-sidebar {
    width: 100%;
  }
}

/* =========================================
   PERBAIKAN LAYOUT SINGLE POST DESKTOP
   ========================================= */

@media (min-width: 901px) {
  body.single-post .site-main {
    padding: 36px 24px 56px;
  }

  body.single-post .site-main > .content-container {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
  }

  body.single-post .article-post-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) 280px;
    justify-content: center;
    align-items: start;
    gap: 28px;
    max-width: 1068px;
    margin: 0 auto;
  }

  body.single-post .article-post-layout > .article-post {
    max-width: 760px;
    min-width: 0;
  }

  body.single-post .article-post-layout .article-post__thumbnail {
    max-width: 520px;
  }

  body.single-post .recent-posts-sidebar {
    width: 100%;
    padding: 18px;
    margin: 0;
  }
}

/* ==========================================
   CENTER YOUTUBE SHORTS - RS PUSPA HUSADA
========================================== */

/* Gunakan selector konten artikel yang sebenarnya */
.single-post .article-post__content figure.wp-block-embed-youtube {
  display: block !important;
  float: none !important;

  width: 422px !important;
  max-width: 100% !important;

  margin: 24px auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Pembungkus video vertikal */
.single-post
  .article-post__content
  figure.wp-block-embed-youtube
  .wp-block-embed__wrapper {
  position: relative !important;
  width: 100% !important;
  height: auto !important;

  aspect-ratio: 9 / 16 !important;
  padding: 0 !important;
  margin: 0 auto !important;

  overflow: hidden;
}

/* Video mengisi pembungkus */
.single-post .article-post__content figure.wp-block-embed-youtube iframe {
  position: absolute !important;
  inset: 0 !important;

  display: block !important;
  width: 100% !important;
  height: 100% !important;

  max-width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
}

/* Penyesuaian layar kecil */
@media (max-width: 480px) {
  .single-post .article-post__content figure.wp-block-embed-youtube {
    width: 100% !important;
    max-width: 100% !important;
  }
}
