/*
|--------------------------------------------------------------------------
| Page: ADUA Institutional Header - Main Header Styles
| File: assets/css/header.css
| Company: Ygrace Tech
| Author: Ibrahim Olalekan
|
| Purpose:
| Defines the main visual layout and behaviour of the ADUA
| Institutional Header with a refined, reduced-height navbar.
|
| Architecture:
| - Establishes the primary institutional header structure.
| - Supports JavaScript-controlled fixed header positioning.
| - Provides a placeholder-compatible layout to prevent page jumping.
| - Reduces excessive vertical space in the white navigation section.
| - Supports compact header states during scrolling.
| - Controls logo, navigation and action-button alignment.
| - Controls header layering and visual separation.
| - Styles the institutional Apply Now action button.
| - Provides accessible hover, focus and active states.
| - Uses shared design tokens from variables.css.
| - Matches the structural markup generated by header.php.
| - Keeps styles scoped to the ADUA header plugin.
| - Respects the WordPress administration bar.
|
| Version: 1.4.0
| Timestamp: 2026-11-21
|--------------------------------------------------------------------------
*/

/* =========================================================
   HEADER WRAPPER
========================================================= */

.adua-ih-wrapper {
    width: 100%;
    position: relative;
    z-index: var(--adua-z-index-header);
}

.adua-ih-header {
    width: 100%;
    position: relative;
    box-sizing: border-box;

    background: var(--adua-white);
    color: var(--adua-text);

    z-index: var(--adua-z-index-header);

    transition: var(--adua-transition-header);
}

/* =========================================================
   MAIN HEADER SURFACE
========================================================= */

/*
 * Reduced desktop header height.
 *
 * The white navigation section now has a controlled
 * minimum height instead of inheriting an unnecessarily
 * large global header dimension.
 */

.adua-ih-main-header {
    width: 100%;
    min-height: 88px;

    position: relative;

    display: flex;
    align-items: center;

    box-sizing: border-box;

    background: var(--adua-white);
    border-bottom: var(--adua-border-width) solid var(--adua-border);

    transition:
        min-height var(--adua-transition-normal),
        box-shadow var(--adua-transition-normal);
}

/* =========================================================
   HEADER CONTAINER
========================================================= */

.adua-ih-container {
    width: 100%;
    max-width: var(--adua-container-width);

    margin-right: auto;
    margin-left: auto;

    padding-right: var(--adua-container-padding);
    padding-left: var(--adua-container-padding);

    box-sizing: border-box;
}

.adua-ih-main-header > .adua-ih-container {
    min-height: inherit;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: var(--adua-space-6);
}

/* =========================================================
   FIXED HEADER SUPPORT
========================================================= */

/*
 * Sticky positioning is controlled by header.js.
 *
 * The JavaScript controller will:
 * - Detect when the header reaches the viewport top.
 * - Add the is-fixed class.
 * - Insert a placeholder before the header.
 * - Preserve the original document layout.
 *
 * The is-sticky class remains the setting-enabled marker.
 * It must not independently apply position: fixed.
 */

.adua-ih-header.is-sticky {
    width: 100%;
}

/*
 * Active fixed state.
 *
 * This state is applied only after the header reaches
 * its configured sticky activation point.
 */

.adua-ih-header.is-fixed {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    width: 100%;

    margin: 0;

    box-shadow: var(--adua-shadow-header);

    z-index: var(--adua-z-index-header);
}

/*
 * Placeholder inserted by header.js.
 *
 * Its height is calculated from the original header height
 * so the page content does not jump when the header becomes fixed.
 */

.adua-ih-sticky-placeholder {
    display: block;

    width: 100%;
    height: 0;

    margin: 0;
    padding: 0;

    border: 0;

    visibility: hidden;
    pointer-events: none;
}

/* =========================================================
   BRAND AND LOGO SIZING
========================================================= */

/*
 * Keep the institutional logo proportionate to the
 * reduced white navigation section.
 *
 * These limits prevent oversized branding from forcing
 * the navbar to become unnecessarily tall.
 */

.adua-ih-brand-logo {
    max-height: 64px;
    width: auto;
    object-fit: contain;
}

/* =========================================================
   COMPACT HEADER STATE
========================================================= */

/*
 * The header and main-header classes are on the same element.
 * Do not use a descendant selector between these two classes.
 */

.adua-ih-header.is-compact.adua-ih-main-header {
    min-height: 68px;

    box-shadow: var(--adua-shadow-soft);
}

.adua-ih-header.is-compact .adua-ih-brand-logo {
    max-height: 48px;
}

.adua-ih-header.is-compact .adua-ih-brand-name {
    font-size: var(--adua-font-size-lg);
}

/*
 * Keep the fixed header shadow visible in compact state.
 */

.adua-ih-header.is-fixed.is-compact {
    box-shadow: var(--adua-shadow-header);
}

