/**
 * Skillfinder UI V2 — final cross-page consistency and responsive safeguards.
 * Presentation only; scoped to the opt-in UI V2 body class.
 */

body.sfc-ui-v2 {
  overflow-x: clip;
}

body.sfc-ui-v2 :where(img, video, iframe) {
  max-width: 100%;
}

body.sfc-ui-v2 :where(
  .wr-table-responsive,
  .table-responsive,
  .wr-payouts-table,
  .wr-invoice-table,
  .wr-proposal-table
) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.sfc-ui-v2 :where(
  .wr-emptydetails,
  .wr-emptydata-holder,
  .wr-empty-state,
  .sfc-ui-v2-empty
) {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 32px 24px;
  text-align: center;
}

body.sfc-ui-v2 :where(
  .wr-btn,
  .wr-primary-btn,
  .wr-secondary-btn,
  input[type="submit"]
) {
  min-height: 44px;
}

/* Guest and member visitors use the same public visual treatment. */
body.sfc-ui-v2-guest.sfc-ui-v2-public-profile,
body.sfc-ui-v2-member.sfc-ui-v2-public-profile,
body.sfc-ui-v2-guest.sfc-ui-v2-public-detail,
body.sfc-ui-v2-member.sfc-ui-v2-public-detail {
  color: var(--sfc-ui-text, #4f565e);
}

@media (max-width: 991px) {
  body.sfc-ui-v2-public-detail :where(
    .col-lg-5.col-xl-4 > aside,
    .wr-servicepkg-tabs
  ) {
    position: static !important;
    top: auto !important;
  }

  body.sfc-ui-v2 :where(
    .wr-project-filter,
    .wr-search-bar,
    .wr-searchform,
    .wr-sortbar,
    .wr-filterbar
  ) {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  body.sfc-ui-v2 :where(
    .sfc-wr-profile-container,
    .wr-main-section > .container,
    .wr-main-section > .container-fluid
  ) {
    width: calc(100% - 32px) !important;
    max-width: 1240px !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  body.sfc-ui-v2 :where(
    .wr-themeform fieldset,
    .wr-form-group,
    .wr-form-group-wrap,
    .wr-filterbar,
    .wr-sortbar
  ) {
    min-width: 0;
  }

  body.sfc-ui-v2 :where(
    .wr-themeform .form-control,
    .wr-themeform select,
    .wr-themeform textarea,
    .wr-themeform .select2-container,
    .wr-themeform .wr-select
  ) {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.sfc-ui-v2 :where(
    .wr-tabs,
    .wr-nav-tabs,
    .wr-dashboard-tabs,
    .wr-profile-tabs
  ) {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  body.sfc-ui-v2-public-profile .sfc-wr-profile-sections > :where(.wr-asidebox, .wr-freelancerinfo, section),
  body.sfc-ui-v2-public-detail .wr-projectbox > .wr-project-box,
  body.sfc-ui-v2-public-task-detail .wr-singleservice-tile {
    padding: 22px 20px !important;
  }
}

@media (max-width: 479px) {
  body.sfc-ui-v2 :where(
    .wr-themeform,
    .wr-sidebarpkg__btn,
    .wr-projectbox,
    .wr-servicepkg-tabs,
    .sfc-wr-profile-actions
  ) :where(
    .wr-btn,
    .wr-primary-btn,
    .wr-secondary-btn,
    input[type="submit"]
  ) {
    width: 100%;
    justify-content: center;
  }

  body.sfc-ui-v2 .sfc-wr-profile-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  body.sfc-ui-v2 .sfc-wr-profile-actions .sfc-wr-save-btn {
    width: 100% !important;
  }
}

/* Public search parity: apply the authenticated workspace treatment to cached
 * guest routes rendered by Elementor/shortcodes without changing form logic. */
body.sfc-ui-v2-public-search {
  background: var(--sfc-workspace-page, var(--sfc-ui-page-bg, #f7f8fa)) !important;
}

body.sfc-ui-v2-public-search :where(.wrb-job-board, .sfc-wr-project-search) {
  width: 100%;
  min-width: 0;
}

body.sfc-ui-v2-public-search .wrb-job-board .wrb-job-search-main,
body.sfc-ui-v2-public-search.page-template-search-projects .sfc-wr-project-search .sfc-wr-project-hero-search {
  box-shadow: none !important;
}

body.sfc-ui-v2-public-search .wrb-job-board .wrb-job-empty,
body.sfc-ui-v2-public-search.page-template-search-projects .sfc-wr-project-search .wr-no-record {
  box-shadow: none !important;
}

@media (max-width: 900px) {
  body.sfc-ui-v2-public-search .wrb-job-board .wrb-job-search-main {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  body.sfc-ui-v2-public-search .wrb-job-board .wrb-search-location {
    border-left: 0 !important;
    border-top: 1px solid var(--sfc-workspace-border, #e7eaed) !important;
    padding-left: 0 !important;
    padding-top: 8px !important;
  }

  body.sfc-ui-v2-public-search .wrb-job-board .wrb-job-search-main button.wrb-btn {
    width: 100%;
    min-height: 46px;
    margin-top: 8px;
  }
}

@media (max-width: 767px) {
  body.sfc-ui-v2-public-search :where(.wrb-job-board, .sfc-wr-project-search) {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.sfc-ui-v2-public-search .wrb-job-board .wrb-job-filter-row {
    grid-template-columns: 1fr !important;
  }

  body.sfc-ui-v2-public-search .wrb-job-board .wrb-job-empty {
    min-height: 150px;
    padding: 28px 20px !important;
  }
}


/* v0.1.51 — preserve the Workreap project-author thumbnail inside global media safeguards. */
body.sfc-ui-v2 .wr-projectinfo_title > img {
  width: 70px !important;
  max-width: 70px !important;
  height: 70px !important;
  flex: 0 1 70px !important;
  object-fit: cover !important;
}
