/*
 * Digizone Jobs -- list styling.
 *
 * PRINCIPLE: inherit, do not redefine.
 *
 * Fonts, text colour and background all come from the theme. This file only adds
 * structure: spacing, borders, the grid. That is why the list looks like the rest of the
 * site -- not because it copies the design, but because it does not override it.
 *
 * Measured on the live site 2026-08-27 (so you know what this is built against):
 *   background  rgb(26, 24, 46)      text  rgb(240, 240, 247)
 *   font        Fabrikat, system-ui  base  18px / 1.625
 *
 * Accent colours are taken from the theme's own CSS custom properties with a fallback.
 * If the theme changes its palette, this list follows automatically.
 *
 * NO TAILWIND UTILITY CLASSES HERE -- on purpose. The theme's Tailwind build purges unused
 * classes, so a utility class referenced only from this plugin might not exist in the
 * compiled stylesheet at all. Own prefix "dgz-", own rules, no surprises.
 */

/* --- Kopfbereich der Jobs-Seite ---------------------------------------- */
/*
 * Das Theme setzt in jeden Kopfbereich zwei Knoepfe: "Mehr erfahren" und
 * "Termin vereinbaren". Auf einer Stellenseite ist der zweite fehl am Platz -- wer
 * eine Stelle sucht, will sich bewerben, keinen Beratungstermin buchen.
 *
 * Ausgeblendet wird er HIER und nicht im Theme, aus zwei Gruenden:
 *  - Das Theme gehoert dem externen Entwickler; ein Eingriff dort waere beim naechsten
 *    Update weg oder wuerde seine Arbeit stoeren.
 *  - Diese Datei wird ausschliesslich geladen, wo der Stellen-Kurzbefehl steht. Die
 *    Regel kann deshalb keine andere Seite treffen -- sie existiert dort gar nicht.
 */
.hero .buttons-wrapper .btn-secondary {
    display: none;
}

.dgz-jobs {
    /* Brand values, MEASURED on the live site 2026-08-27 -- not guessed from a preset.
       My first attempt used --wp--preset--color--primary and produced a purple button
       while the site's own call-to-action is a cyan-to-green gradient. The preset was
       simply a different colour; measuring the actual button settled it. */
    --dgz-brand-a: #00d4ff;
    --dgz-brand-b: #08e3a6;
    --dgz-brand: linear-gradient(to right in oklab, var(--dgz-brand-a) 50%, var(--dgz-brand-b) 100%);
    /* Dark text on the bright gradient -- exactly what the site's own button does.
       White on cyan reads worse, not better. */
    --dgz-brand-text: #1a182e;
    --dgz-accent: var(--dgz-brand-a);
    --dgz-line: color-mix(in srgb, currentColor 18%, transparent);
    --dgz-muted: color-mix(in srgb, currentColor 70%, transparent);
    --dgz-gap: 1.5rem;
    /* Same control height as the site's form fields (measured: 48px). */
    --dgz-control-h: 48px;

    margin-block: 2rem;
}

/* --- heading with the count -------------------------------------------- */

.dgz-jobs-heading {
    margin: 0 0 0.75rem;
}

/* The number sits in the heading instead of a small line below it: it is the first
   thing an applicant wants to know, and here it cannot go stale unnoticed. */
.dgz-jobs-count {
    color: var(--dgz-brand-a);
}

.dgz-jobs-count::before { content: '('; }
.dgz-jobs-count::after  { content: ')'; }

/* --- controls ---------------------------------------------------------- */

.dgz-jobs-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dgz-gap);
    align-items: end;
    margin-bottom: 1.5rem;
}

.dgz-jobs-search { flex: 1 1 20rem; }
.dgz-jobs-sort   { flex: 0 1 14rem; }

.dgz-jobs-label {
    display: block;
    font-size: 0.85em;
    color: var(--dgz-muted);
    margin-bottom: 0.35rem;
}

