/* ====================================================================
   SAI blog : header + announcement bar
   Matches the main SAI site: logo with tagline, four menus (Platform &
   Use cases mega menu, Retail and Industry Formats, Resources, More),
   white rounded panels with icon rows, Primary Orange accents.
   Markup: partials/components/navigation.hbs. Behaviour: sai-header.js.
   Note: screen.css sets `a { color: ... !important }`, so link colours
   here need !important too.
   ==================================================================== */

:root { --sai-ink: #161616; --sai-cream: #FDF6F1; --sai-peach: #FBE6DA; }

/* ---------- Announcement bar ---------- */
.sai-announce {
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid #F3E4DA;
  color: var(--sai-orange);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.sai-announce__track { display: flex; width: max-content; animation: sai-marquee 40s linear infinite; }
.sai-announce:hover .sai-announce__track { animation-play-state: paused; }
.sai-announce__list { display: flex; gap: 64px; margin: 0; padding: 10px 32px; list-style: none; }
.sai-announce__list li { display: flex; align-items: center; gap: 8px; }
@keyframes sai-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sai-announce__track { animation: none; } }

/* ---------- Header shell ---------- */
.gh-navigation.sai-header {
  height: auto;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  color: var(--sai-ink);
}
.sai-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 88px;
  padding-left: max(4vmin, 20px);
  padding-right: max(4vmin, 20px);
  box-sizing: border-box;
  max-width: calc(var(--container-width, 1200px) + 2 * max(4vmin, 20px));
}

/* Brand lockup: logo | tagline */
.sai-brand { display: flex; align-items: center; gap: 18px; text-decoration: none; flex-shrink: 0; }
.sai-brand__logo { display: block; height: 44px; width: auto; }
.sai-brand__word { font-size: 34px; font-weight: 700; color: var(--sai-orange); }
.sai-brand__tag {
  padding-left: 18px;
  border-left: 2px solid var(--sai-orange);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .04em;
  color: var(--sai-orange) !important;
}

/* ---------- Desktop menu ---------- */
.sai-menu { margin-left: auto; }
.sai-menu__list { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sai-menu__item { position: static; }
.sai-menu__trigger {
  position: relative;
  padding: 30px 14px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--sai-ink);
  cursor: pointer;
}
.sai-menu__trigger::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--sai-orange);
  transform: scaleX(0);
  transition: transform .2s ease;
}
.sai-menu__trigger:hover,
.sai-menu__item.is-open .sai-menu__trigger,
.sai-menu__trigger.is-section { color: var(--sai-orange); }
.sai-menu__item.is-open .sai-menu__trigger::after { transform: scaleX(1); }
.sai-menu__trigger:focus-visible { outline: 2px solid var(--sai-orange); outline-offset: -6px; border-radius: 8px; }

/* Panels */
.sai-panel {
  position: absolute;
  top: calc(100% - 8px);
  right: max(4vmin, 20px);
  z-index: 120;
  width: 420px;
  padding: 24px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(60, 30, 15, .16), 0 0 0 1px rgba(0, 0, 0, .03);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.sai-menu__item.is-open .sai-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .18s ease, transform .18s ease;
}
.sai-panel--mega { left: max(4vmin, 20px); width: auto; padding: 32px; }

.sai-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #555;
}

