/* ==========================================================================
   PadhaiX Global Styles
   ========================================================================== */

* {
    box-sizing: border-box;
}

/* Keep keyboard location visible without changing a control's normal design. */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(0, 120, 100, 0.42);
    outline-offset: 3px;
}

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #173b35;
    background: #f5faf9;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    height: 68px;
    background: #ffffff;
    border-bottom: 1px solid #dce9e6;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 5%;

    position: sticky;
    top: 0;
    z-index: 20;
}


/* ==========================================================================
   PadhaiX Brand
   ========================================================================== */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

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

    text-decoration: none;

    flex-shrink: 0;
}


/*
|--------------------------------------------------------------------------
| Legacy brand mark
|--------------------------------------------------------------------------
|
| Kept for compatibility with any older page/component.
|
*/

.brand-mark {
    width: 34px;
    height: 34px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    background: #006b5b;
    color: #ffffff;

    font-family: Georgia, serif;
    font-size: 18px;
}


/* ==========================================================================
   Desktop Navigation
   ========================================================================== */

.nav {
    display: flex;
    align-items: center;

    gap: 24px;

    font-size: 14px;
    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| Navigation Links
|--------------------------------------------------------------------------
*/

.nav > a,
.nav > .nav-dropdown > summary {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 68px;

    color: #173b35;

    white-space: nowrap;

    cursor: pointer;

    transition:
        color 0.2s ease;
}


/*
|--------------------------------------------------------------------------
| Navigation Hover
|--------------------------------------------------------------------------
*/

.nav > a:hover,
.nav > .nav-dropdown > summary:hover {
    color: #007864;
}


/*
|--------------------------------------------------------------------------
| Active Navigation Item
|--------------------------------------------------------------------------
|
| Thin professional underline.
|
*/

.desktop-nav > a.active,
.desktop-nav > .nav-dropdown > summary.active {
    color: #007864;
}


/*
|--------------------------------------------------------------------------
| Active Underline
|--------------------------------------------------------------------------
*/

.desktop-nav > a.active::after,
.desktop-nav > .nav-dropdown > summary.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;

    bottom: 0;

    height: 2px;

    background: #007864;

    border-radius: 2px;
}


/* ==========================================================================
   Chapters Dropdown
   ========================================================================== */

.nav-dropdown {
    position: relative;
}


.nav-dropdown summary {
    list-style: none;
}


.nav-dropdown summary::-webkit-details-marker {
    display: none;
}


.dropdown-arrow {
    font-size: 10px;
    line-height: 1;

    margin-left: 5px;

    transition:
        transform 0.2s ease;
}


.nav-dropdown[open] .dropdown-arrow {
    transform: rotate(180deg);
}


/*
|--------------------------------------------------------------------------
| Desktop Dropdown Menu
|--------------------------------------------------------------------------
*/

.nav-dropdown-menu {
    position: absolute;

    top: calc(100% - 1px);
    left: 50%;

    transform: translateX(-50%);

    min-width: 180px;

    background: #ffffff;

    border: 1px solid #dce9e6;

    border-radius: 9px;

    padding: 8px;

    box-shadow:
        0 10px 28px rgba(20, 60, 55, 0.12);

    z-index: 1000;
}


.nav-dropdown-menu a {
    display: block;

    padding: 10px 12px;

    border-radius: 6px;

    font-size: 14px;

    color: #24423e;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.nav-dropdown-menu a:hover {
    background: #eef7f5;
    color: #007864;
}


.nav-dropdown-menu a.active {
    color: #007864;
    font-weight: 600;
}


/* ==========================================================================
   Search Icon
   ========================================================================== */

.nav-search {
    display: flex;

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

    width: 30px;

    color: #173b35;

    transition:
        color 0.2s ease;
}


.nav-search:hover {
    color: #007864;
}


.nav-search.active {
    color: #007864;
}


/*
|--------------------------------------------------------------------------
| Search Icon Active Underline
|--------------------------------------------------------------------------
*/

.desktop-nav > .nav-search.active::after {
    left: 3px;
    right: 3px;
}


