
/* ==========================================================
   HARMONI KUA BATANGHARI
   Homepage dan sidebar - desain elegan
   File: assets/css/homepage-elegan.css
   ========================================================== */

:root {
    --hk-green: #087f5b;
    --hk-green-dark: #075c43;
    --hk-gold: #c8a85d;
    --hk-ink: #23372d;
    --hk-muted: #78857d;
    --hk-border: #e6ede8;
    --hk-soft: #f5f8f5;
    --hk-shadow: 0 5px 22px rgba(20, 55, 37, .055);
}

/* =========================
   AREA KONTEN HOMEPAGE
   ========================= */

main.my-3 > .container-fluid {
    padding-top: 8px;
    padding-bottom: 24px;
}

main.my-3 .bg-white {
    border-radius: 13px;
}

main.my-3 .section-heading {
    position: relative;
    margin-bottom: 18px !important;
}

main.my-3 .heading-text {
    margin: 0;
    color: var(--hk-ink);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.35;
}

main.my-3 .custom-underline {
    width: 48px;
    height: 3px;
    margin-top: 9px;
    border: 0 !important;
    border-radius: 8px;
    background: var(--hk-gold);
}

/* =========================
   BERITA UTAMA / CAROUSEL
   ========================= */

#carouselExampleControls {
    overflow: hidden;
    background: #edf2ee;
    border: 1px solid var(--hk-border);
    border-radius: 13px;
    box-shadow: var(--hk-shadow);
}

#carouselExampleControls .carousel-inner,
#carouselExampleControls .carousel-item {
    overflow: hidden;
}

#carouselExampleControls .carousel-item > a {
    position: relative;
    display: block;
    overflow: hidden;
    background: #e8eee9;
}

#carouselExampleControls .carousel-item img {
    display: block;
    width: 100%;
    height: 390px !important;
    object-fit: cover;
    transition: transform .4s ease;
}

#carouselExampleControls .carousel-item > a:hover img {
    transform: scale(1.025);
}

#carouselExampleControls .carousel-caption {
    right: 0;
    bottom: 0;
    left: 0;

    padding: 50px 24px 22px !important;
    margin: 0 !important;

    text-align: left;
    border-radius: 0 !important;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 0, 0, .78)
    ) !important;
}

#carouselExampleControls .carousel-caption h5 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.4;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}

#carouselExampleControls .carousel-caption small {
    color: #f4f4f4;
    font-size: 11px;
}

#carouselExampleControls .carousel-control-prev,
#carouselExampleControls .carousel-control-next {
    top: 44%;
    bottom: auto;
    width: 38px;
    height: 42px;
    background: rgba(0, 0, 0, .42);
    border-radius: 6px;
    opacity: .9;
}

#carouselExampleControls .carousel-control-prev {
    left: 12px;
}

#carouselExampleControls .carousel-control-next {
    right: 12px;
}

/* =========================
   BERITA PILIHAN DI KANAN
   ========================= */

main.my-3 .col-lg-8 + .col-md-4 .row > .col-12,
main.my-3 .col-md-4 .row > .col-12 {
    align-items: flex-start;
    gap: 12px;
    padding: 11px;
    margin-bottom: 12px !important;

    background: #fff;
    border: 1px solid var(--hk-border);
    border-radius: 10px;

    transition: box-shadow .2s ease, transform .2s ease;
}

main.my-3 .col-md-4 .row > .col-12:hover {
    box-shadow: var(--hk-shadow);
    transform: translateY(-2px);
}

main.my-3 .col-md-4 .row > .col-12 > a:first-child {
    display: block;
    flex: 0 0 112px;
    width: 112px;
    overflow: hidden;
    border-radius: 7px;
}

main.my-3 .col-md-4 .row > .col-12 > a:first-child img {
    display: block;
    width: 112px !important;
    height: 82px !important;
    object-fit: cover;
    border-radius: 7px !important;
    transition: transform .3s ease;
}

main.my-3 .col-md-4 .row > .col-12:hover > a:first-child img {
    transform: scale(1.04);
}

