/* ============================================================ */
/* WT Law - Careers application form                             */
/* Loaded ONLY on job_opening singles (inc/jobapp-endpoint.php). */
/*                                                               */
/* Field styling is intentionally NOT redefined here: .wt-form,  */
/* .wt-field, .wt-check, .wt-submit-*, .wt-err, .wt-success are  */
/* declared at the top level of contact-modal.css, which loads   */
/* sitewide for the footer modal. This file adds only the        */
/* section shell, the two upload zones, and the progress bar.    */
/* Everything is scoped under .jo-apply so it cannot leak.       */
/* ============================================================ */

/* ----- hidden attribute enforcement -----
   The UA stylesheet's [hidden] { display: none } loses to ANY author rule
   that sets display on the same element - author beats UA. Both .jo-file
   (display:flex below) and .wt-success / .wt-form (display:flex, inherited
   from contact-modal.css) do exactly that, so [hidden] was being ignored and
   the file rows and success panel rendered on page load. This restores it for
   everything inside the section, including elements styled elsewhere. */
.jo-apply [hidden] { display: none !important; }

/* ----- Section shell ----- */
.jo-apply {
  padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.05));
  scroll-margin-top: 90px; /* clears the sticky header on #apply jumps */
}

.jo-apply-shell {
  max-width: 720px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--charcoal, #12121e) 0%, var(--slate, #1a1a2a) 100%);
  border: 1px solid var(--gold-dim, rgba(231, 199, 153, 0.12));
  border-radius: 10px;
  padding: clamp(28px, 4vw, 48px) clamp(22px, 4vw, 44px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.jo-apply-head { margin-bottom: 1.8rem; }

.jo-apply-h {
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--headline-white, #f0f0f8);
  margin: 0 0 .7rem;
}

.jo-apply-sub {
  font-family: var(--font-body, 'Outfit', system-ui, sans-serif);
  font-size: .92rem;
  line-height: 1.65;
  color: var(--platinum, #d8d8e8);
  margin: 0;
  max-width: 52ch;
}

/* ----- Upload zones ----- */
.jo-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.jo-upload { display: flex; flex-direction: column; gap: .4rem; }

.jo-upload-label {
  font-family: var(--font-body, 'Outfit', system-ui, sans-serif);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--platinum, #d8d8e8);
}

.jo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  text-align: center;
  min-height: 132px;
  padding: 1rem .9rem;
  background: rgba(8, 8, 16, 0.6);
  border: 1px dashed var(--border, rgba(231, 199, 153, 0.10));
  border-radius: 5px;
  cursor: pointer;
  transition: border-color var(--fast, 0.15s), background var(--fast, 0.15s),
              box-shadow var(--fast, 0.15s);
}
.jo-drop:hover,
.jo-drop.is-dragging {
  border-color: var(--gold, #e7c799);
  background: rgba(8, 8, 16, 0.85);
}
.jo-drop.is-dragging { box-shadow: 0 0 0 3px rgba(231, 199, 153, 0.10); }

/* The input is inside the label, so a click anywhere in the zone opens the
   picker. Kept focusable (not display:none) so keyboard users can reach it. */
.jo-drop input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.jo-drop:focus-within {
  outline: none;
  border-color: var(--gold, #e7c799);
  box-shadow: 0 0 0 3px rgba(231, 199, 153, 0.10);
}

.jo-drop-icon {
  width: 26px; height: 26px;
  fill: none;
  stroke: var(--gold-readable, #d4b88a);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jo-drop-text {
  font-family: var(--font-body, 'Outfit', system-ui, sans-serif);
  font-size: .85rem;
  color: var(--platinum, #d8d8e8);
  line-height: 1.4;
}

.jo-drop-hint {
  font-family: var(--font-body, 'Outfit', system-ui, sans-serif);
  font-size: .72rem;
  color: var(--dim, #5a5a78);
  letter-spacing: .02em;
}

/* ----- Chosen file row ----- */
.jo-file {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 132px;
  padding: 1rem;
  background: rgba(8, 8, 16, 0.6);
  border: 1px solid var(--gold-dim, rgba(231, 199, 153, 0.12));
  border-radius: 5px;
}

.jo-file-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  fill: none;
  stroke: var(--gold, #e7c799);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jo-file-name {
  flex: 1;
  font-family: var(--font-body, 'Outfit', system-ui, sans-serif);
  font-size: .82rem;
  line-height: 1.45;
  color: var(--headline-white, #f0f0f8);
  word-break: break-word;
}

.jo-file-remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: transparent;
  border: 1px solid var(--border, rgba(231, 199, 153, 0.10));
  border-radius: 50%;
  color: var(--silver, #8a8aa8);
  cursor: pointer;
  transition: border-color var(--fast, 0.15s), color var(--fast, 0.15s),
              background var(--fast, 0.15s);
}
.jo-file-remove svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}
.jo-file-remove:hover,
.jo-file-remove:focus-visible {
  border-color: var(--gold, #e7c799);
  color: var(--gold, #e7c799);
  background: var(--gold-glow, rgba(231, 199, 153, 0.06));
  outline: none;
}

/* ----- Upload progress ----- */
.jo-progress { margin-top: -.2rem; }

.jo-progress-bar {
  height: 3px;
  background: rgba(8, 8, 16, 0.7);
  border-radius: 2px;
  overflow: hidden;
}
.jo-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--gold, #e7c799);
  transition: width 180ms linear;
}

.jo-progress-text {
  font-family: var(--font-body, 'Outfit', system-ui, sans-serif);
  font-size: .74rem;
  color: var(--silver, #8a8aa8);
  text-align: center;
  margin: .5rem 0 0;
}

/* ----- Success panel ----- */
.jo-apply-success { padding: 1.5rem 0 .5rem; }
.jo-apply-success:focus { outline: none; }

/* ----- Mobile ----- */
@media (max-width: 600px) {
  .jo-upload-row { grid-template-columns: 1fr; }
  .jo-drop, .jo-file { min-height: 112px; }
  .jo-apply-shell {
    border-radius: 8px;
    padding: 26px 18px 30px;
  }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .jo-drop, .jo-file-remove, .jo-progress-bar span { transition: none; }
}
