/*
Theme Name:   AfriConsultancy Job Board
Theme URI:    https://africonsultancy.co.za/
Description:  Clean professional job board for AfriConsultancy
Author:       Berzel Chafa
Author URI:   https://africonsultancy.co.za/
Template:     vw-job-board
Version:      1.0.3
License:      GPL v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  africonsultancy-job-board
*/

/* =========================================================
   BRAND VARIABLES – SINGLE SOURCE OF TRUTH
   ========================================================= */
:root {
    --afri-primary:   #003366;
    --afri-secondary: #00A859;
    --afri-accent:    #FF9900;
    --afri-light:     #F5F7FA;
    --afri-gray:      #6b7280;
    --afri-border:    #e0e6ef;
}

/* =========================================================
   GLOBAL CLEANUP – REMOVE UNWANTED ELEMENTS
   ========================================================= */

/* Breadcrumbs */
.vw_job_board_the_breadcrumb,
.breadcrumb,
.breadcrumbs,
.yoast-breadcrumb,
.woocommerce-breadcrumb {
    display: none !important;
}

/* Social icons */
#topbar-social-icons,
#footer-icon,
.social-icons,
.social-links,
.header-social,
.footer-social,
[class*="social-"] {
    display: none !important;
}

/* WooCommerce sidebars */
#woocommerce-shop-sidebar,
#woocommerce-single-sidebar,
.woocommerce-sidebar,
.widget-area.woocommerce {
    display: none !important;
}

/* Theme credits / promotions / upgrade notices */
.powered-by,
.theme-credit,
.vw-credit,
.copyright a[href*="vwthemes"],
footer a[href*="vwthemes"],
footer a[href*="wordpress.org"],
.upgrade-btn,
.bundle-btn,
.demo-btn,
.import-btn,
.pro-button,
.premium-feature,
[class*="upgrade-"],
[class*="pro-"],
.import-demo-link,
.demo-import,
.vw-demo-link {
    display: none !important;
}

/* Featured / related / application count */
.job_listing-badge,
.featured-job,
.job-featured,
.featured-badge,
.related-jobs,
.similar-jobs,
.job-related,
.related.products,
.application-count,
.job-application-count,
.applications-count,
.entry-applications {
    display: none !important;
}

/* WP Job Manager login / sign-in notice */
.account-signin,
.submit_job_form_login {
    display: none !important;
}

/* =========================================================
   JOB SUBMIT FORM (#submit-job-form) – TWO‑COLUMN GRID
   ========================================================= */
#submit-job-form,
.africonsultancy-form-wrapper {
    max-width: 960px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

/* Apply grid to the form itself */
#submit-job-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem 2rem !important;
}

/* Reset any fieldset styles that might interfere */
#submit-job-form fieldset {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Fields that should span both columns */
#submit-job-form .full-width,
#submit-job-form .fieldset-job_type,
#submit-job-form .fieldset-job_description,
#submit-job-form .fieldset-terms,
#submit-job-form .submit-row {
    grid-column: 1 / -1 !important;
}

/* Stack on mobile */
@media (max-width: 640px) {
    #submit-job-form {
        grid-template-columns: 1fr !important;
    }
}

/* Headings inside the form */
#submit-job-form h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--afri-primary);
    margin: 35px 0 20px;
    border-bottom: 2px solid var(--afri-secondary);
    padding-bottom: 0.5rem;
}

#submit-job-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 16px;
    color: var(--afri-primary);
}

#submit-job-form .required {
    color: #dc2626;
    margin-left: 4px;
}

#submit-job-form input[type="text"],
#submit-job-form input[type="email"],
#submit-job-form input[type="url"],
#submit-job-form input[type="file"],
#submit-job-form input[type="password"],
#submit-job-form textarea,
#submit-job-form select {
    width: 100%;
    max-width: 100%;
    padding: 0.9rem 1.1rem;
    border: 2px solid var(--afri-border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fafcff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

#submit-job-form input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

#submit-job-form textarea {
    min-height: 200px;
    resize: vertical;
}

#submit-job-form input:focus,
#submit-job-form textarea:focus,
#submit-job-form select:focus {
    border-color: var(--afri-secondary);
    box-shadow: 0 0 0 3px rgba(0,168,89,0.12);
    outline: none;
}

/* Company logo field – nicer drop-zone style */
.fieldset-company_logo {
    padding: 1.8rem;
    background: var(--afri-light);
    border: 2px dashed var(--afri-secondary);
    border-radius: 12px;
    text-align: center;
}

.fieldset-company_logo input[type="file"] {
    max-width: 400px;
    margin: 10px auto;
    display: block;
}

.fieldset-company_logo .description {
    margin-top: 0.8rem;
    color: var(--afri-gray);
    font-size: 0.95rem;
}

.job-manager-uploaded-file {
    margin-top: 15px;
}