main.my-3 .col-md-4 .row > .col-12 > div {
    min-width: 0;
    flex: 1;
}

main.my-3 .col-md-4 .row > .col-12 h6 {
    margin: 0 0 8px;
    color: var(--hk-ink);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.5;
}

main.my-3 .col-md-4 .row > .col-12 a:hover h6 {
    color: var(--hk-green);
}

main.my-3 .col-md-4 .row > .col-12 small {
    color: var(--hk-muted);
    font-size: 11px;
}

/* =========================
   GRID BERITA LAINNYA
   ========================= */

.row-berita {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

.row-berita > .col-berita {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;

    padding: 0;
    margin: 0 !important;

    background: #fff;
    border: 1px solid var(--hk-border);
    border-radius: 11px;
    box-shadow: 0 3px 13px rgba(20, 55, 37, .035);

    transition: transform .22s ease, box-shadow .22s ease;
}

.row-berita > .col-berita:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 24px rgba(20, 55, 37, .09);
}

.row-berita > .col-berita > a:first-child {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #edf2ee;
}

.row-berita > .col-berita > a:first-child img,
.row-berita > .col-berita > img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    border-radius: 0;
    transition: transform .35s ease;
}

.row-berita > .col-berita:hover > a:first-child img {
    transform: scale(1.04);
}

.row-berita > .col-berita > div {
    padding: 13px;
}

.row-berita .judul-berita {
    display: -webkit-box;
    overflow: hidden;

    color: var(--hk-ink);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.55;
    text-decoration: none;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.row-berita .judul-berita:hover {
    color: var(--hk-green);
}

.row-berita .tanggal-berita {
    margin: 9px 0 0;
    color: var(--hk-muted);
    font-size: 11px;
}

/* =========================
   SIDEBAR: BANNER DAN INFOGRAFIS
   ========================= */

.hk-sidebar {
    display: flex;
    flex-direction: column;
    gap: 26px;
    min-width: 0;
}

.hk-sidebar-section {
    min-width: 0;
    padding: 17px;

    background: #fff;
    border: 1px solid var(--hk-border);
    border-radius: 12px;
    box-shadow: var(--hk-shadow);
}

.hk-sidebar-heading {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0 0 15px;
    padding-bottom: 12px;

    border-bottom: 1px solid var(--hk-border);
}

.hk-sidebar-heading-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 34px;
    width: 34px;
    height: 34px;

    color: #fff;
    background: var(--hk-green);
    border-radius: 8px;
    font-size: 15px;
}

.hk-sidebar-heading h2 {
    margin: 0;
    color: var(--hk-ink);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
}

.hk-sidebar-heading p {
    margin: 3px 0 0;
    color: var(--hk-muted);
    font-size: 11px;
}

/* Slider banner */
.hk-sidebar-banner-slider {
    position: relative;
    width: 100%;
    overflow: hidden;

    background: #f4f7f4;
    border-radius: 9px;
}

.hk-sidebar-banner-slider .banner-slide {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    opacity: 0;
    visibility: hidden;

    transition: opacity .65s ease, visibility .65s ease;
}

.hk-sidebar-banner-slider .banner-slide.active {
    position: relative;
    z-index: 2;

    opacity: 1;
    visibility: visible;
}

.hk-sidebar-banner-slider .banner-slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #fff;
}

/* =========================
   SIDEBAR: BERITA TERPOPULER
   ========================= */

.hk-popular-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hk-popular-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;

    min-width: 0;
    padding-bottom: 12px;

    border-bottom: 1px solid #edf1ed;
}

.hk-popular-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.hk-popular-image {
    display: block;
    flex: 0 0 94px;
    width: 94px;
    height: 74px;

    overflow: hidden;
    background: #edf2ee;
    border-radius: 7px;
}

.hk-popular-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.hk-popular-item:hover .hk-popular-image img {
    transform: scale(1.05);
}

.hk-popular-content {
    flex: 1;
    min-width: 0;
}

