/**
 * Company Hiring Plugin — Public Styles
 * Brand: Kaia Homes, Inc.
 * Primary: var(--ch-pink) (magenta/pink)
 * Font: Playfair Display (headings) + Lato (body)
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Lato:wght@300;400;700&display=swap');

/* =========================================================================
   CSS Variables — Kaia Homes Brand
   Defined on :root so they're available to ALL plugin elements on the page,
   including .ch-job-details-card which lives outside the shortcode wrappers.
   ========================================================================= */
:root {
    --ch-pink:        #d4006e;
    --ch-pink-dark:   #a8005a;
    --ch-pink-light:  #fce8f3;
    --ch-pink-pale:   #fff5fb;
    --ch-text:        #1a1a2e;
    --ch-text-muted:  #6b7280;
    --ch-border:      #f0d6e8;
    --ch-white:       #ffffff;
    --ch-shadow:      0 4px 24px color-mix(in srgb, var(--ch-pink) 8%, transparent);
    --ch-shadow-hover:0 8px 36px color-mix(in srgb, var(--ch-pink) 18%, transparent);
    --ch-radius:      12px;
    --ch-font-head:   'Playfair Display', Georgia, serif;
    --ch-font-body:   'Lato', sans-serif;
}

/* =========================================================================
   Careers Header
   ========================================================================= */
.ch-careers-wrap {
    font-family: var(--ch-font-body);
    color: var(--ch-text);
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.ch-careers-header {
    text-align: center;
    margin-bottom: 56px;
    position: relative;
}

.ch-careers-header::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    background: var(--ch-pink);
    border-radius: 2px;
    margin: 20px auto 0;
}

.ch-careers-eyebrow {
    display: inline-block;
    font-family: var(--ch-font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ch-pink);
    background: var(--ch-pink-light);
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.ch-careers-title {
    font-family: var(--ch-font-head);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    color: var(--ch-text);
    margin: 0 0 14px;
    line-height: 1.2;
}

.ch-careers-subtitle {
    font-size: 17px;
    color: var(--ch-text-muted);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto;
    font-weight: 300;
}

/* =========================================================================
   Jobs Grid
   ========================================================================= */
.ch-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

/* =========================================================================
   Job Card
   ========================================================================= */
.ch-job-card {
    background: var(--ch-white);
    border: 1.5px solid var(--ch-border);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    position: relative;
}

.ch-job-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--ch-pink), var(--ch-pink-dark));
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ch-job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ch-shadow-hover);
    border-color: var(--ch-pink);
}

.ch-job-card:hover::before {
    opacity: 1;
}

.ch-job-card-inner {
    padding: 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

/* Department tag */
.ch-job-dept {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ch-pink);
    background: var(--ch-pink-light);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
    align-self: flex-start;
}

/* Job title */
.ch-job-title {
    font-family: var(--ch-font-head);
    font-size: 21px;
    font-weight: 600;
    color: var(--ch-text);
    margin: 0 0 16px;
    line-height: 1.3;
}

/* Meta row */
.ch-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.ch-job-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--ch-text-muted);
    font-weight: 400;
}

.ch-job-meta-item svg {
    color: var(--ch-pink);
    flex-shrink: 0;
}

/* Excerpt */
.ch-job-excerpt {
    font-size: 14px;
    color: var(--ch-text-muted);
    line-height: 1.65;
    margin: 0 0 24px;
    flex: 1;
}

/* Card footer */
.ch-job-card-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--ch-border);
}

/* Apply button */
.ch-btn-apply {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ch-pink);
    color: var(--ch-white) !important;
    font-family: var(--ch-font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.15s ease;
    border: none;
    cursor: pointer;
}

.ch-btn-apply:hover {
    background: var(--ch-pink-dark);
    transform: translateX(2px);
}

.ch-btn-apply svg {
    transition: transform 0.2s ease;
}

.ch-btn-apply:hover svg {
    transform: translateX(4px);
}

/* =========================================================================
   Empty State
   ========================================================================= */
.ch-no-jobs {
    text-align: center;
    padding: 80px 24px;
    background: var(--ch-pink-pale);
    border-radius: var(--ch-radius);
    border: 1.5px dashed var(--ch-border);
}

.ch-no-jobs-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ch-no-jobs h3 {
    font-family: var(--ch-font-head);
    font-size: 22px;
    color: var(--ch-text);
    margin: 0 0 10px;
}

.ch-no-jobs p {
    color: var(--ch-text-muted);
    font-size: 15px;
    margin: 0;
}

/* =========================================================================
   Apply Form Wrap base styles
   Max-width and padding are overridden by the two-column layout block above.
   ========================================================================= */
.ch-apply-wrap {
    font-family: var(--ch-font-body);
    color: var(--ch-text);
    margin: 0 auto;
}

/* .ch-apply-job-title removed — replaced by .ch-job-details-card */

/* Form heading */
.ch-form-heading {
    font-family: var(--ch-font-head);
    font-size: 28px;
    font-weight: 700;
    color: var(--ch-text);
    margin: 0 0 8px;
}

.ch-form-subheading {
    color: var(--ch-text-muted);
    font-size: 15px;
    margin: 0 0 36px;
    font-weight: 300;
}

/* Form fields */
.ch-form-group {
    margin-bottom: 22px;
}

