/* Home page. Loaded only by templates/home.html via extra_head.
   Depends on the tokens in jobertrust.css. Loaded after it, so these rules
   win where they overlap. */

/* Section order. Desktop and mobile Stitch order sections differently, so the
   DOM carries one copy and the order is set per breakpoint. */
.home {
  display: flex;
  flex-direction: column;
}
.home > .home-hero        { order: 1; }
.home > .home-categories  { order: 2; }
.home > .home-works       { order: 3; }
.home > .home-top         { order: 4; }
.home > .home-why         { order: 5; }
.home > .home-recent      { order: 6; }
.home > .home-cta         { order: 7; }

@media (min-width: 768px) {
  .home > .home-hero        { order: 1; }
  .home > .home-works       { order: 2; }
  .home > .home-top         { order: 3; }
  .home > .home-categories  { order: 4; }
  .home > .home-why         { order: 5; }
  .home > .home-recent      { order: 6; }
  .home > .home-cta         { order: 7; }
}

/* ==========================================================================
   HERO
   ========================================================================== */

.home-hero {
  padding-block: var(--jt-xl) var(--jt-2xl);
  background-image:
    radial-gradient(at 100% 0%, rgba(226, 232, 248, 0.55) 0, transparent 55%),
    radial-gradient(at 0% 100%, rgba(231, 238, 254, 0.55) 0, transparent 55%);
}
@media (min-width: 768px) {
  .home-hero { padding-block: var(--jt-3xl); }
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--jt-xl);
  align-items: center;
}
@media (min-width: 1024px) {
  .home-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.home-hero-copy > * + * { margin-top: var(--jt-lg); }

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jt-on-secondary-container);
  background-color: var(--jt-secondary-container);
  border-radius: var(--jt-radius-full);
}

.home-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 800;
  color: var(--jt-primary);
}
@media (min-width: 768px)  { .home-title { font-size: 40px; letter-spacing: -0.02em; } }
@media (min-width: 1024px) { .home-title { font-size: 48px; line-height: 1.1; } }

.home-lede {
  margin: 0;
  max-width: 34rem;
  font-size: 16px;
  line-height: 1.6;
  color: var(--jt-on-surface-variant);
}
@media (min-width: 768px) { .home-lede { font-size: 18px; } }

/* --- Search --------------------------------------------------------------- */

.home-search {
  display: flex;
  flex-direction: column;
  gap: var(--jt-sm);
  padding: 8px;
  background-color: var(--jt-surface-container-lowest);
  border: 1px solid var(--jt-outline-variant);
  border-radius: var(--jt-radius-lg);
  box-shadow: var(--jt-shadow-lg);
  transition: box-shadow var(--jt-transition), border-color var(--jt-transition);
}
@media (min-width: 768px) {
  .home-search { flex-direction: row; align-items: stretch; }
}
.home-search:focus-within {
  border-color: var(--jt-secondary);
  box-shadow: var(--jt-shadow-xl);
}

.home-search-field {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: var(--jt-sm);
  padding-inline: var(--jt-md);
}
@media (min-width: 768px) {
  .home-search-field { border-right: 1px solid var(--jt-outline-variant); }
}

.home-search-field .material-symbols-outlined {
  flex: 0 0 auto;
  color: var(--jt-outline);
}

/* Overrides .form-input: inside the pill there is no second border. */
.home-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0;
  font-family: inherit;
  font-size: 16px;
  color: var(--jt-on-surface);
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
}
.home-search-input::placeholder { color: var(--jt-outline); }
.home-search-input:focus { border: 0; box-shadow: none; outline: none; }

.home-search-submit {
  flex: 0 0 auto;
  min-height: 52px;
  padding-inline: var(--jt-xl);
  font-size: 15px;
}
@media (max-width: 767px) { .home-search-submit { width: 100%; } }

/* --- Trust points --------------------------------------------------------- */

.home-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--jt-sm) var(--jt-md);
}
.home-point {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--jt-on-surface-variant);
}
.home-point .material-symbols-outlined {
  font-size: 16px;
  color: var(--jt-secondary);
  font-variation-settings: "FILL" 1;
}

