/* ==========================================================
   RUANG BESTARI — GLOBAL PAGE RHYTHM
   Homepage = visual reference
   ========================================================== */

:root {
    --rb-page-top-desktop: 32px;
    --rb-page-bottom-desktop: 32px;

    --rb-page-top-mobile: 24px;
    --rb-page-bottom-mobile: 24px;
}


/* ==========================================================
   1. HOMEPAGE — REFERENCE
   ========================================================== */

@media (min-width: 1025px) {

    body.page-id-18832
    .rb-homepage__container {
        padding-top: var(--rb-page-top-desktop) !important;
        padding-bottom: var(--rb-page-bottom-desktop) !important;
    }

}


/* ==========================================================
   2. AUTH DESKTOP
   Login / Daftar / Lupa Password
   ========================================================== */

@media (min-width: 901px) {

    body.rb-auth-login #inner-wrap,
    body.rb-auth-register #inner-wrap,
    body.rb-auth-password-reset #inner-wrap {
        padding-top: var(--rb-page-top-desktop) !important;
        padding-bottom: var(--rb-page-bottom-desktop) !important;
        box-sizing: border-box !important;
    }

    body.rb-auth-login
    .entry-content.single-content,

    body.rb-auth-register
    .entry-content.single-content,

    body.rb-auth-password-reset
    .entry-content.single-content {
        margin-top: 0 !important;
        margin-right: auto !important;
        margin-bottom: 0 !important;
        margin-left: auto !important;
    }

}


/* ==========================================================
   3. AUTHOR PROFILE DESKTOP
   ========================================================== */

@media (min-width: 1025px) {

    body.rb-um-public-profile
    #inner-wrap {
        padding-top: var(--rb-page-top-desktop) !important;
        padding-bottom: var(--rb-page-bottom-desktop) !important;
        box-sizing: border-box !important;
    }

    /*
     * Hilangkan outer spacing bawaan Kadence / UM.
     * Spacing internal antar-section tetap dipertahankan.
     */
    body.rb-um-public-profile #primary,
    body.rb-um-public-profile .content-area,
    body.rb-um-public-profile .content-container.site-container,
    body.rb-um-public-profile #main.site-main,
    body.rb-um-public-profile .content-wrap,
    body.rb-um-public-profile article,
    body.rb-um-public-profile .entry-content-wrap,
    body.rb-um-public-profile .entry-content,
    body.rb-um-public-profile .um,
    body.rb-um-public-profile .um-profile,
    body.rb-um-public-profile .um-profile-body {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /*
     * Hero adalah section pertama:
     * tidak lagi membawa margin luar.
     */
    body.rb-um-public-profile
    .rb-um-author-hero {
        margin-top: 0 !important;
    }

    /*
     * Penulis lainnya adalah section terakhir:
     * footer gap sekarang dimiliki page shell.
     */
    body.rb-um-public-profile
    .rb-author-others {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

}


/* ==========================================================
   4. SINGLE POST DESKTOP
   ========================================================== */

@media (min-width: 1025px) {

    body.single-post
    #inner-wrap {
        padding-top: var(--rb-page-top-desktop) !important;
        padding-bottom: var(--rb-page-bottom-desktop) !important;
        box-sizing: border-box !important;
    }

    /*
     * #primary sebelumnya memakai 22px atas / 42px bawah.
     * Sekarang outer spacing sepenuhnya milik page shell.
     */
    body.single-post
    #primary.content-area {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

}

/* END RUANG BESTARI — GLOBAL PAGE RHYTHM */

/* ==========================================================
   LOGIN DESKTOP — MATCH REGISTER / PASSWORD RESET EXACTLY
   ========================================================== */

@media (min-width: 901px) {

    body.rb-auth-login #inner-wrap {
        padding-top: var(--rb-page-top-desktop) !important;
        padding-bottom: var(--rb-page-bottom-desktop) !important;
        box-sizing: border-box !important;
    }

    /*
     * Hilangkan seluruh outer spacing bawaan template.
     * Login harus mengikuti shell yang sama dengan auth lain.
     */
    body.rb-auth-login #primary,
    body.rb-auth-login .content-area,
    body.rb-auth-login .content-container,
    body.rb-auth-login .site-container,
    body.rb-auth-login #main.site-main,
    body.rb-auth-login .content-wrap,
    body.rb-auth-login article.page,
    body.rb-auth-login .entry-content-wrap {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body.rb-auth-login
    .entry-content.single-content {
        margin-top: 0 !important;
        margin-right: auto !important;
        margin-bottom: 0 !important;
        margin-left: auto !important;
    }

}

/* END LOGIN DESKTOP — MATCH REGISTER / PASSWORD RESET EXACTLY */

/* ==========================================================
   AUTH DESKTOP — DISABLE KADENCE FOOTER VIEWPORT STRETCH
   Footer follows content + global 32px rhythm.
   ========================================================== */