/* ==========================================================================
   Profile Menu
   ========================================================================== */

.profile-menu {
    position: relative;
}


.profile-menu > summary {
    list-style: none;
}


.profile-menu > summary::-webkit-details-marker {
    display: none;
}


/*
|--------------------------------------------------------------------------
| Circular Profile Button
|--------------------------------------------------------------------------
*/

.profile-button {
    width: 38px;
    height: 38px;

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

    border-radius: 50%;

    background: #087d6d;
    color: #ffffff;

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

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
    user-select: none;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.profile-button:hover {
    background: #006f61;
}


.profile-button:focus-visible {
    outline: 2px solid #007864;
    outline-offset: 3px;
}


/* ==========================================================================
   Profile Dropdown
   ========================================================================== */

.profile-dropdown {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 190px;

    background: #ffffff;

    border: 1px solid #dce9e6;

    border-radius: 9px;

    padding: 8px;

    box-shadow:
        0 10px 28px rgba(20, 60, 55, 0.14);

    z-index: 1000;
}


.profile-dropdown-name {
    padding: 9px 11px 10px;

    font-size: 13px;
    font-weight: 600;

    color: #174f48;

    border-bottom: 1px solid #e7efed;

    margin-bottom: 4px;
}


.profile-dropdown a,
.profile-logout {
    display: block;

    width: 100%;

    box-sizing: border-box;

    padding: 9px 11px;

    border: none;
    border-radius: 6px;

    background: transparent;

    color: #24423e;

    font: inherit;
    font-size: 14px;

    text-align: left;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.profile-dropdown a:hover,
.profile-logout:hover {
    background: #eef7f5;
    color: #007864;
}


.profile-dropdown a.active {
    color: #007864;
    font-weight: 600;
}


/* ==========================================================================
   User Greeting
   ========================================================================== */

.user-greeting {
    font-weight: 600;
    color: #00695c;
    white-space: nowrap;
}


/* ==========================================================================
   Logout Button
   ========================================================================== */

.logout-btn {
    background: none;

    border: none;

    padding: 0;
    margin: 0;

    font: inherit;

    color: inherit;

    cursor: pointer;
}


.logout-btn:hover {
    text-decoration: underline;
}


/* ==========================================================================
   Mobile Header
   ========================================================================== */

.mobile-header-controls {
    display: none;
}


.mobile-navigation {
    display: none;
}


/*
|--------------------------------------------------------------------------
| Hamburger
|--------------------------------------------------------------------------
*/

.mobile-menu-toggle {
    width: 40px;
    height: 40px;

    display: flex;

    flex-direction: column;

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

    gap: 5px;

    border: none;

    background: transparent;

    padding: 0;

    cursor: pointer;
}


.mobile-menu-toggle span {
    display: block;

    width: 21px;
    height: 2px;

    background: #174f48;

    border-radius: 2px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* ==========================================================================
   Main Container
   ========================================================================== */

.container {
    max-width: 1180px;

    margin: auto;

    padding: 34px 22px;

    min-height: calc(100vh - 140px);
}


/* ==========================================================================
   Sticky Breadcrumb Navigation
   ========================================================================== */

.container > .padhaix-breadcrumb {
    position: sticky;
    top: 68px;
    z-index: 19;

    margin: -10px 0 30px;
    padding: 10px 0;

    background: #f5faf9;
}


/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    display: grid;

    grid-template-columns: 1.2fr 0.8fr;

    gap: 30px;

    align-items: center;

    padding: 46px 0;
}


.hero h1 {
    font:
        700 48px/1.05
        Georgia,
        serif;

    margin: 10px 0;
}


.hero p {
    font-size: 18px;

    line-height: 1.6;

    color: #52706a;
}


/* ==========================================================================
   Cards
   ========================================================================== */

.card-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 18px;
}


.card {
    background: #ffffff;

    border: 1px solid #dce9e6;

    border-radius: 12px;

    padding: 20px;

    box-shadow:
        0 4px 14px #17473d0b;
}


.card h3 {
    margin: 0 0 8px;

    font-family: Georgia, serif;
}


/* ==========================================================================
   Text Helpers
   ========================================================================== */

.muted {
    color: #68807a;
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;

    background: #006b5b;

    color: #ffffff;

    border: 0;

    border-radius: 6px;

    padding: 11px 17px;

    font-weight: 700;

    cursor: pointer;
}


.btn.secondary {
    background: #e7f2ef;

    color: #006b5b;
}


/* ==========================================================================
   Section Title
   ========================================================================== */

.section-title {
    font:
        700 30px
        Georgia,
        serif;

    margin: 25px 0 16px;
}


/* ==========================================================================
   Search
   ========================================================================== */

.search {
    display: flex;

    gap: 10px;

    margin: 18px 0;
}


.search input,
.form input,
.form textarea,
.form select {
    width: 100%;

    padding: 12px;

    border: 1px solid #cbded9;

    border-radius: 7px;

    background: #ffffff;
}


/* ==========================================================================
   Forms
   ========================================================================== */

.form {
    max-width: 560px;

    background: #ffffff;

    border: 1px solid #dce9e6;

    border-radius: 12px;

    padding: 24px;
}


.form label {
    display: block;

    font-weight: 700;

    margin: 14px 0 6px;
}


/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: #004f44;

    color: #ffffff;

    padding: 30px 5%;

    display: flex;

    justify-content: space-between;

    gap: 20px;

    flex-wrap: wrap;
}


