/* Global responsive rules that don't belong to one component file.
   Component-specific breakpoints live alongside their component
   (see header.css, hero.css, footer.css, cards.css). */

@media (max-width: 1024px) {
  .section { padding-block: var(--space-10); }
}

@media (max-width: 768px) {
  :root { --fs-3xl: 2.1rem; --fs-2xl: 1.75rem; --fs-xl: 1.375rem; }

  .section { padding-block: var(--space-8); }

  .section-heading {
    flex-direction: row;
    align-items: center;
  }

  .homepage-split {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 375px) {
  .container { padding-inline: var(--space-4); }
  .btn { width: 100%; }
  .hero__search { width: 100%; }
}

/* ---- Mobile bottom tab bar ---- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding-block: var(--space-2);
  }

  .mobile-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: var(--color-text-muted);
  }

  .mobile-bottom-nav__item:hover,
  .mobile-bottom-nav__item.is-active { color: var(--color-secondary); }

  .mobile-bottom-nav__fab-wrap {
    position: relative;
    flex: 0 0 auto;
  }

  .mobile-bottom-nav__fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: var(--color-white);
    border: none;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
    transform: translateY(-14px);
    cursor: pointer;
  }
  .mobile-bottom-nav__fab svg { width: 22px !important; height: 22px !important; }

  .mobile-quick-actions {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    gap: 2px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    min-width: 180px;
  }

  .mobile-bottom-nav__fab-wrap.is-open .mobile-quick-actions { display: flex; }

  .mobile-quick-actions a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--color-ink);
    white-space: nowrap;
  }
  .mobile-quick-actions a:hover { background: var(--color-surface); }

  /* The expanded Create New sheet (Create New / Explore / My
     Workspace — ~16 real destinations) can't fit as a small popup,
     so it becomes its own full-height bottom sheet instead, with the
     bottom nav bar's own fixed positioning left untouched. */
  .mobile-bottom-nav__fab-wrap.is-open .mobile-quick-actions--full {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 64px;
    transform: none;
    width: auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: var(--space-5) var(--space-4);
    overflow-y: auto;
    z-index: calc(var(--z-header) + 1);
    white-space: normal;
  }
  .mobile-quick-actions__heading {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: var(--space-4) 0 var(--space-2);
  }
  .mobile-quick-actions__heading:first-child { margin-top: 0; }
  .mobile-quick-actions--full a { white-space: normal; padding: var(--space-3); font-size: var(--fs-md); }
  .mobile-quick-actions--full a svg { color: var(--color-secondary); flex-shrink: 0; }

  .mobile-quick-actions__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-soft);
  }
  .mobile-quick-actions__header strong { font-size: var(--fs-lg); }
  .mobile-quick-actions__close {
    background: none;
    border: none;
    font-size: var(--fs-xl);
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: var(--space-1);
  }

  /* Notification badge on the bottom nav */
  .mobile-bottom-nav__icon-wrap { position: relative; display: inline-flex; }
  .mobile-bottom-nav__badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #DC2626;
    color: #fff;
    font-size: 9px;
    font-weight: var(--fw-bold);
    min-width: 15px;
    height: 15px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
  }

  /* Prevent the fixed bottom bar from covering page content. */
  body { padding-bottom: 64px; }

  html.jdev-dark .mobile-bottom-nav { background: #16233F; border-color: #26365B; }
}

/* ---- Defensive, doubly-specific icon sizing for the mobile bottom
   nav and footer social row — insurance against any future rule
   elsewhere in the cascade that might otherwise win by being more
   specific than the general .icon rule. ---- */
.mobile-bottom-nav__item svg.icon {
  width: 20px !important;
  height: 20px !important;
}

.footer-social a svg.icon,
.footer__social a svg.icon {
  width: 16px !important;
  height: 16px !important;
}

/* ---- Profile Wizard: mobile/tablet ---- */
@media (max-width: 1024px) {
  .profile-wizard__body { padding: var(--space-5); }
}

@media (max-width: 768px) {
  /* Step nav: smaller, tighter pills that wrap without overlapping */
  .profile-wizard__steps { padding: var(--space-2); gap: 4px; }
  .profile-wizard__step { font-size: 11px; padding: 6px var(--space-2); }
  .profile-wizard__step-icon { width: 16px; height: 16px; font-size: 9px; }

  .profile-wizard__body { padding: var(--space-4); }
  .profile-wizard-panel h2 { font-size: var(--fs-xl); }

  /* Any row of inputs side-by-side (DOB, location, phone) wraps
     instead of squeezing — this is what caused the "du" truncation. */
  .profile-wizard-panel .flex.flex--gap-2 { flex-wrap: wrap; }
  .profile-wizard-panel .flex.flex--gap-2 > input[name^="jdev_dob_"] { min-width: 54px; }

  /* Action row: Back / Skip / Continue stack full-width instead of
     competing for horizontal space (some steps have 3 buttons). */
  .profile-wizard__actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: var(--space-3);
  }
  .profile-wizard__actions .flex.flex--gap-2 {
    flex-direction: column;
    width: 100%;
  }
  .profile-wizard__actions .btn { width: 100%; }

  /* Tag pill "add" row wraps instead of overflowing */
  .tag-pill-add { flex-wrap: wrap; }
  .tag-pill-add input[data-tag-text] { min-width: 140px; }

  /* Country picker: dropdown can't be wider than the viewport, and
     is pinned so it never extends past the right edge of the screen. */
  .country-picker__dropdown {
    width: min(260px, calc(100vw - var(--space-8)));
    left: auto;
    right: 0;
  }

  /* Summary card: quicklinks wrap cleanly, actions move below identity */
  .profile-summary-card__quicklinks { gap: var(--space-3); font-size: var(--fs-xs); }
  .profile-summary-card__actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 480px) {
  .profile-wizard__steps .profile-wizard__step span:not([data-wizard-step-icon]) {
    display: none; /* icon-only step pills on very narrow phones — label still in the progress header above the form */
  }
  .profile-wizard__step { padding: var(--space-2); }
}

/* Keeps the wizard's Back/Continue row from being covered by the
   fixed mobile bottom tab bar. */
@media (max-width: 640px) {
  .profile-wizard { margin-bottom: var(--space-4); }
}

/* ---- Results + sidebar layout (Community, Jobs, Resources,
   Downloads): stacks to a single column on mobile. Same content,
   same features — this only adjusts spacing/order, never removes
   anything. Without this, the 260px sidebar stayed fixed-width and
   crushed the main content on narrow screens. ---- */
@media (max-width: 900px) {
  .taxonomy-listing {
    grid-template-columns: 1fr;
  }
  .taxonomy-filters {
    order: 2;
  }
}

@media (max-width: 900px) {
  .footer__grid--row {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-col--newsletter { grid-column: 1 / -1; max-width: none; }
}

@media (max-width: 640px) {
  .footer__grid--row {
    grid-template-columns: 1fr;
  }
  .footer__newsletter-form { flex-direction: column; }
}
