/**
 * Stratton Careers — Listing & Detail Styles
 *
 * Scoped to #stratton-careers-* containers to avoid theme conflicts.
 * Designed to work inside Divi's content area.
 * No !important unless overriding Divi specificity.
 */

/* ─── Layout ──────────────────────────────────────────────────────────────── */

.stratton-careers-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
}

.stratton-careers-wrap *,
.stratton-careers-wrap *::before,
.stratton-careers-wrap *::after {
    box-sizing: border-box;
}

/* ─── Page Header ─────────────────────────────────────────────────────────── */

.stratton-careers-header {
    text-align: center;
    margin-bottom: 48px;
}

.stratton-careers-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.stratton-careers-header .subtitle {
    font-size: 18px;
    color: #555;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stratton-careers-count {
    display: inline-block;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #2c6e49;
    background: #e8f5e9;
    padding: 6px 16px;
    border-radius: 20px;
}

/* ─── Filter Bar ──────────────────────────────────────────────────────────── */

.stratton-careers-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stratton-careers-filters select {
    padding: 10px 16px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    min-width: 180px;
}

.stratton-careers-filters select:focus {
    outline: none;
    border-color: #2c6e49;
    box-shadow: 0 0 0 2px rgba(44, 110, 73, 0.15);
}

/* ─── Job Cards ───────────────────────────────────────────────────────────── */

.stratton-careers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 48px;
}

.stratton-job-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 28px 32px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stratton-job-card:hover {
    border-color: #2c6e49;
    box-shadow: 0 2px 12px rgba(44, 110, 73, 0.08);
}

.stratton-job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.stratton-job-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.stratton-job-card-title a {
    color: inherit;
    text-decoration: none;
}

.stratton-job-card-title a:hover {
    color: #2c6e49;
}