@media (min-width: 901px) {


}

/* END AUTH DESKTOP — DISABLE KADENCE FOOTER VIEWPORT STRETCH */



/* ==========================================================
   HOMEPAGE MOBILE — 14PX SECTION RHYTHM FINAL
   ========================================================== */

@media (max-width: 767px) {

    /* Header -> hero tetap 24px */
    body.page-id-18832
    .rb-homepage__container {
        padding-top: 24px !important;
        padding-bottom: 14px !important;
    }

    /* Hero -> feed */
    body.page-id-18832
    .rb-homepage__container > .rb-school-cta:first-child {
        margin-bottom: 14px !important;
    }

    /* Main content -> Penulis Paling Produktif */
    body.page-id-18832
    .rb-productive-authors {
        margin-top: 14px !important;
    }

    /* Penulis Paling Produktif -> Multimedia */
    body.page-id-18832
    .rb-multimedia {
        margin-top: 14px !important;
        margin-bottom: 0 !important;
    }

}

/* END HOMEPAGE MOBILE — 14PX SECTION RHYTHM FINAL */

/* ==========================================================
   RUANG BESTARI MOBILE — GLOBAL OUTER RHYTHM FINAL
   Header 24px / Footer 24px
   Homepage = visual reference
   ========================================================== */

@media (max-width: 767px) {

    /* ======================================================
       HOMEPAGE
       ====================================================== */

    body.page-id-18832
    .rb-homepage__container {
        padding-top: var(--rb-page-top-mobile) !important;
        padding-bottom: var(--rb-page-bottom-mobile) !important;
    }

    body.page-id-18832
    .rb-multimedia {
        margin-bottom: 0 !important;
    }


    /* ======================================================
       AUTH
       Login / Register / Password Reset
       ====================================================== */

    body.rb-auth-login #inner-wrap,
    body.rb-auth-register #inner-wrap,
    body.rb-auth-password-reset #inner-wrap {
        flex: none !important;
        min-height: 0 !important;

        padding-top: var(--rb-page-top-mobile) !important;
        padding-bottom: var(--rb-page-bottom-mobile) !important;

        box-sizing: border-box !important;
    }

    body.rb-auth-login
    .entry-content.single-content,

    body.rb-auth-register
    .entry-content.single-content,

    body.rb-auth-password-reset
    .entry-content.single-content {
        margin-top: 0 !important;
        margin-right: auto !important;
        margin-bottom: 0 !important;
        margin-left: auto !important;
    }

    /* Kadence tidak boleh menambahkan sisa tinggi viewport */



    /* ======================================================
       AUTHOR PROFILE
       ====================================================== */

    body.rb-um-public-profile
    #inner-wrap {
        padding-top: var(--rb-page-top-mobile) !important;
        padding-bottom: var(--rb-page-bottom-mobile) !important;
        box-sizing: border-box !important;
    }

    body.rb-um-public-profile #primary,
    body.rb-um-public-profile .content-area,
    body.rb-um-public-profile .content-container.site-container,
    body.rb-um-public-profile #main.site-main,
    body.rb-um-public-profile .content-wrap,
    body.rb-um-public-profile article,
    body.rb-um-public-profile .entry-content-wrap,
    body.rb-um-public-profile .entry-content,
    body.rb-um-public-profile .um,
    body.rb-um-public-profile .um-profile,
    body.rb-um-public-profile .um-profile-body {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body.rb-um-public-profile
    .rb-um-author-hero {
        margin-top: 0 !important;
    }

    body.rb-um-public-profile
    .rb-author-others {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }


    /* ======================================================
       SINGLE POST
       ====================================================== */

    body.single-post
    #inner-wrap {
        padding-top: var(--rb-page-top-mobile) !important;
        padding-bottom: var(--rb-page-bottom-mobile) !important;
        box-sizing: border-box !important;
    }

    body.single-post
    #primary.content-area {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

}

/* END RUANG BESTARI MOBILE — GLOBAL OUTER RHYTHM FINAL */



/* ==========================================================
   RUANG BESTARI — SITEWIDE OUTER RHYTHM FINAL

   Berlaku untuk template WordPress standar:
   - Page biasa
   - Blog / posts index
   - Category / Tag / Author / Date archive
   - Search
   - Attachment
   - 404

   Homepage memiliki container spacing sendiri sehingga
   sengaja dikecualikan agar tidak mendapat padding ganda.
   ========================================================== */


/* ==========================================================
   DESKTOP — 32px / 32px
   ========================================================== */

