/* ===========================================================================
   Jobs Board — "Hireside" look: cool grey-blue page, navy ink, electric blue
   accent and a sun-yellow highlight. Hard 2px ink borders + offset shadows.
   One stylesheet shared by every page (public, forms, admin, install).
   ======================================================================== */

:root {
    --bg:        #f5f3ee;
    --card:      #ffffff;
    --text:      #161a1d;
    --muted:     #5b625f;
    --border:    #dcd8cc;
    --radius:    4px;
    --radius-sm: 3px;

    --accent:      #0b6b4f;
    --accent-dark: #084f3b;
    --accent-bg:   #e1efe9;
    --sun:         #f2b01e;

    --green:   #0b6b4f;
    --green-bg:#e1efe9;

    --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    --body:    "Inter", "Segoe UI", system-ui, sans-serif;

    --ring:      0 0 0 3px rgba(11, 107, 79, .22);
    --shadow:    0 4px 14px rgba(22, 26, 29, .06);
    --shadow-lg: 0 12px 32px rgba(22, 26, 29, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--body);
    font-size: 1.0625rem;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: min(1120px, 100% - 2.5rem);
    margin: 0 auto;
}

a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------------------------------------------------------------- Header -- */
.site-header { padding: 1.25rem 0; background: var(--card); border-top: 4px solid var(--sun); border-bottom: 1px solid var(--border); margin-bottom: 0; }
.site-header .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}
.brand {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    text-decoration: none;
    color: var(--text);
}
.brand::after {                      /* the sun dot */
    content: "";
    display: inline-block;
    width: .7em; height: .7em; margin-left: .15em;
    background: var(--sun); border-radius: var(--radius);
}
.tagline { display: none; }

.site-nav { margin-left: auto; display: flex; gap: 1.5rem; align-items: center; }
.site-nav a { text-decoration: none; font-weight: 500; color: var(--text); }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-nav .who {
    color: var(--muted); font-size: .8rem; font-weight: 700;
    background: #fff; border: 1px solid var(--border); padding: 4px 10px; border-radius: var(--radius);
}
/* The public "Post a job" link becomes a solid ink pill. */
.site-header .site-nav a[href$="post.php"] {
    background: var(--text); color: #fff;
    padding: .65rem 1.3rem; border-radius: var(--radius); border: 1px solid var(--text);
    font-weight: 700; text-decoration: none;
}
.site-header .site-nav a[href$="post.php"]:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

main.container { padding-top: 30px; padding-bottom: 54px; }
.page-wrap { padding-bottom: 54px; }

/* ---------------------------------------------------------------- Footer -- */
.site-footer { color: var(--muted); font-size: .95rem; padding: 2.5rem 0; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; }

/* -------------------------------------------------------------- Headings -- */
.page-title {
    font-family: var(--display);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.05;
    margin: 0 0 22px;
}
.page-title::after {                 /* short sun underline */
    content: "";
    display: block;
    width: 56px; height: 6px; margin-top: 12px;
    border-radius: var(--radius);
    background: var(--sun);
}

/* ------------------------------------------------------------------ Hero -- */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 {
    font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: 1;
    font-size: clamp(2.8rem, 8vw, 6rem); margin: 0 0 1.25rem; max-width: 12ch;
}
.hero h1::after { display: none; }
.hero .lead { font-size: 1.25rem; color: var(--muted); max-width: 34rem; margin: 0 0 2.25rem; }

.search {
    display: grid; grid-template-columns: 1.4fr 1fr auto; background: var(--card);
    border: 1px solid var(--text); border-radius: var(--radius); padding: .5rem; gap: .5rem;
    box-shadow: none; max-width: 860px;
}
.search label { display: flex; flex-direction: column; padding: .4rem 1rem; border-radius: var(--radius); }
.search label:focus-within { background: var(--bg); }
.search label span { font-size: .85rem; color: var(--muted); font-weight: 500; }
.search input, .search select {
    border: 0; background: transparent; font: 500 1.05rem var(--body); color: var(--text);
    padding: .15rem 0; outline: none; width: 100%;
}
.search input::placeholder { color: #98a09b; }
.search button {
    border-radius: var(--radius); background: var(--accent); border: 1px solid var(--accent); color: #fff;
    font: 700 1rem var(--body); padding: .8rem 2rem; cursor: pointer;
}
.search button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.popular { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--muted); }
.popular a {
    text-decoration: none; color: var(--text); border: 1px solid var(--border); background: var(--card);
    padding: .25rem .85rem; border-radius: var(--radius); font-size: .95rem;
}
.popular a:hover { border-color: var(--text); }

