/*
 * CHANGE LOG
 * File: /var/www/html/prohrhq.com/static/css/split-view.css
 * Purpose: Desktop master-detail split view for /need-more-drivers/job.
 *          Page-specific -- loaded only when slug == 'job' -- since this
 *          layout doesn't exist anywhere else on the site. Contains only
 *          rules genuinely unique to this page; typography, palette,
 *          spacing, and button treatment all come from the shared tokens
 *          in prohrhq_public.css.
 * Used by: templates/need-more-drivers-group.html (slug == 'job' only)
 * Version History:
 *   2026-08-08 v1.0 - Initial creation. Michael, direct work order:
 *                     "approximately 40-45% left / 55-60% right on wide
 *                     desktop; right pane may be sticky while the left
 *                     side scrolls... below the desktop breakpoint, use
 *                     ordinary full-page navigation rather than
 *                     squeezing two panes together." Breakpoint (1000px)
 *                     matches the check in static/js/split-view.js
 *                     exactly -- the two must stay in sync if either
 *                     changes.
 */

.ph-split-desktop-only { display: none; }
.ph-split-mobile-only { display: block; }

@media (min-width: 1000px) {
  .ph-split-desktop-only {
    display: grid;
    grid-template-columns: 43fr 57fr;
    gap: 2.5rem;
    align-items: start;
  }
  .ph-split-mobile-only { display: none; }

  .ph-split-group { margin-bottom: 1.75rem; }
  .ph-split-group:last-child { margin-bottom: 0; }
  .ph-split-group-title {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-mute);
    margin: 0 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-rule-soft);
  }
  .ph-split-group ul { list-style: none; margin: 0; padding: 0; }
  .ph-split-item {
    display: block;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.1rem;
    border-left: 3px solid transparent;
  }
  .ph-split-item:hover { background: var(--color-bg-alt); }
  .ph-split-item.is-active { background: var(--color-accent-soft); border-left-color: var(--color-accent); }
  .ph-split-item-label {
    display: block;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--color-text);
  }
  .ph-split-item.is-active .ph-split-item-label { color: var(--color-accent); }
  .ph-split-item-desc {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-mute);
    margin-top: 0.15rem;
    line-height: 1.35;
  }

  .ph-split-pane {
    position: sticky;
    top: calc(var(--navbar-h) + 1.25rem);
    max-height: calc(100vh - var(--navbar-h) - 2.5rem);
    overflow-y: auto;
    border: 1px solid var(--color-rule-soft);
    border-radius: var(--radius);
    padding: 1.75rem;
    background: var(--color-bg);
    box-shadow: var(--shadow-soft);
  }
  /* .ph-split-pane-opentab ("Open full page ->") retired 2026-08-17 -- the
     link was removed from split-view.js per Michael: it plus the fetched
     page's own back-link created two navigation systems inside one pane. */
  /* Suppress any "<- Back to..." link that comes along when a standalone
     page's content is fetched into a split-view pane. That link is correct
     on the standalone route (context: base_public.html + global nav) but
     redundant/circular inside an embed already living on the homepage
     inside the very section it would point back to. One rule, governs
     every current and future split-view pane -- no per-partial edits. */
  .ph-split-injected-content .ph-back-link { display: none; }
  .ph-split-pane-loading {
    color: var(--color-text-mute);
    font-family: var(--font-sans);
    padding: 3rem 1rem;
    text-align: center;
  }
}

@media (min-width: 1300px) {
  .ph-split-desktop-only { grid-template-columns: 40fr 60fr; }
}

/*
 * 2026-08-08 - Driver job review rebuild. Extended 2026-08-14: merged with
 * the ph-splitview-* rules that were cloned from these under a separate
 * class prefix (2026-08-13, to avoid touching this page while building
 * for-carriers.html). Two names still exist in the markup -- ph-job-review-*
 * on /need-more-drivers/job, ph-splitview-* everywhere else -- because
 * changing this page's template carries real regression risk and wasn't
 * asked for. But the RULES are now one shared block with combined
 * selectors: every declaration below applies to both prefixes identically,
 * so they cannot render differently again without someone deliberately
 * writing a page-specific override. Michael, direct instruction: "There
 * should only be one CSS. There should not be two sources of CSS."
 */
.ph-job-review-page,
.ph-splitview-page { max-width: var(--maxw-splitview); }

.ph-job-review-opening { max-width: 760px; margin: 0 0 1.35rem; }
.ph-job-review-opening h1 { margin: 0.2rem 0 0.35rem; }
.ph-job-review-opening p {
  margin: 0;
  color: var(--color-text-mute);
  font-size: 1.04rem;
  line-height: 1.5;
}

.ph-job-review-grid,
.ph-splitview-grid {
  display: grid;
  grid-template-columns: minmax(290px, 34fr) minmax(0, 66fr);
  gap: 2rem;
  align-items: start;
}
.ph-splitview-grid { margin: 2rem 0; }

.ph-job-review-nav,
.ph-splitview-nav { min-width: 0; }