.dgz-jobs-search-input,
.dgz-jobs-sort-select {
    /* Both controls share ONE height. Before, the select was visibly flatter than the
       search field because each was sized by its own padding -- a fixed height is the
       only way two different elements line up reliably. */
    box-sizing: border-box;
    width: 100%;
    height: var(--dgz-control-h);
    padding: 0 0.9em;
    font: inherit;              /* font-family and size from the theme */
    color: inherit;
    background: color-mix(in srgb, currentColor 6%, transparent);
    border: 1px solid var(--dgz-line);
    border-radius: 7px;         /* same radius the forms plugin uses on this site */
}

/* The dropdown itself: browsers style the closed control, but the OPEN list falls back
   to system colours -- which is why it appeared white-on-white in the dark layout. These
   two properties are what a browser actually honours for the open list. */
.dgz-jobs-sort-select {
    color-scheme: dark;
    background-color: #221f3d;
    appearance: none;
    /* own arrow, because appearance:none removes the native one */
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.6em;
}

.dgz-jobs-sort-select option {
    background: #221f3d;
    color: #f0f0f7;
}

.dgz-jobs-search-input:focus-visible,
.dgz-jobs-sort-select:focus-visible {
    outline: 2px solid var(--dgz-accent);
    outline-offset: 2px;
}

.dgz-jobs-result {
    font-size: 0.9em;
    color: var(--dgz-muted);
    margin: 0 0 1rem;
}

/* --- the list ---------------------------------------------------------- */

.dgz-jobs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--dgz-gap);
}

.dgz-job {
    padding: 1.5rem;
    border: 1px solid var(--dgz-line);
    border-radius: 12px;
    background: color-mix(in srgb, currentColor 4%, transparent);
}

.dgz-job[hidden] { display: none; }

/* Titel und Kontext links, Frist und Knopf rechts - auf einer Linie.
   align-items:center haelt die Aktionen mittig zum Textblock, auch wenn der Titel
   zweizeilig wird. */
.dgz-job-head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.dgz-job-head-text {
    flex: 1 1 24rem;
    min-width: 0;               /* sonst sprengt ein langer Titel die Zeile */
}

.dgz-job-head-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.dgz-job-title {
    margin: 0 0 0.35rem;
    font-size: 1.25em;
    line-height: 1.3;
}

/* The heading leads to the same place as the button -- because that is where people
   click first. It stays visually a heading, not a link: colour inherited, underline
   only on hover. */
.dgz-job-title a {
    color: inherit;
    text-decoration: none;
}

.dgz-job-title a:hover,
.dgz-job-title a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* --- speculative applications, set apart below the list ------------------ */

.dgz-jobs-open {
    margin-top: 2.5rem;
    padding: 1.5rem;
    border: 1px dashed var(--dgz-line);
    border-radius: 12px;
    text-align: center;
}

.dgz-jobs-open h3 { margin: 0 0 0.35rem; font-size: 1.1em; }
.dgz-jobs-open p  { margin: 0 0 1.1rem; color: var(--dgz-muted); }

.dgz-job-context {
    margin: 0;
    font-size: 0.9em;
    color: var(--dgz-muted);
}

.dgz-job-description {
    margin-top: 1rem;
}

.dgz-job-description p { margin: 0 0 0.75em; }

/* --- collapsible requirements ------------------------------------------ */

.dgz-job-requirements {
    margin-top: 1rem;
    border-top: 1px solid var(--dgz-line);
    padding-top: 0.75rem;
}

/* Was too small and too dim to read. Now full body size, with a visible marker and
   enough click area to hit on a phone. */
