/*
 * Individual job board page (job-boards/job-board-page.php), V2 design.
 * Only loaded when listing-parts/v2-switch.php enables it ($config['jobboard_design'], <html class="jbv2">).
 * Roll back with $config['jobboard_design'] = 'v1'. Mostly CSS on the V1 markup, plus a few $jbV2 branches in
 * the page (hero facts, "Latest jobs" link, jobs heading, no AI toggle) and js/jobboard-v2.js ("Show more jobs").
 * The page's own <style> blocks are in the body (after this file) and some elements have inline styles:
 * every rule starts with .jbv2, !important only against inline style attributes.
 */

.jbv2 {
    --jb-brand: #42b983;
    --jb-brand-600: #2f9a6b;
    --jb-brand-700: #23794f;
    --jb-brand-50: #effaf4;
    --jb-brand-100: #dcf2e7;
    --jb-ink: #0f172a;
    --jb-text: #334155;
    --jb-muted: #64748b;
    --jb-subtle: #94a3b8;
    --jb-border: #e2e8f0;
    --jb-border-strong: #cbd5e1;
    --jb-soft: #f8fafc;
    --jb-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
    --jb-width: 1100px;
}

.jbv2 body {
    background: #fff;
    color: var(--jb-text);
}

/* ───────────── Breadcrumb ───────────── */

/* Keeps the page's top margin (clears the fixed header) */
.jbv2 .breadcrumb-nav {
    box-sizing: border-box;
    max-width: var(--jb-width);
    padding: 0 20px;
}

.jbv2 .breadcrumb {
    font-size: 13.5px;
}

/* ───────────── Hero: logo, name, subtitle, facts, actions ───────────── */

.jbv2 .hero-wrapper {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 104px 1fr;
    column-gap: 28px;
    align-items: start;
    max-width: var(--jb-width);
    margin: 12px auto 0 !important;
    padding: 32px 36px;
    border: 1px solid var(--jb-border);
    border-radius: 22px;
    background: linear-gradient(135deg, var(--jb-brand-50) 0%, #fff 55%);
    text-align: left;
}

.jbv2 .hero-wrapper > * {
    grid-column: 2;
}

.jbv2 .hero-wrapper .job-board-logo {
    grid-column: 1;
    grid-row: 1 / span 5;
    margin: 0;
}

.jbv2 .hero-wrapper .job-board-logo img.img-thumbnail {
    box-sizing: border-box;
    width: 104px;
    height: 104px;
    padding: 10px;
    border: 1px solid var(--jb-border);
    border-radius: 22px;
    background: #fff;
    object-fit: contain;
    box-shadow: var(--jb-shadow);
}

.jbv2 .hero-wrapper h1 {
    margin: 4px 0 0;
    text-align: left;
    color: var(--jb-ink);
    font-size: clamp(26px, 3.4vw, 36px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.jbv2 .hero-wrapper > p {
    margin: 8px 0 0 !important;
    color: var(--jb-muted) !important;
    font-size: 17px;
    line-height: 1.55 !important;
}

/* Facts row: 💼 jobs · New job · 🌎 remote · 🚀 Since · 📈 DR · ★ rating */
.jbv2 .jb-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.jbv2 .jb-facts li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--jb-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .85);
    color: var(--jb-text);
    font-size: 13.5px;
    line-height: 1.4;
}

.jbv2 .jb-facts b {
    color: var(--jb-ink);
    font-weight: 700;
}

.jbv2 .jb-fact-fresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--jb-brand-700);
    font-weight: 600;
}

.jbv2 .jb-fact-fresh::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--jb-brand);
    box-shadow: 0 0 0 3px rgba(66, 185, 131, .2);
}

.jbv2 .jb-fact-rating {
    color: #f59e0b;
}

/* Actions: Visit (primary), bookmark heart, Latest jobs */
.jbv2 .hero-wrapper .button-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 22px 0 0;
}

.jbv2 .hero-wrapper .button-wrapper a.go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 26px;
    border-radius: 12px;
    background: var(--jb-brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: none;
    box-shadow: 0 6px 16px rgba(66, 185, 131, .28);
}

