/*
 * CareerConnect overrides, layered on top of the JobBox theme's style.css.
 *
 * Kept as a separate file so the theme stylesheet stays untouched and can be
 * replaced wholesale. Linked after it in resources/views/app.blade.php.
 *
 * Rule of thumb: nothing here changes the theme's type scale. Where
 * CareerConnect's longer labels do not fit the theme's spacing, the layout
 * gives way, not the typography.
 *
 * The public site and the dashboard ship different builds of the theme and
 * share class names (.header-right, .nav-main-menu), so anything that targets
 * page chrome is scoped to `body:not(.dashboard-area)` -- the dashboard sets
 * that class on <body>.
 */

/* -------------------------------------------------------------- the brand */

/*
 * The logo stands where the theme's jobhub-logo.svg (139x36) did. The
 * CareerConnect lockup is two lines deep, so it is squarer: at 46px tall it
 * draws about 108px wide, inside the 139px the theme reserves for the logo,
 * so the menu beside it keeps its place. Sized by height only, so the file's
 * own 600px width never leaks into the layout. Used in both areas, so it is
 * not scoped.
 */
.brand-logo img {
    display: block;
    width: auto;
    height: 46px;
}

/* Phones give the logo the row with the burger icon, so it steps down. */
@media (max-width: 575px) {
    .brand-logo img {
        height: 38px;
    }
}

/* ------------------------------------------------------- public site only */

/*
 * The theme switches to the burger menu below 1200px, and CareerConnect keeps
 * that switch. An earlier eight-item menu did not fit until about 1400px, so
 * the burger used to take over there; with the six items in lib/nav.js the
 * menu comes to about 610px against 680px of room at 1200px, next to the logo
 * and Log In / Register / Post a Job. So 1280px and 1366px laptops get the
 * full menu again.
 */

/*
 * One even 30px gap between every item. The theme hangs the dropdown arrow
 * outside the link (position: absolute; right: -19px), past the <li>'s own
 * padding, so on its own it eats 19px of the gap after every item with a
 * sub-menu -- at the old 12px padding that left the arrow about 5px from the
 * next label. Items with children reserve those 19px on the right, so the gap
 * after the arrow matches the gap after a plain label.
 */
@media (min-width: 1200px) {
    body:not(.dashboard-area) .nav-main-menu .main-menu > li {
        padding-left: 15px;
        padding-right: 15px;
    }

    body:not(.dashboard-area) .nav-main-menu .main-menu > li.has-children {
        padding-right: calc(15px + 19px);
    }
}

/*
 * The theme opens a dropdown on :hover only, so keyboard users could never
 * reach its links. PublicHeader adds `menu-open` while a dropdown holds
 * keyboard focus (and drops it on Escape), and this opens it the way :hover
 * does.
 */
body:not(.dashboard-area) .header .main-menu li.menu-open > ul {
    opacity: 1;
    visibility: visible;
    margin-top: 15px;
}

/*
 * The burger is a <button> so it can be reached and named; it keeps the
 * theme's look by dropping the browser's button chrome.
 */
button.burger-icon,
.mobile-header-wrapper-style .mobile-menu li.has-children button.menu-expand {
    padding: 0;
    border: 0;
    background: transparent;
}

/*
 * The theme reserves 215px on the right of the header, which fits its two
 * items (Register, Sign in). CareerConnect has three — Log In, Register and
 * Post a Job — and the third wrapped onto a second row, making the whole
 * header 24px taller than the theme's 108px. There is room for it: the logo,
 * menu and these three come to about 1260px of the 1326px available.
 */
body:not(.dashboard-area) .header .main-header .header-right {
    min-width: 270px;
}

body:not(.dashboard-area) .header .main-header .header-right .block-signin {
    white-space: nowrap;
}

/*
 * The theme's location field is a <select>, which it sizes at 43px.
 * CareerConnect takes free text there ("City, country or remote"), and an
 * <input> is 50px — whose extra inline baseline space stretched the whole
 * search row from 50px to 66px. Laying the wrapper out as flex drops the
 * baseline gap, and the max-width keeps the row's proportions the theme's.
 */
.banner-hero .block-banner .form-find .box-location {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 185px;
}

/*
 * "Search Jobs" is two words where the theme's button said "Search", and it
 * wrapped inside the theme's 122px minimum, taking the search row from 50px
 * to 66px with it.
 */
.banner-hero .block-banner .form-find .btn-find {
    white-space: nowrap;
}

/*
 * The theme's footer runs 24/14/14/14/14/20 per cent, where the last column
 * was a wider "Download App" panel. CareerConnect's five columns are all link
 * lists, so they get equal widths and the brand block takes the slack.
 */
@media (min-width: 992px) {
    .footer .footer-col-1 {
        width: 30%;
    }

    .footer .footer-col-6 {
        width: 14%;
    }
}