.footer-links {
    display: flex;

    gap: 18px;

    font-size: 13px;
}


/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-block;

    padding: 4px 8px;

    border-radius: 20px;

    background: #e8f4f1;

    color: #006b5b;

    font-size: 12px;

    font-weight: 700;
}


/* ==========================================================================
   Messages
   ========================================================================== */

.error {
    background: #fdecec;

    color: #a62b2b;

    padding: 10px;

    border-radius: 7px;

    margin-bottom: 12px;
}


.success {
    background: #e8f6ee;

    color: #176b40;

    padding: 10px;

    border-radius: 7px;

    margin-bottom: 12px;
}


/* ==========================================================================
   Search Page
   ========================================================================== */

.search-page-form {
    display: flex;

    gap: 12px;

    align-items: stretch;

    margin: 24px 0 28px;

    width: 100%;
}


.search-page-input-wrap {
    display: flex;

    align-items: center;

    gap: 10px;

    flex: 1;

    min-width: 0;

    background: #ffffff;

    border: 1px solid #dce9e6;

    border-radius: 10px;

    padding: 0 16px;

    min-height: 48px;
}


.search-page-input-wrap svg {
    flex: 0 0 auto;

    color: #006b5b;
}


.search-page-input-wrap input {
    width: 100%;

    border: 0;

    outline: none;

    background: transparent;

    font: inherit;

    font-size: 16px;

    color: #173b35;

    min-width: 0;
}


.search-page-input-wrap input::placeholder {
    color: #68807b;
}


.search-page-form .btn {
    min-height: 48px;

    padding: 0 24px;

    white-space: nowrap;
}


/* ==========================================================================
   Tablet / Smaller Desktop
   ========================================================================== */

