/*
 * ExAcd Mobile Theme
 * mobile.css
 *
 * Candidate01 foundation.
 * Intentionally contains no visual overrides.
 */

/* EXACD_MOBILE_PRIMARY_ACTIONS_V1
   Normalize dark primary action buttons to ExAcd orange on mobile only.
*/
@media (max-width: 767px) {
  html[data-exacd-mobile-theme="1"] button.bg-ink-gray-9,
  html[data-exacd-mobile-theme="1"] a.bg-ink-gray-9,
  html[data-exacd-mobile-theme="1"] button[class*="bg-ink-gray-9"],
  html[data-exacd-mobile-theme="1"] a[class*="bg-ink-gray-9"] {
    background-color: #ff8a1f !important;
    border-color: #ff8a1f !important;
    color: #ffffff !important;
  }

  html[data-exacd-mobile-theme="1"] button.bg-ink-gray-9:hover,
  html[data-exacd-mobile-theme="1"] a.bg-ink-gray-9:hover,
  html[data-exacd-mobile-theme="1"] button[class*="bg-ink-gray-9"]:hover,
  html[data-exacd-mobile-theme="1"] a[class*="bg-ink-gray-9"]:hover {
    background-color: #f47c0b !important;
    border-color: #f47c0b !important;
    color: #ffffff !important;
  }
}

/* EXACD_MOBILE_TENANT_CTA_V1 */
@media (max-width: 767px) {
  html[data-exacd-mobile-theme="1"] .exacd-mobile-create-cta {
    background-color: #ff8a1f !important;
    border-color: #ff8a1f !important;
    color: #ffffff !important;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-create-cta:hover {
    background-color: #f47c0b !important;
    border-color: #f47c0b !important;
    color: #ffffff !important;
  }
}

/* EXACD_MOBILE_OVERFLOW_V1 */
@media (max-width: 767px) {

  /* ---------------- Profile ---------------- */

  html[data-exacd-mobile-theme="1"] .exacd-mobile-profile-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-profile-shell h2,
  html[data-exacd-mobile-theme="1"] .exacd-mobile-profile-shell p,
  html[data-exacd-mobile-theme="1"] .exacd-mobile-profile-shell div {
    overflow-wrap: anywhere;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-profile-tabs {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-profile-tabs > * {
    min-width: max-content;
  }


  /* ---------------- Job Detail ---------------- */

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-header {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow-x: hidden;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-header > * {
    min-width: 0;
    max-width: 100%;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-actions {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-actions > * {
    min-width: 0;
    max-width: 100%;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-title-row {
    min-width: 0;
    max-width: 100%;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-title-row > div {
    min-width: 0;
    max-width: 100%;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-title-row .text-2xl,
  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-title-row .text-sm {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  html[data-exacd-mobile-theme="1"] .exacd-mobile-job-badges > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* EXACD_MOBILE_OVERFLOW_V2 */
@media (max-width: 767px) {

  /* ------------------------------------------------------
   * Profile tabs
   * Up to three items per row; six items become two rows.
   * ------------------------------------------------------ */

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tab-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 0.35rem !important;
    white-space: normal !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tab-buttons > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
    overflow-wrap: anywhere !important;
  }


  /* ------------------------------------------------------
   * Job Detail
   * Row 1: breadcrumbs
   * Row 2+: actions in a two-column mobile grid
   * ------------------------------------------------------ */

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-page {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 0.6rem !important;
    overflow: hidden !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 0.5rem !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-actions > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-actions button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    justify-content: center !important;
    overflow-wrap: anywhere !important;
  }
}

/* EXACD_MOBILE_OVERFLOW_V3 */
@media (max-width: 767px) {

  /* ======================================================
   * PROFILE
   * Real TabButtons layout lives inside:
   * [data-exacd-control="tab-buttons"]
   * ====================================================== */

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    height: auto !important;
    min-height: 0 !important;

    gap: 0.35rem !important;
    padding: 0.2rem !important;

    align-items: stretch !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    height: auto !important;
    min-height: 2.1rem !important;

    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;

    justify-content: center !important;

    white-space: normal !important;
    line-height: 1.25rem !important;
    text-align: center !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] button span {
    height: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;

    text-align: center !important;
    justify-content: center !important;
  }


  /* ======================================================
   * JOB DETAIL BREADCRUMBS
   * Breadcrumbs internally uses whitespace-nowrap.
   * Keep first crumb compact and truncate long job title.
   * ====================================================== */

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs {
    display: flex !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    overflow: hidden !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs > div {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    overflow: hidden !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs a,
  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs button {
    min-width: 0 !important;
    max-width: 100% !important;

    overflow: hidden !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs a span,
  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs button span {
    display: block !important;

    min-width: 0 !important;
    max-width: 100% !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /*
   * Last breadcrumb is the job title.
   * It must be allowed to shrink inside the available viewport.
   */
  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-breadcrumbs a:last-of-type {
    flex: 1 1 0% !important;
    min-width: 0 !important;
  }


  /* Extra containment for the complete sticky area */
  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-header {
    box-sizing: border-box !important;

    width: 100% !important;
    max-width: 100vw !important;

    overflow-x: hidden !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-job-header > * {
    box-sizing: border-box !important;

    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* EXACD_MOBILE_PROFILE_TABS_V4 */
@media (max-width: 767px) {

  /*
   * IMPORTANT:
   * The component wrapper must NOT be a 3-column grid.
   * Only the real inner tab container is the grid.
   */
  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tab-buttons {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    overflow: visible !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    height: auto !important;

    gap: 0.4rem !important;
    padding: 0.25rem !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] button {
    width: 100% !important;
    min-width: 0 !important;

    height: auto !important;
    min-height: 2.5rem !important;

    padding: 0.35rem 0.4rem !important;

    justify-content: center !important;
    text-align: center !important;

    white-space: normal !important;
  }

  html[data-exacd-mobile-theme="1"]
    .exacd-mobile-profile-tabs
    [data-exacd-control="tab-buttons"] button span {
    display: flex !important;

    width: 100% !important;
    height: auto !important;

    align-items: center !important;
    justify-content: center !important;

    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;

    line-height: 1.25rem !important;
    text-align: center !important;
  }
}