/*
 * Section intros.
 *
 * The theme's intros are a line or two, broken by hand with
 * `<br class="d-none d-lg-block">`. CareerConnect's copy is longer, and run to
 * the container's full 1326px it both reads loose and collides with the
 * carousel arrows that `.style-nav-top` parks 30px above the slider, top
 * right. Capping the measure fixes the reading and the collision at once.
 */
.section-intro {
    max-width: 760px;
}

/*
 * `.style-nav-top` means "arrows above the slider". The theme's base
 * `.box-swiper` rule also pulls them up 55px, though, so its `top: -30px`
 * actually lands them 85px above the carousel — level with the section intro,
 * floating in the white space beside the copy instead of reading as the
 * carousel's own controls. Zeroing that margin puts them where the class says,
 * and the padding gives them a lane clear of the first row of cards.
 */
.box-swiper.style-nav-top {
    padding-top: 20px;
}

.box-swiper.style-nav-top .swiper-button-next,
.box-swiper.style-nav-top .swiper-button-prev {
    top: -30px;
    margin-top: 0;
}

/*
 * Career Advice puts its arrows at the top right, over the intro's line. The
 * 760px cap clears them on a wide screen but not on a narrow one, where the
 * container is smaller than the cap — so there the measure is proportional
 * instead, keeping the top-right corner free.
 */
@media (min-width: 992px) {
    #career-advice .section-intro {
        max-width: min(760px, 68%);
    }
}

/* Below that the arrows go: a carousel is swiped on a touch screen, and the
   theme does the same with its own `.swiper-button-next-1` pair. */
@media (max-width: 991.98px) {
    #career-advice .swiper-button-next,
    #career-advice .swiper-button-prev {
        display: none;
    }
}

/*
 * Swiper's own arrow glyph, on top of the theme's.
 *
 * Swiper 14 injects `<svg class="swiper-navigation-icon">` into every
 * navigation button: an 11x20 chevron stretched to the button's 40x44 and
 * filled with its default blue. The theme draws these buttons with its own
 * background image — a pale circle and a grey chevron — and blanks the
 * `::after` glyph that older Swiper versions used, but it predates the
 * injected SVG, so the big blue arrow sat over the icon that was already
 * there.
 */
.swiper-navigation-icon {
    display: none;
}

/*
 * The industry carousel's arrows.
 *
 * The theme parks `.box-swiper` arrows 65px outside the slider on each side.
 * That works when the slider spans the container, but in this band it sits in
 * the right-hand column — so the left arrow landed on top of the heading in
 * the left column. Both move to the top right of the carousel, the same
 * arrangement `.style-nav-top` uses elsewhere in the theme.
 */
.bg-brand-2 .box-swiper .swiper-button-prev-explore,
.bg-brand-2 .box-swiper .swiper-button-next-explore {
    top: -30px;
    margin-top: 0;
    left: auto;
}

/* Same lane as the Career Advice slider: with the arrows parked above the
   carousel, the cards need to start below them rather than 9px underneath. */
.bg-brand-2 .box-swiper {
    padding-top: 20px;
}

.bg-brand-2 .box-swiper .swiper-button-prev-explore {
    right: 50px;
}

.bg-brand-2 .box-swiper .swiper-button-next-explore {
    right: 0;
}

/*
 * The job-alerts band.
 *
 * `.box-newsletter` carries no horizontal padding, so anything that is not
 * explicitly centred spans the panel edge to edge: the "Interested in" label
 * and its rows started hard against the left edge, clipped. The theme centres
 * its one child, `.box-form-newsletter`, at 610px — so the preferences match
 * that column and sit under the form they belong to.
 */
