/*
  Overrides layered on top of the crawled production stylesheet (public/styles/client.css).
  Keep these changes small and intentional so we don’t fork the legacy snapshot.
*/

/* Contact form submit button loading state */
.contact-form-wrapper button[type="submit"].is-loading {
  opacity: 0.85;
  cursor: progress;
  /* Keep the button width stable when we swap innerHTML to include spinner */
  white-space: nowrap;
  /* Hard lock height so adding spinner never grows the button */
  min-height: 2.75rem;
}

/* Backward compatibility if we ever use btn-primary directly */
.contact-form-wrapper .btn-primary.is-loading {
  opacity: 0.85;
  cursor: progress;
  white-space: nowrap;
}

/* Submit button uses Linking Arts primary green */
.contact-form-wrapper button[type="submit"] {
  background-color: #8bbd00;
  border-color: #8bbd00;
  color: #fff;
}

.contact-form-wrapper button[type="submit"]:hover,
.contact-form-wrapper button[type="submit"]:focus {
  background-color: #79a500;
  border-color: #79a500;
  color: #fff;
}

/* --- Homepage tile override (temporary): make Tech Startups tile 2x wide ---
   This avoids needing to rebuild astro-owned.css during development.
   Once we re-introduce a proper LESS->CSS build step, move this back into the compiled stylesheet.
*/
@media screen and (min-width: 768px) {
  /* Make the explicitly-marked wide tile span 2 columns */
  .page .collage > li:has(> a.featured-wide.grid-2-square.item-project) {
    grid-column: 1 / -1;
  }

  .page .collage > li > a.featured-wide.grid-2-square.item-project {
    width: 100%;
    aspect-ratio: 2 / 1;
    min-height: 280px;
  }
}

/* Keep inner content aligned and prevent height jumps */
.contact-form-wrapper button[type="submit"].is-loading .btn-inner,
.contact-form-wrapper .btn-primary.is-loading .btn-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  line-height: 1;
}

.contact-form-wrapper button[type="submit"].is-loading .btn-spinner,
.contact-form-wrapper .btn-primary.is-loading .btn-spinner {
  flex: 0 0 auto;
  display: inline-block;
  /* Force exact pixel sizing (and override any legacy rules) */
  width: 12px !important;
  height: 12px !important;
  max-width: 12px;
  max-height: 12px;
  box-sizing: border-box;
  vertical-align: middle;
  /* Ensure spinner is visible even if button text color is very light */
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-right-color: transparent;
  border-radius: 50%;
  animation: la-spin 0.8s linear infinite;
}

.contact-form-wrapper button[type="submit"].is-loading .btn-label,
.contact-form-wrapper .btn-primary.is-loading .btn-label {
  display: inline-block;
  line-height: 1;
}

@keyframes la-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Lock primary nav to the top of the viewport. */
nav.nav-primary {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/*
  Temporary: while we still have a fixed nav but haven’t moved nav into a fully
  Astro-owned layout, add safe spacing so the page content doesn’t sit under the nav.

  NOTE: `client.css` used absolute-positioned `.page`. Our Astro-owned stylesheet doesn’t,
  so we use padding instead of `top`.
*/
main {
  padding-top: var(--nav-height, 36px);
}
