/* The site's own rules, loaded after colors_and_type.css. */

/* The specs' helmet <style>. */
body {
  margin: 0;
}
input.input {
  box-sizing: border-box;
}
.btn,
.tag,
button {
  white-space: nowrap;
}
/* Links styled as buttons keep their .btn recipe's own text color. */
a:not(.btn) {
  color: rgb(var(--color-primary-strong));
}
a:not(.btn):hover {
  color: rgb(var(--color-primary));
}

/* The markup's inline display:flex would otherwise show a hidden state. */
[hidden] {
  display: none !important;
}

/* The Agents demo's prompt chips, from the Marketing spec's prompts[].style. */
.agent-chip {
  padding: var(--space-step-5) var(--space-step-10);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--text-step-6);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  border: 1px solid rgb(var(--color-outline-variant));
  background: rgb(var(--color-surface-container));
  color: rgb(var(--color-on-surface-variant));
}
.agent-chip[aria-pressed='true'] {
  border: 1px solid rgb(var(--color-primary) / 0.4);
  background: rgb(var(--color-primary-tint));
  color: rgb(var(--color-on-surface));
}

/* The waitlist's updates checkbox, from the Marketing spec's boxStyle. */
.waitlist-box {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: var(--space-step-0);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgb(var(--color-outline));
  background: rgb(var(--color-surface-container));
  color: transparent;
}
[aria-checked='true'] > .waitlist-box {
  border: none;
  background: rgb(var(--color-primary));
  color: rgb(var(--color-on-primary));
}

/* The site header (CNOTE-74). The width-dependent values live here, not inline,
   so one query changes them at 640px: from 640px up the full nav shows with
   24px row padding, a 16px gap and the "Join the waitlist" button at 8px 16px.
   Below 640px the row holds the logo, the Blog pill and a shorter button, so
   only Blog stays in the nav. None of these properties is inline, so the
   query needs no !important. */
.site-header-row {
  padding: 0 var(--space-step-17);
  gap: var(--space-step-13);
}
.site-nav-link {
  padding: var(--space-step-5) var(--space-step-10);
}
.btn.site-join {
  padding: var(--space-step-7) var(--space-step-13);
}
.site-join-short {
  display: none;
}
/* The cookie banner (CNOTE-102): a small card fixed in the bottom-right corner,
   above the sticky header. No backdrop and no scroll lock, so the page behind
   it stays usable. Below 640px it spans the width between 12px margins. */
.consent-banner {
  position: fixed;
  z-index: 30;
  right: var(--space-step-17);
  bottom: var(--space-step-17);
  max-width: 380px;
  box-sizing: border-box;
  margin: 0;
  padding: var(--space-step-15) var(--space-step-16);
}
@media (max-width: 639px) {
  .consent-banner {
    left: var(--space-step-10);
    right: var(--space-step-10);
    bottom: var(--space-step-10);
    max-width: none;
  }
  .site-header-row {
    padding: 0 var(--space-step-12);
    gap: var(--space-step-5);
  }
  .site-nav-link {
    padding: var(--space-step-5) var(--space-step-9);
  }
  .site-nav-extra {
    display: none;
  }
  .btn.site-join {
    padding: var(--space-step-6) var(--space-step-10);
  }
  .site-join-long {
    display: none;
  }
  .site-join-short {
    display: inline;
  }
}

/* The blog's screenshot gallery: each post screenshot is a button that opens
   the modal dialog src/pages/post.ts renders (CNOTE-65). */
.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  border-radius: var(--radius-xl);
  cursor: zoom-in;
}
.gallery-open:focus-visible {
  outline: 2px solid rgb(var(--color-primary));
  outline-offset: var(--space-step-3);
}
/* The page behind the open gallery does not scroll, so closing it lands where the reader was. */
html:has(.gallery[open]) {
  overflow: hidden;
}
.gallery {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: var(--space-step-7);
  border: none;
  background: rgb(var(--color-surface) / 0.96);
  color: rgb(var(--color-on-surface));
  font-family: var(--font-sans);
}
/* Only while open: the UA's dialog:not([open]) { display: none } must keep the closed gallery hidden. */
.gallery[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gallery-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-step-10);
  min-height: 0;
  max-width: 100%;
  margin: 0;
}
.gallery-image {
  display: block;
  min-height: 0;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-xl);
}
.gallery-caption {
  flex: none;
  max-width: 720px;
  font-size: var(--text-step-11);
  line-height: var(--leading-step-7);
  color: rgb(var(--color-on-surface-variant));
  text-align: center;
}
.gallery-close,
.gallery-previous,
.gallery-next {
  position: absolute;
}
.gallery-close {
  top: var(--space-step-13);
  right: var(--space-step-13);
}
.gallery-previous,
.gallery-next {
  top: 50%;
  transform: translateY(-50%);
}
.gallery-previous {
  left: var(--space-step-13);
}
.gallery-next {
  right: var(--space-step-13);
}
.gallery [aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}
