
/*
|--------------------------------------------------------------------------
| Frontend Shared Layout
|--------------------------------------------------------------------------
| CSS bersama untuk komponen header dan footer JDIH BPSDMP.
|
| Komponen:
| - pages/components/header.php
| - pages/components/footer.php
|
| Gunakan file ini pada seluruh halaman frontend JDIH.
|--------------------------------------------------------------------------
*/

/* =========================================================
   1. GLOBAL VARIABLES
========================================================= */

:root {
    --navy: #06234b;
    --navy-dark: #03162f;
    --navy-deep: #02152e;
    --blue: #123d79;
    --gold: #d99b26;
    --gold-light: #f1c15b;
    --text: #102b58;
    --muted: #667da6;
    --border: #e6edf6;
    --surface: #ffffff;
    --background: #f8fafc;
    --green: #14ad69;
    --shadow: 0 8px 25px rgba(13, 39, 78, .055);

    --header-height-desktop: 78px;
    --header-height-mobile: 66px;

    --header-container-width: 1200px;
    --header-container-gutter: 100px;
}


/* =========================================================
   2. SHARED CONTAINER
   Header dan Footer
========================================================= */

.site-header > .container,
.site-footer > .container {
    width: min(
        var(--header-container-width),
        calc(100% - var(--header-container-gutter))
    ) !important;

    max-width: var(--header-container-width) !important;

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

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

    box-sizing: border-box !important;
}


/* =========================================================
   3. HEADER BASE
========================================================= */

.site-header {
    position: relative;
    z-index: 100;

    display: block;

    width: 100%;
    height: calc(var(--header-height-desktop) + 1px);
    min-height: calc(var(--header-height-desktop) + 1px);

    margin: 0;
    padding: 0;

    box-sizing: border-box;

    font-family: Inter, Arial, sans-serif;

    background: var(--navy-dark);

    border-bottom: 1px solid rgba(255, 255, 255, .13);
}


/* =========================================================
   4. HEADER NAVBAR
   Reset Bootstrap Navbar
========================================================= */

.site-header > .container.navbar {
    position: relative;

    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap !important;

    align-items: center !important;
    justify-content: space-between !important;

    width: min(
        var(--header-container-width),
        calc(100% - var(--header-container-gutter))
    ) !important;

    max-width: var(--header-container-width) !important;

    height: var(--header-height-desktop) !important;
    min-height: var(--header-height-desktop) !important;
    max-height: var(--header-height-desktop) !important;

    margin: 0 auto !important;
    padding: 0 !important;

    gap: clamp(16px, 2.5vw, 38px);

    box-sizing: border-box !important;
}


/* =========================================================
   5. BRAND / LOGO
========================================================= */

.site-header .brand {
    display: inline-flex !important;

    flex-direction: row;
    flex-wrap: nowrap;

    align-items: center;
    justify-content: flex-start;

    flex: 0 0 auto;

    gap: 12px;

    min-width: 0;

    margin: 0;
    padding: 0;

    color: #fff;
    text-decoration: none;

    line-height: normal;
}

.site-header .brand img {
    display: block;

    flex: 0 0 54px;

    width: 54px;
    height: 54px;

    max-width: 54px;

    margin: 0;
    padding: 0;

    object-fit: contain;
}

.site-header .brand-copy {
    display: grid;

    flex: 0 0 auto;

    gap: 4px;

    margin: 0;
    padding: 0;

    line-height: normal;
}

.site-header .brand-copy strong {
    display: block;

    margin: 0;
    padding: 0;

    color: #f2b32f;

    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.35px;

    line-height: 1.25;
}

.site-header .brand-copy span {
    display: block;

    margin: 0;
    padding: 0;

    color: #d7e0ef;

    font-size: 11px;
    font-weight: 400;

    line-height: 1.3;
}


/* =========================================================
   6. DESKTOP NAVIGATION
========================================================= */

.site-header .nav-links {
    position: relative;

    display: flex !important;

    flex: 1 1 auto;
    flex-direction: row;
    flex-wrap: nowrap;

    align-items: center;
    justify-content: center;

    height: var(--header-height-desktop);
    min-height: var(--header-height-desktop);

    min-width: 0;

    margin: 0;
    padding: 0;

    gap: clamp(16px, 2vw, 32px);

    list-style: none;
}