.ch-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ch-text);
    margin-bottom: 7px;
    letter-spacing: 0.3px;
}

.ch-form-group label .ch-required {
    color: var(--ch-pink);
    margin-left: 2px;
}

.ch-form-group input[type="text"],
.ch-form-group input[type="email"],
.ch-form-group input[type="tel"],
.ch-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--ch-border);
    border-radius: 8px;
    font-family: var(--ch-font-body);
    font-size: 15px;
    color: var(--ch-text);
    background: var(--ch-white);
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.ch-form-group input:focus,
.ch-form-group textarea:focus {
    border-color: var(--ch-pink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch-pink) 10%, transparent);
}

.ch-form-group textarea {
    resize: vertical;
    min-height: 130px;
}

/* File upload field */
.ch-file-upload-area {
    border: 2px dashed var(--ch-border);
    border-radius: 8px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    background: var(--ch-pink-pale);
    position: relative;
}

.ch-file-upload-area:hover,
.ch-file-upload-area.ch-drag-over {
    border-color: var(--ch-pink);
    background: var(--ch-pink-light);
}

.ch-file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.ch-file-upload-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.ch-file-upload-area p {
    margin: 0;
    font-size: 14px;
    color: var(--ch-text-muted);
    line-height: 1.6;
}

.ch-file-upload-area strong {
    color: var(--ch-pink);
}

.ch-file-selected {
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--ch-pink-light);
    border: 1.5px solid var(--ch-pink);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--ch-text);
}

.ch-file-selected svg {
    color: var(--ch-pink);
    flex-shrink: 0;
}

/* Error messages */
.ch-field-error {
    display: block;
    font-size: 12px;
    color: #dc2626;
    margin-top: 5px;
}

/* Form notices */
.ch-notice {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.ch-notice-success {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #166534;
}

.ch-notice-error {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    color: #991b1b;
}

/* Submit button */
.ch-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--ch-pink);
    color: var(--ch-white) !important;
    font-family: var(--ch-font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 15px 40px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.ch-btn-submit:hover {
    background: var(--ch-pink-dark);
}

.ch-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media ( max-width: 640px ) {
    .ch-careers-wrap,
    .ch-apply-wrap {
        padding: 40px 16px 60px;
    }

    .ch-jobs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ch-job-card-inner {
        padding: 22px;
    }

    .ch-careers-title {
        font-size: 26px;
    }
}

/* =========================================================================
   Apply Page — Two Column Layout
   Desktop: job details on left, form on right (sticky)
   Mobile:  stacked single column
   ========================================================================= */
.ch-apply-wrap {
    max-width: 1200px; /* wider to accommodate two columns */
    padding: 48px 24px 80px;
}

.ch-apply-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Job details column — sticky so it stays visible while user scrolls the form */
.ch-apply-layout-details {
    position: sticky;
    top: 32px;
}

/* Form column */
.ch-apply-layout-form {
    /* nothing extra needed — natural flow */
}

/* Make the job details card fill full height of the column */
.ch-apply-layout-details .ch-job-details-card {
    margin-bottom: 0;
}

/* Mobile — stack into single column */
@media ( max-width: 860px ) {
    .ch-apply-wrap {
        max-width: 680px;
        padding: 40px 16px 60px;
    }

    .ch-apply-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .ch-apply-layout-details {
        position: static; /* disable sticky on mobile */
    }
}

/* =========================================================================
   Job Details Card — shown above the apply form
   ========================================================================= */
.ch-job-details-card {
    background: #ffffff;
    border: 1.5px solid var(--ch-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: var(--ch-shadow);
    font-family: 'Lato', sans-serif;
}

/* Gradient header */
.ch-job-details-header {
    background: var(--ch-pink); /* solid fallback */
    background: linear-gradient(135deg, var(--ch-pink) 0%, var(--ch-pink-dark) 100%);
    padding: 26px 30px;
}

.ch-job-details-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
}

.ch-job-details-title {
    font-family: var(--ch-font-head);
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

/* Body */
.ch-job-details-body {
    padding: 22px 30px 26px;
}

/* Meta row */
.ch-job-details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ch-border);
}

.ch-job-details-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ch-text-muted);
}

.ch-job-details-meta-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ch-pink);
    flex-shrink: 0;
}

/* Description label */
.ch-job-details-desc-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ch-pink);
    margin-bottom: 12px;
}

/* Description content — allow WP editor HTML like lists and headings */
.ch-job-details-desc {
    font-size: 14px;
    color: var(--ch-text);
    line-height: 1.8;
}

.ch-job-details-desc p      { margin: 0 0 12px; }
.ch-job-details-desc p:last-child { margin-bottom: 0; }
.ch-job-details-desc ul,
.ch-job-details-desc ol     { padding-left: 20px; margin: 0 0 12px; }
.ch-job-details-desc li     { margin-bottom: 5px; }
.ch-job-details-desc strong { color: var(--ch-text); }
.ch-job-details-desc h3,
.ch-job-details-desc h4     { font-family: var(--ch-font-head); color: var(--ch-text); margin: 18px 0 8px; }

/* =========================================================================
   Apply Divider
   ========================================================================= */
.ch-apply-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.ch-apply-divider-line {
    flex: 1;
    height: 1px;
    background: var(--ch-border);
    display: block;
}

.ch-apply-divider-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ch-text-muted);
    white-space: nowrap;
}