.home-popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--jt-sm);
}
.home-popular-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--jt-on-surface-variant);
}
.home-popular .chip { padding: 5px 14px; font-size: 13px; }

/* --- Hero image ----------------------------------------------------------- */

.home-hero-media { position: relative; }

.home-hero-img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: var(--jt-radius-2xl);
  box-shadow: var(--jt-shadow-xl);
}
@media (min-width: 768px)  { .home-hero-img { height: 340px; } }
@media (min-width: 1024px) { .home-hero-img { height: 460px; border-radius: 24px; } }

/* Mobile: glass overlay sits inside the image, per the mobile screen.
   Desktop: solid card overhangs the bottom-left corner. */
.home-hero-badge {
  position: absolute;
  left: var(--jt-md);
  right: var(--jt-md);
  bottom: var(--jt-md);
  display: flex;
  align-items: center;
  gap: var(--jt-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--jt-radius-lg);
  box-shadow: var(--jt-shadow);
}
@media (min-width: 1024px) {
  .home-hero-badge {
    left: -28px;
    right: auto;
    bottom: -28px;
    max-width: 19rem;
    padding: var(--jt-lg);
    gap: var(--jt-md);
    background: var(--jt-surface-container-lowest);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--jt-outline-variant);
    border-radius: var(--jt-radius-xl);
    box-shadow: var(--jt-shadow-lg);
  }
}

.home-hero-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  color: var(--jt-secondary);
  background-color: rgba(0, 108, 73, 0.1);
  border-radius: var(--jt-radius-full);
}
@media (min-width: 1024px) {
  .home-hero-badge-icon { width: 48px; height: 48px; }
}
.home-hero-badge-title { margin: 0; font-size: 14px; font-weight: 600; }
.home-hero-badge-sub   { margin: 0; font-size: 12px; color: var(--jt-on-surface-variant); }

/* ==========================================================================
   SHARED SECTION FURNITURE
   ========================================================================== */

.home-head { margin-bottom: var(--jt-xl); }
.home-head-center { text-align: center; }
@media (min-width: 768px) {
  .home-head { margin-bottom: var(--jt-2xl); }
  .home-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--jt-lg);
  }
}
.home-h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--jt-primary);
}
@media (min-width: 768px) { .home-h2 { font-size: 32px; letter-spacing: -0.01em; } }
.home-sub { margin: var(--jt-sm) 0 0; font-size: 15px; color: var(--jt-on-surface-variant); }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--jt-on-tertiary-container);
  text-decoration: none;
  white-space: nowrap;
}
.home-link:hover { text-decoration: underline; }

/* ==========================================================================
   HOW IT WORKS
   ========================================================================== */

.home-works-grid { display: grid; gap: var(--jt-md); }
@media (min-width: 768px) {
  .home-works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--jt-xl); }
}

.home-work {
  display: flex;
  gap: var(--jt-md);
  align-items: flex-start;
  padding: var(--jt-md);
  background-color: var(--jt-surface-container-lowest);
  border: 1px solid var(--jt-outline-variant);
  border-radius: var(--jt-radius-xl);
  transition: box-shadow var(--jt-transition);
}
@media (min-width: 768px) {
  .home-work { display: block; padding: var(--jt-xl); border-radius: var(--jt-radius-2xl); }
  .home-work:hover { box-shadow: var(--jt-shadow-lg); }
}

.home-work-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  font-size: 22px;
  font-weight: 700;
  color: var(--jt-on-tertiary-container);
  background-color: var(--jt-primary-container);
  border-radius: var(--jt-radius-full);
}
.home-work-icon .material-symbols-outlined { font-size: 28px; }
@media (min-width: 768px) {
  .home-work-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--jt-lg);
    border-radius: var(--jt-radius-lg);
    transition: transform var(--jt-transition);
  }
  .home-work:hover .home-work-icon { transform: scale(1.1); }
}

