/* ==========================================================================
   Nevion Labs — shared components
   Header, footer, buttons, breadcrumb, quick-contact bar, reveal + keyframes.
   Breakpoints used across the site:
     1080px  header switches to the mobile menu
      960px  "narrow" layouts (single column, quick bar)
      640px  "mobile"
      560px  header CTA hidden
   ========================================================================== */

/* ---------- Keyframes (only defined when motion is allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes nvRise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
  @keyframes nvFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes nvFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
  @keyframes nvPulse { 0% { box-shadow: 0 0 0 0 rgba(241, 43, 43, .6); } 100% { box-shadow: 0 0 0 14px rgba(241, 43, 43, 0); } }
  @keyframes nvScan { 0% { left: 0; width: 0; } 50% { left: 0; width: 100%; } 100% { left: 100%; width: 0; } }
  @keyframes nvSpin { to { transform: rotate(360deg); } }
}

.anim-rise { animation: nvRise .9s var(--ease-out) both; }

/* Scroll reveal — js/main.js adds .reveal to [data-reveal] elements that start
   below the fold, then .is-revealed when they enter the viewport. */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.is-revealed { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border: 0;
  transition: background .2s, color .2s, border-color .2s;
}
.btn--dark { background: var(--ink); color: var(--white); }
.btn--dark:hover { background: var(--red); color: var(--white); }
.btn--white { background: var(--white); color: var(--ink); }
.btn--white:hover { background: var(--red); color: var(--white); }
.btn--lg { padding: 18px 26px; font-size: 16px; }

/* Underlined text link, e.g. "All articles →" */
.link-underline {
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}
.link-underline:hover { color: var(--red); border-color: var(--red); }

/* ---------- FAQ (<details>) ----------
   Every FAQ summary ends with a "+" icon; it turns into "×" while the answer is open. */
details > summary > :last-child {
  display: inline-block;
  transition: transform .2s var(--ease-out);
}
details[open] > summary > :last-child { transform: rotate(45deg); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb__current { display: flex; align-items: center; gap: 8px; color: var(--ink); }

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 245, 243, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid #E2E1DC;
  color: var(--ink);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo (assets/img/brand/logo-dark.png in the header, logo-light.png in the footer) */
.brand {
  display: flex;
  align-items: center;
  flex: none;
}
.brand__logo {
  display: block;
  height: 18px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 36px);
  font-size: clamp(14px, 1.1vw, 15px);
  white-space: nowrap;
}

.site-nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: var(--ink);
  border-bottom: 1px solid transparent;
}
.site-nav__link:hover { color: var(--red); }
.site-nav__link[aria-current="page"] { border-bottom-color: var(--red); }
.site-nav__caret { font-size: 10px; color: var(--muted); }

.site-nav__drop {
  position: relative;
  height: 76px;
  display: flex;
  align-items: center;
}

.mega {
  position: absolute;
  top: 76px;
  left: -28px;
  width: min(640px, calc(100vw - 48px));
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--white);
  border: 1px solid #E2E1DC;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  white-space: normal;
}
.site-nav__drop.is-open .mega { display: grid; }

.mega__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
}
.mega__item:hover { background: var(--paper); color: var(--ink); }
.mega__meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.mega__title { font-size: 15px; font-weight: 500; }
.mega__all {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
}

.site-header__actions { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 1px solid var(--ink);
  background: transparent;
}
.menu-toggle span { display: block; width: 18px; height: 1.5px; background: var(--ink); }

/* Mobile navigation panel */
.mobile-nav {
  display: none;
  flex-direction: column;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px var(--gutter) 28px;
  border-top: 1px solid #E2E1DC;
  background: var(--paper);
}
.mobile-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }

.mobile-nav__link,
.mobile-nav__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #E2E1DC;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.mobile-nav__toggle {
  width: 100%;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  text-align: left;
}
.mobile-nav__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #CFCEC8;
  font-size: 18px;
  color: var(--ink);
}
.mobile-nav__icon::before { content: "+"; }
.mobile-nav__toggle[aria-expanded="true"] .mobile-nav__icon { color: var(--red); }
.mobile-nav__toggle[aria-expanded="true"] .mobile-nav__icon::before { content: "−"; }

.mobile-nav__sub {
  display: flex;
  flex-direction: column;
  padding: 4px 0 8px;
  border-bottom: 1px solid #E2E1DC;
  animation: nvFade .3s ease both;
}
.mobile-nav__sublink {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 16px;
  color: var(--ink);
}
.mobile-nav__num { font-family: var(--mono); font-size: 11px; color: var(--red); }
.mobile-nav__arrow { color: var(--muted-2); }
.mobile-nav__all {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.mobile-nav__cta {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--ink);
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
}
.mobile-nav__cta:hover { color: var(--white); background: var(--red); }

@media (max-width: 1079.98px) {
  .site-nav { display: none; }
  .menu-toggle { display: flex; }
  .site-header.is-menu-open .mobile-nav { display: flex; }
}

@media (max-width: 639.98px) {
  .brand__logo { height: 15px; }
}

@media (max-width: 559.98px) {
  .site-header__cta { display: none; }
}

/* ---------- Site footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: var(--on-dark);
  border-top: 1px solid var(--line-dark);
  overflow: hidden;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 6vw, 88px) var(--gutter) 32px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 40px 32px;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.site-footer__brand .brand__logo { height: 16px; }
.site-footer__about { font-size: 14px; line-height: 1.6; max-width: 30ch; color: #A9A8A2; }

.social { display: flex; gap: 8px; margin-top: 4px; }
.social__link {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-dark-2);
  transition: border-color .2s, background .2s;
}
.social__link:hover { border-color: var(--red); background: var(--red-deep); }
.social__link img { display: block; width: 18px; height: 18px; }

.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col__title {
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.footer-col a { font-size: 14px; color: #E4E3DE; }
.footer-col a:hover { color: var(--red); }
.footer-col__address { font-style: normal; max-width: 30ch; }
.footer-col__address a { display: block; line-height: 1.6; color: #A9A8A2; }

.site-footer__bar {
  margin-top: clamp(48px, 5vw, 72px);
  padding-top: 24px;
  border-top: 1px solid #262624;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #8A8984;
}
.site-footer__bar a { color: var(--on-dark); }
.site-footer__bar a:hover { color: var(--red); }
.site-footer__legal { display: flex; gap: 18px; }

.site-footer__wordmark {
  margin-top: clamp(40px, 5vw, 72px);
  padding-bottom: 0.06em;
  font-size: clamp(34px, 14.6vw, 222px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.92;
  color: var(--white);
  white-space: nowrap;
}

@media (max-width: 639.98px) {
  .footer-col--desktop { display: none; }
}

/* ---------- Quick-contact bar (narrow screens) ----------
   Markup: <div class="quick-bar" data-quick-bar hidden> … </div>
   Behaviour lives in js/main.js (see initQuickBar). */
.quick-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--ink);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.45);
  animation: nvRise .45s var(--ease-out) both;
}
.quick-bar__primary {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 16px;
  background: var(--red);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
}
.quick-bar__primary:hover { color: var(--white); }
.quick-bar__secondary {
  flex: none;
  display: flex;
  align-items: center;
  padding: 15px 14px;
  border: 1px solid var(--line-dark-2);
  color: var(--white);
  font-size: 14px;
}
.quick-bar__secondary:hover { color: var(--white); border-color: var(--red); }
