/* NAC responsive fixes — loaded after the site's own stylesheet. */

/* Header on phones: logo, name, language button and menu button must fit on one row. */
@media (max-width: 480px) {
  header .container-custom > div { gap: 6px; height: 4.5rem; padding-left: 4px; padding-right: 4px; }
  header a[href="/"] { flex-shrink: 1 !important; min-width: 0; gap: 8px; }
  header a[href="/"] > div:first-child { width: 44px; height: 44px; flex: none; }
  header a[href="/"] > div:last-child { min-width: 0; }
  header a[href="/"] span.font-bold { font-size: .8rem; line-height: 1.15; }
  header .lg\:hidden:not(.fixed) { flex: none; gap: 2px; }
}
@media (max-width: 360px) {
  header a[href="/"] > div:first-child { width: 38px; height: 38px; }
  header a[href="/"] span.font-bold { font-size: .72rem; }
}

/* Top menu: show as many links as fit; the rest go in the three-line menu. (Measured per screen width.) */
@media (min-width: 768px) {
  header nav.hidden { display: flex !important; }
  header div.lg\:hidden:not(.fixed) > button:first-child { display: none !important; } /* language button is already in the top menu */
}
@media (min-width: 1024px) {
  header div.lg\:hidden:not(.fixed) { display: flex !important; }
  header .lg\:hidden.fixed { display: block !important; }
}

@media (min-width: 768px) and (max-width: 815px) {
  header nav.hidden > a:nth-child(n+4) { display: none !important; }
  header .fixed nav > a:nth-child(-n+3) { display: none !important; }
}
@media (min-width: 816px) and (max-width: 871px) {
  header nav.hidden > a:nth-child(n+5) { display: none !important; }
  header .fixed nav > a:nth-child(-n+4) { display: none !important; }
}
@media (min-width: 872px) and (max-width: 935px) {
  header nav.hidden > a:nth-child(n+6) { display: none !important; }
  header .fixed nav > a:nth-child(-n+5) { display: none !important; }
}
@media (min-width: 936px) and (max-width: 1023px) {
  header nav.hidden > a:nth-child(n+7) { display: none !important; }
  header .fixed nav > a:nth-child(-n+6) { display: none !important; }
}
@media (min-width: 1024px) and (max-width: 1095px) {
  header nav.hidden > a:nth-child(n+8) { display: none !important; }
  header .fixed nav > a:nth-child(-n+7) { display: none !important; }
}
@media (min-width: 1096px) and (max-width: 1151px) {
  header nav.hidden > a:nth-child(n+9) { display: none !important; }
  header .fixed nav > a:nth-child(-n+8) { display: none !important; }
}
@media (min-width: 1152px) and (max-width: 1223px) {
  header nav.hidden > a:nth-child(n+10) { display: none !important; }
  header .fixed nav > a:nth-child(-n+9) { display: none !important; }
}
@media (min-width: 1224px) and (max-width: 1231px) {
  header nav.hidden > a:nth-child(n+11) { display: none !important; }
  header .fixed nav > a:nth-child(-n+10) { display: none !important; }
}
@media (min-width: 1232px) and (max-width: 1279px) {
  header div.lg\:hidden:not(.fixed) { display: none !important; } /* everything fits: no extra menu needed */
}
@media (min-width: 1280px) and (max-width: 1343px) {
  header nav.hidden > a:nth-child(n+10) { display: none !important; }
  header .fixed nav > a:nth-child(-n+9) { display: none !important; }
}
@media (min-width: 1344px) and (max-width: 1375px) {
  header nav.hidden > a:nth-child(n+11) { display: none !important; }
  header .fixed nav > a:nth-child(-n+10) { display: none !important; }
}
@media (min-width: 1376px) {
  header div.lg\:hidden:not(.fixed) { display: none !important; } /* everything fits: no extra menu needed */
}

/* Very narrow phones (320px): nothing may push the page wider than the screen. */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow-x: clip) { body { overflow-x: hidden; } }
.grid > * { min-width: 0; }
img, video { max-width: 100%; }

/* The three-line menu repeated the language button with white text on white; the top bar already has one. */
header .fixed nav > button { display: none !important; }