.hk-popular-title {
    display: -webkit-box;
    overflow: hidden;

    margin: 0 0 7px;

    color: var(--hk-ink);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.5;
    text-decoration: none;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.hk-popular-title:hover {
    color: var(--hk-green);
}

.hk-popular-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    color: var(--hk-muted);
    font-size: 10px;
}

.hk-popular-meta i {
    color: var(--hk-green);
}

/* =========================
   SIDEBAR: TAG POPULER
   ========================= */

.hk-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hk-tag-pill {
    display: inline-flex;
    align-items: center;

    padding: 7px 10px;

    color: var(--hk-green-dark);
    background: #f0f7f2;
    border: 1px solid #dcebe0;
    border-radius: 20px;

    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;

    transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.hk-tag-pill:hover {
    color: #fff;
    background: var(--hk-green);
    border-color: var(--hk-green);
}

/* Pesan data kosong */
.hk-empty {
    padding: 22px 12px;
    color: var(--hk-muted);
    text-align: center;
    font-size: 12px;
}

.hk-empty i {
    display: block;
    margin-bottom: 8px;
    color: var(--hk-green);
    font-size: 24px;
}

/* =========================
   BAGIAN PENYULUH AGAMA
   ========================= */

.hk-counselor {
    padding: 20px;
    background: var(--hk-soft);
    border: 1px solid var(--hk-border);
    border-radius: 13px;
}

/* =========================
   RESPONSIF TABLET
   ========================= */

@media (max-width: 991.98px) {
    .row-berita {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    #carouselExampleControls .carousel-item img {
        height: 340px !important;
    }

    #carouselExampleControls .carousel-caption h5 {
        font-size: 20px;
    }

    .hk-sidebar {
        margin-top: 10px;
    }
}

/* =========================
   RESPONSIF HP
   ========================= */

@media (max-width: 575.98px) {
    main.my-3 > .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }

    main.my-3 .bg-white {
        padding: 12px !important;
    }

    main.my-3 .heading-text {
        font-size: 18px;
    }

    #carouselExampleControls .carousel-item img {
        height: 280px !important;
    }

    #carouselExampleControls .carousel-caption {
        padding: 38px 14px 15px !important;
    }

    #carouselExampleControls .carousel-caption h5 {
        font-size: 17px;
        line-height: 1.4;
    }

    #carouselExampleControls .carousel-control-prev,
    #carouselExampleControls .carousel-control-next {
        width: 30px;
        height: 34px;
    }

    .row-berita {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .row-berita > .col-berita > div {
        padding: 10px;
    }

    .row-berita .judul-berita {
        font-size: 12px;
        line-height: 1.45;
    }

    .row-berita .tanggal-berita {
        font-size: 10px;
    }

    .hk-sidebar-section {
        padding: 13px;
    }

    .hk-sidebar-heading h2 {
        font-size: 15px;
    }

    .hk-popular-image {
        flex-basis: 88px;
        width: 88px;
        height: 70px;
    }

    .hk-counselor {
        padding: 13px;
    }
}


/* ==================================================
   HOTFIX HOMEPAGE HARMONI KUA
   Pembatas gambar dan perbaikan tata letak .home-editorial .hk-featured-caption
   ================================================== */

.home-editorial,
.home-editorial * {
    box-sizing: border-box;
}

.home-editorial {
    width: 100%;
    min-width: 0;
    color: #23372d;
}

.home-editorial > .bg-white {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Grid Bootstrap */
.home-editorial .row {
    min-width: 0;
}

.home-editorial .col-lg-8,
.home-editorial .col-lg-4 {
    min-width: 0;
}

/* Kartu berita pilihan */
.home-editorial .hk-side-news {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.home-editorial a.hk-side-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 10px;
    overflow: hidden;
    color: #23372d;
    background: #fff;
    border: 1px solid #e6ede8;
    border-radius: 10px;
    text-decoration: none;
}

/* Paksa thumbnail tetap berada dalam kolom */
.home-editorial .hk-side-image {
    position: relative;
    display: block;
    flex: 0 0 108px;
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    height: 82px;
    overflow: hidden;
    background: #edf2ee;
    border-radius: 7px;
}

.home-editorial .hk-side-image img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0;
    object-fit: cover;
}