@media (max-width: 760px) {
    .search { grid-template-columns: 1fr; box-shadow: none; }
    .site-nav { gap: 1rem; }
}

/* ========================================================================= */
/*  Two-column layout: sidebar + results                                     */
/* ========================================================================= */
.layout { display: grid; grid-template-columns: 290px 1fr; gap: 28px; align-items: start; }
.content { min-width: 0; }

/* ----------------------------------------------- Sidebar filters (redesign) */
.sidebar {
    position: sticky; top: 20px;
    background: var(--card);
    border: 1px solid var(--text);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}
/* Solid header strip inside the sidebar. */
.sidebar::before {
    content: "Filter jobs";
    display: block;
    padding: 14px 20px;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    background: var(--text);
    letter-spacing: .01em;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 18px 18px 20px;
}
.field {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.field input,
.field select {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .92rem; font-weight: 500;
    background: #faf9f6;
    color: var(--text);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: #94a3b8; font-weight: 400; }
.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: var(--ring);
}

/* Custom dropdown arrow in the accent color. */
.field select,
.stacked-form select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230b6b4f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 34px;
}

.filter-actions {
    display: flex; align-items: center; gap: 12px;
    margin-top: 4px;
}
.filter-actions button {
    flex: 1;
    padding: 11px 18px;
    border: 0; border-radius: var(--radius);
    background: var(--text);
    color: #fff; font-weight: 700; font-size: .95rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.filter-actions button:hover { background: var(--accent-dark); }
.filter-actions button:active { transform: translateY(1px); }
.filter-actions .clear {
    font-size: .85rem; font-weight: 700; color: var(--muted);
    text-decoration: none;
}
.filter-actions .clear:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 760px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}

/* ------------------------------------------------------------ Result meta -- */
.results-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px 16px;
    margin: 0 0 16px;
}
.result-count {
    color: var(--muted); font-size: .9rem; font-weight: 600;
    margin: 0;
}
.result-count strong { color: var(--text); }
.result-count .showing { color: var(--muted); font-weight: 500; }