.jbv2 .hero-wrapper .button-wrapper a.go:hover {
    background: var(--jb-brand-600);
}

.jbv2 .hero-wrapper .button-wrapper a.go svg.svg-link {
    width: 13px;
    height: 13px;
    fill: #fff;
}

.jbv2 .hero-wrapper .heart-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0;
    border: 1.5px solid var(--jb-border-strong);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.jbv2 .hero-wrapper .heart-wrapper:hover {
    border-color: #f43f5e;
}

.jbv2 .hero-wrapper .heart-wrapper .icon-heart {
    margin: 0;
    font-size: 22px;
}

.jbv2 .jb-jobs-link {
    display: inline-flex;
    align-items: center;
    padding: 11px 18px;
    border: 1.5px solid var(--jb-ink);
    border-radius: 12px;
    color: var(--jb-ink);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.jbv2 .jb-jobs-link:hover {
    background: var(--jb-ink);
    color: #fff;
}

/* JobCopilot line under the hero */
.jbv2 .toptext {
    box-sizing: border-box;
    width: auto;
    max-width: var(--jb-width);
    margin: 14px auto 0;
    color: var(--jb-muted);
    font-size: 13.5px;
}

.jbv2 .toptext a {
    color: var(--jb-brand-700);
    font-weight: 700;
}

/* ───────────── About card: description, tags, social, AI details ───────────── */

/* Same width as the hero, also when the "Featured" sidebar (featured.php) sits next to the card */
.jbv2 .main-content-wrapper {
    box-sizing: border-box;
    max-width: var(--jb-width);
    margin-right: auto;
    margin-left: auto;
    padding-right: 0;
    padding-left: 0;
}

.jbv2 .main-content-wrapper:has(#sidebar) > .content-wrapper {
    margin-right: 20px;
}

@media (max-width: 1140px) {
    .jbv2 .main-content-wrapper {
        padding-right: 12px;
        padding-left: 12px;
    }
}

/* Discontinued board banner (header.php styles every h2: italic, negative margin) */
.jbv2 .sunset-banner {
    max-width: var(--jb-width);
    border-radius: 18px;
}

.jbv2 .sunset-banner h2 {
    display: block;
    margin: 0;
    color: #b91c1c;
    font-size: 18px;
    font-style: normal;
    font-weight: 800;
}

.jbv2 .content-wrapper {
    box-sizing: border-box;
    width: auto;
    max-width: var(--jb-width);
    margin: 24px auto;
    padding: 32px 36px;
    border: 1px solid var(--jb-border);
    border-radius: 22px;
    background: #fff;
    color: var(--jb-text);
    font-size: 16px;
    line-height: 1.7;
}

.jbv2 .content-wrapper h3 {
    margin: 28px 0 8px;
    color: var(--jb-ink);
    font-size: 18px !important;
    font-weight: 800;
    line-height: 1.3;
}

.jbv2 .content-wrapper h3 b {
    font-weight: 800;
}

.jbv2 .content-wrapper > h3:first-child {
    margin-top: 0;
    font-size: 22px !important;
}

/* Tags */
.jbv2 .content-wrapper .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
}

.jbv2 .content-wrapper .badges span {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    line-height: 1;
}

.jbv2 .content-wrapper .badges span a {
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border: 1px solid var(--jb-border);
    border-radius: 999px;
    background: #fff;
    color: var(--jb-text);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.jbv2 .content-wrapper .badges span a:hover {
    border-color: var(--jb-brand);
    background: var(--jb-brand-50);
    color: var(--jb-brand-700);
}

/* Social links: icon + name, the "•" separators (text nodes) hidden with font-size 0 */
.jbv2 .content-wrapper .social-networks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 4px;
    margin: 16px 0 0;
    font-size: 0;
    line-height: 1;
}

.jbv2 .content-wrapper .social-networks svg {
    width: 16px;
    height: 16px;
    margin: 0 0 0 10px;
    fill: var(--jb-ink);
}

.jbv2 .content-wrapper .social-networks svg:first-child {
    margin-left: 0;
}

