/* ==========================================================================
   Tech4TIME — pages/careers.css
   Open roles, and the state where there are none.

   Job posts expand with <details>/<summary>, the same as the certification
   groups: the browser's own disclosure widget, so no JavaScript, no roving
   tabindex, and correct announcement without any aria- attributes.
   ========================================================================== */

.job {
  background-color: var(--bg-elevated);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration) var(--ease-out);
}

.job + .job {
  margin-block-start: var(--space-md);
}

.job:hover,
.job[open] {
  border-color: var(--silver-accent-mid);
}

/* --------------------------------------------------------------- summary */

.job__summary {
  list-style: none;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
}

.job__summary::-webkit-details-marker {
  display: none;
}

.job__summary:focus-visible {
  outline: var(--focus-ring);
  outline-offset: -3px;
  border-radius: var(--radius-lg);
}

/* A real <h3> inside the <summary>, which summary allows, so the roles are
   reachable by heading navigation rather than only by tabbing. */
.job__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.job__label {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.job__title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.job__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3xs) var(--space-2xs);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.job__meta-sep {
  color: var(--border-strong);
}

.job__marker {
  fill: var(--text-muted);
  transition: transform var(--duration) var(--ease-out);
}

.job[open] .job__marker {
  transform: rotate(90deg);
}

/* ----------------------------------------------------------------- panel */

.job__panel {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  border-block-start: var(--border-width) solid var(--border-subtle);
}

.job__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-xl);
  padding: var(--space-sm) var(--space-md);
  margin-block-end: var(--space-lg);
  background-color: var(--bg-surface);
  border-radius: var(--radius);
}

.job__fact-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.job__fact-value {
  margin-block-start: var(--space-3xs);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.job__section + .job__section {
  margin-block-start: var(--space-lg);
}

.job__section-title {
  margin-block-end: var(--space-2xs);
  font-size: var(--text-md);
  color: var(--accent-text);
}

/* The body of a section is author-written HTML from the editor, restricted by
   careers_sanitise_html() to p, br, strong, em, u, ul, ol, li and a. Styling
   it by element rather than by class is the point: the author cannot add a
   class, so every tag they can produce needs to already look right. */
.job__body {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.job__body > :first-child { margin-block-start: 0; }
.job__body > :last-child { margin-block-end: 0; }

.job__body p {
  margin-block: var(--space-2xs);
}

.job__body ul,
.job__body ol {
  display: grid;
  gap: var(--space-2xs);
  padding-inline-start: var(--space-md);
  margin-block: var(--space-2xs);
}

.job__body li::marker {
  color: var(--silver-accent-mid);
}

.job__body strong {
  font-weight: 700;
  color: var(--text-primary);
}

.job__body em {
  font-style: italic;
}

/* Underline is the one format that reads as a link on the web. Offsetting it
   and thinning it keeps the two distinguishable at a glance. */
.job__body u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.job__body a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.job__body a:hover {
  color: var(--text-primary);
}

/* The four alignment classes the editor writes. They exist because the CSP is
   style-src 'self': an inline text-align would be blocked here, so alignment
   has to arrive as a class the stylesheet already knows. Kept in sync with
   CAREERS_ALLOWED_CLASSES in lib/careers.php. */
.job__body .ta-left { text-align: left; }
.job__body .ta-center { text-align: center; }
.job__body .ta-right { text-align: right; }
.job__body .ta-justify { text-align: justify; }

.job__apply {
  margin-block-start: var(--space-xl);
  padding-block-start: var(--space-lg);
  border-block-start: var(--border-width) solid var(--border-subtle);
}

.job__apply-note {
  margin-block-start: var(--space-2xs);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* --------------------------------------------------------- no openings */

.cv__actions {
  display: flex;
  justify-content: center;
}

.empty-state {
  max-width: 40rem;
  padding: var(--space-2xl) var(--space-lg);
  margin-inline: auto;
  text-align: center;
  background-color: var(--bg-elevated);
  border: var(--border-width) dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin-inline: auto;
  margin-block-end: var(--space-md);
  color: var(--on-accent);
  background-image: var(--silver-gradient-fill);
  border-radius: 50%;
}

.empty-state__title {
  margin-block-end: var(--space-2xs);
  font-size: var(--text-xl);
}

.empty-state__text {
  margin-block-end: var(--space-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

@media (min-width: 48em) {
  .job__summary,
  .job__panel {
    padding-inline: var(--space-xl);
  }

  .job__heading {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .job__label {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  .job__marker {
    transition: none;
  }
}
