/*
 * Recruitment adaptation rules
 *
 * This file defines behavior, not a second visual design. The existing Figma
 * values remain the source of truth; these rules only decide how the same
 * modules flow when the available space changes.
 */
:root {
  --recruit-edge: clamp(20px, 6.25vw, 90px);
  --recruit-content-width: 1160px;
}

body,
.page,
.recruit-page {
  min-width: 0;
  overflow-x: clip;
}

/* Full-bleed page backgrounds; inner content keeps its design max-width. */
@media (min-width: 1441px) {
  .page {
    width: 100%;
    max-width: none;
  }
}

.jobs-shell,
.detail-shell,
.apply-shell,
.recruit-footer .footer-inner {
  width: min(100% - var(--recruit-edge) * 2, var(--recruit-content-width));
  margin-left: auto;
  margin-right: auto;
}

/* Keep every footer on the same full-width rail as the approved footer. */
.footer .footer-inner {
  width: 100%;
  max-width: none;
}

.legal-content {
  width: min(calc(100% - 48px), 800px);
  margin: 88px auto 120px;
  color: var(--ink);
}
.legal-content h1 { margin: 0 0 12px; font-size: 36px; line-height: 50px; }
.legal-content h2 { margin: 36px 0 12px; font-size: 20px; line-height: 28px; }
.legal-content p { margin: 0; color: var(--text); font-size: 16px; line-height: 28px; }
.legal-content .legal-updated { color: #909090; font-size: 14px; line-height: 22px; }

.job-card,
.why-card,
.process-card,
.filter-card,
.detail-block,
.form-section {
  min-width: 0;
}

.job-card-title h3,
.job-card p,
.detail-heading h1,
.detail-block,
.field-stack,
.form-section,
.faq-list h3,
.faq-list p {
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
}

/* Homepage heading markers: desktop and intermediate layouts. */
.section-title > span {
  width: 5px !important;
  height: 29px !important;
  flex: 0 0 5px !important;
  border-radius: 0 !important;
  background: #1873F3;
}

/* Inner-page heading markers: desktop and intermediate layouts. */
.detail-block h2::before,
.form-section h2::before {
  width: 4px !important;
  height: 20px !important;
  border-radius: 0 !important;
}

.detail-block h2::before {
  top: 7px;
}

.form-section h2::before {
  top: 4px;
}

@media (min-width: 1440px) {
  .hero {
    height: min(clamp(560px, 66.32vw, 955px), 100svh);
  }

  .detail-page .detail-shell {
    width: min(calc(100% - 48px), 800px);
    margin-left: auto;
    margin-right: auto;
  }
}

/* At wide desktop, every homepage section shares the same 140px rails. */
@media (min-width: 1440px) {
  .section > .section-title,
  .section > .faq-list {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .section > .why-grid,
  .section > .colleague-panel,
  .section > .process-grid {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .colleague-panel,
  .process-grid {
    justify-content: center;
  }

  .why-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.section-title {
  align-items: center;
}

.faq-list article h3,
.faq-list article p {
  margin-left: 0;
  padding-left: 0;
  text-indent: 0;
}

.faq-list h3,
.campus-cta a {
  color: #1873F3;
}

.faq-list h3 .faq-title-text {
  display: inline-block;
  transform: translateX(3px);
}

/* Hero delivery CTA: the blue fill expands without moving the arrow. */
.join-cta.deliver-button,
.campus-join-cta {
  width: 221px;
  height: 66px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: #f1f2f3;
  position: absolute;
  transform: none;
}

.join-cta-fill {
  position: absolute;
  z-index: 1;
  left: 4px;
  top: 4.5px;
  width: 57px;
  height: 57px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 89px;
  background: var(--blue);
  transition: width .22s cubic-bezier(.2, .72, .2, 1);
}

.deliver-icon {
  position: relative;
  z-index: 2;
  flex: 0 0 57px;
}

.join-cta-label,
.join-cta-hover-text {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 58px;
  width: 156px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-size: 24px;
  line-height: 1;
  font-weight: bolder;
}

.join-cta-label {
  color: var(--blue);
  transform: translateY(0);
  transition: opacity .14s ease;
}

.join-cta-hover-text {
  left: 54px;
  color: #fff;
  opacity: 0;
  z-index: 3;
  transform: translateY(0);
  transition: opacity .16s ease, transform .16s ease;
}

@media (hover: hover) and (pointer: fine) {
  .hero .join-cta:hover .join-cta-fill { width: 213px; }
  .hero .join-cta:hover .join-cta-label { opacity: 0; }
  .hero .join-cta:hover .join-cta-hover-text { opacity: 1; transform: translateY(0); }
  .campus-join-cta:hover .join-cta-fill { width: 213px; }
  .campus-join-cta:hover .join-cta-label { opacity: 0; }
  .campus-join-cta:hover .join-cta-hover-text { opacity: 1; transform: translateY(0); }
}

.join-cta.campus-join-cta {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none;
  align-self: center !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  flex: 0 0 auto;
  opacity: 1 !important;
}

.campus-join-cta > .join-cta-label {
  left: 58px;
  transform: translateY(0);
}

.campus-join-cta .join-cta-fill > .join-cta-hover-text {
  left: 54px;
  transform: translateY(0);
}

.join-cta > .reveal,
.join-cta > .reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
  transition-delay: 0s !important;
}

.join-cta > .join-cta-label.reveal,
.join-cta > .join-cta-label.reveal.is-visible {
  transform: translateY(0) !important;
}

.join-cta-hover-text.reveal,
.join-cta-hover-text.reveal.is-visible {
  opacity: 0 !important;
}

@media (hover: hover) and (pointer: fine) {
  .join-cta:hover > .join-cta-label.reveal,
  .join-cta:hover > .join-cta-label.reveal.is-visible {
    opacity: 0 !important;
  }

  .join-cta:hover .join-cta-hover-text.reveal,
  .join-cta:hover .join-cta-hover-text.reveal.is-visible {
    opacity: 1 !important;
  }
}

.campus-cta {
  gap: 48px !important;
}

@media (min-width: 1440px) {
  .jobs-page .mobile-jobs-header,
  .jobs-page > .mobile-jobs-header {
    display: none !important;
  }

  .jobs-hero-bg {
    object-position: center calc(50% - 180px) !important;
    transform: none !important;
  }

  .jobs-hero-line {
    top: 254px !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
  }
}

@media (min-width: 1440px) and (max-width: 1800px) {
  .hero-bg {
    left: 0 !important;
    width: 100% !important;
    transform: none !important;
    object-fit: cover;
    object-position: center top;
    animation: none !important;
  }

  .hero h1 {
    width: 92%;
    font-size: clamp(42px, 5.8vw, 86px);
  }
}

.social-popover {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
}

.social-popover img {
  display: block;
}

.copyright > span,
.copyright > a {
  color: inherit;
  font: inherit;
  line-height: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

@media (min-width: 1440px) {
  .jobs-page .jobs-shell {
    width: 100%;
    max-width: none;
  }
}

@media (min-width: 1440px) {
  .copyright > :first-child {
    margin-right: 20px;
  }
}

.social-popover-panel {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 12px);
  box-sizing: border-box;
  width: 260px;
  padding: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 24, 31, .14);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity .2s ease, transform .2s ease;
}

.social-popover-panel::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -12px;
  left: 0;
  height: 12px;
  background: transparent;
}

.social-popover-panel img { width: 100%; height: auto; border-radius: 4px; }
.social-popover-panel b { display: block; margin-top: 12px; text-align: center; font-size: 16px; line-height: 24px; font-weight: 400; }
.social-popover-panel button { display: block; margin: 12px auto 0; border: 0; background: none; color: #1873F3; font-size: 16px; cursor: pointer; }

/* All recruitment subpages use the homepage footer composition. */
.unified-footer .company-logo,
.unified-footer .socials > span:not(.social-popover) {
  display: none;
}

.unified-footer .socials img:nth-of-type(1) { order: 2; }
.unified-footer .socials img:nth-of-type(2) { order: 3; }
.unified-footer .socials img:nth-of-type(3) { order: 1; }

.footer,
.recruit-footer {
  overflow: visible;
}

.jobs-page .footer-inner,
.page:has(.jobs-shell) .footer-inner {
  width: 100%;
  max-width: none;
  border-top: 0;
}

/* Lined footers span the full rail width; the footer supplies the 140px desktop inset. */
.recruit-page:not(.jobs-page) .unified-footer .footer-inner {
  width: 100%;
  max-width: none;
}

.socials {
  position: relative;
  z-index: 5;
}

@media (hover: hover) and (pointer: fine) {
  .social-popover:hover .social-popover-panel,
  .social-popover:focus-within .social-popover-panel {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }
}

@media (max-width: 639px) {
  :root { --recruit-edge: 32px; }

  .jobs-shell,
  .detail-shell,
  .apply-shell,
  .recruit-footer .footer-inner {
    width: calc(100% - var(--recruit-edge) * 2);
  }

  .why-grid,
  .process-grid,
  .colleague-panel {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .why-card,
  .process-card,
  .person-card {
    width: auto;
    max-width: none;
  }

  .jobs-shell {
    grid-template-columns: minmax(220px, 28%) minmax(0, 1fr);
  }

  .person-visual {
    height: auto;
    aspect-ratio: 373.333 / 240.2;
  }

  .person-visual .quote-shape {
    width: 100%;
    height: 100%;
    object-fit: fill;
  }

  .person-visual .person-avatar {
    bottom: 0;
  }
}

/* Mobile page rails are consistently 20px on every recruitment page. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Intermediate footers use the mobile flow while retaining PC sizes. */
@media (min-width: 640px) and (max-width: 1439px) {
  .page .footer {
    box-sizing: border-box;
    height: auto !important;
    padding: 0 clamp(24px, 9.72vw, 140px) !important;
  }

  .page .footer-inner {
    box-sizing: border-box;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 28px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
  }

  .page .footer .brand-blue {
    width: 224px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
  }

  .page .footer .socials {
    width: 180px !important;
    height: 44px !important;
    margin: 24px 0 0 !important;
    gap: 24px !important;
  }

  .page .footer .socials img {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    flex: 0 0 44px !important;
  }

  .page .footer .social-popover {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
  }

  .page .footer .copyright {
    width: 100% !important;
    margin: 48px 0 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    font-size: 12px !important;
    line-height: 14.4px !important;
    white-space: normal;
  }

  .page .footer .copyright > :first-child {
    width: 100%;
    flex: 0 0 100%;
  }

  .page .footer .copyright > a,
  .page .footer .copyright > span {
    font-size: 12px !important;
    line-height: 14.4px !important;
    white-space: nowrap;
  }
}

/* Intermediate footer: compact two-column composition from Figma 2434:19888. */
@media (min-width: 850px) and (max-width: 1439px) {
  .page .footer-inner {
    display: grid !important;
    grid-template-columns: 224px minmax(343px, 1fr) !important;
    grid-template-rows: 30px 44px !important;
    column-gap: 32px !important;
    row-gap: 32px !important;
    align-items: center !important;
    padding: 24px 0 !important;
  }

  .page .footer .brand-blue {
    grid-column: 1;
    grid-row: 1;
  }

  .page .footer .socials {
    grid-column: 1;
    grid-row: 2;
    margin: 0 !important;
  }

  .page .footer .copyright {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center !important;
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-content: space-between !important;
    justify-content: flex-end !important;
    gap: 0 12px !important;
    text-align: right !important;
  }

  .page .footer .copyright > :first-child {
    width: 100% !important;
    flex: 0 0 100% !important;
    text-align: right !important;
  }
}

/* Final mobile homepage flow. Keep all major sections in normal document flow. */

/* Final Hero layout: one coordinate system for every viewport. */
.hero {
  height: 100svh;
}

.hero-bg {
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  object-fit: cover !important;
  object-position: center calc(65% - 60px) !important;
  animation: none !important;
}

.hero h1 {
  left: 50% !important;
  top: calc(15.18% - 50px) !important;
  width: min(92%, 1100px) !important;
  font-size: clamp(48px, 6.667vw, 96px);
  transform: translateX(-50%) !important;
  text-align: center;
}

.hero h1 .hero-title-line {
  display: inline-block !important;
  white-space: nowrap !important;
}

/* Match every non-mobile recruitment header to the homepage navigation rail. */
@media (min-width: 640px) and (max-width: 1439px) {
  .recruit-page {
    --recruit-nav-content: 576px;
  }

  .legal-page .legal-content {
    width: min(var(--recruit-nav-content), 800px);
    max-width: 100%;
  }

  .recruit-page .recruit-top {
    padding: 0 !important;
  }

  .recruit-page .recruit-nav,
  .jobs-page .jobs-hero .nav-on-hero {
    box-sizing: border-box;
    width: var(--recruit-nav-content) !important;
    height: 94px !important;
    margin: 0 auto !important;
    padding: 24px 0 0 !important;
    align-items: flex-start !important;
  }

  .recruit-page .breadcrumb {
    width: var(--recruit-nav-content) !important;
    margin: 13px auto 0 !important;
  }

  .recruit-top > .intermediate-about-link {
    top: 29px !important;
    right: calc((100% - var(--recruit-nav-content)) / 2) !important;
  }

  .jobs-page .jobs-hero .nav-on-hero > .intermediate-about-link {
    top: 29px !important;
    right: 0 !important;
  }
}

@media (min-width: 761px) and (max-width: 819px) {
  .recruit-page { --recruit-nav-content: 697px; }
}

@media (min-width: 820px) and (max-width: 889px) {
  .recruit-page { --recruit-nav-content: 756px; }
}

@media (min-width: 890px) and (max-width: 949px) {
  .recruit-page { --recruit-nav-content: 826px; }
}

@media (min-width: 950px) and (max-width: 1199px) {
  .recruit-page { --recruit-nav-content: 886px; }
}

@media (min-width: 1200px) and (max-width: 1439px) {
  .recruit-page {
    --recruit-nav-content: 1120px;
  }

  .apply-page .apply-shell {
    width: var(--recruit-nav-content) !important;
  }
}

@media (min-width: 1440px) {
  .recruit-page .recruit-top {
    padding: 0 140px !important;
  }

  .recruit-page .recruit-nav {
    box-sizing: border-box;
    width: min(100%, var(--content)) !important;
    height: 94px !important;
    margin: 0 !important;
    padding: 32px 0 0 !important;
    align-items: flex-start !important;
  }

  .recruit-page .breadcrumb {
    width: min(100%, var(--content)) !important;
    margin: 13px 0 0 !important;
  }

  .recruit-top > .intermediate-about-link {
    top: 37px !important;
    right: 140px !important;
  }

  .jobs-page .jobs-hero .nav-on-hero {
    box-sizing: border-box;
    width: 100% !important;
    height: 94px !important;
    margin: 0 !important;
    padding: 32px 140px 0 !important;
    align-items: flex-start !important;
  }

  .jobs-page .jobs-hero .nav-on-hero > .intermediate-about-link {
    top: 37px !important;
    right: 140px !important;
  }
}

@media (min-width: 1440px) {
  .hero h1 {
    font-size: 80px;
    line-height: 104.56px;
  }

  .hero-line-a { left: 1.56%; top: 49.77%; width: 28.81%; }
  .hero-line-b { left: 74.34%; top: 50.06%; width: 23.42%; }
  .hero-line-c { left: 45.17%; top: 64.96%; width: 9.63%; }
}

.hero .join-cta.deliver-button {
  left: 50%;
  top: auto;
  bottom: clamp(28px, 5.2vw, 76px);
  transform: translateX(-50%);
}

/* Authoritative mobile homepage spacing. This block must remain last. */

/* Match the official-site footer link underline interaction at every size. */
.page .footer .copyright > a {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.page .footer .copyright > a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.page .footer .copyright > a:hover::after,
.page .footer .copyright > a:focus-visible::after {
  transform: scaleX(1);
}
