/* ======================================================================================================================
   Header mega menus (Features, Industries, Reviews), the footer columns and the hub pages (pages/hub.php).
   Markup: includes/menu.php (render_mega_item) and includes/layout.php. Behaviour: assets/js/site.js.
   ====================================================================================================================== */

/* ---- header on wide screens: logo on the left, the menu centred, the call-to-action button on the right ------------------------------------ */
@media (min-width: 1100px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 24px; }
  .header-inner .brand { justify-self: start; }
  .primary-nav { justify-self: center; }
  .primary-nav__list { justify-content: center; }
  .primary-nav__cta { display: none; }         /* the button lives in the header's right column here */
  .header-cta { justify-self: end; }
}
@media (max-width: 1099px) { .header-cta { display: none; } }

/* ---- desktop navigation: link + caret per item, the panel spans the header width ------------------------------------------------ */
.nav-item { display: flex; align-items: center; }
.primary-nav__list > li > a.nav-link { padding: 0 10px; }
.has-mega > a.nav-link { padding-right: 2px; }
.nav-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 44px;
  margin: 0 2px 0 -2px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--primary);
  cursor: pointer;
}
.nav-caret .icon { width: 16px; height: 16px; transition: transform .18s ease; }
.nav-caret:hover { background: var(--tint); color: var(--accent); }
.has-mega.is-open > .nav-caret { color: var(--accent); }
.has-mega.is-open > .nav-caret .icon { transform: rotate(180deg); }
.has-mega.is-open > a.nav-link { color: var(--accent); }

.mega {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 110;
  display: none;
  max-height: calc(100vh - var(--header-h) - 12px);
  overflow-y: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 28px 44px rgba(11, 31, 51, .16);
}
.has-mega.is-open > .mega { display: block; animation: mega-in .16s ease-out; }
.no-js .has-mega:hover > .mega, .no-js .has-mega:focus-within > .mega { display: block; }   /* without JavaScript the panels still open on hover and focus */
@keyframes mega-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.mega__inner { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 40px; max-width: 1500px; margin-inline: auto; padding-block: 32px 36px; }
.mega__intro { padding-right: 32px; border-right: 1px solid var(--border); }
.mega__eyebrow { margin: 0 0 .5rem; color: var(--accent); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }   /* 12px, 5.47:1 */
.mega__title { margin: 0 0 .65rem; color: var(--primary); font-size: 1.25rem; font-weight: 800; line-height: 1.25; letter-spacing: -.015em; }
.mega__text { margin: 0 0 1.1rem; color: var(--body); font-size: .9375rem; line-height: 1.6; }
.mega__all { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: .9375rem; font-weight: 700; text-decoration: none; }
.mega__all:hover { color: var(--accent-hover); text-decoration: underline; }
.mega__all .icon { width: 16px; height: 16px; }

.mega__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 28px 32px; align-content: start; }
.mega__col-title { margin: 0 0 .65rem; padding-bottom: .5rem; border-bottom: 2px solid var(--tint-2); color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }   /* 4.76:1 */
.mega__col ul { margin: 0; padding: 0; list-style: none; }
.mega__link { display: block; margin: 0 -10px 2px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--primary); text-decoration: none; }
.mega__link:hover, .mega__link:focus-visible { background: var(--tint); }
.mega__link.is-current { background: var(--tint); }
.mega__link-name { display: flex; align-items: center; gap: 8px; font-size: .97rem; font-weight: 650; line-height: 1.35; }
.mega__link:hover .mega__link-name { color: var(--accent); }
.mega__link-desc { display: block; margin-top: 1px; color: var(--muted); font-size: .8125rem; line-height: 1.4; }   /* 13px, 4.76:1 on white; 4.5:1 on the tint hover */
.mega__rating { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--tint-2); color: #115E59; font-size: .75rem; font-weight: 700; line-height: 1.7; }   /* 6.4:1 */