.jbv2 .content-wrapper .social-networks a {
    color: var(--jb-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.jbv2 .content-wrapper .social-networks a:hover {
    color: var(--jb-brand-700);
    text-decoration: underline;
}

/* AI details: always open (V1 pins its height with an inline style for the collapse animation) */
.jbv2 .AI-description-wrapper {
    height: auto !important;
    margin: 28px 0 0;
    padding: 4px 0 0;
    overflow: visible;
    border-top: 1px solid var(--jb-border);
    background: none;
    font-size: 16px;
    line-height: 1.7;
}

.jbv2 .AI-description-wrapper h3.top-15 {
    margin-top: 26px;
}

/* Key features: checklist, two columns on wide screens */
.jbv2 .AI-description-wrapper ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px 20px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.jbv2 .content-wrapper .AI-description-wrapper ul li {
    position: relative;
    margin: 0;
    padding: 0 0 0 28px;
    list-style: none;
    line-height: 1.5;
}

.jbv2 .content-wrapper .AI-description-wrapper ul li::before {
    content: "✓";
    position: absolute;
    top: 1px;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--jb-brand-100);
    color: var(--jb-brand-700);
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.jbv2 .AI-description-wrapper p {
    margin: 0;
}

/* Domain Rating */
.jbv2 .dr-meter {
    max-width: 320px;
    height: 8px;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--jb-border);
}

.jbv2 .dr-fill {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--jb-brand), var(--jb-brand-600));
}

/* AI tags */
.jbv2 .ai-tag-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 24px;
    padding: 0;
    border: 0;
    background: none;
}

.jbv2 span.AI-tags {
    margin: 0;
    padding: 5px 12px;
    border: 1px solid var(--jb-border);
    border-radius: 999px;
    background: var(--jb-soft);
    color: var(--jb-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* ───────────── Screenshots ───────────── */

.jbv2 #jobboard-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    max-width: var(--jb-width);
    margin: 8px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
}

.jbv2 #jobboard-gallery a {
    display: block;
    overflow: hidden;
    border: 1px solid var(--jb-border);
    border-radius: 14px;
    box-shadow: var(--jb-shadow);
    transition: transform .15s, box-shadow .15s;
}

.jbv2 #jobboard-gallery a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.jbv2 #jobboard-gallery img.jobboard-screenshot {
    display: block;
    width: 260px;
    height: 170px;
    margin: 0;
    object-fit: cover;
    object-position: top;
}

/* ───────────── Latest jobs ───────────── */

/* header.php styles every h2 (italic, hidden on small screens, negative margin): reset */
.jbv2 h2.last-jobs {
    display: block;
    scroll-margin-top: 90px;
    max-width: var(--jb-width);
    margin: 48px auto 0;
    font-style: normal;
    padding: 0 20px;
    color: var(--jb-ink);
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.jbv2 .jb-jobs-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
    padding: 0 12px;
    margin: 8px auto 0;
    color: var(--jb-muted);
    font-size: 14px;
    text-align: center;
}

.jbv2 p.similar-subtitle {
    max-width: 760px;
    margin: 10px auto 0 !important;
    padding: 0 20px;
    color: var(--jb-muted);
    font-size: 15px;
    line-height: 1.6;
}

.jbv2 .jobs-wrapper {
    box-sizing: border-box;
    max-width: 900px;
    margin: 24px auto 0;
    padding: 0 20px;
}