.stratton-job-card-type {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.stratton-job-card-type--full-time {
    background: #e3f2fd;
    color: #1565c0;
}

.stratton-job-card-type--part-time {
    background: #fff3e0;
    color: #e65100;
}

.stratton-job-card-type--contract {
    background: #f3e5f5;
    color: #7b1fa2;
}

.stratton-job-card-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.stratton-job-card-meta span {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stratton-job-card-meta .meta-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.stratton-job-card-summary {
    font-size: 15px;
    color: #444;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.stratton-job-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stratton-job-card-cta {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #2c6e49;
    text-decoration: none;
    padding: 8px 20px;
    border: 2px solid #2c6e49;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.stratton-job-card-cta:hover {
    background: #2c6e49;
    color: #fff;
}

.stratton-job-card-salary {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */

.stratton-careers-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border: 1px dashed #d0d0d0;
    border-radius: 8px;
    margin-bottom: 48px;
}

.stratton-careers-empty h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.stratton-careers-empty p {
    font-size: 16px;
    color: #666;
    margin: 0 0 8px 0;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Flow B Section ──────────────────────────────────────────────────────── */

.stratton-careers-flow-b {
    background: #f5f8f5;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 40px 32px;
    text-align: center;
    margin-top: 16px;
}

.stratton-careers-flow-b h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.stratton-careers-flow-b p {
    font-size: 16px;
    color: #555;
    margin: 0 0 24px 0;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Divider ─────────────────────────────────────────────────────────────── */

.stratton-careers-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 48px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* DETAIL PAGE                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

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

.stratton-careers-breadcrumb {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
}

.stratton-careers-breadcrumb a {
    color: #2c6e49;
    text-decoration: none;
}

.stratton-careers-breadcrumb a:hover {
    text-decoration: underline;
}

.stratton-careers-breadcrumb .separator {
    margin: 0 8px;
    color: #ccc;
}

.stratton-careers-breadcrumb .current {
    color: #555;
}

/* ─── Detail Header ──────────────────────────────────────────────────────── */

.stratton-detail-header {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e0e0e0;
}

.stratton-detail-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.stratton-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.stratton-detail-meta-item {
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stratton-detail-meta-item .meta-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.stratton-detail-summary {
    font-size: 17px;
    color: #444;
    line-height: 1.7;
    margin: 16px 0 0 0;
    max-width: 720px;
}

/* ─── Above-the-Fold CTA ─────────────────────────────────────────────────── */

.stratton-detail-cta-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stratton-detail-apply-btn {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #2c6e49;
    text-decoration: none;
    padding: 12px 32px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.stratton-detail-apply-btn:hover {
    background: #245a3b;
    color: #fff;
}

.stratton-detail-deadline {
    font-size: 14px;
    color: #888;
    font-style: italic;
}

/* ─── Job Description Body ────────────────────────────────────────────────── */

.stratton-detail-body {
    max-width: 720px;
    margin-bottom: 48px;
}

.stratton-detail-body h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 32px 0 12px 0;
}

.stratton-detail-body h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 28px 0 10px 0;
}

.stratton-detail-body h4 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 24px 0 8px 0;
}

.stratton-detail-body p {
    font-size: 16px;
    color: #333;
    line-height: 1.7;
    margin: 0 0 16px 0;
}

.stratton-detail-body ul,
.stratton-detail-body ol {
    margin: 0 0 20px 0;
    padding-left: 24px;
}

.stratton-detail-body li {
    font-size: 16px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 6px;
}

.stratton-detail-body a {
    color: #2c6e49;
    text-decoration: underline;
}

.stratton-detail-body strong {
    font-weight: 600;
}

/* ─── Detail Sidebar (Job Facts) ──────────────────────────────────────────── */

.stratton-detail-sidebar {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 48px;
    max-width: 720px;
}

.stratton-detail-sidebar h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.stratton-detail-facts {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    margin: 0;
}

.stratton-detail-facts dt {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin: 0;
    padding: 4px 0;
}

.stratton-detail-facts dd {
    font-size: 14px;
    color: #1a1a1a;
    margin: 0;
    padding: 4px 0;
}

/* ─── Apply Section (Bottom) ──────────────────────────────────────────────── */

.stratton-detail-apply-section {
    background: #f5f8f5;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 40px 32px;
    margin-bottom: 32px;
}

.stratton-detail-apply-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.stratton-detail-apply-section > p {
    font-size: 16px;
    color: #555;
    margin: 0 0 24px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* FORMS (Flow A & Flow B)                                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Form Layout ─────────────────────────────────────────────────────────── */

.stratton-careers-form {
    text-align: left;
}

.stratton-detail-apply-section .stratton-careers-form,
.stratton-detail-form-placeholder {
    max-width: 560px;
}

.stratton-careers-flow-b .stratton-careers-form {
    max-width: 520px;
    margin: 0 auto;
}

.stratton-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ─── Form Fields ─────────────────────────────────────────────────────────── */

.stratton-form-field {
    margin-bottom: 20px;
}

.stratton-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.stratton-form-field label .required {
    color: #d32f2f;
}

.stratton-form-field label .optional {
    font-weight: 400;
    color: #888;
    font-size: 13px;
}

.stratton-form-field input[type="text"],
.stratton-form-field input[type="email"],
.stratton-form-field input[type="tel"],
.stratton-form-field select,
.stratton-form-field textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stratton-form-field input:focus,
.stratton-form-field select:focus,
.stratton-form-field textarea:focus {
    outline: none;
    border-color: #2c6e49;
    box-shadow: 0 0 0 2px rgba(44, 110, 73, 0.15);
}

.stratton-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.stratton-form-field input::placeholder,
.stratton-form-field textarea::placeholder {
    color: #aaa;
}

/* ─── Validation States ───────────────────────────────────────────────────── */

.stratton-form-field.has-error input,
.stratton-form-field.has-error select,
.stratton-form-field.has-error textarea {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.12);
}

.stratton-form-field.has-error label {
    color: #d32f2f;
}

.stratton-form-field.is-valid input,
.stratton-form-field.is-valid select,
.stratton-form-field.is-valid textarea {
    border-color: #2c6e49;
}

.stratton-form-error {
    display: block;
    font-size: 13px;
    color: #d32f2f;
    margin-top: 4px;
    min-height: 18px;
}

.stratton-form-hint {
    display: block;
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

/* ─── File Upload ─────────────────────────────────────────────────────────── */

.stratton-form-file-wrapper {
    position: relative;
}

.stratton-form-file-wrapper input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.stratton-form-file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px dashed #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-size: 14px;
    color: #666;
}

.stratton-form-file-label:hover {
    border-color: #2c6e49;
    background: #f5f8f5;
}

.stratton-form-file-label.has-file {
    border-color: #2c6e49;
    border-style: solid;
    background: #f5f8f5;
}

.stratton-form-file-label .upload-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.stratton-form-file-name {
    display: inline-block;
    font-size: 13px;
    color: #2c6e49;
    font-weight: 500;
    margin-top: 6px;
}

.stratton-form-file-clear {
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.stratton-form-file-clear:hover {
    color: #d32f2f;
}

.has-error .stratton-form-file-label {
    border-color: #d32f2f;
}

/* ─── Submit Button ───────────────────────────────────────────────────────── */

.stratton-form-actions {
    margin-top: 24px;
}

.stratton-form-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.stratton-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.stratton-form-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: stratton-spin 0.6s linear infinite;
}

@keyframes stratton-spin {
    to { transform: rotate(360deg); }
}

/* ─── Error Banner ────────────────────────────────────────────────────────── */

.stratton-form-error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.stratton-form-error-banner strong {
    display: block;
    font-size: 15px;
    color: #991b1b;
    margin-bottom: 4px;
}

.stratton-form-error-banner p {
    font-size: 14px;
    color: #b91c1c;
    margin: 0;
}

/* ─── Success State ───────────────────────────────────────────────────────── */

.stratton-form-success {
    text-align: center;
    padding: 32px 20px;
}

.stratton-form-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stratton-form-success-icon svg {
    width: 28px;
    height: 28px;
    color: #2c6e49;
}

.stratton-form-success h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.stratton-form-success p {
    font-size: 16px;
    color: #555;
    margin: 0 0 8px 0;
}

.stratton-form-success-sub {
    font-size: 14px !important;
    color: #888 !important;
}

/* ─── Form Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .stratton-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ─── Back Link ───────────────────────────────────────────────────────────── */

.stratton-detail-back {
    padding: 16px 0;
}

.stratton-detail-back a {
    font-size: 15px;
    color: #2c6e49;
    text-decoration: none;
}

.stratton-detail-back a:hover {
    text-decoration: underline;
}

/* ─── Mobile Sticky Apply Button ──────────────────────────────────────────── */

.stratton-detail-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stratton-detail-sticky-btn {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #2c6e49;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.stratton-detail-sticky-btn:hover {
    background: #245a3b;
    color: #fff;
}

/* Hide sticky on desktop — only useful on mobile where scrolling is longer */
@media (min-width: 769px) {
    .stratton-detail-sticky-cta {
        display: none;
    }
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .stratton-careers-wrap {
        padding: 40px 16px;
    }

    /* ── Listing page ── */
    .stratton-careers-header h1 {
        font-size: 28px;
    }

    .stratton-job-card {
        padding: 20px;
    }

    .stratton-job-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .stratton-job-card-title {
        font-size: 18px;
    }

    .stratton-job-card-meta {
        gap: 12px;
    }

    .stratton-job-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stratton-job-card-cta {
        width: 100%;
        text-align: center;
    }

    .stratton-careers-filters {
        flex-direction: column;
    }

    .stratton-careers-filters select {
        width: 100%;
        min-width: unset;
    }

    .stratton-careers-flow-b {
        padding: 28px 20px;
    }

    /* ── Detail page ── */
    .stratton-detail-title {
        font-size: 26px;
    }

    .stratton-detail-meta {
        gap: 10px;
    }

    .stratton-detail-cta-top {
        flex-direction: column;
        align-items: stretch;
    }

    .stratton-detail-apply-btn {
        text-align: center;
    }

    .stratton-detail-body h2 {
        font-size: 20px;
    }

    .stratton-detail-body h3 {
        font-size: 18px;
    }

    .stratton-detail-facts {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }

    .stratton-detail-facts dt {
        padding-bottom: 0;
        margin-top: 8px;
    }

    .stratton-detail-facts dd {
        padding-top: 0;
    }

    .stratton-detail-sidebar {
        padding: 20px;
    }

    .stratton-detail-apply-section {
        padding: 28px 20px;
    }

    /* Add bottom padding so sticky button doesn't overlap content */
    #stratton-careers-detail {
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .stratton-careers-header h1 {
        font-size: 24px;
    }

    .stratton-job-card-meta {
        flex-direction: column;
        gap: 6px;
    }

    .stratton-detail-title {
        font-size: 22px;
    }

    .stratton-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
