/*
 * TPAL Custom Styles (V4)
 */

:root {
    --tpal-header-offset: 0px;
    --tpal-admin-bar-offset: 0px;
}

body.tpal-has-sticky-header {
    padding-top: calc(var(--tpal-header-offset) + var(--tpal-admin-bar-offset));
}

body.wp-admin.tpal-has-sticky-header {
    padding-top: 0;
}

.tpal-header {
    background-color: #1133AF;
    color: #FFFFFF;
    padding: 18px clamp(16px, 4vw, 48px);
}

body:not(.wp-admin) .tpal-header {
    position: fixed;
    top: var(--tpal-admin-bar-offset);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.wp-admin .tpal-header {
    position: relative;
    box-shadow: none;
}

.tpal-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    font-family: 'Poppins', sans-serif;
}

.tpal-header__logo img {
    display: block;
    width: clamp(180px, 20vw, 280px);
    height: auto;
}

/* 1. Target our hard-coded nav container */
.tpal-header-nav {
    display: flex;
    justify-content: flex-end; /* Aligns menu to the right */
    flex: 1 1 auto;
    align-self: flex-end;
}

/* 2. Target the list and make it a horizontal flex row */
.tpal-header-nav ul {
    display: flex; /* Makes list items horizontal */
    flex-wrap: wrap; /* Allows wrapping on small screens */
    list-style-type: none; /* Removes bullets */
    margin: 0;
    padding: 0;
    gap: 8px;
}

/* 3. Target the links inside the list */
.tpal-header-nav li a {
    font-family: 'Poppins', sans-serif;
    color: #FFFFFF;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 3px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: block; /* Ensures padding is respected */
}

/* 4. Navigation Hover State */
.tpal-header-nav li a:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.15); /* Subtle white highlight */
}

/*
 * 5. Navigation Active State (Current Page)
 *
 * This will be added in the next step with JavaScript.
 * The CSS rule will look like this:
 *
 * .tpal-header-nav li.current-page-link a {
 * background-color: #FFFFFF;
 * color: #1133AF;
 * font-weight: 600;
 * }
 */

@media (max-width: 782px) {
    .tpal-header__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .tpal-header-nav {
        width: 100%;
        justify-content: flex-start;
        align-self: auto;
    }

    .tpal-header-nav ul {
        gap: 4px;
    }
}