.job-manager-uploaded-file img {
    max-width: 180px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.job-manager-uploaded-file a.remove-file {
    color: #d32f2f;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
}

/* Submit button */
#submit-job-form .button,
#submit-job-form input[type="submit"] {
    background: linear-gradient(135deg, var(--afri-primary), var(--afri-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#submit-job-form .button:hover,
#submit-job-form input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,51,102,0.22);
}

/* =========================================================
   JOB DASHBOARD
   ========================================================= */
.jm-dashboard {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.jm-dashboard table {
    border: none;
    width: 100%;
}

.jm-dashboard th {
    background: var(--afri-primary);
    color: #ffffff;
    font-weight: 600;
    padding: 12px;
}

/* =========================================================
   FOOTER STYLING
   ========================================================= */
#footer {
    background: #1a1a1a;
    color: #999;
    padding: 40px 0;
}

.copyright-wrapper {
    background: #222;
    padding: 20px 0;
    text-align: center;
}

.copyright p {
    color: #ccc;
    font-size: 14px;
    margin: 0;
}

/* =========================================================
   SINGLE JOB LISTING (.single-job-listing)
   ========================================================= */
.single-job-listing {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.job-header {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--afri-border);
}

.company-logo img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.job-title {
    margin: 0 0 0.6rem;
    font-size: 2.6rem;
    color: var(--afri-primary);
    line-height: 1.15;
}

.company-info {
    font-size: 1.3rem;
    color: var(--afri-gray);
}

.apply-button-wrapper {
    margin-left: auto;
}

.job-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.8rem;
    background: var(--afri-light);
    border-radius: 12px;
}

.meta-item {
    text-align: center;
}

.meta-item .label {
    display: block;
    font-size: 0.95rem;
    color: var(--afri-gray);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.type-badge {
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    background: var(--afri-secondary);
    color: white;
    font-weight: 600;
}

.job-description {
    line-height: 1.8;
    font-size: 1.08rem;
    color: #374151;
}

.job-description h2,
.company-links h3 {
    color: var(--afri-primary);
    margin: 3rem 0 1.5rem;
    font-size: 1.9rem;
}

/* =========================================================
   JOB LISTINGS GRID / CARDS
   ========================================================= */
.job-listings.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.8rem;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.job-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.job-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.14);
}

.job-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.job-card-logo {
    width: 80px;
    height: 80px;
    margin: 1.5rem 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--afri-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--afri-secondary);
}

.job-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.job-card-content {
    padding: 1.2rem 1.5rem 1.5rem;
    flex: 1;
}

.job-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    color: var(--afri-primary);
    line-height: 1.3;
}

.job-card-company {
    font-size: 1.05rem;
    color: var(--afri-gray);
    margin-bottom: 0.8rem;
}

.job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.job-type {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    background: #e0f2fe;
    color: #0369a1;
}

.job-card-apply-hint {
    margin-top: auto;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--afri-primary), var(--afri-secondary));
    color: white;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

/* Modern alternative card (if used) */
.modern-job-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    margin-bottom: 20px;
}

.modern-job-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    border-color: #3b82f6;
}

.modern-job-card__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.modern-job-card__logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
}

.modern-job-card__title {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.modern-job-card__company {
    color: #6b7280;
    font-size: 0.95rem;
}

.tagline {
    font-size: 0.85rem;
    color: #9ca3af;
}

.modern-job-card__location {
    color: #4b5563;
    font-size: 0.95rem;
    margin-top: 6px;
}

.modern-job-card__meta {
    margin-left: auto;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.job-type-pill,
.remote-badge,
.modern-job-card__salary {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 9999px;
    font-weight: 600;
}

.remote-badge {
    background: #ecfdf5;
    color: #10b981;
}

.job-type-pill {
    background: #f3f4f6;
    color: #374151;
}

.modern-job-card__salary {
    color: #16a34a;
    font-weight: 700;
}

.modern-job-card__date {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* =========================================================
   MODERN HEADER STYLES
   ========================================================= */
.modern-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 999;
    transition: all 0.3s ease;
}

.modern-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    animation: slideDown 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.sticky-placeholder {
    display: none;
    height: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-bar {
    background: var(--afri-light);
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--afri-border);
}

.top-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-left span {
    margin-right: 20px;
    color: var(--afri-gray);
}

.top-left i {
    margin-right: 5px;
    color: var(--afri-secondary);
}

.top-left a {
    color: var(--afri-gray);
    text-decoration: none;
}

.top-left a:hover {
    color: var(--afri-secondary);
}

.top-right a {
    margin-left: 15px;
    text-decoration: none;
    color: var(--afri-gray);
    font-weight: 500;
}

.top-right a:hover {
    color: var(--afri-secondary);
}

.main-header {
    padding: 15px 0;
    background: #fff;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.site-branding img.custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    color: var(--afri-primary);
    text-decoration: none;
}

.site-description {
    margin: 5px 0 0;
    font-size: 14px;
    color: var(--afri-gray);
}

.main-navigation {
    flex: 1;
    text-align: center;
    margin: 0 20px;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    flex-wrap: wrap;
}

.main-navigation li {
    position: relative;
    margin: 0 15px;
}

.main-navigation a {
    display: block;
    padding: 10px 0;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 16px;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    color: var(--afri-secondary);
}

.main-navigation .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
    text-align: left;
    border-radius: 6px;
    padding: 8px 0;
}

.main-navigation li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
}

