/* ============ Site Header (shared by index/about/cases/...) ============ */

/* Wide container — same as home.css. Bootstrap's .container (1140px)
   would make the nav narrower on widget-rendered list/article pages. */
:root { --container: 1450px; }
.container {
  width: calc(100% - 96px);
  max-width: var(--container);
  margin-inline: auto;
  padding: 0;
}

.header {
  height: 80px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(223, 247, 244, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 64px;
}
.brand { margin-right: auto; flex: none; }
.brand img { width: 68px; height: 68px; object-fit: contain; }
.main-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 55px;
}
.main-nav a {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  font-size: 15px;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { color: var(--green-dark, #008b79); }
.main-nav a.active:after {
  content: "";
  position: absolute;
  bottom: 8px;
  height: 2px;
  background: var(--green, #00b99e);
  width: 100%;
  left: 0;
}
.header-contact {
  border-radius: 30px;
  background: #438f86;
  color: #fff;
  font-size: 14px;
  padding: 3px 20px;
  white-space: nowrap;
}
.nav-toggle { display: none; }

/* --- Mobile dropdown animation (works with header.js) --- */
.header.site-header .nav-toggle span {
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.header.site-header .nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header.site-header .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.header.site-header .nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============ Responsive: <= 1599px ============ */
@media (max-width: 1599px) {
  .container { max-width: 1160px; width: calc(100% - 64px); }
  .header-inner { gap: 38px; }
  .main-nav { gap: 31px; }
}

/* ============ Responsive: <= 1199px ============ */
@media (max-width: 1199px) {
  .header-inner { gap: 25px; }
  .main-nav { gap: 23px; }
  .main-nav a { font-size: 13px; }
}

/* ============ Responsive: <= 959px (tablet / mobile) ============ */
@media (max-width: 959px) {
  .container { width: calc(100% - 40px); }
  .header { height: auto; min-height: 72px; }
  .header-inner { min-height: 72px; flex-wrap: wrap; gap: 16px; position: relative; }
  .brand img { width: 58px; height: 58px; }
  .header-contact { margin-right: 54px; }
  .nav-toggle:not([hidden]) {
    display: flex;
    position: absolute;
    right: 0;
    top: 15px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: #edf9f6;
    width: 42px;
    height: 42px;
    border-radius: 7px;
    padding: 10px;
  }
  .nav-toggle span { display: block; width: 22px; height: 2px; background: #137c6e; }
  /* When JS is active, hide the inline nav and show it as a floating dropdown. */
  .main-nav {
    width: 100%;
    order: 5;
    align-self: auto;
    display: flex;
    gap: 6px 25px;
    flex-wrap: wrap;
    padding-bottom: 14px;
  }
  .main-nav a { min-height: 40px; font-size: 15px; }
  .main-nav a.active:after { bottom: 1px; }
  .header.js-nav .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 101;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
    background: #fff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
  }
  .header.js-nav .main-nav a {
    width: 100%;
    min-height: 44px;
    padding: 10px 4px;
    border-bottom: 1px solid #f1f5f4;
  }
  .header.js-nav .main-nav a:last-child { border-bottom: 0; }
  .header.js-nav .main-nav.open { display: flex; }
}

/* ============ Responsive: <= 639px (mobile) ============ */
@media (max-width: 639px) {
  .container { width: calc(100% - 36px); }
  .header-inner { gap: 8px; }
  .main-nav { padding: 8px 0 16px; gap: 4px 0; justify-content: space-between; }
  .main-nav a { width: 32%; font-size: 14px; }
  .main-nav a.active:after { width: 28px; }
  .header-contact { font-size: 13px; padding: 4px 15px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .header.site-header .nav-toggle span { transition: none; }
}
