/**
 * @file
 * Styles for the Sticky Navbar module — DESKTOP (>1024px) ONLY.
 *
 * CSS ARCHITECTURE:
 * - BEM naming: .sticky-navbar__element--modifier
 * - The wrapper uses position:sticky to pin ticker + navbar on scroll.
 * - Megamenus use opacity/visibility transitions for smooth reveal.
 * - All ≤1024px (tablet + mobile) rules live in css/navbar.miller.css.
 *   Do NOT add @media (max-width: 1024px) blocks here.
 */

/* ========== CLARITY FACTORY BRAND TOKENS ========== */
:root {
  --cf-dark: #192c29;
  --cf-leaf: #4a6b68;
  --cf-apple: #7ee6a1;
  --cf-sky: #7eb9e6;
  --cf-light: #81d8d0;
  --cf-mid: #69758c;
  --cf-teal: #6bc288;
  --cf-rose: #d9ae6c;
  --cf-mauve: #d99998;
}

/* ========== WRAPPER (sticky container for ticker + navbar) ========== */
.sticky-navbar-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;              /* Layer above all page content */
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

}

/* ========== ANNOUNCEMENTS TICKER ========== */
.sticky-navbar__ticker {
  background: var(--cf-dark);  /* Fallback; overridden by inline style from JSON */
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.sticky-navbar__ticker-track {
  display: inline-flex;
  /* Animation driven by JavaScript — see js/sticky-navbar.js */
}

.sticky-navbar__ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  flex-shrink: 0;
}


/* ========== NAVBAR ========== */
.sticky-navbar {
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 44, 41, 0.08);
}

.sticky-navbar__inner {
  /* max-width: 1280px; */
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  height: 64px;
  border: 0px solid #606b4a;

}

/* ========== BRAND / LOGO ========== */
.sticky-navbar__brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cf-leaf);
  letter-spacing: -0.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding:20px;
}

.sticky-navbar__brand img{
  padding:10px;
}

.sticky-navbar__brand-logo {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

/* ========== HAMBURGER TOGGLE (hidden on desktop) ========== */
.sticky-navbar__toggle {
  display: none;               /* Hidden on desktop; shown via media query in navbar.miller.css */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.sticky-navbar__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cf-dark);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Animated hamburger → X when open */
.sticky-navbar__toggle[aria-expanded="true"] .sticky-navbar__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.sticky-navbar__toggle[aria-expanded="true"] .sticky-navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}
.sticky-navbar__toggle[aria-expanded="true"] .sticky-navbar__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== NAV LIST ========== */
.sticky-navbar__list {
  list-style: none;
  display: flex;
  gap: 4px;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* ========== NAV ITEMS ========== */
.sticky-navbar__item {
  position: relative;          /* Anchor for absolutely-positioned megamenu */
  height: 100%;
  display: flex;
  align-items: center;
}

.sticky-navbar__item > a {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--cf-dark);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  margin:3px;
}
.sticky-navbar__item > a:hover,
.sticky-navbar__item:hover > a {
  background: rgba(74, 107, 104, 0.1);
  color: var(--cf-leaf);
}

/* Arrow indicator for items with megamenus.
   Issue 2 (final fix): chevron is absolutely positioned, decoupled from
   text flow so it physically cannot be orphaned on its own line.
   The label gets right-padding to reserve space for the chevron. */
.sticky-navbar__item--has-mega > a {
  position: relative;
  padding-right: calc(10px + 1.1em);  /* original 10px + room for chevron */
}
.sticky-navbar__item--has-mega > a::after {
  content: '\25BE';            /* ▾ */
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1em;
  opacity: 0.6;
  pointer-events: none;
  line-height: 1;
}

/* ========== MEGAMENU PANEL ========== */
.sticky-navbar__megamenu {
  position: absolute;
  top: 100%;                   /* Flush below the nav item */
  left: 0;
  min-width: 800px;            /* Phase 3.1: was 600px — wider for B2B link density */
  background: #fff;
  border-top: 2px solid var(--cf-leaf);
  box-shadow: 0 24px 48px rgba(25, 44, 41, 0.15);
  border-radius: 0 0 6px 6px;
  padding: 28px 32px;

  /* Hidden by default — JS toggles .is-open with hover delays. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  pointer-events: none;        /* Don't capture clicks while invisible */
}

