/* Design tokens mirrored from packages/aisteacorp (variables.scss /
   accordion.scss / button.scss) so this plugin looks native on the site
   instead of carrying its own generic theme. Kept as plain CSS custom
   properties (no SCSS build step in this extension). */
.jo-accordion,
.jo-application,
.jo-detail,
.jo-nav-fab {
    --jo-primary: #05c3de;
    --jo-secondary: #4db956;
    --jo-gradient: linear-gradient(90deg, var(--jo-primary), var(--jo-secondary));
    --jo-dark-text: #1d1d1f;
    --jo-light-text: #86868b;
    --jo-background-light: #f5f5f7;
    --jo-hover: rgba(0, 0, 0, 0.03);
    --jo-border: rgba(0, 0, 0, 0.08);
    --jo-transition: 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
}

/* Accordion job listing
   ------------------------------------------------------------------ */
.jo-accordion {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-block: 32px;
}

.jo-item {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--jo-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all var(--jo-transition);
}

.jo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.12);
}

.jo-item__header {
    margin: 0;
}

.jo-item__trigger {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 0.75em;
    row-gap: 0.3em;
    width: 100%;
    padding: 16px 48px 16px 20px;
    background: #fff;
    border: none;
    text-align: left;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--jo-dark-text);
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    transition: background var(--jo-transition);
}

.jo-item__trigger::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: 16px;
    top: 50%;
    margin-top: -10px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231d1d1f'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    opacity: 0.7;
    transition: all var(--jo-transition);
}

.jo-item__trigger:hover {
    background: var(--jo-hover);
}

.jo-item__trigger:hover::after {
    opacity: 1;
}

.jo-item__trigger:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(5, 195, 222, 0.3);
}

.jo-item--open .jo-item__trigger {
    background: rgba(5, 195, 222, 0.03);
}

.jo-item--open .jo-item__trigger::after {
    transform: rotate(180deg);
    opacity: 1;
}

.jo-item__title {
    font-weight: inherit;
}

.jo-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}

.jo-badge {
    display: inline-block;
    padding: 0.2em 0.7em;
    border-radius: 999px;
    background: var(--jo-background-light);
    color: var(--jo-dark-text);
    font-size: 0.75em;
    font-weight: 500;
    white-space: nowrap;
}

.jo-badge--remote {
    background: rgba(77, 185, 86, 0.12);
    color: #2f7a3a;
}

.jo-item__panel {
    max-height: 0;
    overflow: hidden;
    background: #fff;
    padding: 0 20px;
    transition: max-height 0.4s ease, padding var(--jo-transition);
}

.jo-item--open .jo-item__panel {
    padding: 4px 20px 20px;
}

.jo-item__body {
    padding-top: 12px;
    border-top: 1px solid transparent;
    background-image: linear-gradient(90deg, transparent, rgba(5, 195, 222, 0.15), transparent);
    background-position: top;
    background-repeat: no-repeat;
    background-size: 100% 1px;
}

.jo-item__body h4 {
    color: var(--jo-dark-text);
    margin: 16px 0 8px;
    font-weight: 600;
}

.jo-item__body p {
    color: var(--jo-light-text);
    line-height: 1.6;
    margin: 8px 0;
}

.jo-item__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2em;
    margin-top: 1.4em;
}

.jo-empty {
    padding: 1em 0;
    color: var(--jo-light-text);
}

/* Pill buttons — mirrors .btn-primary
   ------------------------------------------------------------------ */
.jo-apply-button,
.jo-application__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--jo-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    padding: 14px 28px;
    border: none;
    border-radius: 980px;
    text-decoration: none;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all var(--jo-transition);
}

.jo-application__submit {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 0.5em;
}

.jo-apply-button:hover,
.jo-apply-button:focus,
.jo-application__submit:hover,
.jo-application__submit:focus {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.jo-apply-button:active,
.jo-application__submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Job detail page
   ------------------------------------------------------------------ */
.jo-detail__title {
    margin-bottom: 0.4em;
    color: var(--jo-dark-text);
}

/* Slim application form, rendered directly by the plugin itself
   (no separate content element) — see Partials/ApplicationForm.html.
   ------------------------------------------------------------------ */
.jo-application {
    margin-top: 3em;
    padding-top: 2.5em;
    border-top: 1px solid var(--jo-border);
}

.jo-application__title {
    margin-bottom: 1.2em;
    color: var(--jo-dark-text);
    font-size: 1.7em;
}

.jo-application__success {
    box-sizing: border-box;
    padding: 1em 1.2em;
    margin-bottom: 1.5em;
    border-radius: 12px;
    background: rgba(77, 185, 86, 0.12);
    color: #2f7a3a;
}

.jo-application__error-intro {
    margin-bottom: 0.3em;
    color: #b4293a;
    font-weight: 600;
}

.jo-application__error-list {
    margin: 0 0 1.5em;
    padding-left: 1.2em;
    color: #b4293a;
}

.jo-application__form {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 1.5em;
    row-gap: 1.2em;
}

@media (min-width: 700px) {
    .jo-application__form {
        grid-template-columns: 1fr 1fr;
    }

    .jo-field--full {
        grid-column: 1 / -1;
    }
}

.jo-field label {
    display: block;
    margin-bottom: 0.4em;
    font-weight: 500;
    color: var(--jo-dark-text);
}

.jo-field input[type="text"],
.jo-field input[type="email"],
.jo-field input[type="tel"],
.jo-field input[type="file"],
.jo-field select,
.jo-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75em 0.95em;
    border: 1px solid var(--jo-border);
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    color: var(--jo-dark-text);
    background: #fff;
    transition: border-color var(--jo-transition), box-shadow var(--jo-transition);
}

.jo-field input:focus,
.jo-field select:focus,
.jo-field textarea:focus {
    outline: none;
    border-color: var(--jo-primary);
    box-shadow: 0 0 0 3px rgba(5, 195, 222, 0.15);
}

.jo-field textarea {
    min-height: 9em;
    resize: vertical;
}

.jo-field--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
}

.jo-field--checkbox input {
    margin-top: 0.3em;
}

.jo-field--checkbox label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: 0.9em;
    color: var(--jo-light-text);
}

.jo-field--checkbox a {
    color: var(--jo-primary);
    text-decoration: none;
}

/* Honeypot field must stay invisible to real users but remain reachable
   in the DOM (bots that fill every field will trip it). */
.jo-honeypot {
    position: absolute !important;
    left: -9999px !important;
}

/* Site-wide floating link to the job listing, rendered on every page via
   lib.jobOffersNavIcon (see Classes/Rendering/FloatingNavIconRenderer.php).
   Sits as a vertically-centered tab on the right edge, deliberately not in
   either bottom corner since the cookie-consent UI already lives there.
   ------------------------------------------------------------------ */
.jo-nav-fab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    background: var(--jo-primary);
    color: #fff;
    padding: 0.85em 1.1em 0.85em 1em;
    border-radius: 999px 0 0 999px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.2);
    transition: all var(--jo-transition);
}

.jo-nav-fab:hover,
.jo-nav-fab:focus {
    filter: brightness(1.08);
    padding-right: 1.4em;
}

.jo-nav-fab svg {
    flex-shrink: 0;
}

.jo-nav-fab__label {
    white-space: nowrap;
}

@media (max-width: 600px) {
    .jo-nav-fab {
        padding: 0.75em 0.9em;
    }

    .jo-nav-fab__label {
        display: none;
    }
}
