<?php
/**
 * Site header
 *
 * @package JobPortal
 */
?><!doctype html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="profile" href="https://gmpg.org/xfn/11">
    <?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php if ( function_exists( 'wp_body_open' ) ) wp_body_open(); ?>

<header class="jp-site-header">
    <div class="jp-container jp-site-header__inner">

        <a class="jp-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
            <?php if ( has_custom_logo() ) : ?>
                <?php the_custom_logo(); ?>
            <?php else : ?>
                <span class="jp-logo__text"><?php bloginfo( 'name' ); ?></span>
            <?php endif; ?>
        </a>

        <nav class="jp-nav" aria-label="<?php esc_attr_e( 'Primary', 'jobportal' ); ?>">
            <?php
            if ( has_nav_menu( 'primary' ) ) {
                wp_nav_menu( array(
                    'theme_location' => 'primary',
                    'container'      => false,
                    'menu_class'     => 'jp-nav__menu',
                    'depth'          => 1,
                    'fallback_cb'    => false,
                ) );
            } else {
                ?>
                <ul class="jp-nav__menu">
                    <li><a href="#"><?php esc_html_e( 'Our Partners', 'jobportal' ); ?></a></li>
                    <li><a href="#"><?php esc_html_e( 'Newsletter', 'jobportal' ); ?></a></li>
                    <li><a href="#"><?php esc_html_e( 'Contact us', 'jobportal' ); ?></a></li>
                </ul>
                <?php
            }
            ?>
        </nav>

        <div class="jp-header-actions">
            <div class="jp-auth">
                <span class="jp-auth__icon" aria-hidden="true">
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
                </span>
                <?php if ( is_user_logged_in() ) : ?>
                    <a href="<?php echo esc_url( admin_url() ); ?>"><?php esc_html_e( 'Dashboard', 'jobportal' ); ?></a>
                    <a href="<?php echo esc_url( wp_logout_url( home_url( '/' ) ) ); ?>"><?php esc_html_e( 'Logout', 'jobportal' ); ?></a>
                <?php else : ?>
                    <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php esc_html_e( 'Login', 'jobportal' ); ?></a>
                    <a href="<?php echo esc_url( wp_registration_url() ); ?>"><?php esc_html_e( 'Register', 'jobportal' ); ?></a>
                <?php endif; ?>
            </div>

            <div class="jp-social" aria-label="<?php esc_attr_e( 'Social links', 'jobportal' ); ?>">
                <a href="https://x.com/psyjobmarket" aria-label="Twitter" target="_blank" rel="noopener">
                    <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M22.46 6c-.77.35-1.6.58-2.46.69a4.3 4.3 0 0 0 1.88-2.37 8.59 8.59 0 0 1-2.72 1.04 4.28 4.28 0 0 0-7.3 3.9A12.14 12.14 0 0 1 3.1 4.79a4.28 4.28 0 0 0 1.32 5.71 4.27 4.27 0 0 1-1.94-.54v.06a4.28 4.28 0 0 0 3.43 4.2 4.3 4.3 0 0 1-1.93.07 4.29 4.29 0 0 0 4 2.97A8.6 8.6 0 0 1 2 18.95a12.13 12.13 0 0 0 6.56 1.92c7.88 0 12.2-6.53 12.2-12.2 0-.19 0-.37-.01-.55A8.65 8.65 0 0 0 22.46 6z"/></svg>
                </a>
                <a href="https://linkedin.com/company/psyjobmarket" aria-label="LinkedIn" target="_blank" rel="noopener">
                    <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M4.98 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM3 9h4v12H3V9zm7 0h3.8v1.7h.05c.53-1 1.83-2.05 3.77-2.05 4.03 0 4.78 2.65 4.78 6.1V21h-4v-5.4c0-1.29-.02-2.95-1.8-2.85-1.8 0-2.07 1.4-2.07 2.85V21h-4V9z"/></svg>
                </a>
            </div>
        </div>

    </div>
</header>
.jp-institution-link {
    color: var(--jp-primary);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: border-color .15s ease, color .15s ease;
}
.jp-institution-link:hover {
    color: var(--jp-primary-2);
    border-bottom-color: var(--jp-primary-2);
}