/* Reveal megamenu when JS marks the parent .is-open, or when focus is inside.
   :focus-within is a failsafe so keyboard users always see the open menu
   regardless of whether the JS class state has caught up. */
.sticky-navbar__item--has-mega.is-open .sticky-navbar__megamenu,
.sticky-navbar__item--has-mega:focus-within .sticky-navbar__megamenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Phase 3.3: active-state indicator on the trigger when its menu is open. */
.sticky-navbar__item--has-mega.is-open > a,
.sticky-navbar__item--has-mega:focus-within > a {
  background: rgba(74, 107, 104, 0.1);
  color: var(--cf-leaf);
  box-shadow: inset 0 -2px 0 var(--cf-leaf);  /* underline within link padding */
}

/* Issue 1d: empty-state megamenu (rendered when hasMegamenu=true but
   columns is empty). Narrow box, centered tagline. */
.sticky-navbar__megamenu--empty {
  min-width: 320px;
}
.sticky-navbar__megamenu-empty {
  font-size: 1rem;
  font-weight: 500;
  font-style: italic;
  color: rgba(74, 107, 104, 0.7);
  text-align: center;
  padding: 16px 24px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* Visible focus indicators on megamenu trigger link */
.sticky-navbar__item > a:focus-visible {
  outline: 2px solid var(--cf-leaf);
  outline-offset: 2px;
}

/* Focus indicators on megamenu links */
.sticky-navbar__megamenu a:focus-visible {
  outline: 2px solid var(--cf-leaf);
  outline-offset: 2px;
}

/* ========== MEGA-GRID (3-column layout inside megamenu) ========== */
.sticky-navbar__mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Per-column configurable background and border */
.sticky-navbar__mega-col {
  padding: 16px;
  border-radius: 6px;
  transition: background-color 0.15s;
}

/* When a column has a background, add internal padding for breathing room */
.sticky-navbar__mega-col[style*="background-color"] {
  padding: 16px 20px;
}

.sticky-navbar__mega-col h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cf-leaf);
  margin-bottom: 0px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(74, 107, 104, 0.2);
}
.sticky-navbar__mega-col p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--cf-mid);
  padding-bottom: 6px;
}
.sticky-navbar__mega-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sticky-navbar__mega-col li {
  padding-bottom: 8px;
}
.sticky-navbar__mega-col li a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--cf-dark);
  padding-right:8px;
  padding: 4px 0;
  text-decoration: none;
  transition: color 0.15s, padding-left 0.15s;
  border: 0px solid #4a6b68;

}
.sticky-navbar__mega-col li a:hover {
  color: var(--cf-leaf);
  padding-right:0px;
  padding-left: 6px;          /* Subtle slide-right effect */

}

/* ========== INLINE LINK ICONS ========== */
.sticky-navbar__link-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

/* ========== MEGA-CARD (configurable card layout) ========== */
.sticky-navbar__mega-card {
  border-radius: 8px;
  padding: 16px;
  margin-top: 8px;
  background: transparent;    /* Fallback; overridden by inline style */
}

.sticky-navbar__mega-card-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(1, 1fr);  /* Fallback; overridden by inline style */
}

.sticky-navbar__mega-card-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--cf-dark);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.sticky-navbar__mega-card-item:hover {
  background: rgba(74, 107, 104, 0.1);
  color: var(--cf-leaf);
}

/* Issue 3: card items that include a description stack vertically so the
   subtitle renders on its own line below the link text. */
.sticky-navbar__mega-card-item--has-desc {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
}

.sticky-navbar__mega-card-item--has-desc .sticky-navbar__link-text {
  font-weight: 500;
}

.sticky-navbar__mega-card-item--has-desc .sticky-navbar__link-desc {
  font-size: 0.75rem;
  color: var(--cf-mid);
  line-height: 1.4;
  margin-top: 2px;
}

