/* CCS_HEADER_MARKER
   Chamathka Cab Service - site header.
   Snippet: "CCS Site Header" | group: Site Frame | type: css | run_at: wp_head
   Ported from the design's components.css (.site-header, .site-nav, .mobile-menu).

   Core's block-library CSS prints AFTER snippet CSS, so every override of a
   core class carries a .ccs-header parent to win on specificity, not order.
   No filter/backdrop-filter is ever set on .ccs-header itself: it is an
   ancestor of core/navigation, whose overlay is position:fixed and would be
   trapped inside a filtered ancestor. The blur lives on ::after. */

/* --- 1. The bar --------------------------------------------------------- */
.ccs-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: var(--wp--custom--z-header);
  margin: 0;
  padding: 0;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  color: var(--wp--preset--color--base);
  transition:
    border-color var(--wp--custom--duration-base) var(--wp--custom--ease-out),
    box-shadow var(--wp--custom--duration-base) var(--wp--custom--ease-out);
}

.ccs-header::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 160px;
  z-index: -1;
  background: var(--wp--custom--scrim-top);
  pointer-events: none;
  transition: opacity var(--wp--custom--duration-base) var(--wp--custom--ease-out);
}

.ccs-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--wp--custom--duration-base) var(--wp--custom--ease-out);
}

.ccs-header.is-ccs-stuck {
  border-bottom-color: var(--wp--custom--border-inverse);
  box-shadow: var(--wp--custom--shadow-md);
}

.ccs-header.is-ccs-stuck::before {
  opacity: 0;
}

.ccs-header.is-ccs-stuck::after {
  opacity: 1;
}

.ccs-header .ccs-header__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--wp--preset--spacing--50);
  width: 100%;
  max-width: calc(var(--wp--custom--container-max) + var(--wp--custom--container-gutter) * 2);
  height: var(--wp--custom--header-height);
  margin-block: 0;
  margin-inline: auto;
  padding-block: 0;
  padding-inline: var(--wp--custom--container-gutter);
  color: var(--wp--preset--color--base);
  transition: height var(--wp--custom--duration-base) var(--wp--custom--ease-out);
}

.ccs-header.is-ccs-stuck .ccs-header__inner {
  height: var(--wp--custom--header-height-compact);
}

/* --- 2. Brand ----------------------------------------------------------- */
.ccs-header .ccs-header__brand {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--wp--preset--spacing--20);
  margin: 0;
  padding: 0;
}

.ccs-header .wp-block-site-logo {
  margin: 0;
  line-height: 0;
}

.ccs-header .wp-block-site-logo a {
  display: block;
}

.ccs-header .wp-block-site-logo img {
  display: block;
  width: 46px;
  height: auto;
  border-radius: var(--wp--custom--radius-sm);
  transition: width var(--wp--custom--duration-base) var(--wp--custom--ease-out);
}

.ccs-header.is-ccs-stuck .wp-block-site-logo img {
  width: 40px;
}

.ccs-header .ccs-header__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

.ccs-header .ccs-header__brand-name {
  margin: 0;
  color: var(--wp--preset--color--base);
  font-size: var(--wp--preset--font-size--base);
  font-weight: 700;
  letter-spacing: var(--wp--custom--tracking-tight);
  line-height: 1.12;
}

.ccs-header .ccs-header__brand-tagline {
  margin: 0;
  color: var(--wp--preset--color--accent-ink-inverse);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--wp--custom--tracking-wide);
  line-height: 1.12;
  text-transform: uppercase;
}

/* --- 3. Right-hand cluster ---------------------------------------------- */
.ccs-header .ccs-header__end {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--wp--preset--spacing--50);
  margin: 0;
  padding: 0;
}

.ccs-header .ccs-header__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--wp--preset--spacing--20);
}

.ccs-header .ccs-header__phone {
  display: none;
  align-items: center;
  gap: var(--wp--preset--spacing--10);
  color: var(--wp--preset--color--base);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--wp--custom--duration-fast) var(--wp--custom--ease-out);
}

.ccs-header .ccs-header__phone:hover,
.ccs-header .ccs-header__phone:focus-visible {
  color: var(--wp--preset--color--accent-ink-inverse);
}

.ccs-header .ccs-header__cta {
  display: none;
}

/* --- 4. Navigation, desktop --------------------------------------------- */
.ccs-header .ccs-nav {
  color: var(--wp--preset--color--base);
}

.ccs-header .ccs-nav .wp-block-navigation__container {
  gap: clamp(0.5rem, 0.1rem + 1vw, 1.25rem);
}

.ccs-header .ccs-nav .wp-block-navigation-item__content {
  position: relative;
  display: block;
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--10);
  color: var(--wp--custom--text-inverse-muted);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--wp--custom--duration-fast) var(--wp--custom--ease-out);
}

.ccs-header .ccs-nav .wp-block-navigation-item__content:hover,
.ccs-header .ccs-nav .wp-block-navigation-item__content:focus-visible,
.ccs-header .ccs-nav .current-menu-item .wp-block-navigation-item__content {
  color: var(--wp--preset--color--base);
}

/* Core positions these three wrappers; that hijacks nothing here because we
   have no submenus, but keeping them static also keeps the overlay anchored
   to the viewport rather than to the nav block. */
.ccs-header .ccs-nav.wp-block-navigation,
.ccs-header .ccs-nav .wp-block-navigation__responsive-dialog,
.ccs-header .ccs-nav .wp-block-navigation__responsive-close {
  position: static;
}

