/* ============================================================
   CAREERS PAGE — role list, photo gallery and role dialog
   (Shared blocks live in content.css)
============================================================ */

/* ── Role list ── */
.roles { border-top: 1px solid var(--line-dark); border-left: 1px solid var(--line-dark); border-right: 1px solid var(--line-dark); }
.roles__group {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 18px clamp(24px, 3.4vw, 52px);
  background: var(--paper); border-bottom: 1px solid var(--line-dark);
  font: 500 11px var(--font-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--accent);
}

.role {
  position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto;
  gap: clamp(20px, 3vw, 48px); align-items: center;
  width: 100%; padding: clamp(28px, 3.4vw, 44px) clamp(24px, 3.4vw, 52px);
  text-align: left; background: var(--white); color: var(--text);
  border-bottom: 1px solid var(--line-dark);
  transition: background .4s var(--ease), color .4s var(--ease);
}
.role::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px;
  background: var(--gradient-brand);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.role__no { font: 500 12px var(--font-mono); letter-spacing: .2em; color: var(--accent); transition: color .3s; }
.role__main { min-width: 0; }
.role__title { display: block; margin-bottom: 12px; font-size: clamp(20px, 2vw, 28px); font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.role__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font: 400 12px var(--font-mono); letter-spacing: .08em; color: var(--subtle); transition: color .3s; }
.role__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.role__meta .material-icons-round { font-size: 16px; }
.role__arrow { font-size: 26px; color: var(--accent); transition: transform .35s var(--ease), color .3s; }

.role:hover, .role:focus-visible { background: var(--ink); color: var(--white); }
.role:hover::before, .role:focus-visible::before { transform: scaleX(1); }
.role:hover .role__no, .role:focus-visible .role__no,
.role:hover .role__arrow, .role:focus-visible .role__arrow { color: var(--accent-soft); }
.role:hover .role__arrow, .role:focus-visible .role__arrow { transform: translateX(6px); }
.role:hover .role__meta, .role:focus-visible .role__meta { color: rgba(var(--white-rgb), .55); }
.role:hover .tag--dark, .role:focus-visible .tag--dark { color: var(--accent-soft); border-color: rgba(var(--accent-soft-rgb), .4); background: rgba(var(--accent-soft-rgb), .08); }

/* ── Photo gallery (4 tiles) ── */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-dark); border-left: 1px solid var(--line-dark); }
.gallery__item { position: relative; margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--ink-2); border-right: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.82); transition: transform 1.2s var(--ease), filter .6s; }
.gallery__item:hover img { transform: scale(1.04); filter: brightness(1); }
.gallery__item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 72px 24px 22px; color: var(--white);
  font: 500 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase;
  background: linear-gradient(0deg, rgba(var(--ink-rgb), .92) 0%, rgba(var(--ink-rgb), 0) 100%);
}

/* ── Role dialog ──
   The panel is capped to the visible viewport. Header and footer stay
   pinned; only .modal__body scrolls, so the dialog can never run off-screen. */
.modal {
  --modal-pad: clamp(12px, 3vw, 40px);
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  padding: var(--modal-pad);
  background: rgba(var(--ink-rgb), .82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s linear .35s;
}
.modal.is-open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease), visibility 0s; }
.modal[hidden] { display: none; }

.modal__panel {
  display: flex; flex-direction: column;
  width: 100%; max-width: 880px;
  max-height: calc(100vh - (var(--modal-pad) * 2));
  max-height: calc(100dvh - (var(--modal-pad) * 2));
  overflow: hidden;
  background: var(--white); color: var(--text); border-top: 3px solid var(--accent-blue);
  transform: translateY(24px); transition: transform .5s var(--ease);
}
.modal.is-open .modal__panel { transform: none; }

.modal__head { flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: clamp(20px, 3vw, 40px); border-bottom: 1px solid var(--line-dark); }
.modal__title { margin-bottom: 14px; font-size: clamp(22px, 2.6vw, 34px); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; }
.modal__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.modal__close { display: grid; place-items: center; flex-shrink: 0; width: var(--control-h); height: var(--control-h); border: 1px solid var(--line-dark); transition: background .25s, color .25s, border-color .25s; }
.modal__close:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }

.modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(20px, 3vw, 40px); }
.modal__section + .modal__section { margin-top: 32px; }
.modal__section h3 { margin-bottom: 14px; padding-bottom: 12px; font: 500 11px var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); border-bottom: 1px solid var(--line-dark); }
.modal__section p { font-size: 15.5px; line-height: 1.85; color: var(--muted); }
.modal__section ul, .modal__section ol { display: flex; flex-direction: column; gap: 10px; }
.modal__section li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.modal__section ul li::before { content: ""; position: absolute; left: 0; top: .78em; width: 10px; height: 1px; background: var(--accent); }
.modal__section ol { counter-reset: apply; }
.modal__section ol li { counter-increment: apply; padding-left: 32px; }
.modal__section ol li::before { content: counter(apply, decimal-leading-zero); position: absolute; left: 0; top: .2em; font: 500 11px var(--font-mono); color: var(--accent); }

.modal__foot { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 20px clamp(20px, 3vw, 40px); border-top: 1px solid var(--line-dark); background: var(--paper); }
.modal__note { max-width: 460px; font-size: 13.5px; line-height: 1.7; color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .role { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .role .tag { display: none; }
}
@media (max-width: 640px) {
  .role { grid-template-columns: minmax(0, 1fr) auto; }
  .role__no { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .gallery__item { aspect-ratio: 16 / 10; }
  .modal__foot .btn { width: 100%; justify-content: space-between; }
}