/* ========== NAVBAR MESSAGE SECTION ========== */
.sticky-navbar__message {
  font-size: 0.8rem;
  color: var(--cf-mid);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0 12px;
}

.sticky-navbar__message strong {
  font-weight: 600;
  color: var(--cf-dark);
}

.sticky-navbar__message a {
  color: var(--cf-leaf);
  text-decoration: none;
  transition: color 0.15s;
}

.sticky-navbar__message a:hover {
  color: var(--cf-dark);
  text-decoration: underline;
}

/* ========== LINK DESCRIPTIONS (subtitle below link text) ========== */
.sticky-navbar__link--has-desc {
  display:flex;
  flex-direction:column;
  align-items: flex-start;
}

.sticky-navbar__link-text {
  display: block;
  text-align: left;
  gap: 6px;
  border: 0px solid #4a6b68;


}

.sticky-navbar__link-desc {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--cf-mid);
  line-height: 1.4;
  margin-top: 2px;
}

/* ========== LINK TAGS / BADGES ========== */
.sticky-navbar__link-tag {
  display: inline-block;
  font-size: 0.7rem;           /* Phase 3.4: bumped from 0.6rem for B2B readability */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--cf-apple);
  color: var(--cf-dark);
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
  margin-left: 6px;
}

/* Phase 3.4: "New" tag — distinct color + leading dot for visual punch. */
.sticky-navbar__link-tag--new {
  background: var(--cf-sky);
  color: var(--cf-dark);
}
.sticky-navbar__link-tag--new::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cf-dark);
  margin-right: 5px;
  vertical-align: middle;
}

/* ========== MEGAMENU FEATURED CARD ========== */
.sticky-navbar__mega-featured {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(74, 107, 104, 0.15);
}

.sticky-navbar__mega-featured-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  background: rgba(25, 44, 41, 0.03);
  text-decoration: none;
  transition: background 0.15s;
}

.sticky-navbar__mega-featured-link:hover {
  background: rgba(74, 107, 104, 0.08);
}

.sticky-navbar__mega-featured-img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.sticky-navbar__mega-featured-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sticky-navbar__mega-featured-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cf-leaf);
}

.sticky-navbar__mega-featured-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cf-dark);
  line-height: 1.3;
}

/* ========== PHASE 3.5: RIGHT-RAIL FEATURED LAYOUT ==========
   Applied only to megamenus where the JSON includes a `featured` object.
   The template adds the .--has-featured modifier conditionally, so menus
   without featured content keep the original single-column stack. */
.sticky-navbar__megamenu--has-featured {
  display: grid;
  grid-template-columns: minmax(0, 60%) minmax(0, 40%);
  column-gap: 32px;
  min-width: 1000px;           /* Wider canvas when featured rail is present */
}

/* Featured card sits in right column — no top border/spacing needed. */
.sticky-navbar__megamenu--has-featured .sticky-navbar__mega-featured {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  align-self: start;
}

/* Stack the featured card vertically (image on top) for stronger presence. */
.sticky-navbar__megamenu--has-featured .sticky-navbar__mega-featured-link {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
}

.sticky-navbar__megamenu--has-featured .sticky-navbar__mega-featured-img {
  width: 100%;
  height: auto;
  max-height: 180px;
}

/* ========== CTA BUTTONS (right-side actions) ========== */


.sticky-navbar__cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
  flex-shrink: 0;
}

.sticky-navbar__cta-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cf-dark);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sticky-navbar__cta-link:hover {
  background: rgba(74, 107, 104, 0.1);
  color: var(--cf-leaf);
}

.sticky-navbar__cta-button {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--cf-leaf);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}

.sticky-navbar__cta-button:hover {
  background: var(--cf-dark);
}

/* ================================================================
   NOTE: All ≤1024px (tablet + mobile) rules now live in
   css/navbar.miller.css — that file owns the responsive breakpoint.
   Do not add @media (max-width: 1024px) blocks here; add them there.
   ================================================================ */