/* =========================================================
   HEADER NAVIGATION AREA
========================================================= */

/*
 * Matches the actual class in templates/header.php:
 * adua-ih-header-navigation-area
 */

.adua-ih-header-navigation-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: var(--adua-space-5);

    min-width: 0;
    flex: 1 1 auto;
}

/* =========================================================
   HEADER ACTIONS
========================================================= */

.adua-ih-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: var(--adua-space-3);

    flex-shrink: 0;
}

/* =========================================================
   INSTITUTIONAL APPLY NOW BUTTON
========================================================= */

.adua-ih-apply-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 0 20px;

    background: var(--adua-primary, #123D2D);
    color: #ffffff !important;

    border: 1px solid var(--adua-primary, #123D2D);
    border-radius: 5px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;

    text-decoration: none !important;
    white-space: nowrap;

    box-shadow: 0 4px 12px rgba(18, 61, 45, 0.12);

    cursor: pointer;

    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.adua-ih-apply-button:hover {
    background: var(--adua-accent, #A78945);
    border-color: var(--adua-accent, #A78945);

    color: #ffffff !important;

    box-shadow: 0 6px 16px rgba(18, 61, 45, 0.18);

    transform: translateY(-2px);
}

.adua-ih-apply-button:active {
    transform: translateY(0);

    box-shadow: 0 2px 6px rgba(18, 61, 45, 0.12);
}

.adua-ih-apply-button:focus {
    outline: none;
}

.adua-ih-apply-button:focus-visible {
    outline: 3px solid var(--adua-accent, #A78945);
    outline-offset: 4px;
}

/* Button text */

.adua-ih-apply-button-text {
    display: inline-block;
}

/* Arrow indicator */

.adua-ih-apply-button-arrow {
    display: inline-block;

    font-size: 18px;
    font-weight: 400;
    line-height: 1;

    transition: transform 0.25s ease;
}

.adua-ih-apply-button:hover .adua-ih-apply-button-arrow {
    transform: translateX(4px);
}

/* Compact header button */

.adua-ih-header.is-compact .adua-ih-apply-button {
    min-height: 38px;

    padding-right: 16px;
    padding-left: 16px;

    font-size: 13px;
}

/* =========================================================
   HEADER SEPARATION AND LAYERING
========================================================= */

.adua-ih-header::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: -1px;

    height: 1px;

    background: rgba(18, 61, 45, 0.04);

    pointer-events: none;
}

/* =========================================================
   ADMIN BAR COMPATIBILITY
========================================================= */

/*
 * WordPress desktop administration bar.
 */

body.admin-bar .adua-ih-header.is-fixed {
    top: 32px;
}

/*
 * WordPress mobile administration bar.
 */

@media screen and (max-width: 782px) {

    body.admin-bar .adua-ih-header.is-fixed {
        top: 46px;
    }

}

/* =========================================================
   TABLET LAYOUT
========================================================= */

@media (max-width: 1024px) {

    .adua-ih-main-header {
        min-height: 82px;
    }

    .adua-ih-container {
        padding-right: 28px;
        padding-left: 28px;
    }

    .adua-ih-main-header > .adua-ih-container {
        gap: var(--adua-space-5);
    }

    .adua-ih-brand-logo {
        max-height: 58px;
    }

    .adua-ih-header-navigation-area {
        gap: var(--adua-space-3);
    }

    .adua-ih-apply-button {
        min-height: 40px;

        padding-right: 16px;
        padding-left: 16px;

        font-size: 13px;
    }

}

/* =========================================================
   MOBILE LAYOUT
========================================================= */

@media (max-width: 767px) {

    .adua-ih-container {
        padding-right: 20px;
        padding-left: 20px;
    }

    .adua-ih-main-header {
        min-height: 70px;
    }

    .adua-ih-main-header > .adua-ih-container {
        gap: var(--adua-space-3);
    }

    .adua-ih-brand-logo {
        max-height: 48px;
    }

    .adua-ih-header.is-compact.adua-ih-main-header {
        min-height: 64px;
    }

    .adua-ih-header.is-compact .adua-ih-brand-logo {
        max-height: 44px;
    }

    .adua-ih-header-navigation-area {
        flex: 0 0 auto;
    }

    /*
     * The desktop action area is hidden on mobile.
     * Mobile CTA placement remains the responsibility
     * of the mobile navigation template.
     */

    .adua-ih-header-actions {
        display: none;
    }

    .adua-ih-apply-button {
        min-height: 40px;

        padding-right: 16px;
        padding-left: 16px;

        font-size: 13px;
    }

}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .adua-ih-header,
    .adua-ih-main-header,
    .adua-ih-apply-button,
    .adua-ih-apply-button-arrow {
        transition: none;
    }

    .adua-ih-apply-button:hover {
        transform: none;
    }

}