@media (min-width: 1025px) {

    body.page:not(.page-id-18832) #inner-wrap,
    body.blog #inner-wrap,
    body.archive #inner-wrap,
    body.search #inner-wrap,
    body.attachment #inner-wrap,
    body.error404 #inner-wrap {
        padding-top: var(--rb-page-top-desktop) !important;
        padding-bottom: var(--rb-page-bottom-desktop) !important;
        box-sizing: border-box !important;
    }


    /*
     * Hilangkan vertical margin bawaan Kadence:
     * .content-area { margin: var(--global-xxl-spacing) 0; }
     */
    body.page:not(.page-id-18832) #primary.content-area,
    body.blog #primary.content-area,
    body.archive #primary.content-area,
    body.search #primary.content-area,
    body.attachment #primary.content-area,
    body.error404 #primary.content-area {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }


    /*
     * Author archive custom:
     * shell sudah memberi 32px sehingga hero pertama
     * tidak boleh membawa margin-top tambahan.
     */
    body.author
    .rb-author-profile-hero {
        margin-top: 0 !important;
    }

}


/* ==========================================================
   MOBILE — 24px / 24px
   ========================================================== */

@media (max-width: 767px) {

    body.page:not(.page-id-18832) #inner-wrap,
    body.blog #inner-wrap,
    body.archive #inner-wrap,
    body.search #inner-wrap,
    body.attachment #inner-wrap,
    body.error404 #inner-wrap {
        padding-top: var(--rb-page-top-mobile) !important;
        padding-bottom: var(--rb-page-bottom-mobile) !important;
        box-sizing: border-box !important;
    }


    body.page:not(.page-id-18832) #primary.content-area,
    body.blog #primary.content-area,
    body.archive #primary.content-area,
    body.search #primary.content-area,
    body.attachment #primary.content-area,
    body.error404 #primary.content-area {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }


    body.author
    .rb-author-profile-hero {
        margin-top: 0 !important;
    }

}


/* ==========================================================
   DISABLE KADENCE VIEWPORT FOOTER STRETCH

   Footer selalu mengikuti akhir konten + spacing global.
   Tidak ada lagi "sisa tinggi layar" yang terlihat sebagai
   jarak tambahan.
   ========================================================== */

body.footer-on-bottom.page:not(.page-id-18832):not(.rb-auth-login):not(.rb-auth-register):not(.rb-auth-password-reset):not(.page-id-18880) #wrapper,
body.footer-on-bottom.blog #wrapper,
body.footer-on-bottom.archive #wrapper,
body.footer-on-bottom.search #wrapper,
body.footer-on-bottom.attachment #wrapper,
body.footer-on-bottom.error404 #wrapper {
    min-height: 0 !important;
    display: block !important;
}

body.footer-on-bottom.page:not(.page-id-18832):not(.rb-auth-login):not(.rb-auth-register):not(.rb-auth-password-reset):not(.page-id-18880) #inner-wrap,
body.footer-on-bottom.blog #inner-wrap,
body.footer-on-bottom.archive #inner-wrap,
body.footer-on-bottom.search #inner-wrap,
body.footer-on-bottom.attachment #inner-wrap,
body.footer-on-bottom.error404 #inner-wrap {
    flex: none !important;
    min-height: 0 !important;
}


/* END RUANG BESTARI — SITEWIDE OUTER RHYTHM FINAL */

/* ==========================================================
   ALL POSTS ARCHIVE — REMOVE KADENCE PAGE HERO
   /tulisan/ uses its own archive header.
   ========================================================== */

body.rb-all-posts-archive-page .entry-hero,
body.rb-all-posts-archive-page .entry-hero-container,
body.rb-all-posts-archive-page .page-header,
body.rb-all-posts-archive-page article.page > .entry-header {
    display: none !important;
}

body.rb-all-posts-archive-page #inner-wrap,
body.rb-all-posts-archive-page .content-area,
body.rb-all-posts-archive-page #primary,
body.rb-all-posts-archive-page #main.site-main,
body.rb-all-posts-archive-page .content-wrap,
body.rb-all-posts-archive-page article.page,
body.rb-all-posts-archive-page .entry-content-wrap,
body.rb-all-posts-archive-page .entry-content.single-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.rb-all-posts-archive-page article.page,
body.rb-all-posts-archive-page .entry-content-wrap {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* END ALL POSTS ARCHIVE — REMOVE KADENCE PAGE HERO */

/* ==========================================================
   ALL POSTS ARCHIVE — REMOVE PAGE CONTAINER NESTING
   /tulisan/ must share the same horizontal line as category.
   ========================================================== */

body.rb-all-posts-archive-page
.content-container.site-container,
body.rb-all-posts-archive-page
#primary.content-area,
body.rb-all-posts-archive-page
#main.site-main,
body.rb-all-posts-archive-page
.content-wrap,
body.rb-all-posts-archive-page
article.page,
body.rb-all-posts-archive-page
.entry-content-wrap,
body.rb-all-posts-archive-page
.entry-content.single-content {
    width: 100% !important;
    max-width: none !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    box-sizing: border-box !important;
}

/* END ALL POSTS ARCHIVE — REMOVE PAGE CONTAINER NESTING */
