/* ==========================================================================
   Melbourne Recruitment and Consultants Australia — Responsive Styles
   Breakpoints follow Bootstrap 5: sm 576 · md 768 · lg 992 · xl 1200 · xxl 1400
   ========================================================================== */

/* ---------- Desktop navigation (≥ 992px) ---------- */
@media (min-width: 992px) {
  .main-nav {
    flex-grow: 1;
  }

  .main-nav .offcanvas-body {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.6rem;
  }

  .navbar-nav {
    flex-direction: row;
    align-items: center;
    gap: .15rem;
  }

  .nav-link {
    padding: .55rem .8rem !important;
  }

  .nav-link::after {
    content: '';
    position: absolute;
    left: .8rem;
    right: .8rem;
    bottom: .25rem;
    height: 2px;
    border-radius: 2px;
    background: var(--mr-gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .4s var(--mr-ease-out);
  }

  .nav-link:hover::after,
  .nav-link:focus-visible::after,
  .nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .has-sub .nav-link {
    padding-right: .2rem !important;
  }

  .has-sub .nav-link::after {
    right: .2rem;
  }

  .sub-toggle {
    width: 22px;
    height: 22px;
    margin-right: .4rem;
  }

  .sub-toggle:hover {
    background: var(--mr-blue-soft);
  }

  .has-sub {
    position: relative;
  }

  .submenu {
    position: absolute;
    top: calc(100% + 14px);
    left: -1rem;
    z-index: 10;
    width: 300px;
    padding: .7rem;
    background: #fff;
    border: 1px solid var(--mr-border);
    border-radius: 22px;
    box-shadow: var(--mr-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s var(--mr-ease), transform .35s var(--mr-ease), visibility .3s;
  }

  /* Invisible hover bridge between link and dropdown */
  .submenu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -16px;
    height: 16px;
  }

  .has-sub:hover>.submenu,
  .has-sub:focus-within>.submenu,
  .has-sub.is-open>.submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .has-sub:hover>.nav-item-row .sub-toggle {
    transform: rotate(180deg);
  }

  .has-sub.is-closed>.submenu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
  }

  .has-mega .submenu {
    left: 50%;
    width: 560px;
    transform: translate(-50%, 10px);
  }

  .has-mega:hover>.submenu,
  .has-mega:focus-within>.submenu,
  .has-mega.is-open>.submenu {
    transform: translate(-50%, 0);
  }

  .has-mega.is-closed>.submenu {
    transform: translate(-50%, 10px);
  }

  .has-mega .submenu-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .1rem;
  }

  /* All dropdowns share the same compact item style */
  .submenu-link {
    align-items: center;
    padding: .55rem .7rem;
  }

  .submenu-title {
    padding-top: 0;
    font-size: .9rem;
  }

  .submenu-icon {
    width: 34px;
    height: 34px;
  }

  .header-cta {
    flex-shrink: 0;
  }

  /* Light header text over dark page heroes */
  .has-dark-hero .site-header:not(.is-scrolled) .nav-link {
    color: rgba(255, 255, 255, .88);
  }

  .has-dark-hero .site-header:not(.is-scrolled) .nav-link:hover,
  .has-dark-hero .site-header:not(.is-scrolled) .nav-link.active {
    color: #fff;
  }

  .has-dark-hero .site-header:not(.is-scrolled) .nav-link::after {
    background: #7fd8f7;
  }

  .has-dark-hero .site-header:not(.is-scrolled) .sub-toggle {
    color: rgba(255, 255, 255, .88);
  }

  .has-dark-hero .site-header:not(.is-scrolled) .sub-toggle:hover {
    background: rgba(255, 255, 255, .12);
  }
}

/* Compact desktop: tighten nav so everything fits on one line */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .nav-link {
    font-size: .9rem;
    padding: .5rem .55rem !important;
  }

  .main-nav .offcanvas-body {
    gap: .8rem;
  }

  .header-cta {
    padding: .65rem 1.05rem;
    font-size: .88rem;
  }
}