.dgz-job-requirements summary {
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: var(--dgz-brand-a);
    padding: 0.4em 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.dgz-job-requirements summary::-webkit-details-marker { display: none; }

.dgz-job-requirements summary::before {
    content: '';
    width: 0.5em;
    height: 0.5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.dgz-job-requirements[open] summary::before { transform: rotate(45deg); }

.dgz-job-requirements summary:hover { text-decoration: underline; }

.dgz-job-requirements > div { margin-top: 0.75rem; }

/* The deadline is the second most important thing on a vacancy, right after the title --
   it was rendered as fine print. Now it reads as a countdown: a pill with a clock, at
   body size, with the number carrying the weight. */
.dgz-job-deadline {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: 1em;
    font-weight: 600;
    padding: 0.45em 0.9em;
    border-radius: 999px;
    border: 1px solid var(--dgz-line);
    background: color-mix(in srgb, currentColor 6%, transparent);
    color: inherit;
}

.dgz-job-deadline::before {
    content: '';
    width: 1.05em;
    height: 1.05em;
    flex: none;
    border: 2px solid currentColor;
    border-radius: 50%;
    /* two hands of a clock, drawn from the border box */
    background:
        linear-gradient(to bottom, currentColor 0 45%, transparent 45%) 50% 12% / 2px 40% no-repeat,
        linear-gradient(to right, currentColor 0 45%, transparent 45%) 62% 50% / 34% 2px no-repeat;
}

/* Deadline within a week: emphasised, but not alarming. A warning light that is always on
   is no warning light -- so this only appears when it actually means something. */
.dgz-job-deadline.is-soon {
    color: var(--dgz-brand-a);
    border-color: color-mix(in srgb, var(--dgz-brand-a) 45%, transparent);
    background: color-mix(in srgb, var(--dgz-brand-a) 10%, transparent);
}

.dgz-job-deadline.is-expired {
    text-decoration: line-through;
    opacity: 0.7;
}

.dgz-job-apply {
    display: inline-block;
    padding: 0.7em 1.6em;
    border-radius: 8px;             /* same as the site's own call-to-action */
    background: var(--dgz-brand);   /* the measured cyan-to-green gradient */
    color: var(--dgz-brand-text);   /* dark text -- what the site itself uses */
    font-weight: 700;
    text-decoration: none;
}

.dgz-job-apply:hover,
.dgz-job-apply:focus-visible {
    filter: brightness(1.08);
}

.dgz-job-expired { opacity: 0.6; }

.dgz-jobs-empty {
    color: var(--dgz-muted);
    font-style: italic;
}

/* --- narrow screens ---------------------------------------------------- */

@media (max-width: 640px) {
    .dgz-job { padding: 1.25rem; }
    .dgz-job-foot { flex-direction: column; align-items: stretch; }
    .dgz-job-apply { text-align: center; }
}

/* --- light background --------------------------------------------------- */
/* The site is dark today. Should a page ever use a light background, the borders derived
   from currentColor keep working -- that is the reason for color-mix instead of fixed
   rgba() values. Nothing to do here; this note exists so nobody "fixes" it later. */

/* --- Trenner zwischen Beschreibung und Anforderungen -------------------- */
.dgz-job-trenner {
    border: 0;
    border-top: 1px solid var(--dgz-line);
    margin: 1.25rem 0;
}

.dgz-job-description p:last-child,
.dgz-job-anforderungen p:last-child { margin-bottom: 0; }

/* Auf schmalen Bildschirmen rutschen die Aktionen unter den Text, in voller Breite -
   ein Knopf, den man nicht trifft, ist kein Knopf. */
@media (max-width: 780px) {
    .dgz-job-head-action {
        width: 100%;
        justify-content: space-between;
    }
    .dgz-job-apply { flex: 1 1 auto; text-align: center; }
}
/* --- Kennzeichnung und Untertitel ueber der Liste ----------------------- */
/* Die Klassen badge-title und page-subtitle stammen aus dem Theme und werden
   BENUTZT, nicht nachgebaut - so kommen Farbe, Rahmen und Abstaende von dort und
   folgen einem Design-Update automatisch. Hier nur die Abstaende drumherum. */
.dgz-jobs-badge    { margin-bottom: 1rem; }
.dgz-jobs-subtitle { margin: 0 0 1.5rem; }