/* --- 5. The hamburger --------------------------------------------------- */
.ccs-header .ccs-nav .wp-block-navigation__responsive-container-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--wp--custom--button-height-sm);
  height: var(--wp--custom--button-height-sm);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--wp--custom--radius-sm);
  background-color: transparent;
  color: var(--wp--preset--color--base);
}

.ccs-header .ccs-nav .wp-block-navigation__responsive-container-open svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* --- 6. Breakpoint band: keep the overlay up to the design's 1060px ------ */
@media (min-width: 600px) and (max-width: 1059.98px) {
  .ccs-header .ccs-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none;
  }

  .ccs-header .ccs-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }
}

/* --- 7. Desktop: links out, hamburger gone ------------------------------ */
@media (min-width: 1060px) {
  .ccs-header .ccs-header__phone {
    display: inline-flex;
  }

  .ccs-header .ccs-header__cta {
    display: inline-flex;
  }

  .ccs-header .ccs-nav .wp-block-navigation__responsive-container-open {
    display: none;
  }

  .ccs-header .ccs-nav .ccs-nav__cta {
    display: none;
  }

  .ccs-header .ccs-nav .ccs-nav__jobs {
    display: none;
  }

  .ccs-header .ccs-nav .wp-block-navigation-item__content::after {
    content: "";
    position: absolute;
    inset-inline: var(--wp--preset--spacing--10);
    inset-block-end: 0;
    height: var(--wp--custom--border-thick);
    background-color: var(--wp--preset--color--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--wp--custom--duration-base) var(--wp--custom--ease-out);
  }

  .ccs-header .ccs-nav .wp-block-navigation-item__content:hover::after,
  .ccs-header .ccs-nav .wp-block-navigation-item__content:focus-visible::after {
    transform: scaleX(1);
  }
}

/* --- 8. The open overlay ------------------------------------------------ */
.ccs-header .ccs-nav .wp-block-navigation__responsive-container.is-menu-open {
  padding: 0;
  background-color: var(--wp--preset--color--black);
  color: var(--wp--preset--color--base);
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation__responsive-close {
  width: 100%;
  max-width: calc(var(--wp--custom--container-max) + var(--wp--custom--container-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--wp--custom--container-gutter);
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation__responsive-dialog {
  margin-block-start: 0;
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation__responsive-container-close {
  position: absolute;
  inset-block-start: calc((var(--wp--custom--header-height) - 42px) / 2);
  inset-inline-end: var(--wp--custom--container-gutter);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--wp--custom--radius-sm);
  background-color: transparent;
  color: var(--wp--preset--color--base);
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation__responsive-container-close svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation__responsive-container-content {
  display: block;
  width: 100%;
  padding-block: calc(var(--wp--custom--header-height) + var(--wp--preset--spacing--50)) var(--wp--preset--spacing--80);
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation__container {
  display: block;
  width: 100%;
  gap: 0;
  counter-reset: ccs-nav;
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation-item {
  display: block;
  width: 100%;
}

.ccs-header .ccs-nav .is-menu-open .ccs-nav__item {
  counter-increment: ccs-nav;
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation-item__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--wp--preset--spacing--40) 0;
  border-bottom: 1px solid var(--wp--custom--border-inverse);
  color: var(--wp--preset--color--base);
  font-size: var(--wp--preset--font-size--xl);
  font-weight: 600;
  letter-spacing: var(--wp--custom--tracking-tight);
  white-space: normal;
}

.ccs-header .ccs-nav .is-menu-open .wp-block-navigation-item__content:hover,
.ccs-header .ccs-nav .is-menu-open .wp-block-navigation-item__content:focus-visible {
  color: var(--wp--preset--color--accent-ink-inverse);
}

.ccs-header .ccs-nav .is-menu-open .ccs-nav__item .wp-block-navigation-item__content::after {
  content: counter(ccs-nav, decimal-leading-zero);
  color: var(--wp--preset--color--accent-ink-inverse);
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 700;
  letter-spacing: var(--wp--custom--tracking-wide);
}

/* CTA items - real menu items the owner can edit, drawn as buttons. */
.ccs-header .ccs-nav .is-menu-open .ccs-nav__cta {
  margin-block-start: var(--wp--preset--spacing--50);
}

.ccs-header .ccs-nav .is-menu-open .ccs-nav__cta + .ccs-nav__cta {
  margin-block-start: var(--wp--preset--spacing--20);
}

.ccs-header .ccs-nav .is-menu-open .ccs-nav__cta .wp-block-navigation-item__content {
  justify-content: center;
  min-height: var(--wp--custom--button-height);
  padding: 0 var(--wp--preset--spacing--50);
  border: 1px solid var(--wp--preset--color--accent-fill);
  border-radius: var(--wp--custom--radius-md);
  background-color: var(--wp--preset--color--accent-fill);
  color: var(--wp--preset--color--base);
  font-size: var(--wp--preset--font-size--base);
  font-weight: 600;
  line-height: 1;
}

.ccs-header .ccs-nav .is-menu-open .ccs-nav__cta--ghost .wp-block-navigation-item__content {
  border-color: rgba(255, 255, 255, 0.34);
  background-color: rgba(255, 255, 255, 0.06);
}

/* Hide the bar's own phone/CTA while the overlay owns the screen. */
.ccs-header:has(.is-menu-open) .ccs-header__actions {
  visibility: hidden;
}

/* --- 9. Editor: the header part is not fixed inside the canvas ---------- */
.editor-styles-wrapper .ccs-header,
.block-editor-block-list__layout .ccs-header {
  position: relative;
}

.editor-styles-wrapper .ccs-header::after,
.block-editor-block-list__layout .ccs-header::after {
  opacity: 1;
}