/* ---------- Mobile / tablet navigation (< 992px) ---------- */
@media (max-width: 991.98px) {
  :root {
    --header-h: 72px;
  }

  .site-header .navbar,
  .site-header.is-scrolled .navbar {
    padding: .7rem 0;
  }

  .site-header {
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 1px 0 rgba(10, 26, 51, .06);
  }

  /* backdrop-filter on the header makes it the containing block for the fixed
     offcanvas menu, squashing the menu into the header bar once scrolled. */
  .site-header,
  .site-header.is-scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .has-dark-hero .site-header:not(.is-scrolled) {
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* Left-to-right slide-in panel (Bootstrap offcanvas-lg) */
  .main-nav.offcanvas-lg {
    --bs-offcanvas-width: min(88vw, 380px);
    --bs-offcanvas-transition: transform .45s cubic-bezier(.16, 1, .3, 1);
    background: #fff;
    border-right: 0 !important;
    box-shadow: 30px 0 60px -30px rgba(10, 26, 51, .45);
  }

  .main-nav .offcanvas-header {
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--mr-border);
  }

  .main-nav .offcanvas-header .brand {
    color: var(--mr-ink);
  }

  .main-nav .offcanvas-header .brand-logo {
    height: 50px;
  }

  .site-header .brand-logo,
  .site-header.is-scrolled .brand-logo {
    height: 48px;
  }

  .main-nav .offcanvas-body {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 2rem;
  }

  .navbar-nav {
    gap: 0;
  }

  .navbar-nav>.nav-item {
    border-bottom: 1px solid var(--mr-border);
  }

  .nav-item-row {
    justify-content: space-between;
  }

  .nav-link {
    padding: 1rem .25rem !important;
    font-size: 1.05rem;
    flex-grow: 1;
  }

  .sub-toggle {
    width: 42px;
    height: 42px;
    background: var(--mr-bg-soft);
    border-radius: 12px;
  }

  .sub-toggle .bi {
    font-size: .85rem;
  }

  .submenu {
    display: none;
    padding: 0 0 1rem;
  }

  .submenu-link {
    padding: .6rem .5rem;
    align-items: center;
  }

  .submenu-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .submenu-title {
    padding-top: 0;
    font-size: .95rem;
  }

  .submenu-more {
    margin: .5rem .5rem 0;
  }

  .header-cta {
    justify-content: center;
    margin-top: 1.75rem;
    padding: .95rem 1.4rem;
    font-size: 1rem;
  }

  .mobile-nav-contact {
    margin-top: 1.75rem;
    padding: 1.25rem;
    border-radius: 18px;
    background: var(--mr-bg-soft);
  }

  .mobile-nav-label {
    margin: 0 0 .6rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mr-muted);
  }

  .mobile-nav-contact a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem 0;
    font-weight: 600;
    color: var(--mr-ink);
    word-break: break-all;
    font-size: 12px;
  }

  .mobile-nav-contact .bi {
    color: var(--mr-primary);
  }

  /* Stagger menu items in as the panel opens */
  .main-nav .navbar-nav>.nav-item,
  .main-nav .header-cta,
  .main-nav .mobile-nav-contact {
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity .4s, transform .5s var(--mr-ease-out);
  }

  .main-nav.show .navbar-nav>.nav-item,
  .main-nav.show .header-cta,
  .main-nav.show .mobile-nav-contact {
    opacity: 1;
    transform: none;
  }

  .main-nav.show .navbar-nav>.nav-item:nth-child(1) {
    transition-delay: .08s;
  }

  .main-nav.show .navbar-nav>.nav-item:nth-child(2) {
    transition-delay: .12s;
  }

  .main-nav.show .navbar-nav>.nav-item:nth-child(3) {
    transition-delay: .16s;
  }

  .main-nav.show .navbar-nav>.nav-item:nth-child(4) {
    transition-delay: .2s;
  }

  .main-nav.show .navbar-nav>.nav-item:nth-child(5) {
    transition-delay: .24s;
  }

  .main-nav.show .header-cta {
    transition-delay: .28s;
  }

  .main-nav.show .mobile-nav-contact {
    transition-delay: .32s;
  }

  /* Layout */
  :root {
    --section-y: 88px;
  }

  .hero {
    padding: calc(var(--header-h) + 48px) 0 120px;
  }

  .hero .hero-lead {
    margin-inline: auto;
  }

  .hero .btn-group-mr {
    justify-content: center;
  }

  .page-hero {
    padding: calc(var(--header-h) + 64px) 0 76px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(3)::before {
    display: none;
  }

  .stat:nth-child(n+3) {
    border-top: 1px solid var(--mr-border);
  }

  .collage {
    max-width: 560px;
    margin: 0 auto;
  }

  .why-visual {
    max-width: 560px;
    margin: 0 auto;
  }

  .why-quote {
    right: 0;
  }

  .industry-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
  }

  .industry-grid> :nth-last-child(-n+2):nth-child(4n+1),
  .industry-grid> :nth-last-child(-n+2):nth-child(4n+1)~* {
    grid-column: span 2;
  }

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

  .process {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 620px;
    margin: 0 auto;
  }

  .process::before,
  .process::after {
    top: 44px;
    bottom: 44px;
    left: 44px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .process::after {
    transform: scaleY(0);
    transform-origin: top;
  }

  .process.is-visible::after {
    transform: scaleY(1);
  }

  .process-step {
    display: grid;
    grid-template-columns: 88px 1fr;
    column-gap: 1.5rem;
    text-align: left;
    padding: 0 0 2.25rem;
  }

  .process-step:last-child {
    padding-bottom: 0;
  }

  .process-marker {
    grid-row: span 2;
    margin: 0;
  }

  .process-title {
    align-self: end;
    margin-top: .9rem;
  }

  .service-row,
  .service-row-reverse {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .service-row-reverse .service-row-media {
    order: 0;
  }

  .service-rows {
    gap: 4.5rem;
  }

  .cta-band {
    padding: 4rem 2.5rem;
  }

  .map-card {
    grid-template-columns: 1fr;
  }

  .map-visual {
    min-height: 240px;
  }
}

/* ---------- Tablet ---------- */
@media (max-width: 767.98px) {
  :root {
    --section-y: 72px;
    --bs-body-font-size: 1rem;
  }

  .section-head {
    margin-bottom: 2.25rem;
  }

  .section-text,
  .hero-lead,
  .page-hero-lead,
  .cta-text {
    font-size: 1.05rem;
  }

  .industry-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 240px;
    gap: .85rem;
  }

  .industry-grid>* {
    grid-column: auto !important;
  }

  .industry-more {
    opacity: 1;
    transform: none;
  }

  .industry-name {
    transform: none;
    font-size: 1.02rem;
  }

  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .values-grid> :last-child {
    grid-column: span 2;
  }

  .form-card {
    padding: 1.75rem 1.4rem;
    border-radius: var(--mr-radius);
  }

  .purpose-card {
    padding: 2.2rem 1.8rem;
  }

  .cta-band {
    padding: 3.25rem 1.6rem;
    border-radius: 26px;
  }

  .map-body {
    padding: 2rem 1.6rem;
  }

  .footer-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .service-row-num {
    font-size: 4rem;
    top: -20px;
  }

  .roles-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 575.98px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .g-5 {
    --bs-gutter-x: 2.5rem;
  }

  /* half-gutter must not exceed container padding */
  .hero {
    padding-bottom: 104px;
  }

  .hero-badge {
    font-size: .78rem;
  }

  .hero .btn-group-mr .btn-mr {
    flex: 1 1 100%;
    justify-content: center;
  }

  .stats-wrap {
    margin-top: -60px;
  }

  .stat {
    padding: 1.4rem .75rem;
  }

  .stat-label {
    font-size: .8rem;
  }

  .seal {
    width: 100px;
    height: 100px;
    top: 4%;
    right: 0;
  }

  .seal-text text {
    font-size: 9px;
  }

  .seal-mark {
    width: 40px;
  }

  .collage-small {
    border-width: 5px;
    border-radius: 16px;
  }

  .btn-group-mr {
    gap: .75rem;
  }

  .page-hero .btn-group-mr .btn-mr,
  .cta-band .btn-group-mr .btn-mr {
    flex: 1 1 100%;
    justify-content: center;
  }

  .industry-grid {
    grid-auto-rows: 200px;
  }

  .industry-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    top: .75rem;
    left: .75rem;
  }

  .industry-body {
    padding: .9rem;
  }

  .industry-name {
    font-size: .92rem;
  }

  .industry-more {
    font-size: .78rem;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .values-grid> :last-child {
    grid-column: auto;
  }

  .process-step {
    grid-template-columns: 72px 1fr;
    column-gap: 1.1rem;
  }

  .process-icon {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
  }

  .process::before,
  .process::after {
    left: 36px;
    top: 36px;
    bottom: 36px;
  }

  .why-quote {
    position: relative;
    left: auto;
    right: auto;
    margin: -2.5rem 1rem 0;
  }

  .why-visual {
    padding-bottom: 0;
  }

  .detail-visual {
    padding: 0 0 18px 18px;
  }

  .detail-visual-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    right: 16px;
    border-radius: 18px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 46px;
    height: 46px;
  }
}