.site-header .nav-link {
    position: relative;

    display: flex !important;

    flex: 0 0 auto;

    align-items: center;
    justify-content: center;

    height: 100%;
    min-height: 100%;

    margin: 0;
    padding: 0;

    color: #f0f4fb;

    font-size: 12px;
    font-weight: 500;

    line-height: 1.4;

    white-space: nowrap;

    text-decoration: none;

    transition: color .2s ease;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: #ffc342;
}

.site-header .nav-link.active::after {
    position: absolute;

    right: 0;
    bottom: 12px;
    left: 0;

    height: 2px;

    background: #eeb02c;

    content: "";
}


/* =========================================================
   7. HEADER ACTIONS
========================================================= */

.site-header .nav-actions {
    display: flex !important;

    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: nowrap;

    align-items: center;
    justify-content: flex-end;

    gap: 14px;

    min-width: 0;

    margin: 0;
    padding: 0;
}

.site-header .nav-search {
    display: grid !important;

    flex: 0 0 42px;

    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;

    place-items: center;

    margin: 0;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 50%;

    color: #fff;
    background: transparent;

    font-size: 17px;

    cursor: pointer;

    transition: background .2s ease;
}

.site-header .nav-search:hover {
    background: rgba(255, 255, 255, .08);
}

.site-header .admin-button {
    display: inline-flex !important;

    flex: 0 0 auto;

    align-items: center;
    justify-content: center;

    gap: 9px;

    min-height: 40px;

    margin: 0;
    padding: 12px 20px;

    border: 0;
    border-radius: 28px;

    color: #fff;

    background: linear-gradient(135deg, #edb43f, #b8790c);

    font-size: 11px;
    font-weight: 800;

    line-height: 1.2;

    white-space: nowrap;
    text-decoration: none;

    box-shadow: 0 4px 12px rgba(206, 143, 26, .14);

    transition: filter .2s ease;
}

.site-header .admin-button:hover {
    color: #fff;
    filter: brightness(1.06);
}


/* =========================================================
   8. MOBILE TOGGLE
========================================================= */

.site-header .mobile-toggle {
    display: none;

    flex: 0 0 40px;

    align-items: center;
    justify-content: center;

    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;

    margin: 0;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 9px;

    color: #fff;
    background: transparent;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}


/* =========================================================
   9. FOOTER BASE
========================================================= */

.site-footer {
    position: relative;

    width: 100%;

    overflow: hidden;

    margin: 0;
    padding: 34px 0 0;

    box-sizing: border-box;

    color: #e5edf8;

    background: linear-gradient(110deg, #03172f, #061f43);

    font-family: Inter, Arial, sans-serif;
}

.site-header a,
.site-footer a {
    text-decoration: none;
}


/* =========================================================
   10. FOOTER BRAND
========================================================= */

.footer-brand {
    display: inline-flex;

    align-items: center;

    gap: 10px;

    margin: 0 0 12px;
    padding: 0;
}

.footer-brand img {
    display: block;

    width: 42px;
    height: 42px;

    object-fit: contain;
}

.footer-brand strong {
    display: block;

    margin: 0 0 4px;

    color: #efb333;

    font-size: 12px;
    font-weight: 800;
}

.footer-brand span {
    display: block;

    color: #c9d5e8;

    font-size: 10px;
}


/* =========================================================
   11. FOOTER GRID
========================================================= */

.footer-grid {
    display: grid;

    grid-template-columns: 1.35fr .8fr 1fr .55fr;

    gap: 40px;

    padding-bottom: 22px;
}

.footer-description {
    max-width: 300px;

    margin: 0;

    color: #c0cde0;

    font-size: 12px;
    line-height: 1.7;
}

.footer-column h3 {
    margin: 5px 0 14px;

    color: #fff;

    font-size: 12px;
    font-weight: 800;
}

.footer-links {
    display: grid;

    gap: 8px;
}

.footer-links a,
.contact-line {
    display: flex;

    align-items: flex-start;

    gap: 8px;

    color: #c8d5e8;

    font-size: 12px;
    line-height: 1.6;
}

.footer-links a:hover {
    color: #ffc342;
}

.footer-links i,
.contact-line i {
    flex-shrink: 0;

    color: #efb22f;

    font-size: 12px;
}

.contact-list {
    display: grid;

    gap: 9px;
}


/* =========================================================
   12. FOOTER SOCIAL
========================================================= */

.social-links {
    display: flex;

    flex-wrap: wrap;

    gap: 9px;
}

.social-links a {
    display: grid;

    width: 34px;
    height: 34px;

    place-items: center;

    border-radius: 7px;

    color: #fff;
    background: #16437b;

    font-size: 17px;

    transition: background .2s ease;
}

.social-links a:hover {
    color: #fff;
    background: #b78017;
}


/* =========================================================
   13. FOOTER BOTTOM
========================================================= */

.footer-bottom {
    padding: 13px 0;

    border-top: 1px solid rgba(255, 255, 255, .12);

    color: #9aacc8;

    font-size: 10px;

    text-align: center;
}


/* =========================================================
   14. RESPONSIVE TABLET
========================================================= */

@media (max-width: 1100px) {

    .site-header > .container.navbar {
        gap: 16px;
    }

    .site-header .nav-links {
        gap: 17px;
    }

    .site-header .brand-copy strong {
        font-size: 13px;
    }

    .site-header .admin-button {
        padding-left: 14px;
        padding-right: 14px;
    }

    .footer-grid {
        gap: 24px;
    }
}


/* =========================================================
   15. RESPONSIVE MOBILE
========================================================= */

@media (max-width: 820px) {

    .site-header {
        height: calc(var(--header-height-mobile) + 1px);
        min-height: calc(var(--header-height-mobile) + 1px);
    }

    .site-header > .container.navbar {
        width: calc(100% - 32px) !important;
        max-width: none !important;

        height: var(--header-height-mobile) !important;
        min-height: var(--header-height-mobile) !important;
        max-height: var(--header-height-mobile) !important;

        gap: 12px;
    }

    .site-header .mobile-toggle {
        display: inline-flex !important;
    }

    .site-header .nav-links {
        position: absolute;

        top: 100%;
        right: 0;
        left: 0;

        display: none !important;

        flex: none;

        flex-direction: column;
        flex-wrap: nowrap;

        align-items: stretch;
        justify-content: flex-start;

        width: 100%;
        height: auto;
        min-height: 0;

        margin: 0;
        padding: 12px 20px 18px;

        gap: 0;

        background: #041a37;

        border-top: 1px solid rgba(255, 255, 255, .1);

        box-shadow: 0 12px 24px rgba(0, 0, 0, .15);
    }

    .site-header .nav-links.open,
    .site-header .nav-links.show {
        display: flex !important;
    }

    .site-header .nav-link {
        display: flex !important;

        flex: none;

        align-items: center;
        justify-content: flex-start;

        width: 100%;
        height: auto;
        min-height: 43px;

        padding: 8px 0;

        white-space: normal;
    }

    .site-header .nav-link.active::after {
        right: auto;
        bottom: 4px;
        left: 0;

        width: 35px;
    }

    .site-header .nav-actions {
        margin-left: auto;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   16. RESPONSIVE SMALL MOBILE
========================================================= */

@media (max-width: 520px) {

    .site-header > .container.navbar {
        width: calc(100% - 28px) !important;
        max-width: none !important;
    }

    .site-header .brand {
        gap: 8px;
    }

    .site-header .brand img {
        flex-basis: 39px;

        width: 39px;
        height: 39px;

        max-width: 39px;
    }

    .site-header .brand-copy strong {
        font-size: 11px;
    }

    .site-header .brand-copy span {
        font-size: 9px;
    }

    .site-header .nav-search {
        display: none !important;
    }

    .site-header .admin-button {
        min-height: 36px;

        padding: 10px 12px;

        font-size: 10px;
    }

    .site-header .mobile-toggle {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;

        flex-basis: 38px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;

        gap: 25px 18px;
    }

    .footer-description {
        font-size: 10px;
    }
}


/* =========================================================
   17. ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .site-header *,
    .site-header *::before,
    .site-header *::after,
    .site-footer *,
    .site-footer *::before,
    .site-footer *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