/* ------------------------------------------------------------------
   Desktop hover polish (mouse devices only; phones and tablets are untouched)
   ------------------------------------------------------------------ */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  /* Top menu: the old hover colour matched the bar, so nothing was visible. */
  header nav > a { position: relative; }
  header nav > a:not([class*="bg-white"]):hover { background: rgba(255, 255, 255, .16) !important; transform: translateY(-1px); }
  header nav > a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px;
    background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; opacity: .85;
  }
  header nav > a:not([class*="bg-white"]):hover::after { transform: scaleX(1); }
  header nav > a[class*="bg-white"]::after { display: none; }

  /* Buttons and button-style links outside the header. */
  :is(button, a).inline-flex:not(header *):not(:disabled) {
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  }
  :is(button, a).inline-flex:not(header *):not(:disabled):hover {
    transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(25, 87, 52, .45);
  }
  :is(button, a).inline-flex:not(header *):not(:disabled):active { transform: translateY(0); box-shadow: 0 3px 8px -4px rgba(25, 87, 52, .4); }

  /* Cards (service, job, blog, client and similar). Cards that hold form fields stay still. */
  .bg-card:is(.rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl):not(:has(input, textarea, select)),
  .group.bg-white:is(.rounded-xl, .rounded-2xl) {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  }
  .bg-card:is(.rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl):not(:has(input, textarea, select)):hover,
  .group.bg-white:is(.rounded-xl, .rounded-2xl):hover {
    transform: translateY(-4px); box-shadow: 0 18px 36px -14px rgba(15, 40, 28, .28); border-color: rgba(25, 87, 52, .35);
  }
  a:has(> .bg-card), .group { cursor: pointer; }

  /* Footer links. */
  footer a { transition: color .2s ease, transform .2s ease; }
  footer a:hover { text-decoration: underline; text-underline-offset: 4px; transform: translateX(2px); }

  /* Keyboard users get a clear ring on the same elements. */
  header nav > a:focus-visible, :is(button, a).inline-flex:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(25, 87, 52, .6); }
}
@media (prefers-reduced-motion: reduce) {
  header nav > a, :is(button, a).inline-flex, .bg-card, footer a { transition: none !important; transform: none !important; }
}

/* ------------------------------------------------------------------
   Three-line menu: modern glass panel with a dimmed backdrop and locked page scroll.
   Note: the header's backdrop blur makes it the reference box for the fixed menu parts below.
   ------------------------------------------------------------------ */
header .container-custom { position: relative; z-index: 35; }       /* keep the logo row and the close button above the backdrop */

/* Backdrop: covers the whole screen, dims the page, closes the menu when tapped. */
header > div.fixed.inset-0 {
  top: -1rem !important; left: -1rem !important; right: auto !important; bottom: auto !important;
  width: 100vw; height: 100vh; height: 100dvh; border-radius: 0 !important;
  background: rgba(6, 22, 14, .6) !important; -webkit-backdrop-filter: none; backdrop-filter: none;
  animation: nacFade .2s ease-out;
}

/* The panel itself. */
header .fixed.inset-x-4 {
  left: 0 !important; right: 0 !important; top: calc(100% + 10px) !important; width: auto;
  background: linear-gradient(165deg, rgba(27, 92, 58, .99), rgba(12, 44, 28, .99)) !important;
  -webkit-backdrop-filter: none; backdrop-filter: none; will-change: transform, opacity;
  border: 1px solid rgba(255, 255, 255, .14) !important; border-radius: 22px !important;
  box-shadow: 0 16px 32px -14px rgba(0, 0, 0, .5) !important;
  max-height: calc(100vh - 8.5rem) !important; max-height: calc(100dvh - 8.5rem) !important;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  transform-origin: top right; animation: nacDrop .16s ease-out;
}
header .fixed.inset-x-4 nav { padding: 10px !important; gap: 4px !important; }
header .fixed.inset-x-4 nav > a {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  color: rgba(255, 255, 255, .92) !important; font-size: 1.02rem !important; font-weight: 500 !important;
  padding: 14px 16px !important; border-radius: 14px !important;
  background-color: transparent; background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.45' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
  transition: background-color .12s ease !important; transition-delay: 0s !important;   /* the site adds a per-link delay (40ms x position) that made hover feel slow */
}
header .fixed.inset-x-4 nav > a:active { background-color: rgba(255, 255, 255, .14); }
header .fixed.inset-x-4 nav > a[class*="bg-white"] {             /* current page */
  background-color: rgba(255, 255, 255, .15) !important; color: #fff !important; font-weight: 700 !important;
  box-shadow: inset 3px 0 0 #7ee0a8;
}

/* Phones and small tablets: lock the page behind the open menu. */
@media (max-width: 767px) {
  html:has(header > div.fixed.inset-0), body:has(header > div.fixed.inset-0) { overflow: hidden !important; }
}

/* Tablets and desktops: compact panel under the button, backdrop only closes the menu (no dimming). */
@media (min-width: 768px) {
  header .fixed.inset-x-4 { left: auto !important; width: 280px; }
  header > div.fixed.inset-0 { background: transparent !important; -webkit-backdrop-filter: none; backdrop-filter: none; animation: none; }
}
@media (min-width: 1024px) {
  header > div.fixed.inset-0 { display: block !important; }
  header .fixed nav > a::after { display: none !important; }
  header .fixed nav > a:hover { transform: none !important; }
}
@media (hover: hover) and (pointer: fine) {
  header .fixed.inset-x-4 nav > a:hover { background-color: rgba(255, 255, 255, .1) !important; }
  header .fixed.inset-x-4 nav > a[class*="bg-white"]:hover { background-color: rgba(255, 255, 255, .18) !important; }
}
@keyframes nacDrop { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes nacFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { header .fixed.inset-x-4, header > div.fixed.inset-0 { animation: none; } }

/* Home pop-up: show each job poster whole (it was cropped to a wide box), whatever its proportions. */
div.fixed.bottom-6.right-6 img[alt^="Ad "] {
  width: auto !important; height: 190px !important; max-width: none; flex: none;
  object-fit: contain !important; background: rgba(255, 255, 255, .06);
}
@media (max-width: 480px) { div.fixed.bottom-6.right-6 img[alt^="Ad "] { height: 150px !important; } }