@media (max-width: 1000px) {

    .site-header {
        padding: 0 24px;
    }

    .nav {
        gap: 16px;

        font-size: 13px;
    }

}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 768px) {

    /*
    |--------------------------------------------------------------------------
    | Header
    |--------------------------------------------------------------------------
    */

    .site-header {
        height: 64px;

        padding: 0 16px;

        position: sticky;

        justify-content: space-between;
    }


    .container > .padhaix-breadcrumb {
        top: 64px;

        margin-bottom: 24px;
    }


    /*
    |--------------------------------------------------------------------------
    | Brand
    |--------------------------------------------------------------------------
    */

    .brand {
        gap: 8px;
    }


    .brand-logo {
        width: 46px;
        height: 46px;
    }


    .brand-name {
        font-size: 25px;
    }


    .brand-tagline {
        font-size: 10px;

        margin-top: 4px;
    }


    /*
    |--------------------------------------------------------------------------
    | Hide Desktop Navigation
    |--------------------------------------------------------------------------
    */

    .desktop-nav {
        display: none !important;
    }


    /*
    |--------------------------------------------------------------------------
    | Mobile Controls
    |--------------------------------------------------------------------------
    */

    .mobile-header-controls {
        display: flex;

        align-items: center;

        gap: 8px;
    }


    /*
    |--------------------------------------------------------------------------
    | Mobile Navigation
    |--------------------------------------------------------------------------
    */

    .mobile-navigation {
        display: none;

        position: absolute;

        top: 100%;

        left: 0;
        right: 0;

        background: #ffffff;

        border-top: 1px solid #e1ebe8;

        border-bottom: 1px solid #e1ebe8;

        padding: 8px 18px 14px;

        box-shadow:
            0 8px 20px rgba(20, 60, 55, 0.08);

        z-index: 999;
    }


    .mobile-navigation.is-open {
        display: block;
    }


    /*
    |--------------------------------------------------------------------------
    | Mobile Navigation Links
    |--------------------------------------------------------------------------
    */

    .mobile-navigation > a,
    .mobile-nav-dropdown > summary {
        position: relative;

        display: block;

        padding: 12px 4px;

        color: #24423e;

        text-decoration: none;

        font-size: 15px;

        border-bottom: 1px solid #edf2f0;
    }


    .mobile-navigation > a:hover,
    .mobile-nav-dropdown > summary:hover {
        color: #007864;
    }


    /*
    |--------------------------------------------------------------------------
    | Mobile Active Navigation
    |--------------------------------------------------------------------------
    */

    .mobile-navigation > a.active,
    .mobile-nav-dropdown > summary.active {
        color: #007864;
    }


    .mobile-navigation > a.active::after,
    .mobile-nav-dropdown > summary.active::after {
        content: "";

        position: absolute;

        left: 4px;

        width: 42px;

        bottom: -1px;

        height: 2px;

        background: #007864;

        border-radius: 2px;
    }


    /*
    |--------------------------------------------------------------------------
    | Mobile Chapters
    |--------------------------------------------------------------------------
    */

    .mobile-nav-dropdown summary {
        list-style: none;

        cursor: pointer;
    }


    .mobile-nav-dropdown summary::-webkit-details-marker {
        display: none;
    }


    .mobile-nav-dropdown-menu {
        padding-left: 14px;
    }


    .mobile-nav-dropdown-menu a {
        display: block;

        padding: 10px 4px;

        color: #526b66;

        text-decoration: none;

        font-size: 14px;
    }


    .mobile-nav-dropdown-menu a:hover,
    .mobile-nav-dropdown-menu a.active {
        color: #007864;
    }


    /*
    |--------------------------------------------------------------------------
    | Mobile Profile
    |--------------------------------------------------------------------------
    */

    .mobile-profile-menu .profile-dropdown {
        right: 0;
    }


    /*
    |--------------------------------------------------------------------------
    | Main Content
    |--------------------------------------------------------------------------
    */

    .container {
        padding: 24px 16px;
    }


    /*
    |--------------------------------------------------------------------------
    | Hero
    |--------------------------------------------------------------------------
    */

    .hero {
        grid-template-columns: 1fr;
    }


    .hero h1 {
        font-size: 38px;
    }


    /*
    |--------------------------------------------------------------------------
    | Cards
    |--------------------------------------------------------------------------
    */

    .card-grid {
        grid-template-columns: 1fr;
    }

}


/* ==========================================================================
   Small Mobile
   ========================================================================== */

@media (max-width: 600px) {

    .search-page-form {
        flex-direction: column;
    }


    .search-page-form .btn {
        width: 100%;
    }

}


/* ==========================================================================
   Very Small Screens
   ========================================================================== */

@media (max-width: 430px) {

    .site-header {
        padding: 0 12px;
    }


    .brand-logo {
        width: 42px;
        height: 42px;
    }


    .brand-name {
        font-size: 22px;
    }


    .brand-tagline {
        font-size: 9px;
    }


    .mobile-header-controls {
        gap: 4px;
    }


    .profile-button {
        width: 36px;
        height: 36px;

        font-size: 14px;
    }


    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }

}