.main-navigation .sub-menu li {
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.main-navigation .sub-menu li:last-child {
    border-bottom: none;
}

.main-navigation .sub-menu a {
    padding: 12px 20px;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--afri-primary);
    position: relative;
    transition: background 0.3s;
    border-radius: 3px;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--afri-primary);
    left: 0;
    transition: transform 0.3s;
    border-radius: 3px;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.header-cta .cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--afri-primary), var(--afri-secondary));
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: none;
    box-shadow: 0 4px 12px rgba(0,51,102,0.2);
}

.header-cta .cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,51,102,0.3);
    background: linear-gradient(135deg, var(--afri-secondary), var(--afri-primary));
}

.header-search {
    position: relative;
    margin-left: 10px;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--afri-primary);
    padding: 8px;
    transition: color 0.3s;
}

.search-toggle:hover {
    color: var(--afri-secondary);
}

.search-form-wrapper {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 320px;
    display: none;
    z-index: 999;
    border-radius: 12px;
    margin-top: 10px;
}

.search-form-wrapper.active {
    display: block;
}

.search-form-wrapper .search-form {
    display: flex;
    gap: 10px;
}

.search-form-wrapper input[type="search"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--afri-border);
    border-radius: 8px;
    font-size: 15px;
}

.search-form-wrapper input[type="search"]:focus {
    border-color: var(--afri-secondary);
    outline: none;
}

.search-form-wrapper button {
    background: var(--afri-secondary);
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-form-wrapper button:hover {
    background: var(--afri-primary);
}

/* =========================================================
   MOBILE & RESPONSIVE STYLES
   ========================================================= */
@media (max-width: 1024px) {
    .job-listings.modern-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 992px) {
    .header-row {
        flex-wrap: wrap;
    }
    .main-navigation {
        order: 3;
        width: 100%;
        margin: 15px 0 0;
        text-align: left;
    }
    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        border-radius: 8px;
        padding: 10px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .main-navigation.toggled ul {
        display: flex;
    }
    .main-navigation li {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .main-navigation li:last-child {
        border-bottom: none;
    }
    .main-navigation a {
        padding: 14px 20px;
    }
    .main-navigation .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        padding-left: 20px;
        border-left: 2px solid var(--afri-light);
        margin: 5px 0;
        border-radius: 0;
    }
    .main-navigation .sub-menu a {
        padding: 12px 20px;
    }
    .menu-toggle {
        display: inline-block;
    }
    .header-cta {
        margin-left: auto;
    }
    .header-search {
        margin-left: 5px;
    }
}

@media (max-width: 768px) {
    .job-header {
        flex-direction: column;
        text-align: center;
    }
    .apply-button-wrapper {
        margin: 1.5rem 0 0;
        width: 100%;
    }
    .job-meta-grid {
        grid-template-columns: 1fr;
    }
    .job-card-title {
        font-size: 1.25rem;
    }
    .job-hero {
        flex-direction: column;
        text-align: center;
    }
    .apply-cta {
        width: 100%;
        text-align: center;
    }
    .top-bar-row {
        flex-direction: column;
        text-align: center;
    }
    .top-left span {
        margin: 5px 10px;
        display: inline-block;
    }
    .top-right {
        margin-top: 5px;
    }
    .header-row {
        justify-content: space-between;
    }
    .site-branding img.custom-logo {
        max-height: 50px;
    }
    .header-cta .cta-button {
        padding: 10px 18px;
        font-size: 14px;
    }
    .search-form-wrapper {
        width: 280px;
        right: -50px;
    }
    .modern-job-card__inner {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .modern-job-card__meta {
        margin-left: 0;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 22px;
    }
    .header-cta .cta-button {
        padding: 8px 14px;
        font-size: 13px;
    }
    .search-toggle {
        font-size: 18px;
    }
}

/* =========================================================
   ADDITIONAL UTILITIES & OVERRIDES
   ========================================================= */

/* Force job listings to show (if hidden) */
.job_listings,
.job-card,
.job-card__link,
.job-card__content,
li.job_listing,
.job_listing {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide breadcrumbs */
.bradcrumbs {
    display: none !important;
}

/* PDF upload field styling */
.fieldset-job_pdf input[type="file"] {
    padding: 10px;
    border: 2px dashed #e0e6ef;
    background: #f5f7fa;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}
.fieldset-job_pdf small {
    display: block;
    margin-top: 5px;
    color: #6b7280;
}