.ph-job-review-group,
.ph-splitview-group { margin: 0 0 1.25rem; }
.ph-job-review-group:last-child,
.ph-splitview-group:last-child { margin-bottom: 0; }
.ph-job-review-group h2,
.ph-splitview-group h2 {
  margin: 0 0 0.42rem;
  padding: 0 0 0.38rem;
  border-bottom: 1px solid var(--color-rule-soft);
  color: var(--color-text-mute);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Item row, icon column, hover/active states -- ONE shared rule set.
   2026-08-14: icon box enlarged 58x44 -> 72x54, then reported still too
   small ("twice the size that they are") -> doubled again to 144x108
   (64x48 -> 128x96 on the <680px breakpoint). Reported live: "the good
   one has got larger icons, the bad one's got little tiny icons." Root
   cause wasn't the CSS (both prefixes always declared the same 58x44) --
   it was that the newer icon library (static/images/journey-icons/) has
   more internal padding per glyph than the original job-review-icons set,
   so the same CSS box showed less of the actual drawing. Re-cropping
   tighter had almost no visible effect (each icon's own negative space
   varies too much to fix uniformly by cropping alone) -- enlarging the
   shared box is what actually fixes it, for every icon in both sets. */
.ph-job-review-item,
.ph-splitview-item {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  margin: 0 0 0.12rem;
  padding: 0.52rem 0.6rem;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
}
.ph-job-review-item:hover, .ph-job-review-item:focus-visible,
.ph-splitview-item:hover, .ph-splitview-item:focus-visible { background: var(--color-bg-alt); }
.ph-job-review-item.is-active,
.ph-splitview-item.is-active {
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.ph-job-review-item.is-active .ph-job-review-copy > span,
.ph-splitview-item.is-active .ph-splitview-copy > span { color: var(--color-text); }

.ph-job-review-icon,
.ph-splitview-icon {
  display: flex;
  width: 144px;
  height: 108px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 5px;
  background: var(--color-bg-alt);
}
.ph-job-review-icon img,
.ph-splitview-icon img { display: block; width: 144px; height: 108px; object-fit: cover; }

.ph-job-review-copy,
.ph-splitview-copy { min-width: 0; }
.ph-job-review-copy strong,
.ph-splitview-copy strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}
.ph-job-review-copy > span,
.ph-splitview-copy > span {
  display: block;
  margin-top: 0.12rem;
  color: var(--color-text-mute);
  font-size: 0.81rem;
  line-height: 1.3;
}

.ph-job-review-detail,
.ph-splitview-detail {
  position: sticky;
  top: calc(var(--navbar-h) + 1rem);
  min-width: 0;
  max-height: calc(100vh - var(--navbar-h) - 2rem);
  overflow-y: auto;
  border: 1px solid var(--color-rule-soft);
  border-radius: var(--radius);
  background: var(--color-bg);
  box-shadow: var(--shadow-soft);
}
.ph-job-review-detail { min-height: 520px; }
.ph-splitview-detail { min-height: 420px; }
.ph-job-review-detail .ph-split-pane-loading,
.ph-splitview-detail .ph-split-pane-loading {
  padding: 3rem 1rem;
  color: var(--color-text-mute);
  text-align: center;
}
.ph-job-review-detail .ph-split-pane-content,
.ph-splitview-detail .ph-split-pane-content { min-width: 0; padding: 1rem; }

.ph-job-review-bottom {
  max-width: 820px;
  margin: 2rem auto 0;
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--color-rule-soft);
  text-align: center;
}
.ph-job-review-bottom h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.ph-job-review-bottom p { margin: 0; color: var(--color-text-mute); }

@media (max-width: 999px) {
  .ph-job-review-grid,
  .ph-splitview-grid { grid-template-columns: 1fr; }
  .ph-job-review-detail,
  .ph-splitview-detail { display: none; }
  .ph-job-review-item,
  .ph-splitview-item {
    margin-bottom: 0.4rem;
    border: 1px solid var(--color-rule-soft);
    border-left-width: 3px;
  }
}

@media (max-width: 680px) {
  .ph-job-review-page {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .ph-job-review-item,
  .ph-splitview-item {
    grid-template-columns: 128px minmax(0, 1fr);
  }
  .ph-job-review-icon, .ph-job-review-icon img,
  .ph-splitview-icon, .ph-splitview-icon img {
    width: 128px;
    height: 96px;
  }
}

/*
 * 2026-08-08 - Split-view visible error state.
 * Fail loudly in the pane instead of silently navigating away.
 */
.ph-split-visible-error {
  margin: 1rem;
  padding: 1rem;
  border: 2px solid #9b2c2c;
  border-radius: var(--radius);
  background: #fff5f5;
  color: #5f1b1b;
  font-family: var(--font-sans);
  line-height: 1.45;
}

.ph-split-visible-error strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.ph-split-visible-error p {
  margin: 0 0 0.6rem;
}

.ph-split-visible-error a {
  color: #7f1d1d;
  font-weight: 700;
}


/*
 * 2026-08-08 - Job split detail bar + loud error state.
 */
.ph-job-split-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1rem -1rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-rule-soft);
  background: var(--color-bg);
  font-family: var(--font-sans);
}

.ph-job-split-detail-bar a {
  flex: 0 0 auto;
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.ph-job-split-loaded {
  min-width: 0;
}

.ph-job-split-loaded .ph-journey-sidebar {
  display: none;
}

