/* ==========================================================================
   Pharmainnovators v2.1 — website enhancements
   Loaded after theme.css. Component-level additions and responsive corrections only:
   the existing design language (colours, type, spacing tokens) is reused.
   ========================================================================== */

/* ---------- transparent brand logos must never show the image placeholder background
   (root cause of the white square behind the footer logo: base.css gives every <img> a
   light background colour, which shows through the transparent PNG) */
img[src*="/assets/img/brand/"], .x-flogo img, .brand img, .pbrand img { background: none !important; }
.x-flogo-img { width: 58px; height: 58px; object-fit: contain; flex: 0 0 auto; }
[data-theme="dark"] .brand img { background: #fff !important; }

/* ---------- homepage hero (v2): scientific background, readable overlay, capability strip */
.x-hero--v2 { background: #061a46; }
.x-hero--v2 .x-hero-bg { background: none; }
.x-hero--v2 .x-hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; opacity: .28; filter: saturate(.85); background: none; }
.x-hero--v2 .x-hero-bg::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, rgba(5,22,62,.97) 0%, rgba(7,31,82,.92) 42%, rgba(10,42,107,.72) 70%, rgba(15,154,168,.45) 100%); }
.x-hero--v2 .x-hero-bg::after { z-index: 2; }
.x-hero--v2 .x-hero-grid { z-index: 3; }
.x-hero--v2 .x-hero-lead { color: #dbe6fb; }
.x-hero-caps { list-style: none; padding: 0; margin: 4px 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.x-hero-caps li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); color: #eaf1ff; font-size: .84rem; font-weight: 600; line-height: 1.2; }
.x-hero-caps .ic { width: 17px; height: 17px; color: #5fe0d2; flex: 0 0 auto; }
.x-hero--v2 .x-hero-main { border-color: rgba(255,255,255,.28); }
.x-hero--v2 .x-hero-main img { object-position: center 35%; }
.x-hero--v2 .x-hero-float img { object-position: center; }

/* ---------- partnerships gallery (v2): consistent 16:10 frames, captions, no distortion */
.x-gallery--v2 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.x-gallery--v2 figure { aspect-ratio: auto; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-border, #dde3ea); }
.x-gallery--v2 figure > img, .x-gallery--v2 figure picture, .x-gallery--v2 figure picture img { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover; object-position: center; background: #e9eef6; }
.x-gallery--v2 figcaption { padding: 12px 14px 14px; display: grid; gap: 4px; }
.x-gallery--v2 figcaption strong { font-family: var(--f-head, inherit); color: var(--navy, #0a2a6b); font-size: .98rem; }
.x-gallery--v2 figcaption span { color: var(--c-muted, #55657e); font-size: .86rem; line-height: 1.45; }
[data-theme="dark"] .x-gallery--v2 figure { background: #0f1d36; border-color: #23365a; }
[data-theme="dark"] .x-gallery--v2 figcaption strong { color: #e6eeff; }

/* ---------- careers */
.x-careers-intro { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; margin-bottom: 28px; }
.x-careers-legend { background: var(--c-bg-2, #f4f7fc); border: 1px solid var(--c-border, #dde3ea); border-radius: 16px; padding: 18px 20px; }
.x-careers-legend p { margin: 0 0 10px; font-size: .94rem; }
.x-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.x-tag--vac { background: #dcfce7; color: #166534; } .x-tag--pool { background: #e0ecff; color: #1e40af; } .x-tag--lvl { background: #f1f5f9; color: #334155; }
.x-lvgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.x-lvcard { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--c-border, #dde3ea); background: #fff; text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s, border-color .2s; }
.x-lvcard:hover, .x-lvcard:focus-visible, .x-lvcard.is-on { border-color: var(--teal, #0f9aa8); box-shadow: var(--sh-1); transform: translateY(-2px); }
.x-lvcard-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad, #1257d6); color: #fff; }
.x-lvcard strong { font-size: 1.05rem; color: var(--navy, #0a2a6b); } .x-lvcard span { font-size: .88rem; color: var(--c-muted, #55657e); line-height: 1.45; } .x-lvcard b { margin-top: auto; font-size: .82rem; color: var(--teal, #0f9aa8); }
.x-jobfilter { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; background: #fff; padding: 16px; border-radius: 16px; border: 1px solid var(--c-border, #dde3ea); margin: 6px 0 14px; }
.x-jobfilter .field { margin: 0; min-width: 0; } .x-jobfilter label { font-size: .82rem; font-weight: 600; display: block; margin-bottom: 4px; }
.x-jobfilter input, .x-jobfilter select { width: 100%; min-width: 0; }
.x-jobfilter-actions { display: flex; gap: 8px; }
.x-jobcount { color: var(--c-muted, #55657e); font-size: .9rem; margin: 0 0 12px; }
.x-jobgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.x-jobcard { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--c-border, #dde3ea); border-top: 4px solid var(--tone, #1257d6); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.x-jobcard-top { display: flex; gap: 6px; flex-wrap: wrap; }
.x-jobcard h3 { font-size: 1.05rem; margin: 4px 0 0; line-height: 1.35; overflow-wrap: anywhere; } .x-jobcard h3 a { color: var(--navy, #0a2a6b); text-decoration: none; } .x-jobcard h3 a:hover { text-decoration: underline; }
.x-jobcard p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--c-text-2, #3c4a60); }
.x-jobcard-svc, .x-jobcard-meta { display: flex; gap: 6px; align-items: flex-start; font-size: .84rem !important; color: var(--c-muted, #55657e) !important; } .x-jobcard-svc .ic, .x-jobcard-meta .ic { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
.x-jobcard-actions { margin-top: auto; padding-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.x-jobdetail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(20px, 4vw, 44px); align-items: start; }
.x-jobdetail-main h2 { font-size: 1.25rem; margin: 26px 0 10px; } .x-jobdetail-main h2:first-of-type { margin-top: 18px; }
.x-jobdetail-side { position: sticky; top: 92px; display: grid; gap: 16px; }
.x-dl { margin: 0 0 14px; display: grid; gap: 10px; } .x-dl div { display: grid; gap: 2px; } .x-dl dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted, #55657e); } .x-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.x-linklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; } .x-linklist small { display: block; color: var(--c-muted, #55657e); }
.x-empty { text-align: center; padding: 40px 16px; background: #fff; border-radius: 16px; border: 1px dashed var(--c-border, #dde3ea); } .x-empty .ic { width: 34px; height: 34px; color: var(--c-muted, #55657e); }
.x-applying p { margin: 0; }
[data-theme="dark"] .x-jobcard, [data-theme="dark"] .x-lvcard, [data-theme="dark"] .x-jobfilter, [data-theme="dark"] .x-empty { background: #0f1d36; border-color: #23365a; }
[data-theme="dark"] .x-jobcard h3 a, [data-theme="dark"] .x-lvcard strong { color: #e6eeff; }

/* ---------- field-level guidance (website forms) */
.fh-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: 6px; padding: 0; border-radius: 50%; border: 1px solid #b9cdf0; background: #eef4ff; color: #1257d6; cursor: pointer; vertical-align: middle; flex: 0 0 auto; line-height: 1; }
.fh-btn:hover, .fh-btn[aria-expanded="true"] { background: #1257d6; color: #fff; border-color: #1257d6; }
.fh-btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.fh-pop { margin: 6px 0 8px; padding: 12px 14px; border-radius: 12px; background: #f4f8ff; border: 1px solid #c7dafb; color: #1c2a43; font-size: .88rem; line-height: 1.5; box-shadow: 0 8px 20px rgba(10, 42, 107, .08); max-width: 100%; }
.fh-pop p { margin: 0 0 6px; }
.fh-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .fh-head strong { flex: 1 1 auto; color: #0a2a6b; }
.fh-req { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; } .fh-req.is-req { background: #fee2e2; color: #991b1b; } .fh-req.is-opt { background: #e2e8f0; color: #334155; }
.fh-close { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: #475569; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; } .fh-close:hover { background: #e2e8f0; }
.fh-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-top: 1px dashed #c7dafb; } .fh-row strong { color: #0a2a6b; font-size: .8rem; } .fh-row span { overflow-wrap: anywhere; }
.fh-ex span { font-style: italic; }
[data-theme="dark"] .fh-pop { background: #10203d; border-color: #2a4372; color: #dbe6fb; } [data-theme="dark"] .fh-head strong, [data-theme="dark"] .fh-row strong { color: #a9c3f2; }

/* ---------- responsive corrections (found during the cross-device inspection) */
@media (max-width: 1100px) {
  .x-jobgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-jobfilter { grid-template-columns: 1fr 1fr; } .x-jobfilter .field:first-child { grid-column: 1 / -1; } .x-jobfilter-actions { grid-column: 1 / -1; }
  .x-lvgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .x-careers-intro, .x-jobdetail { grid-template-columns: 1fr; }
  .x-jobdetail-side { position: static; }
  .x-gallery--v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .x-jobgrid, .x-lvgrid, .x-jobfilter, .x-gallery--v2 { grid-template-columns: 1fr; }
  .x-hero-caps li { font-size: .8rem; padding: 6px 10px; }
  .fh-row { grid-template-columns: 1fr; gap: 2px; }
  .x-jobfilter-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- service pages: engagement excerpt table */
.x-tablewrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-border, #dde3ea); border-radius: 12px; margin: 8px 0 10px; }
.x-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 460px; }
.x-table th { background: var(--navy, #0a2a6b); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; }
.x-table td { padding: 9px 12px; border-top: 1px solid var(--c-border, #dde3ea); vertical-align: top; }
.x-table tr:nth-child(even) td { background: var(--c-bg-2, #f4f7fc); }
.x-block h3 { margin-top: 18px; }
[data-theme="dark"] .x-table tr:nth-child(even) td { background: #0f1d36; }

/* ---------- header: desktop navigation must fit between 1281 px and 1600 px at 100 % zoom
   (previously the right-hand buttons overflowed by ~25–110 px on 1280–1440 px laptops, forcing users to zoom out) */
@media (min-width: 1281px) and (max-width: 1599px) {
  .x-header .header-inner { gap: 12px; }
  .x-header .brand-text span { display: none; }
  .x-header .nav-link, .x-header .nav-toggle-sub { padding-inline: 9px; }
  .x-header .header-actions { gap: 6px; flex: 0 0 auto; }
}
@media (min-width: 1281px) and (max-width: 1439px) {
  .x-header .nav-link, .x-header .nav-toggle-sub { padding-inline: 7px; font-size: .9rem; }
  .x-header .header-actions [data-theme-toggle] { display: none; }
  .x-header .btn-cta { padding-inline: 14px; }
}
@media (min-width: 1281px) and (max-width: 1365px) {
  .x-header .btn-cta-text { display: none; }
  .x-header .btn-cta { width: 44px; padding: 0; justify-content: center; }
}

/* ---------- "Join as a professional" layout: the form/aside wrapper had no layout rule, so the step
   indicator's minimum width (6 × 92 px) pushed the form 280 px beyond the screen on phones */
.x-formlayout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(20px, 3vw, 36px); align-items: start; }
.x-formlayout > * { min-width: 0; }
.x-formlayout .wizard, .x-formlayout form { min-width: 0; max-width: 100%; }
.x-formside { position: sticky; top: 92px; }
@media (max-width: 980px) { .x-formlayout { grid-template-columns: minmax(0, 1fr); } .x-formside { position: static; } }

/* ---------- very small phones (320–359 px): header controls must stay inside the screen */
@media (max-width: 359px) {
  .x-header .header-inner { gap: 6px; padding-inline: 10px; }
  .x-header .brand { min-width: 0; flex: 1 1 auto; gap: 6px; }
  .x-header .brand-text { min-width: 0; }
  .x-header .brand-text strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .x-header .header-actions { gap: 4px; }
  .x-header .icon-btn { width: 38px; height: 38px; }
}
/* step indicator on phones: compact dots, only the current step's label is shown */
@media (max-width: 600px) {
  .stepper li { min-width: 52px; font-size: .72rem; }
  .stepper li > span:not(.dot) { display: none; }
  .stepper li.current > span:not(.dot) { display: block; white-space: nowrap; }
}