/* ---- phone and tablet: the menu is one column, each mega item folds out under its row ------------------------------------------------ */
@media (max-width: 1099px) {
  .primary-nav__list > li { border-bottom: 1px solid var(--border); }
  .primary-nav__list > li > a { border-bottom: 0; }
  .nav-item { flex-wrap: wrap; }
  .primary-nav__list > li > a.nav-link { flex: 1 1 auto; width: auto; padding: 0 4px; }
  .has-mega > a.nav-link { padding-right: 4px; }
  .nav-caret { width: 48px; height: 48px; margin: 0; border-left: 1px solid var(--border); border-radius: 0; }
  .nav-caret .icon { width: 20px; height: 20px; }
  .mega { position: static; flex: 0 0 100%; max-height: none; overflow: visible; border: 0; box-shadow: none; background: var(--bg-alt); }
  .has-mega.is-open > .mega { animation: none; }
  .no-js .has-mega .nav-caret, .no-js .mega { display: none; }
  .mega__inner { display: block; padding: 4px var(--gutter) 14px; }
  .mega__intro { padding: 0; border: 0; }
  .mega__eyebrow, .mega__title, .mega__text { display: none; }
  .mega__all { margin: 8px 0 4px; min-height: 40px; }
  .mega__cols { display: block; }
  .mega__col { margin-top: 10px; }
  .mega__col-title { margin-bottom: .25rem; padding-bottom: .35rem; }
  .mega__link { margin: 0; padding: 0 4px; min-height: 44px; display: flex; align-items: center; }
  .mega__link-name { font-weight: 600; }
  .mega__link-desc { display: none; }
}

/* ---- footer: guide columns, legal row ------------------------------------------------------------------------------------------------ */
.footer-grid { grid-template-columns: 1.45fr repeat(4, minmax(0, 1fr)); gap: 40px 28px; }
.footer-brand__cta { margin: 20px 0 0; }
.footer-brand__cta .btn { min-height: 44px; }
.footer-col__all { margin-top: 4px; }
.footer-col__all a { color: var(--accent-bright); font-weight: 600; }       /* 6.71:1 on the dark footer */
.footer-col__all .icon { width: 15px; height: 15px; margin-left: 6px; }
.footer-col a { line-height: 1.4; padding-block: 5px; }
.footer-legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14); }
.footer-legal ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.footer-legal a { display: inline-flex; align-items: center; min-height: 32px; color: #CBD5E1; }
.footer-legal a:hover { color: #fff; }
.footer-bottom { margin-top: 8px; padding-top: 18px; }
@media (max-width: 1180px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 40px; align-items: start; }
  .footer-brand .brand, .footer-brand p:not(.footer-brand__cta) { grid-column: 1; }
  .footer-brand .footer-contact, .footer-brand .footer-brand__cta { grid-column: 2; }
  .footer-brand .footer-contact { grid-row: 1 / span 2; }
  .footer-brand .footer-brand__cta { grid-row: 3; margin-top: 8px; }
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { display: block; }
  .footer-brand .footer-contact { margin-top: 12px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- hub pages (Features, Industries, Reviews) ------------------------------------------------------------------------------------- */
.hub-group { margin: 0 0 56px; }
.hub-group:last-child { margin-bottom: 0; }
.hub-group h2 { margin: 0 0 1.25rem; font-size: 1.5rem; line-height: 1.25; letter-spacing: -.02em; }
.hub-group h2::before { content: ""; display: block; width: 36px; height: 3px; margin-bottom: .75rem; border-radius: 3px; background: var(--accent); }
.hub-grid { display: grid; gap: 24px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.hub-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); transition: box-shadow .18s ease, transform .18s ease; }
.hub-card:hover, .hub-card:focus-within { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hub-card__media { position: relative; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.hub-card__media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.hub-card__rating { position: absolute; top: 12px; right: 12px; padding: 2px 10px; border-radius: 999px; background: #fff; color: var(--primary); font-size: .8125rem; font-weight: 800; box-shadow: var(--shadow-sm); }
.hub-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.hub-card h3 { margin: 0 0 .5rem; font-size: 1.1875rem; line-height: 1.3; }
.hub-card h3 a { color: var(--primary); text-decoration: none; }
.hub-card h3 a::after { content: ""; position: absolute; inset: 0; }         /* the whole card is the link */
.hub-card { position: relative; }
.hub-card h3 a:hover { color: var(--accent); }
.hub-card p { margin: 0 0 1rem; color: var(--body); font-size: .9375rem; line-height: 1.6; }
.hub-card__more { margin-top: auto; color: var(--accent); font-size: .9375rem; font-weight: 700; }
.hub-cta { margin-top: 56px; padding: 36px; border-radius: var(--radius); background: var(--tint); text-align: center; }
.hub-cta h2 { margin: 0 0 .5rem; font-size: 1.5rem; }
.hub-cta p { max-width: 56ch; margin: 0 auto 1.25rem; }