/* ---------- Small mobile ---------- */
@media (max-width: 374.98px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .industry-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Large desktop ---------- */
@media (min-width: 1400px) {
  :root {
    --section-y: 128px;
  }

  .industry-grid {
    grid-auto-rows: 360px;
  }
}

/* ---------- Touch devices: simplified hover effects ---------- */
@media (hover: none) {
  .industry-more {
    opacity: 1;
    transform: none;
  }

  .industry-name {
    transform: none;
  }

  .service-card:hover,
  .value-card:hover,
  .point-card:hover,
  .purpose-card:hover {
    transform: none;
  }
}

/* ---------- Footer grid ---------- */
/* Tablet: 2 × 2 */
@media (max-width: 991.98px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 2rem;
  }
}

/* Mobile: company and contact full width, links side by side */
@media (max-width: 575.98px) {
  .footer-grid {
    gap: 2.25rem 1.5rem;
    padding-bottom: 2.5rem;
  }

  .footer-brand,
  .footer-contact-col {
    grid-column: 1 / -1;
  }
}

/* ---------- Hero slider ---------- */
@media (max-width: 991.98px) {
  .hero-slider .carousel-item {
    min-height: 680px;
  }

  .hero-slider .carousel-item>.container {
    padding-bottom: 200px;
  }

  .hero-indicators [data-bs-slide-to] {
    min-width: 110px;
  }

  .hero-slide-overlay {
    background: linear-gradient(180deg, rgba(10, 26, 51, .7) 0%, rgba(10, 26, 51, .82) 55%, rgba(10, 26, 51, .95) 100%);
  }
}