/* One list growing with the page (V1: 500px box with its own scrollbar), js/jobboard-v2.js shows 10 at a time */
.jbv2 .jobs-wrapper .jobs ul {
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.jbv2 .jobs-wrapper .jobs ul > li.jb-hidden {
    display: none;
}

.jbv2 .jobs-wrapper .jobs .job {
    margin: 0 0 10px;
    padding: 14px 52px 12px 14px;
    border: 1px solid var(--jb-border);
    border-radius: 14px;
    background: #fff;
    color: var(--jb-text);
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}

.jbv2 .jobs-wrapper .jobs .job:hover {
    border-color: var(--jb-brand);
    background: #fff;
    box-shadow: var(--jb-shadow);
}

.jbv2 .jobs-wrapper .jobs .job.paid-board {
    border-color: var(--jb-border);
}

.jbv2 .jobs-wrapper .jobs .job .logo {
    width: 42px;
    height: 42px;
    border: 1px solid var(--jb-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    object-fit: contain;
}

.jbv2 .jobs-wrapper .jobs .job .logo.initial {
    background: var(--jb-soft) !important;
    color: var(--jb-muted) !important;
    font-weight: 700;
    line-height: 42px;
}

/* Full titles (V1: one line with "…", 2 lines clamped on mobile) */
.jbv2 .jobs-wrapper .jobs div.title-wrapper {
    display: inline-block;
    width: calc(100% - 60px);
    margin-top: 0;
    vertical-align: top;
    -webkit-line-clamp: unset;
    overflow: visible;
    white-space: normal;
    line-height: 1.4;
}

.jbv2 .jobs-wrapper .jobs .job .title-wrapper a {
    color: var(--jb-muted);
    font-size: 14px;
    text-decoration: none;
}

.jbv2 .jobs-wrapper .jobs div.title-wrapper span {
    display: block;
    margin-top: 2px;
    color: var(--jb-ink);
    font-size: 16px;
    font-weight: 700;
}

.jbv2 .jobs-wrapper .jobs .job:hover div.title-wrapper span {
    color: var(--jb-brand-700);
}

.jbv2 .jobs-wrapper .jobs .jobdescription {
    display: inline-block;
    margin: 8px 0 0 54px;
}

.jbv2 .jobs-wrapper .jobs .viewDescription {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--jb-border);
    border-radius: 999px;
    background: #fff;
    color: var(--jb-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.jbv2 .jobs-wrapper .jobs .viewDescription:hover {
    border-color: var(--jb-brand);
    color: var(--jb-brand-700);
}

.jbv2 .jobs-wrapper .jobs div.badges-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0 54px;
}

.jbv2 .jobs-wrapper .jobs .job .badge {
    max-width: none;
    margin: 0;
    padding: 3px 10px;
    border: 1px solid var(--jb-border);
    border-radius: 999px;
    background: var(--jb-soft);
    color: var(--jb-text);
    font-size: 12.5px;
    font-weight: 500;
}

.jbv2 .jobs-wrapper .jobs .job .badge.time {
    color: var(--jb-muted);
}

.jbv2 .jobs-wrapper .jobs .job .badge.time.new {
    border-color: var(--jb-brand-100);
    background: var(--jb-brand-100);
    color: var(--jb-brand-700);
    font-weight: 700;
}

.jbv2 .jobs-wrapper .jobs .job .share-button {
    top: 14px;
    right: 14px;
    bottom: auto;
    width: 30px;
    height: 30px;
}

/* Bookmark (jbsLpFeedBookmarkButton, js/job-bookmarks.js): left of the share button. jobs.css places
   .job-bookmark top right for the /jobs pages, moved here */
.jbv2 .jobs-wrapper .jobs .job {
    padding-right: 92px;
}

.jbv2 .jobs-wrapper .jobs .job .lp-job-bookmark {
    position: absolute;
    top: 14px;
    right: 52px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--jb-border);
    border-radius: 50%;
    background: #fff;
    color: var(--jb-muted);
    cursor: pointer;
    transition: color .15s, border-color .15s, background-color .15s;
}

.jbv2 .jobs-wrapper .jobs .job .lp-job-bookmark svg {
    width: 16px;
    height: 16px;
}

.jbv2 .jobs-wrapper .jobs .job .lp-job-bookmark svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.jbv2 .jobs-wrapper .jobs .job .lp-job-bookmark:hover,
.jbv2 .jobs-wrapper .jobs .job .lp-job-bookmark:focus-visible {
    border-color: var(--jb-brand);
    color: var(--jb-brand-700);
    outline: none;
}

.jbv2 .jobs-wrapper .jobs .job .lp-job-bookmark.bookmarked {
    border-color: var(--jb-brand);
    background: var(--jb-brand-50);
    color: var(--jb-brand-600);
}

.jbv2 .jobs-wrapper .jobs .job .lp-job-bookmark.bookmarked svg path {
    fill: currentColor;
}

/* "🔖 Saved jobs · n" next to the jobs count */
.jbv2 .jb-saved-jobs {
    white-space: nowrap;
    padding: 2px 10px;
    border: 1px solid var(--jb-brand-100);
    border-radius: 999px;
    background: var(--jb-brand-50);
    color: var(--jb-brand-700);
    font-weight: 700;
    text-decoration: none;
}

.jbv2 .jb-saved-jobs[hidden] {
    display: none;
}

.jbv2 .jb-saved-jobs:hover {
    border-color: var(--jb-brand);
}

/* Native ad row inside the list */
.jbv2 .jobs-wrapper .jobs li.native {
    border-style: dashed;
    background: var(--jb-soft);
}

/* "Show more jobs" (js/jobboard-v2.js) */
.jbv2 .jb-more-jobs {
    display: block;
    margin: 6px auto 0;
    padding: 11px 22px;
    border: 1.5px solid var(--jb-border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--jb-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.jbv2 .jb-more-jobs:hover {
    border-color: var(--jb-brand);
    color: var(--jb-brand-700);
}

/* ───────────── Alternatives ───────────── */

.jbv2 .similar-wrapper {
    box-sizing: border-box;
    max-width: var(--jb-width);
    margin: 56px auto 0;
    padding: 0 20px;
    background: none;
}

.jbv2 .similar-title {
    margin: 0;
    color: var(--jb-ink);
    font-size: clamp(22px, 2.8vw, 28px);
    font-weight: 800;
    line-height: 1.25;
}

.jbv2 .grid-similar {
    gap: 14px;
    margin-top: 22px;
    padding: 0;
    border: 0;
    background: none;
}

.jbv2 .similar-item {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--jb-border) !important;
    border-radius: 16px !important;
    background: #fff;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.jbv2 .similar-item:hover {
    border-color: var(--jb-brand) !important;
    box-shadow: var(--jb-shadow) !important;
    transform: translateY(-1px);
}

.jbv2 .similar-item img {
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    padding: 4px;
    border: 1px solid var(--jb-border);
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}

.jbv2 .similar-item h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.jbv2 .similar-item h3 a {
    color: var(--jb-ink);
}

.jbv2 .similar-item:hover h3 a {
    color: var(--jb-brand-700);
}

.jbv2 .similar-item h3 + div {
    margin-top: 4px;
    color: var(--jb-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ───────────── Mobile ───────────── */

@media (max-width: 700px) {
    .jbv2 .hero-wrapper {
        grid-template-columns: 1fr;
        margin: 8px 12px 0 !important;
        padding: 22px 20px;
        border-radius: 18px;
    }

    .jbv2 .hero-wrapper > *,
    .jbv2 .hero-wrapper .job-board-logo {
        grid-column: 1;
        grid-row: auto;
    }

    .jbv2 .hero-wrapper .job-board-logo img.img-thumbnail {
        width: 72px;
        height: 72px;
        border-radius: 16px;
    }

    .jbv2 .hero-wrapper h1 {
        margin-top: 14px;
    }

    .jbv2 .hero-wrapper > p {
        font-size: 15.5px;
    }

    .jbv2 .hero-wrapper .button-wrapper a.go {
        flex: 1 1 auto;
        justify-content: center;
    }

    .jbv2 .content-wrapper {
        margin: 16px 12px;
        padding: 22px 20px;
        border-radius: 18px;
        font-size: 15px;
    }

    .jbv2 .jobs-wrapper,
    .jbv2 .similar-wrapper {
        padding: 0 12px;
    }

    .jbv2 .jobs-wrapper .jobs .jobdescription,
    .jbv2 .jobs-wrapper .jobs div.badges-wrapper {
        margin-left: 0;
    }

    .jbv2 #jobboard-gallery img.jobboard-screenshot {
        width: calc(50vw - 30px);
        height: 120px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jbv2 #jobboard-gallery a,
    .jbv2 .similar-item {
        transition: none;
    }

    .jbv2 #jobboard-gallery a:hover,
    .jbv2 .similar-item:hover {
        transform: none;
    }
}
