/* ==========================================================================
   CityFoundry AG — Site header
   Sticky bar, primary navigation, services mega menu, mobile drawer.
   Requires: tokens.css
   ========================================================================== */

/* --- Bar --------------------------------------------------------------- */
.cf-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(22px);
  padding: 20px 0;
  transition: padding .35s ease, box-shadow .35s ease;
}

/* Compacts once the page is scrolled — `is-scrolled` is set on <body>
   by the header script. */
body.is-scrolled .cf-header {
  padding-top: 13px;
  padding-bottom: 13px;
  box-shadow: 0 1px 0 rgba(4, 33, 31, .09), 0 14px 40px rgba(4, 33, 31, .06);
}

.cf-header__inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--cf-gutter);
  display: flex;
  align-items: center;
  gap: 34px;
}

.cf-header__logo {
  flex-shrink: 0;
  display: block;
  line-height: 0;
}

.cf-header__logo img {
  height: 30px;
  width: auto;
  display: block;
}

/* --- Primary navigation ------------------------------------------------ */
.cf-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.cf-nav__link {
  position: relative;
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--cf-ink);
  white-space: nowrap;
}

.cf-nav__link:hover { color: var(--cf-ink); }

/* Underline that wipes in from the left on hover. The current page is
   marked with `aria-current="page"` for assistive technology; add
   `data-on="1"` alongside it to keep the underline drawn as well. */
.cf-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1.5px;
  background: var(--cf-ink);
  transition: right .45s var(--cf-ease);
}

.cf-nav__link:hover::after,
.cf-nav__link[data-on="1"]::after { right: 0; }

.cf-nav__divider {
  width: 1px;
  height: 18px;
  background: var(--cf-line-ink-14);
}

/* --- Header call to action --------------------------------------------- */
.cf-header__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 7px 7px 7px 20px;
  border-radius: var(--cf-radius-pill);
  background: var(--cf-ink);
  color: var(--cf-white);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background .3s ease;
}

.cf-header__cta:hover {
  background: var(--cf-ink-2);
  color: var(--cf-white);
}

.cf-header__cta-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cf-cyan);
  color: var(--cf-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* --- Burger (mobile only) ---------------------------------------------- */
.cf-header__burger {
  display: none;
  margin-left: auto;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cf-line-ink-14);
  border-radius: 13px;
  background: var(--cf-white);
  cursor: pointer;
}

/* --- Mega menu ---------------------------------------------------------- */
.cf-mega {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--cf-white);
  border-top: 1px solid var(--cf-line-ink-08);
  box-shadow: 0 30px 70px rgba(4, 33, 31, .14);
  animation: cf-mega-in .3s var(--cf-ease) both;
}

@keyframes cf-mega-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

.cf-mega__grid {
  max-width: 1360px;
  margin: 0 auto;
  padding: 34px var(--cf-gutter) 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr) .82fr;
  gap: 22px;
}

.cf-mega__card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: var(--cf-ink);
}

.cf-mega__card:hover { color: var(--cf-ink); }

.cf-mega__media {
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.cf-mega__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .8s var(--cf-ease);
}

.cf-mega__card:hover .cf-mega__media img { transform: scale(1.08); }

.cf-mega__index {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 11px;
  border-radius: var(--cf-radius-pill);
  background: rgba(255, 255, 255, .92);
  font-family: var(--cf-font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .06em;
}

.cf-mega__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cf-mega__title {
  font-family: var(--cf-font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.02em;
}

.cf-mega__arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--cf-line-ink-16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background .3s ease, color .3s ease;
}

.cf-mega__card:hover .cf-mega__arrow {
  background: var(--cf-cyan);
  color: var(--cf-ink);
}

.cf-mega__text {
  display: block;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--cf-muted);
}

/* --- Mega menu promo tile ----------------------------------------------- */
.cf-mega__promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--cf-ink);
  text-decoration: none;
  color: var(--cf-white);
}

.cf-mega__promo:hover { color: var(--cf-white); }

.cf-mega__promo-glow {
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--cf-gradient-conic);
  filter: blur(6px);
  opacity: .5;
}

.cf-mega__promo-body {
  position: relative;
  display: block;
}

.cf-mega__promo-eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cf-cyan);
  margin-bottom: 10px;
}

.cf-mega__promo-title {
  display: block;
  font-family: var(--cf-font-head);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -.025em;
}

.cf-mega__promo-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--cf-white);
}

.cf-mega__promo-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cf-cyan);
  color: var(--cf-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* --- Mobile drawer ------------------------------------------------------- */
.cf-mobile-nav {
  border-top: 1px solid var(--cf-line-ink-08);
  margin-top: 18px;
  padding: 22px 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--cf-white);
}

.cf-mobile-nav__link {
  padding: 13px 0;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  color: var(--cf-ink);
  border-bottom: 1px solid var(--cf-line-ink-07);
}

.cf-mobile-nav__link:hover { color: var(--cf-ink); }

/* The three service entries carry a thumbnail. */
.cf-mobile-nav__link--media {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cf-mobile-nav__link--media img {
  width: 46px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

/* Last entry before the CTA closes the list without a rule. */
.cf-mobile-nav__link--last { border-bottom: 0; }

.cf-mobile-nav__cta {
  margin-top: 14px;
  text-align: center;
  padding: 15px;
  border-radius: var(--cf-radius-pill);
  background: var(--cf-ink);
  color: var(--cf-white);
  font-weight: 500;
  text-decoration: none;
}

.cf-mobile-nav__cta:hover { color: var(--cf-white); }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1240px) {
  .cf-nav,
  .cf-header__cta { display: none; }
  .cf-header__burger { display: inline-flex; }
}

@media (max-width: 720px) {
  .cf-header__inner {
    padding-left: var(--cf-gutter-sm);
    padding-right: var(--cf-gutter-sm);
  }
}