/* Teks berita pilihan */
.home-editorial .hk-side-content {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.home-editorial .hk-side-content h3 {
    margin: 0 0 9px;
    color: #23372d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.home-editorial .hk-side-content .hk-meta {
    color: #78857d;
    font-size: 11px;
}

/* Berita utama */
.home-editorial .hk-featured,
.home-editorial .hk-featured .carousel,
.home-editorial .hk-featured .carousel-inner,
.home-editorial .hk-featured .carousel-item {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.home-editorial .hk-featured-link {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
}

.home-editorial .hk-featured-image {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 360px;
    object-fit: cover;
}

/* Grid berita lainnya */
.home-editorial .hk-news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.home-editorial .hk-news-card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.home-editorial .hk-news-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.home-editorial .hk-news-image img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* HP dan tablet */
@media (max-width: 991px) {
    .home-editorial .hk-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .home-editorial .hk-featured-image {
        height: 260px;
    }

    .home-editorial .hk-side-image {
        flex-basis: 92px;
        width: 92px;
        min-width: 92px;
        max-width: 92px;
        height: 72px;
    }

    .home-editorial .hk-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}



/* ==================================================
   FINISHING TOUCH - HOMEPAGE HARMONI KUA
   ================================================== */

/* Heading bagian */
.home-editorial .hk-section-heading h2 {
    color: #20382c;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.25px;
}

.home-editorial .hk-heading-line {
    width: 44px;
    height: 3px;
    margin-top: 8px;
    background: #c8a85d;
    border-radius: 5px;
}

/* Berita utama: judul tidak tampak seperti tautan default
.home-editorial .hk-featured-caption .hk-category-label {

*/
.home-editorial .hk-featured-caption h3 {
    margin: 0 0 12px;
    color: #173e2c !important;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.45;
    text-shadow: none;
}

.home-editorial .hk-featured-link,
.home-editorial .hk-featured-link:hover {
    color: inherit;
    text-decoration: none;
}

.home-editorial .hk-featured-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;

    padding: 24px 26px;
    color: #23372d;
    background: #e8efea;
    text-align: left;
}

/* Pilihan berita */
.home-editorial .hk-side-card {
    padding: 10px;
    border-color: #e5ece7;
    border-radius: 9px;
}

.home-editorial .hk-side-content h3 {
    font-size: 12px;
    line-height: 1.5;
}

.home-editorial .hk-side-card:hover {
    border-color: #b8d8c7;
    box-shadow: 0 5px 14px rgba(20, 55, 37, .07);
}

/* Berita lainnya */
.home-editorial .hk-news-card {
    border-color: #e5ece7;
    border-radius: 10px;
}

.home-editorial .hk-news-body {
    padding: 13px;
}

.home-editorial .hk-news-body h3 {
    min-height: 60px;
    margin-bottom: 11px;
    color: #23372d;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.55;
}

.home-editorial .hk-news-body > a {
    text-decoration: none;
}

.home-editorial .hk-news-card:hover .hk-news-body h3 {
    color: #087f5b;
}

.home-editorial .hk-meta {
    font-size: 11px;
    line-height: 1.5;
}

/* Sidebar */
.hk-sidebar {
    gap: 20px;
}

.hk-sidebar-section {
    padding: 15px;
    border-color: #e5ece7;
    border-radius: 11px;
    box-shadow: 0 4px 16px rgba(20, 55, 37, .045);
}

.hk-sidebar-heading {
    margin-bottom: 13px;
    padding-bottom: 11px;
}

.hk-sidebar-heading h2 {
    font-size: 15px;
    font-weight: 800;
}

.hk-popular-item {
    gap: 10px;
}

.hk-popular-title {
    font-size: 12px;
    line-height: 1.5;
}

.hk-tag-pill {
    font-size: 11px;
}

/* HP */
@media (max-width: 575.98px) {
    .home-editorial .hk-section-heading h2 {
        font-size: 17px;
    }

    .home-editorial .hk-featured-caption h3 {
        font-size: 18px;
    }

    .home-editorial .hk-news-body {
        padding: 10px;
    }

    .home-editorial .hk-news-body h3 {
        min-height: 0;
        font-size: 12px;
    }
}


.home-editorial .hk-featured-caption .hk-category-label {
    margin-bottom: 10px;
}

.home-editorial .hk-featured-caption .hk-meta {
    color: #5f7166;
}

.home-editorial .hk-featured-caption .hk-meta i {
    color: #087f5b;
}

/* Jika overlay gambar tidak diperlukan di atas caption */
.home-editorial .hk-featured-overlay {
    pointer-events: none;
}

/* 2. BERIKAN JARAK ANTARBAGIAN */
.home-editorial .hk-section {
    margin-bottom: 34px !important;
}

.home-editorial .hk-section-heading {
    margin-bottom: 18px !important;
}

.home-editorial .hk-featured {
    margin-bottom: 0;
}

/* 3. GRID BERITA: semua kartu sama tinggi */
.home-editorial .hk-news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
}

