/* ============================================================
   SWISS CLUSTER MENU — component styles
   Framework-free. Scoped under .sc-page so it won't collide
   with the rest of your project.

   Background is transparent — the component adapts to whatever
   page it is placed on.

   Theming: override the CSS variables in :root or on .sc-page.

   Responsive behaviour (self-contained — no page CSS needed):
     > 1100px        full horizontal row, tagline visible
     721px–1100px    horizontal row, tagline hidden (avoids an
                     ugly truncated "Advanced Thin F..." ellipsis)
     <= 720px        fully stacked: logo -> tagline -> Menu button
   ============================================================ */

.sc-page {
  /* ---- design tokens (override these to re-theme) ---- */
  --sc-bar-bg: var(--sc-ink);
  --sc-panel-bg: var(--sc-ink);
  --sc-btn-bg: #f7f7f7;
  --sc-btn-bg-hover: var(--sc-white);
  --sc-btn-bg-active: #e9e9e9;
  --sc-text-light: var(--sc-white);
  --sc-text-dark: #333333;
  --sc-text-muted: var(--sc-gray-2);
  --sc-radius: 12px;
  --sc-gap: 4px;
  --sc-panel-gap: 6px;
  --sc-font: var(--sc-font-sans);

  background: transparent;
  padding: 14px;
  box-sizing: border-box;
  max-width: 1400px;
  margin: 0 auto;
}

.sc-page *,
.sc-page *::before,
.sc-page *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- HEADER ROW ---------- */
.sc-header {
  display: flex;
  align-items: stretch;
  font-family: var(--sc-font);
  -webkit-font-smoothing: antialiased;
}

/* dark bar */
.sc-navbar {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sc-bar-bg);
  border-radius: var(--sc-radius);
  height: 60px;
  padding: 0 22px;
  min-width: 0;
}

.sc-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.sc-logo {
  height: 40px;
  width: auto;
  flex: 0 0 auto;
  display: block;
  /* render the SVG white regardless of its source fill colour */
  filter: brightness(0) invert(1);
}

.sc-navbar .sc-tagline {
  color: var(--sc-text-muted);
  font-size: var(--sc-text-md);
  font-weight: var(--sc-weight-regular);
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  margin-right: 40px;
}

/* Menu / Close button */
.sc-menu-btn {
  flex: 0 0 auto;
  margin-left: var(--sc-gap);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--sc-btn-bg);
  color: var(--sc-text-dark);
  border: none;
  border-radius: var(--sc-radius);
  height: 60px;
  padding: 0 32px;
  font-family: inherit;
  font-size: var(--sc-text-md);
  font-weight: var(--sc-weight-medium);
  cursor: pointer;
  transition: background 0.195s ease;
}
.sc-menu-btn:hover {
  background: var(--sc-btn-bg-hover);
}
.sc-menu-btn:active {
  background: var(--sc-btn-bg-active);
}

.sc-menu-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-menu-icon span {
  display: block;
  width: 15px;
  height: 2px;
  background: var(--sc-text-dark);
  border-radius: 1px;
}

.sc-close-icon {
  font-size: var(--sc-text-base);
  line-height: 1;
  color: var(--sc-text-dark);
}

/* ---------- PANELS ---------- */
.sc-panels {
  display: none;
  gap: var(--sc-panel-gap);
  margin-top: 14px;
}
.sc-panels.sc-open {
  display: flex;
}

.sc-panel {
  flex: 1 1 0;
  background: var(--sc-panel-bg);
  border-radius: var(--sc-radius);
  border: 2px solid transparent;
  padding: 26px 24px;
  min-height: 220px;
  font-family: var(--sc-font);
}

/* active panel — no highlight border (kept transparent like the rest) */
.sc-panel.sc-panel-active {
  border-color: transparent;
}

/* link panels (Company / Contact) are <a> tags — kill the default
   underline so no purple visited-link line shows beneath the title */
.sc-panel--link {
  text-decoration: none;
  color: inherit;
}

.sc-panel-title {
  color: var(--sc-text-light);
  font-size: var(--sc-text-lg);
  font-weight: var(--sc-weight-bold);
  letter-spacing: -0.5px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* machine list */
.sc-machines {
  display: block;
}

.sc-machine {
  display: block;
  color: var(--sc-text-light);
  font-size: var(--sc-text-md);
  font-weight: var(--sc-weight-semibold);
  text-decoration: none;
  margin-bottom: 16px;
}
.sc-machine:last-child {
  margin-bottom: 0;
}
.sc-machine:hover {
  text-decoration: underline;
}

/* caret next to Systems — hidden on desktop */
.sc-caret {
  display: none;
  font-size: var(--sc-text-lg);
  line-height: 1;
  color: var(--sc-text-light);
  transition: transform 0.26s ease;
}

/* button face swap */
.sc-page[data-open="true"] .sc-face-menu {
  display: none;
}
.sc-page[data-open="false"] .sc-face-close {
  display: none;
}
.sc-face-menu,
.sc-face-close {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* ============================================================
   TABLET  (721px - 1100px)
   Navbar stays horizontal, but there isn't room for the full
   tagline beside the logo + Menu button, so hide it rather than
   show a cut-off "Advanced Thin F..." ellipsis.
   ============================================================ */
@media (max-width: 1100px) {
  .sc-navbar .sc-tagline {
    display: none;
  }
}

/* ============================================================
   PHONE  (<= 720px)
   Fully stack the header: logo -> tagline -> Menu button.
   ============================================================ */
@media (max-width: 720px) {
  /* header stacks: navbar on top, button beneath */
  .sc-header {
    flex-direction: column;
    align-items: stretch;
  }

  /* navbar stacks internally: logo, then tagline */
  .sc-navbar {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    height: auto;
    gap: 6px;
    padding: 16px 20px;
  }

  /* tagline reappears (hidden in the tablet band) and wraps */
  .sc-navbar .sc-tagline {
    display: block;
    white-space: normal;
    margin-right: 0;
  }

  /* Menu button full width beneath the navbar */
  .sc-menu-btn {
    margin-left: 0;
    margin-top: 6px;
    width: 100%;
  }

  /* panels stack vertically */
  .sc-panels.sc-open {
    flex-direction: column;
  }

  .sc-panel {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 22px;
  }

  .sc-panel-title {
    font-size: var(--sc-text-lg);
    margin-bottom: 0;
  }

  /* Systems is collapsible on phone */
  .sc-caret {
    display: block;
  }

  .sc-panel-systems .sc-panel-title {
    cursor: pointer;
  }

  .sc-panel-systems .sc-machines {
    display: none;
    margin-top: 16px; /* title → first machine = the inter-item gap */
  }
  .sc-panel-systems.sc-sys-open .sc-machines {
    display: flex;
    flex-direction: column;
    gap: 16px; /* even spacing between all machines */
  }
  /* even, predictable gaps: let the flex gap (above) drive spacing instead
     of per-item margins + tall line-boxes — that mismatch made the
     title→SC-1 gap look tight while SC-1→Qube→Optima looked large */
  .sc-panel-systems .sc-machine {
    margin-bottom: 0;
    line-height: 1.2;
  }
  .sc-panel-systems.sc-sys-open .sc-caret {
    transform: rotate(180deg);
  }
}
