/* MASI — MW Market–inspired layout, local branding */

:root {
  --color-bg: #ffffff;
  --color-text: #1a1d21;
  --color-text-muted: #5c6370;
  --color-border: #e8eaed;
  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;
  --color-footer-bg: #0f1419;
  --color-footer-text: #c9cdd4;
  --header-height: 4rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-header: 0 1px 0 var(--color-border);
  --radius-btn: 6px;
  --focus-ring: 2px solid var(--color-accent);
  /* Letterboxing when slide image uses object-fit: contain (aspect ≠ viewport) — matches UI gray */
  --carousel-filler-bg: #b8b8b8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  min-height: var(--header-height);
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 2.25rem;
  width: auto;
  display: block;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-bg);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 1.25rem;
  margin: 0 auto;
  background: var(--color-text);
}

.nav-toggle:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
  justify-content: flex-end;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.35rem 0;
  border-radius: 4px;
}

.site-nav__links a:hover {
  color: var(--color-accent);
}

.site-nav__links a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.site-nav__links > li {
  list-style: none;
}

.site-nav__item--has-dropdown {
  position: static;
}

/* Tight box around the trigger — submenu positions relative to this, not the whole row */
.site-nav__dropdown-root {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  vertical-align: middle;
}

.site-nav__dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
}

.site-nav__dropdown-trigger:hover {
  color: var(--color-accent);
}

.site-nav__dropdown-trigger:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.site-nav__dropdown-trigger[aria-expanded="true"] .site-nav__dropdown-chevron {
  transform: rotate(180deg);
}

.site-nav__dropdown-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s ease;
}

.site-nav__dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: max(100%, 12.5rem);
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.1);
  z-index: 200;
}

.site-nav__dropdown-link {
  display: block;
  padding: 0.65rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}

.site-nav__dropdown-link:hover {
  color: var(--color-accent);
  background: #f4f6f8;
}

.site-nav__dropdown-link:focus-visible {
  outline: var(--focus-ring);
  outline-offset: -2px;
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.btn--ghost {
  color: var(--color-text);
  background: transparent;
  border-color: var(--color-border);
}

.btn--ghost:hover {
  background: #f4f6f8;
}

.btn--primary {
  color: #fff;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 1.25rem 1rem;
    background: var(--color-bg);
    box-shadow: 0 8px 24px rgba(15, 20, 25, 0.08);
    border-top: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease, visibility 0.2s;
  }

  .site-nav.is-open {
    max-height: 32rem;
    opacity: 1;
    visibility: visible;
  }

  .site-nav__links {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 0;
    gap: 0;
  }

  .site-nav__links li {
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav__links a {
    display: block;
    padding: 0.75rem 0;
  }

  .site-nav__dropdown-root {
    display: block;
    width: 100%;
  }

  .site-nav__dropdown-trigger {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    text-align: left;
  }

  .site-nav__dropdown {
    position: static;
    margin: 0 0 0.5rem;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #f8f9fb;
  }

  .site-nav__dropdown[hidden] {
    display: none;
  }

  .site-nav__dropdown:not([hidden]) {
    display: block;
  }

  .site-nav__dropdown-link {
    padding: 0.65rem 0.75rem;
  }

  .site-nav__actions {
    flex-direction: column;
    padding-bottom: 0.5rem;
  }

  .site-nav__actions .btn {
    width: 100%;
  }

  .site-header__inner {
    position: relative;
  }
}

/* —— Hero carousel: bright images, dots under viewport —— */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 2.5rem;
}

.hero-carousel__viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(78vh, 900px);
  margin: 0 auto;
  background: var(--carousel-filler-bg);
}

.hero-carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel__track {
    transition: none;
  }
}

.hero-carousel__slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--carousel-filler-bg);
}

.hero-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Aspect ≠ 16:9: full image visible; gray bands fill the rest */
.hero-carousel__slide--contain img {
  object-fit: contain;
  padding: clamp(0.75rem, 3vw, 2.5rem);
  box-sizing: border-box;
}

.hero-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin: 1rem 0 0;
  padding: 0 1rem;
  list-style: none;
}

.hero-carousel__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.hero-carousel__dot:hover {
  border-color: #c5cad3;
  background: #f4f6f8;
}

.hero-carousel__dot[aria-selected="true"] {
  width: 28px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: var(--color-accent);
  transform: none;
}

.hero-carousel__dot:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.hero-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-carousel__arrow:hover {
  background: #fff;
}

.hero-carousel__arrow:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.hero-carousel__arrow--prev {
  left: max(0.75rem, env(safe-area-inset-left));
}

.hero-carousel__arrow--next {
  right: max(0.75rem, env(safe-area-inset-right));
}

@media (max-width: 600px) {
  .hero-carousel__arrow {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.25rem;
  }

  .hero-carousel__arrow--prev {
    left: 0.35rem;
  }

  .hero-carousel__arrow--next {
    right: 0.35rem;
  }
}

#explore {
  scroll-margin-top: var(--header-height);
}

#contact {
  scroll-margin-top: var(--header-height);
}

/* —— Footer —— */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 3rem 1.25rem 1.5rem;
  margin-top: 2rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

.site-footer__brand {
  max-width: 280px;
}

.site-footer__logo {
  opacity: 0.92;
  margin-bottom: 0.75rem;
}

.site-footer__tagline {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #9aa3af;
}

.site-footer__social {
  display: flex;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-footer-text);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
}

.site-footer__social-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.site-footer__social-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-footer__heading {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.site-footer__list li {
  margin-bottom: 0.65rem;
}

.site-footer__list a {
  color: var(--color-footer-text);
  text-decoration: none;
}

.site-footer__list a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer__list a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-footer__bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8125rem;
  color: #7a8494;
  text-align: center;
}

/* —— Track campaign (blank shell): sticky header + sticky footer, main fills viewport —— */
body.page-track-campaign {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-track-campaign .page-main--blank {
  flex: 1 0 auto;
  min-height: 0;
}

body.page-track-campaign .site-footer {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin-top: auto;
}

/* —— Track campaign: API form + scrollable results table —— */
.track-campaign-main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.track-campaign-panel {
  width: 100%;
}

.track-campaign-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.track-campaign-lead {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  max-width: 52rem;
}

.track-campaign-code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: #f0f2f5;
  color: var(--color-text);
}

.track-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

@media (max-width: 640px) {
  .track-form__grid {
    grid-template-columns: 1fr;
  }
}

.track-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.track-form__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

.track-form__input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-bg);
  color: var(--color-text);
}

.track-form__input:focus {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.track-form__actions {
  margin-top: 1.25rem;
}

.track-campaign-status {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  min-height: 1.25em;
  color: var(--color-text-muted);
}

.track-campaign-status--loading {
  color: var(--color-accent);
}

.track-campaign-status--ok {
  color: var(--color-text-muted);
}

.track-campaign-status--error {
  color: #b91c1c;
}

.track-table-wrap {
  margin-top: 1rem;
  overflow: auto;
  max-height: min(58vh, 28rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: #fafbfc;
  -webkit-overflow-scrolling: touch;
}

.track-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  background: var(--color-bg);
}

.track-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: #f0f2f5;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.track-table tbody td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  max-width: 24rem;
  word-break: break-word;
  white-space: normal;
}

.track-table tbody tr:last-child td {
  border-bottom: none;
}

.track-table__empty {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 1rem !important;
}