/* Per-page selector → segmented control (plain links, no JS). */
.per-page { display: flex; align-items: center; gap: 8px; }
.per-page-label {
    font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted);
}
.per-page .pp-opt {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; padding: 5px 10px;
    border: 1px solid var(--border); border-left: 0;
    background: var(--card); color: var(--accent);
    font-size: .85rem; font-weight: 700; text-decoration: none;
    transition: background .15s, color .15s;
}
.per-page .pp-opt:first-of-type { border-left: 1px solid var(--border); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.per-page .pp-opt:last-child    { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.per-page .pp-opt:hover { background: #f1f5f9; }
.per-page .pp-opt.is-active {
    background: var(--accent); border-color: var(--accent); color: #fff; cursor: default;
}

/* Pagination */
.pagination {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-top: 24px;
}
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--card); color: var(--accent);
    font-size: .9rem; font-weight: 700; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.pagination a:hover { background: #f1f5f9; border-color: #cbd5e1; }
.pagination .page-num.is-active {
    background: var(--accent); border-color: var(--accent); color: #fff; cursor: default;
}
.pagination .page-gap {
    border: 0; background: transparent; color: var(--muted);
    min-width: 20px; padding: 0 2px; font-weight: 600;
}
.pagination .page-btn.is-disabled {
    color: #cbd5e1; background: var(--card); cursor: not-allowed;
}
@media (max-width: 480px) {
    .pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 9px; font-size: .85rem; }
}
.empty {
    color: var(--muted);
    background: var(--card);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 26px; text-align: center;
}

/* ================================================================ Job list */
.jobs-panel { background: var(--card); border: 1px solid var(--text); border-radius: var(--radius); overflow: hidden; }
.job-list { list-style: none; padding: 0; margin: 0; }
.job-row { border-bottom: 1px solid var(--border); }
.job-row:last-child { border-bottom: 0; }
.job-row a {
    display: grid; grid-template-columns: 3rem 1fr auto auto; gap: 1.25rem; align-items: center;
    padding: 1.15rem 1.4rem; text-decoration: none; color: inherit;
}
.job-row a:hover { background: #faf9f6; }
.job-row a:hover .job-title { text-decoration: underline; text-underline-offset: 4px; }
.mark {
    width: 3rem; height: 3rem; border-radius: var(--radius); display: grid; place-items: center;
    font: 800 1.1rem var(--display); color: #fff; flex: none;
}
.job-title { font-weight: 700; font-size: 1.15rem; display: block; line-height: 1.3; }
.job-meta { color: var(--muted); font-size: .95rem; display: block; }
.tag { font-size: .85rem; font-weight: 700; padding: .2rem .7rem; border-radius: var(--radius); background: var(--bg); white-space: nowrap; }
.tag.remote { background: var(--sun); }
.salary { font-weight: 700; white-space: nowrap; text-align: right; }

@media (max-width: 760px) {
    .job-row a { grid-template-columns: 3rem 1fr; padding: 1rem; }
    .job-row .tag, .job-row .salary { grid-column: 2; text-align: left; justify-self: start; }
}

/* Chips (detail page meta + tags). */
.job-card-meta {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem;
}
.job-card-meta li {
    background: var(--bg); color: var(--text);
    padding: 4px 12px; border-radius: var(--radius); font-weight: 500;
}
.job-card-meta .salary {
    background: var(--green-bg); color: var(--green); font-weight: 700; text-align: left;
}
.job-card-meta .remote { background: var(--sun); font-weight: 700; }

.tags { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
    font-size: .8rem; font-weight: 700; padding: 4px 11px; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--border); color: var(--muted);
}

/* ============================================================== Job detail */
.breadcrumb { margin-bottom: 18px; font-size: .95rem; font-weight: 700; }
.breadcrumb a { text-decoration: none; color: var(--text); }
.breadcrumb a:hover { text-decoration: underline; text-underline-offset: 4px; }

.job-detail { max-width: 860px; }
.job-detail-header {
    background: var(--card); border: 1px solid var(--text); border-radius: var(--radius);
    box-shadow: none;
    padding: 1.75rem; margin-bottom: 2rem;
}
.job-detail-top { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1.25rem; }
.job-detail-top .mark { width: 4rem; height: 4rem; font-size: 1.5rem; border-radius: var(--radius); }
.job-detail-header .page-title { margin: 0 0 4px; font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.job-detail-header .page-title::after { display: none; }
.job-detail-company { margin: 0; font-size: 1.1rem; font-weight: 500; color: var(--muted); }
.job-detail-company a { color: var(--text); font-weight: 700; text-decoration: none; }
.job-detail-company a:hover { text-decoration: underline; text-underline-offset: 4px; }

.job-detail-body { padding: 0 .25rem; font-size: 1.08rem; }
.job-detail-body h3, .job-detail-body h4 {
    font-family: var(--display); letter-spacing: -.02em; font-size: 1.5rem;
    margin: 1.8em 0 .5em; color: var(--text);
}
.job-detail-body h3:first-child, .job-detail-body h4:first-child { margin-top: 0; }
.job-detail-body ul { padding-left: 1.2em; }
.job-detail-body li { margin: 6px 0; }
.job-detail-body a { font-weight: 700; }

.expired-notice {
    background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239;
    padding: 11px 15px; border-radius: var(--radius-sm);
    font-size: .95rem; font-weight: 600; margin-bottom: 14px;
}

.apply-box {
    margin-top: 2.5rem; padding: 1.75rem; background: var(--text); color: #fff; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.apply-box p { margin: 0; font: 800 1.5rem var(--display); letter-spacing: -.02em; }
.apply-btn {
    display: inline-block; background: var(--sun); color: var(--text); text-decoration: none;
    font-weight: 700; font-size: 1rem; padding: .85rem 2rem; border-radius: var(--radius);
    border: 1px solid var(--sun); transition: background .15s;
}
.apply-btn:hover { background: #fff; border-color: #fff; }

/* ========================================================================= */
/*  Generic stacked forms (admin, post-a-job, install)                       */
/* ========================================================================= */
.admin-narrow { max-width: 580px; }
.stacked-form { display: flex; flex-direction: column; gap: 18px; }
.stacked-form fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px; margin: 0;
    background: var(--card);
    box-shadow: var(--shadow);
    position: relative;
}
.stacked-form legend {
    font-weight: 800; padding: 3px 12px; font-size: .74rem;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--accent-dark);
    background: var(--accent-bg);
    border-radius: var(--radius);
}
.stacked-form label {
    display: block; font-size: .74rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em;
    color: var(--muted); margin-bottom: 14px;
}
.stacked-form label:last-child { margin-bottom: 0; }
.stacked-form input,
.stacked-form select,
.stacked-form textarea {
    display: block; width: 100%; margin-top: 6px;
    padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .95rem; font-weight: 500; color: var(--text); background: #faf9f6;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus {
    outline: none; border-color: var(--accent); background: #fff; box-shadow: var(--ring);
}
.stacked-form small { display: block; margin-top: 5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.stacked-form textarea { resize: vertical; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
@media (max-width: 600px) {
    .row-2, .row-3, .row-4 { grid-template-columns: 1fr; }
}
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.btn-primary {
    align-self: flex-start;
    padding: 12px 28px; border: 0; border-radius: var(--radius);
    background: var(--text); color: #fff; font-weight: 700; font-size: .95rem;
    cursor: pointer; text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: translateY(1px); }

/* --------------------------------------------------------------- Notices -- */
.notice { border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 18px; font-size: .92rem; font-weight: 500; }
.notice ul { margin: 0; padding-left: 1.2em; }
.notice-ok   { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.notice-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice-err  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ========================================================================= */
/*  Admin dashboard                                                          */
/* ========================================================================= */
.admin-main { padding-bottom: 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-section { margin-top: 30px; }
.admin-section h2 { font-size: 1.12rem; margin: 0 0 12px; font-weight: 800; }
.admin-section .count {
    display: inline-block; min-width: 20px; text-align: center;
    background: var(--accent); color: #fff; border-radius: var(--radius);
    font-size: .72rem; font-weight: 700; padding: 2px 9px; margin-left: 6px; vertical-align: middle;
}
.admin-table {
    width: 100%; border-collapse: collapse;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow);
}
.admin-table td { padding: 13px 15px; border-top: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:first-child td { border-top: 0; }
.admin-table tr:hover td { background: #faf9f6; }
.admin-table a { font-weight: 600; text-decoration: none; }
.admin-table a:hover { text-decoration: underline; }
.admin-table .muted { color: var(--muted); font-size: .82rem; margin-top: 3px; font-weight: 400; }
.admin-table .nowrap { white-space: nowrap; color: var(--muted); font-size: .85rem; }
.admin-table .actions { text-align: right; white-space: nowrap; }
.row-expired td { background: #fff7f8; }

.badge { font-size: .66rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius); margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: .03em; }
.badge-exp { background: #ffe4e6; color: #9f1239; }
.badge-ok  { background: #dcfce7; color: #166534; margin-left: 0; margin-right: 4px; }

.admin-head-actions { display: flex; gap: 10px; align-items: center; }

/* JSON import help block */
.import-help { margin-top: 22px; font-size: .9rem; color: var(--muted); }
.import-help summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.import-help code { background: #eef2ff; color: #4338ca; padding: 1px 6px; border-radius: var(--radius); font-size: .85em; }
.code-sample {
    background: #0f172a; color: #e2e8f0;
    padding: 16px 18px; border-radius: var(--radius-sm);
    overflow-x: auto; font-size: .82rem; line-height: 1.5;
    margin-top: 12px;
}
.stacked-form input[type="file"] {
    background: #faf9f6; padding: 9px 11px; cursor: pointer;
}

.inline { display: inline; }
.btn-sm {
    display: inline-block; padding: 6px 12px; margin-left: 4px;
    border: 1.5px solid var(--border); border-radius: var(--radius); background: #fff;
    font-size: .82rem; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-sm:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-ok { border-color: #a7f3d0; color: #047857; }
.btn-ok:hover { background: #ecfdf5; }
.btn-danger { border-color: #fecdd3; color: #be123c; }
.btn-danger:hover { background: #fff1f2; }

/* ---------------------------------------------------------- Small screens -- */
@media (max-width: 480px) {
    .page-title { font-size: 1.5rem; }
    .brand { font-size: 1.15rem; }
    .admin-head { flex-direction: column; align-items: flex-start; }
}

/* Related jobs (job page) */
.related { margin-top: 3rem; }
.related-title { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 1.6rem; margin: 0 0 1rem; }
