/* Vacancies page (/vacancies). Page-specific rules only;
   fonts, tokens (--ol-*), buttons, pill, yellow band and footer come from olerex-ui.css. */

/* ---------- Hero ---------- */
.vac-hero {
    background: var(--ol-yellow);
    position: relative;
    padding-top: 28px;
}

.vac-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 40px;
    align-items: end;
    padding-top: 40px;
}

.vac-hero-text {
    display: grid;
    gap: 22px;
    align-content: end;
    padding-bottom: 84px;
    min-width: 0;
}

.vac-hero-photo {
    position: relative;
    z-index: 1;
    min-width: 0;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    margin-bottom: -64px;
    background: var(--ol-ink-2);
    box-shadow: 0 28px 60px rgba(20, 20, 20, .28);
}

.vac-hero-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 38%;
}

/* ---------- List ---------- */
.vac-list {
    background: var(--ol-ground);
    padding: 104px 0 56px; /* 64px photo overlap + 40px */
}

.vac-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.vac-list-title {
    font-family: var(--ol-display);
    font-weight: normal;
    font-size: 36px;
    line-height: 1;
    margin: 0;
}

.vac-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vac-chip {
    font-family: var(--ol-body);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #c9c7be;
    background: #fff;
    color: var(--ol-ink);
    cursor: pointer;
}

.vac-chip[aria-pressed="true"] {
    background: var(--ol-ink);
    color: #fff;
    border-color: var(--ol-ink);
}

.vac-chip:focus-visible {
    outline: 3px solid var(--ol-ink);
    outline-offset: 2px;
}

.vac-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.vac-card {
    background: var(--ol-paper);
    border: 1px solid var(--ol-line);
    border-radius: 14px;
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    transition: transform .15s ease-out, box-shadow .15s ease-out;
}

.vac-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(20, 20, 20, .10);
}

.vac-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.vac-region {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ol-yellow);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 6px;
}

.vac-region svg {
    width: 12px;
    height: 12px;
    flex: none;
}

.vac-badge-new {
    font-family: var(--ol-label);
    font-size: 14px;
    letter-spacing: .08em;
    line-height: 1;
    background: var(--ol-ink);
    color: var(--ol-yellow);
    padding: 6px 9px 5px;
    border-radius: 6px;
}

.vac-card-title {
    font-family: var(--ol-display);
    font-weight: normal;
    font-size: 38px;
    line-height: .95;
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

.vac-meta {
    color: var(--ol-muted);
    font-size: 15px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.vac-meta svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.vac-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 6px;
    flex-wrap: wrap;
}

.vac-card-actions .ol-btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 17px;
    padding: 12px 14px 11px;
}

/* Skeleton while loading */
.vac-skeleton {
    pointer-events: none;
}

.vac-skeleton:hover {
    transform: none;
    box-shadow: none;
}

.vac-skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--ol-ground-2) 25%, #f7f6f2 50%, var(--ol-ground-2) 75%);
    background-size: 200% 100%;
    animation: vac-shimmer 1.4s infinite;
}

.vac-skeleton-line.is-chip {
    width: 90px;
    height: 24px;
}

.vac-skeleton-line.is-title {
    width: 70%;
    height: 34px;
}

.vac-skeleton-line.is-meta {
    width: 55%;
}

.vac-skeleton-line.is-btn {
    width: 130px;
    height: 44px;
    border-radius: 8px;
}

@keyframes vac-shimmer {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

/* Empty list / error */
.vac-state {
    background: var(--ol-paper);
    border: 1px dashed #c9c7be;
    border-radius: 14px;
    padding: 40px 32px;
    text-align: center;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.vac-state h3 {
    font-family: var(--ol-display);
    font-weight: normal;
    font-size: 32px;
    line-height: 1;
    margin: 0;
}

.vac-state p {
    margin: 0;
    color: var(--ol-ink-2);
    max-width: 48ch;
}

.vac-state p a {
    color: inherit;
}

.vac-state .ol-btn {
    margin-top: 8px;
}

/* ---------- Poster modal (Bootstrap 5) ---------- */
/* The modal sits outside <main class="ol-page">, so the body font is set here separately */
.vac-modal {
    font-family: var(--ol-body);
    color: var(--ol-ink);
}

.vac-modal .modal-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
}

.vac-modal .modal-header {
    align-items: flex-start;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--ol-line);
}

.vac-modal-title {
    font-family: var(--ol-display);
    font-weight: normal;
    font-size: 36px;
    line-height: 1;
    margin: 0;
}

.vac-modal .vac-meta {
    margin-top: 6px;
}

.vac-modal .btn-close {
    margin: -4px -8px 0 auto;
    padding: 12px;
}

/* On desktop the dialog always has the maximum height, so zooming does not change the modal's size */
@media (min-width: 768px) {
    .vac-modal .modal-dialog {
        height: calc(100% - 3.5rem);
    }

    .vac-modal .modal-content {
        height: 100%;
    }
}

/* By default the whole poster fits the body height; a click enlarges it to full width and makes it scrollable.
   margin: auto centres the poster when there is room and keeps it at the top when it is taller than the body
   (scrollable), so the poster does not jump when zoomed. */
.vac-modal-body {
    position: relative;
    background: var(--ol-ground-2);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px;
}

.vac-modal-body img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(20, 20, 20, .18);
    cursor: zoom-in;
}

.vac-modal-body.is-zoomed img {
    width: 100%;
    max-height: none;
    cursor: zoom-out;
}

.vac-modal-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -1rem 0 0 -1rem;
    color: var(--ol-ink-2);
}

.vac-modal-fallback {
    align-self: center;
    margin: 40px 0;
    color: var(--ol-ink-2);
    text-align: center;
    max-width: 40ch;
}

.vac-modal .modal-footer {
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--ol-line);
}

.vac-modal .modal-footer > * {
    margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .vac-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        padding-top: 28px;
    }

    .vac-hero-text {
        padding-bottom: 0;
    }

    .vac-hero-photo {
        margin-bottom: -40px;
    }

    .vac-list {
        padding-top: 76px;
    }

    .vac-list-title {
        font-size: 30px;
    }

    .vac-card-title {
        font-size: 34px;
    }
}

@media (max-width: 767.98px) {
    /* Bootstrap's modal-fullscreen-md-down: no rounded corners in fullscreen */
    .vac-modal .modal-content {
        border-radius: 0;
    }

    /* On mobile the poster is screen-wide and scrollable anyway, no zoom */
    .vac-modal-body img {
        width: 100%;
        max-height: none;
        cursor: default;
    }
}

@media (max-width: 600px) {
    .vac-hero-photo {
        aspect-ratio: 3 / 2;
    }

    .vac-modal-title {
        font-size: 30px;
    }

    .vac-state {
        padding: 32px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vac-card {
        transition: none;
    }

    .vac-skeleton-line {
        animation: none;
    }
}