.home-editorial .hk-news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

/* Semua thumbnail memiliki rasio yang sama */
.home-editorial .hk-news-image {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

/* Area isi kartu menggunakan tinggi yang konsisten */
.home-editorial .hk-news-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
}

/* Judul disediakan ruang untuk maksimal 3 baris */
.home-editorial .hk-news-body h3 {
    display: -webkit-box;
    width: 100%;
    min-height: calc(1.55em * 3);
    max-height: calc(1.55em * 3);
    overflow: hidden;

    margin: 0 0 12px;
    color: #23372d;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.55;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Tanggal selalu berada pada garis yang sama */
.home-editorial .hk-news-body .hk-meta {
    min-height: 18px;
    margin-top: auto;
    margin-bottom: 8px;
    color: #78857d;
}

/* Link baca selengkapnya berada di bawah */
.home-editorial .hk-news-body .hk-read-more {
    margin-top: 0;
    padding-top: 2px;
    color: #087f5b;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}

.home-editorial .hk-news-body .hk-read-more:hover {
    color: #075c43;
    text-decoration: underline;
}

/* 4. JARAK KHUSUS BAGIAN PENYULUH */
.home-editorial .hk-counselor-section {
    margin-top: 12px;
    margin-bottom: 34px;
}

/* 5. TABLET */
@media (max-width: 991.98px) {
    .home-editorial .hk-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .home-editorial .hk-featured-caption {
        padding: 18px;
    }

    .home-editorial .hk-featured-caption h3 {
        font-size: 20px;
    }
}

/* 6. HP */
@media (max-width: 575.98px) {
    .home-editorial .hk-section {
        margin-bottom: 27px !important;
    }

    .home-editorial .hk-section-heading {
        margin-bottom: 14px !important;
    }

    .home-editorial .hk-featured-caption {
        padding: 14px;
    }

    .home-editorial .hk-featured-caption h3 {
        font-size: 17px;
        line-height: 1.4;
    }

    .home-editorial .hk-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .home-editorial .hk-news-body {
        padding: 10px;
    }

    .home-editorial .hk-news-body h3 {
        min-height: calc(1.45em * 3);
        max-height: calc(1.45em * 3);
        font-size: 12px;
        line-height: 1.45;
    }

    .home-editorial .hk-news-body .hk-meta {
        font-size: 10px;
    }

    .home-editorial .hk-news-body .hk-read-more {
        font-size: 11px;
    }
}





/* Hormati preferensi gerakan pengguna */
@media (prefers-reduced-motion: reduce) {
    .hk-sidebar-banner-slider .banner-slide,
    .hk-popular-image img,
    .row-berita > .col-berita,
    #carouselExampleControls .carousel-item img {
        transition: none;
    }
}