.box-newsletter .newsletter-copy {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.box-newsletter .newsletter-preferences {
    max-width: 610px;
    margin-left: auto;
    margin-right: auto;
}

.box-newsletter .newsletter-preferences label {
    cursor: pointer;
}

/* Checkbox rows in the job-alerts band. */
.box-newsletter input[type='checkbox'] {
    accent-color: #ffffff;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

/* ------------------------------------------------- missing utilities */

/*
 * The theme ships `.d-flex` but none of Bootstrap's flex alignment utilities,
 * and no `.h-100`. Markup using them — the theme's own included, such as the
 * candidate card's `employers-info align-items-center` — silently got no
 * alignment at all. These are the ones this site relies on.
 */
.h-100 {
    height: 100%;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.justify-content-between {
    justify-content: space-between;
}

/* ------------------------------------------------- sections added for CC */

/*
 * Cards in the sections added for CareerConnect sit in equal-height rows, so
 * the theme's card frame needs to fill its column rather than hug its text.
 */
.card-grid-2.h-100 {
    display: flex;
    flex-direction: column;
}

.card-grid-2.h-100 .card-block-info {
    flex: 1 1 auto;
}

/*
 * A secondary button for the dark bands. The theme only ships filled buttons
 * and a light-background outline (.btn-border), neither of which reads on
 * bg-brand-2.
 */
.btn-border-white {
    border: 1px solid #ffffff;
    color: #ffffff;
    background: transparent;
}

.btn-border-white:hover {
    background: #ffffff;
    color: #05264e;
}

/*
 * `.h1`: the theme's h1 type on an element that is not a heading.
 *
 * The homepage's figures and step numerals were <h1>s in the theme, which gave
 * the page eight top-level headings. They are <div class="h1"> now, and this
 * repeats style.css's `h1` rule so they look exactly as before. No colour here:
 * the elements carry their own (.color-brand-2, .number-element), and a colour
 * on this selector would outrank them.
 */
body:not(.dashboard-area) .h1 {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: 56px;
    line-height: 71px;
    margin: 0;
}

body:not(.dashboard-area) .h1.number-element {
    line-height: 110px;
    margin-bottom: 20px;
}

/*
 * The other way round: a page's main heading that the theme drew as an h3
 * (e.g. "45 Jobs Available Now" on /jobs). It is an <h1 class="h3"> now, so
 * the page has a top-level heading, and this repeats style.css's `h3` rule so
 * it keeps the h3 size instead of the theme's 56px h1.
 */
body:not(.dashboard-area) h1.h3 {
    font-weight: 700;
    font-size: 28px;
    line-height: 35px;
    margin: 0;
}

/* The same for a main heading the theme drew as an h2 (the sign-in page). */
body:not(.dashboard-area) h1.h2 {
    font-weight: 700;
    font-size: 36px;
    line-height: 45px;
    margin: 0;
}

/* style.css shrinks h2 on phones; an h1.h2 follows it. */
@media (max-width: 767.98px) {
    body:not(.dashboard-area) h1.h2 {
        font-size: 25px;
        line-height: 34px;
    }
}

@media (max-width: 484.98px) {
    body:not(.dashboard-area) h1.h2 {
        font-size: 20px;
        line-height: 28px;
    }
}

/* And as an h5: the name on company and candidate profiles. */
body:not(.dashboard-area) h1.h5 {
    font-weight: 700;
    font-size: 20px;
    line-height: 26px;
    margin: 0;
}

/* The rule above outranks `.f-18`, so the profile names restate it. */
body:not(.dashboard-area) h1.h5.f-18 {
    font-size: 18px;
}

/*
 * The dashboard's page titles (DashboardLayout's breadcrumbTitle, the
 * dashboard home's greeting), repeating the dashboard build's h3. No margin
 * here: the titles carry the theme's !important spacing utilities.
 */
body.dashboard-area h1.h3 {
    font-weight: 700;
    font-size: 28px;
    line-height: 35px;
}

/*
 * Pricing's featured plan. The theme's `.most-popular` card turns its type
 * white but, in this build, sets no background (the demo drew one from an
 * image that was not shipped), so the card read as white on white. Brand navy
 * fills it; the feature list and the badge, which the theme leaves grey and
 * unfilled, follow.
 */
body:not(.dashboard-area) .block-pricing .most-popular {
    background-color: #05264e;
    border-color: #05264e;
}

body:not(.dashboard-area) .block-pricing .most-popular .list-package-feature li {
    color: #ffffff;
}

body:not(.dashboard-area) .block-pricing .most-popular .btn-white-sm {
    background-color: #ffffff;
    cursor: default;
}

/*
 * The photo upload on /my-account. The public build has no upload-box styles,
 * so the raw file input kept the browser's width (the page scrolled sideways
 * on a 375px phone) and the theme's "Upload" button beside it did nothing.
 * The input is now hidden but stays focusable, and its <label> is the button.
 */
body:not(.dashboard-area) .avatar-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

body:not(.dashboard-area) .avatar-upload label.btn {
    cursor: pointer;
}

/* The label shows where keyboard focus is, since the input itself is hidden. */
body:not(.dashboard-area) .avatar-upload-input:focus-visible + label {
    outline: 2px solid #3c65f5;
    outline-offset: 2px;
}

body:not(.dashboard-area) .avatar-upload-input:disabled + label {
    cursor: progress;
    opacity: 0.7;
}

/*
 * The theme's custom checkbox hides the real input at 0x0, but its own
 * `.form-group input { width: 100% }` comes later at the same specificity and
 * wins inside a form group. The invisible input, offset by the label's 35px
 * padding, then stuck out of the page: /my-account scrolled sideways on phones.
 */
body:not(.dashboard-area) .form-group .cb-container input {
    width: 0;
    height: 0;
}

/*
 * Footer entries that have no page yet: the theme's link type, but not a link,
 * so nothing suggests a click will go anywhere.
 */
.footer .menu-footer li .menu-footer-soon {
    color: #4f5e64;
    font-size: 14px;
    cursor: default;
}

/* Candidate cards (homepage and /candidates): three lines of bio, so one long bio can't stretch its row. */
.card-grid-2 .card-block-info .candidate-bio {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
