/**
 * OrgMesh Platform
 * Copyright (c) 2024-2026 Blair David Stevenson. All rights reserved.
 * Developed and engineered by Green Route Cambodia Enterprise.
 * PROPRIETARY AND CONFIDENTIAL
 */
:root {
    --color-bg: #f4f7fb;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fbff;
    --color-surface-muted: #eef3f8;

    --color-text: #182538;
    --color-text-muted: #5f6f86;
    --color-heading: #0f1c2d;

    --color-primary: #0f4c81;
    --color-primary-strong: #0b3b64;
    --color-primary-soft: #dcecff;
    --color-secondary: #1d6fa3;
    --color-accent: #d9ebfa;
    --color-accent-strong: #c7ddf3;

    --color-border: rgba(24, 37, 56, 0.1);
    --color-border-strong: rgba(24, 37, 56, 0.18);

    --shadow-sm: 0 8px 20px rgba(12, 28, 52, 0.06);
    --shadow-md: 0 14px 32px rgba(12, 28, 52, 0.09);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 999px;

    --container-width: 1240px;
    --site-gutter: 1.25rem;

    --font-sans:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;

    --transition-fast: 0.2s ease;
    --transition-medium: 0.28s ease;

    --header-height: 82px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

img,
picture,
svg,
canvas {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background:
        radial-gradient(circle at top left, rgba(15, 76, 129, 0.05), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--color-bg) 100%);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body > main,
.page-main {
    flex: 1 0 auto;
    width: 100%;
}

:focus-visible {
    outline: 3px solid rgba(15, 76, 129, 0.28);
    outline-offset: 3px;
    border-radius: 6px;
}

.site-shell {
    width: min(100% - (var(--site-gutter) * 2), var(--container-width));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid rgba(24, 37, 56, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.site-header__inner {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-header__brand-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.25rem 0;
    max-width: 100%;
    min-width: 0;
}

.site-header__brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.site-header__brand-logo-image {
    display: block;
    width: 58px;
    height: auto;
    max-width: 58px;
}

.site-header__brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.site-header__brand-title {
    color: var(--color-heading);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.site-header__brand-tagline {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    line-height: 1.2;
}

.site-header__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(15, 76, 129, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-primary-strong);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.site-header__toggle:hover,
.site-header__toggle:focus-visible {
    background: #ffffff;
    border-color: rgba(15, 76, 129, 0.22);
    color: var(--color-primary-strong);
    box-shadow: 0 10px 22px rgba(12, 28, 52, 0.08);
}

.site-header__toggle-label {
    display: inline-block;
}

.site-header__nav {
    flex: 0 0 auto;
    min-width: 0;
}

.site-header__nav-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-header__nav-item {
    position: relative;
    margin: 0;
}

.site-header__nav-item--has-children::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 14px;
}

.site-header__nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.72rem 1rem;
    border-radius: 10px;
    color: var(--color-text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;
    transition:
        color var(--transition-fast),
        background-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.site-header__nav-link:hover,
.site-header__nav-link:focus-visible {
    color: var(--color-primary-strong);
    background: rgba(15, 76, 129, 0.06);
}

.site-header__nav-link.is-active,
.site-header__nav-link[aria-current="page"] {
    color: var(--color-primary-strong);
    background: linear-gradient(180deg, rgba(15, 76, 129, 0.12), rgba(15, 76, 129, 0.07));
    box-shadow:
        inset 0 0 0 1px rgba(15, 76, 129, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.8);
}

.site-header__nav-caret {
    width: 0.48rem;
    height: 0.48rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.7;
    flex: 0 0 auto;
}

.site-header__subnav {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1001;
    min-width: 230px;
    margin: 0;
    padding: 0.65rem 0.45rem 0.45rem;
    list-style: none;
    background: rgba(255, 255, 255, 0.985);
    border: 1px solid rgba(24, 37, 56, 0.08);
    border-radius: 14px;
    box-shadow:
        0 16px 36px rgba(12, 28, 52, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition:
        opacity var(--transition-fast),
        visibility var(--transition-fast),
        transform var(--transition-fast);
}

.site-header__nav-item--has-children:hover .site-header__subnav,
.site-header__nav-item--has-children:focus-within .site-header__subnav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.site-header__subnav-item {
    margin: 0;
}

.site-header__subnav-item + .site-header__subnav-item {
    margin-top: 0.12rem;
}

.site-header__subnav-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2.55rem;
    padding: 0.72rem 0.85rem;
    border-radius: 10px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.93rem;
    line-height: 1.3;
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.site-header__subnav-link:hover,
.site-header__subnav-link:focus-visible {
    background: linear-gradient(180deg, rgba(15, 76, 129, 0.07), rgba(15, 76, 129, 0.04));
    color: var(--color-primary-strong);
    box-shadow: inset 0 0 0 1px rgba(15, 76, 129, 0.06);
}

.site-header__subnav-link.is-active,
.site-header__subnav-link[aria-current="page"] {
    background: linear-gradient(180deg, rgba(15, 76, 129, 0.1), rgba(15, 76, 129, 0.06));
    color: var(--color-primary-strong);
    box-shadow: inset 0 0 0 1px rgba(15, 76, 129, 0.08);
}

.site-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.site-header__portal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.72rem 1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(15, 76, 129, 0.18);
    transition:
        transform var(--transition-medium),
        box-shadow var(--transition-medium),
        background-color var(--transition-medium);
}

.site-header__portal-link:hover,
.site-header__portal-link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 76, 129, 0.22);
}

@media (max-width: 980px) {
    :root {
        --header-height: 74px;
    }

    .site-header__inner {
        flex-wrap: wrap;
        align-items: center;
        padding: 0.7rem 0;
        gap: 0.8rem;
    }

    .site-header__brand-wrap {
        flex: 1 1 auto;
    }

    .site-header__brand {
        gap: 0.7rem;
    }

    .site-header__brand-logo-image {
        width: 50px;
        max-width: 50px;
    }

    .site-header__toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .site-header__nav {
        display: none;
        width: 100%;
        flex: 0 0 100%;
    }

    .site-header__nav.is-open {
        display: block;
    }

    .site-header__nav-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
        width: 100%;
        margin: 0.75rem 0 0;
        padding: 0;
        list-style: none;
    }

    .site-header__nav-item {
        width: 100%;
    }

    .site-header__nav-item--has-children::after {
        display: none;
    }

    .site-header__nav-link {
        width: 100%;
        justify-content: space-between;
        min-height: 2.75rem;
        padding: 0.72rem 0.9rem;
        border-radius: 10px;
    }

    .site-header__subnav {
        position: static;
        top: auto;
        left: auto;
        z-index: auto;
        min-width: 0;
        margin: 0.35rem 0 0;
        padding: 0.2rem 0 0 0.9rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        display: block;
    }

    .site-header__subnav-item + .site-header__subnav-item {
        margin-top: 0.2rem;
    }

    .site-header__subnav-link {
        min-height: 2.35rem;
        padding: 0.55rem 0.8rem;
        font-size: 0.92rem;
        border-left: 2px solid rgba(15, 76, 129, 0.12);
        border-radius: 0 10px 10px 0;
        background: transparent;
    }

    .site-header__subnav-link:hover,
    .site-header__subnav-link:focus-visible {
        background: rgba(15, 76, 129, 0.05);
        box-shadow: none;
    }

    .site-header__actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (min-width: 981px) {
    .site-header__toggle {
        display: none !important;
    }

    .site-header__nav {
        display: block !important;
        width: auto;
        flex: 0 0 auto;
    }

    .site-header__nav-list {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.35rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }
}

@media (max-width: 720px) {
    :root {
        --site-gutter: 0.9rem;
    }

    body {
        font-size: 15.5px;
    }

    .site-header__brand {
        max-width: 100%;
        gap: 0.65rem;
    }

    .site-header__brand-logo-image {
        width: 44px;
        max-width: 44px;
    }

    .site-header__brand-title {
        font-size: 1rem;
    }

    .site-header__brand-tagline {
        font-size: 0.72rem;
    }

    .site-header__nav-link {
        min-height: 2.55rem;
        padding: 0.65rem 0.85rem;
        font-size: 0.92rem;
    }

    .site-header__subnav {
        padding-left: 0.7rem;
    }

    .site-header__subnav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .site-header__portal-link {
        min-height: 2.6rem;
        padding: 0.68rem 0.9rem;
        font-size: 0.88rem;
    }
}

@media (max-width: 520px) {
    .site-header__inner {
        min-height: auto;
    }

    .site-header__brand-logo-image {
        width: 40px;
        max-width: 40px;
    }

    .site-header__brand-title {
        font-size: 0.96rem;
    }

    .site-header__brand-tagline {
        font-size: 0.7rem;
    }

    .site-header__toggle {
        min-height: 2.55rem;
        padding: 0.65rem 0.85rem;
        font-size: 0.92rem;
    }

    .site-header__portal-link {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .site-header__subnav {
        transition: none !important;
    }

    .site-header__portal-link:hover,
    .site-header__portal-link:focus-visible {
        transform: none;
    }
}