.home-work-title { margin: 0 0 6px; font-size: 20px; line-height: 1.4; font-weight: 600; color: var(--jt-primary); }
.home-work-text  { margin: 0; font-size: 14px; line-height: 1.5; color: var(--jt-on-surface-variant); }

/* Step numbers appear on mobile only, per the mobile screen. */
.home-work-step { display: inline-flex; }
@media (min-width: 768px) { .home-work-step { display: none; } }
.home-work-glyph { display: none; }
@media (min-width: 768px) { .home-work-glyph { display: inline-flex; } }

/* ==========================================================================
   TOP RATED PROFESSIONALS
   ========================================================================== */

.home-top-grid { display: grid; gap: var(--jt-md); }
@media (min-width: 640px)  { .home-top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .home-top-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--jt-lg); } }
@media (min-width: 1280px) { .home-top-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ==========================================================================
   CATEGORIES
   Mobile: horizontal scroll strip. Desktop: 5-column grid.
   ========================================================================== */

.home-categories { background-color: var(--jt-surface-container); }

.home-cat-scroll {
  display: flex;
  gap: var(--jt-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--jt-sm);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.home-cat-scroll::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .home-cat-scroll {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }
}

.home-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--jt-sm);
  flex: 0 0 auto;
  width: 112px;
  padding: var(--jt-md);
  scroll-snap-align: start;
  text-align: center;
  text-decoration: none;
  color: var(--jt-on-surface);
  background-color: var(--jt-surface-container-lowest);
  border: 1px solid var(--jt-outline-variant);
  border-radius: var(--jt-radius-xl);
  transition: transform var(--jt-transition), box-shadow var(--jt-transition), border-color var(--jt-transition);
}
@media (min-width: 768px) {
  .home-cat { width: auto; padding: var(--jt-xl) var(--jt-md); }
  .home-cat:hover {
    transform: scale(1.04);
    border-color: var(--jt-primary);
    box-shadow: var(--jt-shadow);
  }
}
.home-cat-icon { font-size: 34px; color: var(--jt-secondary); transition: transform var(--jt-transition); }
.home-cat:hover .home-cat-icon { transform: scale(1.1); }
.home-cat-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
@media (min-width: 768px) { .home-cat-name { font-size: 14px; } }

/* ==========================================================================
   WHY  --  bento on mobile, 4-column grid on desktop
   ========================================================================== */

.home-why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jt-md);
}
@media (min-width: 1024px) {
  .home-why-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--jt-lg); }
}

.home-feature {
  padding: var(--jt-lg);
  background-color: var(--jt-surface-container-lowest);
  border: 1px solid var(--jt-outline-variant);
  border-radius: var(--jt-radius-xl);
  transition: box-shadow var(--jt-transition);
}
@media (min-width: 1024px) {
  .home-feature { padding: var(--jt-xl); border-radius: var(--jt-radius-2xl); }
  .home-feature:hover { box-shadow: var(--jt-shadow); }
}
.home-feature-icon { display: block; margin-bottom: var(--jt-md); font-size: 32px; color: var(--jt-secondary); }
.home-feature-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.home-feature-text  { margin: 0; font-size: 13px; line-height: 1.5; color: var(--jt-on-surface-variant); }

/* First tile spans the full row on mobile and inverts, per the bento layout. */
.home-feature-lead { grid-column: span 2; color: var(--jt-on-primary); background-color: var(--jt-primary-container); border-color: transparent; }
.home-feature-lead .home-feature-icon  { color: var(--jt-secondary-fixed); font-size: 44px; }
.home-feature-lead .home-feature-title { font-size: 20px; margin-bottom: var(--jt-sm); color: var(--jt-surface-bright); }
.home-feature-lead .home-feature-text  { color: rgba(255, 255, 255, 0.8); font-size: 14px; }
@media (min-width: 1024px) {
  .home-feature-lead { grid-column: span 1; color: inherit; background-color: var(--jt-surface-container-lowest); border-color: var(--jt-outline-variant); }
  .home-feature-lead .home-feature-icon  { color: var(--jt-secondary); font-size: 32px; }
  .home-feature-lead .home-feature-title { font-size: 14px; margin-bottom: 4px; color: inherit; }
  .home-feature-lead .home-feature-text  { color: var(--jt-on-surface-variant); font-size: 13px; }
}