/* Icon rows (formats, resources, more, mega tabs) */
.sai-rows { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.sai-row, .sai-tab {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s;
}
.sai-row:hover, .sai-row:focus-visible, .sai-row.is-current,
.sai-tab.is-active { background: var(--sai-peach); opacity: 1; }
.sai-row__ic { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; fill: none; stroke: var(--sai-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sai-row:hover .sai-row__ic, .sai-row.is-current .sai-row__ic, .sai-tab.is-active .sai-row__ic { stroke: var(--sai-orange); }
.sai-row__text { display: flex; flex-direction: column; gap: 2px; }
.sai-row__title { font-size: 15.5px; font-weight: 600; color: var(--sai-ink) !important; line-height: 1.3; }
.sai-row__desc { font-size: 13.5px; font-weight: 400; color: #6B6B6B !important; line-height: 1.4; }

/* Mega menu layout */
.sai-mega { display: grid; grid-template-columns: 240px minmax(0, 1fr) 250px; gap: 32px; }
.sai-mega__tabs ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.sai-mega__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.sai-mega__title { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--sai-ink); }
.sai-mega__lede { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: #555; max-width: 52ch; }
.sai-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--sai-orange) !important; white-space: nowrap; text-decoration: none; }
.sai-link__ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; max-height: 330px; overflow-y: auto; }
.sai-grid[hidden] { display: none; }
.sai-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #EFE7E1;
  border-radius: 14px;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.sai-tile:hover { border-color: var(--sai-orange-mid); box-shadow: 0 6px 18px rgba(235, 93, 59, .1); opacity: 1; }
.sai-tile__ic { flex: 0 0 40px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--sai-orange-light); }
.sai-tile__ic .sai-ic { width: 20px; height: 20px; fill: none; stroke: var(--sai-orange); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sai-tile__t { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--sai-ink) !important; }

.sai-mega__promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px;
  border-radius: 18px;
  background: linear-gradient(160deg, #FCEDE5 0%, #F9DCCD 100%);
}
.sai-mega__promo-title { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--sai-ink); }
.sai-mega__promo-text { margin: 12px 0 20px; font-size: 14px; line-height: 1.55; color: #555; }

/* Buttons (shared with the homepage hero) */
.sai-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 24px; border-radius: 999px;
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.sai-btn--primary { background: var(--sai-orange); border: 2px solid var(--sai-orange); color: #fff !important; box-shadow: 0 8px 20px rgba(235, 93, 59, .25); }
.sai-btn--primary:hover { background: var(--sai-orange-dark); border-color: var(--sai-orange-dark); color: #fff !important; opacity: 1; }
.sai-btn--sm { min-height: 40px; padding: 0 18px; font-size: 14px; box-shadow: none; }
.sai-header__cta { margin-left: 8px; }

/* ---------- Mobile ---------- */
.sai-burger { display: none; }
.sai-mob[hidden] { display: none; }

@media (max-width: 1279px) {
  .sai-mega { grid-template-columns: 220px minmax(0, 1fr); }
  .sai-mega__promo { display: none; }
}

@media (max-width: 1099px) {
  .sai-menu, .sai-header__cta { display: none; }
  .sai-header__inner { min-height: 72px; }
  .sai-brand__logo { height: 36px; }
  .sai-brand__tag { font-size: 12px; padding-left: 14px; }
  .sai-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; margin-left: auto; padding: 0 10px;
    border: 0; border-radius: 10px; background: none; cursor: pointer;
  }
  .sai-burger span { display: block; height: 2px; border-radius: 2px; background: var(--sai-ink); transition: transform .2s, opacity .2s; }
  .is-mob-open .sai-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .is-mob-open .sai-burger span:nth-child(2) { opacity: 0; }
  .is-mob-open .sai-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .sai-mob {
    max-height: calc(100vh - var(--sai-nav-h, 72px));
    overflow-y: auto;
    padding: 8px max(4vmin, 20px) 28px;
    border-top: 1px solid #F0E6DF;
    background: #fff;
  }
  .sai-mob__group { border-bottom: 1px solid #F0E6DF; }
  .sai-mob__group summary {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0; font-size: 17px; font-weight: 600; color: var(--sai-ink);
    list-style: none; cursor: pointer;
  }
  .sai-mob__group summary::-webkit-details-marker { display: none; }
  .sai-mob__chev { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
  .sai-mob__group[open] .sai-mob__chev { transform: rotate(180deg); color: var(--sai-orange); }
  .sai-mob__group ul { margin: 0 0 12px; padding: 0; list-style: none; }
  .sai-mob__group a { display: block; padding: 9px 0; font-size: 15px; color: #444 !important; text-decoration: none; }
  .sai-mob__cta { width: 100%; margin-top: 20px; }
}

@media (max-width: 480px) {
  .sai-brand__tag { display: none; }
}