@media (max-width: 575.98px) {
  .hero-slider .carousel-item {
    min-height: 720px;
  }

  .hero-slider .carousel-item>.container {
    padding-top: calc(var(--header-h) + 28px);
    padding-bottom: 180px;
  }

  .hero-slider .btn-group-mr .btn-mr {
    flex: 1 1 100%;
    justify-content: center;
  }

  .hero-slider-ui {
    bottom: 92px;
  }

  .hero-indicators.carousel-indicators {
    gap: .9rem;
  }

  .hero-indicators [data-bs-slide-to] {
    min-width: 52px;
  }

  .hero-indicator-label {
    display: none;
  }

  .hero-arrow {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

@media (max-width: 374.98px) {
  .hero-indicators.carousel-indicators {
    gap: .6rem;
  }

  .hero-indicators [data-bs-slide-to] {
    min-width: 40px;
  }

  .hero-arrows {
    gap: .4rem;
  }

  .hero-arrow {
    width: 40px;
    height: 40px;
  }
}
/* Navy scrolled header (desktop): white dropdown arrows to match the menu text */
@media (min-width: 992px) {
  .site-header.is-scrolled .sub-toggle {
    color: rgba(255, 255, 255, .88);
  }

  .site-header.is-scrolled .sub-toggle:hover {
    background: rgba(255, 255, 255, .12);
  }
}


@media (max-width: 992px) {
    .hero-slider .hero-title {
    color: #fff;
    font-size: 35px;
}

}