/* ==========================================================================
   RECENTLY REVIEWED
   ========================================================================== */

.home-recent {
  background-color: var(--jt-surface-container-low);
  border-top: 1px solid var(--jt-outline-variant);
}
.home-recent-scroll {
  display: flex;
  gap: var(--jt-md);
  overflow-x: auto;
  padding-bottom: var(--jt-sm);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.home-recent-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  .home-recent-scroll {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }
}

.home-review {
  position: relative;
  flex: 0 0 auto;
  width: 260px;
  padding: var(--jt-md);
  color: inherit;
  text-decoration: none;
  background-color: var(--jt-surface-container-lowest);
  border: 1px solid var(--jt-outline-variant);
  border-radius: var(--jt-radius-xl);
  transition: box-shadow var(--jt-transition);
}
@media (min-width: 768px) {
  .home-review { width: auto; display: flex; align-items: center; gap: var(--jt-md); padding: var(--jt-lg); }
}
.home-review:hover { box-shadow: var(--jt-shadow); }

.home-review-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  overflow: hidden;
  color: var(--jt-on-surface-variant);
  background-color: var(--jt-surface-container);
  border-radius: var(--jt-radius-full);
}
.home-review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.home-review-name { margin: 0; font-size: 14px; font-weight: 600; color: var(--jt-primary); }
.home-review-when { margin: 2px 0 0; font-size: 12px; color: var(--jt-on-surface-variant); }
.home-review-flag {
  position: absolute;
  top: var(--jt-sm);
  right: var(--jt-sm);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--jt-on-secondary-container);
  background-color: rgba(0, 108, 73, 0.1);
  border-radius: var(--jt-radius-sm);
}
.home-review-flag .material-symbols-outlined { font-size: 12px; font-variation-settings: "FILL" 1; }

/* ==========================================================================
   CTA
   ========================================================================== */

.home-cta { background-color: var(--jt-primary-container); }
.home-cta-inner { max-width: 56rem; margin-inline: auto; text-align: center; }
.home-cta-title { margin: 0 0 var(--jt-md); font-size: 26px; line-height: 1.2; font-weight: 800; color: var(--jt-surface-bright); }
@media (min-width: 768px) { .home-cta-title { font-size: 42px; letter-spacing: -0.02em; } }
.home-cta-text {
  margin: 0 auto var(--jt-xl);
  max-width: 42rem;
  font-size: 15px;
  line-height: 1.6;
  color: var(--jt-on-primary-container);
}
@media (min-width: 768px) { .home-cta-text { font-size: 18px; } }
.home-cta-actions { display: flex; flex-direction: column; gap: var(--jt-md); justify-content: center; }
@media (min-width: 640px) { .home-cta-actions { flex-direction: row; } }

.home-cta-primary {
  color: var(--jt-primary);
  background-color: var(--jt-surface-bright);
  border-radius: var(--jt-radius-lg);
  padding-inline: var(--jt-2xl);
}
.home-cta-primary:hover { background-color: #fff; transform: scale(1.03); }
.home-cta-secondary {
  color: var(--jt-surface-bright);
  background: transparent;
  border: 1px solid var(--jt-on-primary-container);
  border-radius: var(--jt-radius-lg);
  padding-inline: var(--jt-2xl);
}
.home-cta-secondary:hover { background-color: rgba(124, 131, 155, 0.15); }

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.home-empty {
  padding: var(--jt-2xl) var(--jt-lg);
  text-align: center;
  color: var(--jt-on-surface-variant);
  background-color: var(--jt-surface-container-lowest);
  border: 1px dashed var(--jt-outline-variant);
  border-radius: var(--jt-radius-xl);
}
.home-empty .material-symbols-outlined { font-size: 32px; color: var(--jt-outline); }
.home-empty p { margin: var(--jt-sm) 0 0; font-size: 14px; }