/* components.css — shared components (shell: header, nav, footer) */

/* Skip link: visually hidden, visible on focus */
.skip-link {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

.skip-link:focus {
  clip: auto;
  overflow: visible;
}

/* Site header */
.site-header {
  background: transparent;
  padding-block: var(--space-2) calc(var(--space-8) + var(--space-5));
}

.site-header .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--space-6);
}

/* Brand (left) */
.site-header .brand {
  justify-self: start;
  white-space: nowrap;
}

/* Navigation (center) */
.site-header .site-nav {
  justify-self: center;
}

.site-header .site-nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-5);
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  list-style: none;
}

.site-header .site-nav li {
  margin: 0;
}

.site-header .site-nav a {
  white-space: nowrap;
  text-decoration: none;
}

.site-header .site-nav a:visited {
  text-decoration: none;
}

.site-header .site-nav a:hover,
.site-header .site-nav a:focus-visible {
  text-decoration: underline;
}

/* Header CTAs (right) */
.site-header .header-ctas {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Mobile wrap safety */
@media (max-width: 48em) {
  .site-header .container {
    grid-template-columns: 1fr;
    row-gap: var(--space-4);
  }

  .site-header .site-nav {
    justify-self: start;
  }

  .site-header .header-ctas {
    justify-self: start;
  }
}

.brand {
  text-decoration: none;
}

/* Header CTA — primary (content-hugging) */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
  padding-block: 0.075rem;
  padding-inline: 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

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

/* Header CTA — secondary (outline, transparent) */
.nav-cta--secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
}

.nav-cta--secondary:hover {
  background: color-mix(in srgb, currentColor 6%, transparent);
}

.nav-cta--secondary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Nav active state indicator (no underline) */
.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Site footer */
.site-footer {
  background: var(--bg-section);
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--space-6);
  margin-top: var(--space-8);
}

.site-footer .container {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

.site-footer h2 {
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: var(--space-1);
}

.site-footer a {
  display: inline-block;
  color: var(--text-2);
}

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

.site-footer p {
  margin-top: var(--space-5);
  color: var(--text-3);
  max-width: var(--measure);
}

@media (min-width: 48em) {
  .site-footer .container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64em) {
  .site-footer .container {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Surface utility (subtle elevation, no border/shadow) */
.surface {
  background: var(--bg-surface);
  padding: var(--space-6);
  border-radius: 8px;
}

/* Panel surface (borderless, no shadow) */
.panel {
  background: var(--bg-surface);
  padding: var(--space-5);
  border-radius: 10px;
}

.panel--tight {
  padding: var(--space-4);
}

/* Button utilities (reusable) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
}

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

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

.btn--secondary {
  background: transparent;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.btn--secondary:hover {
  color: var(--accent-hover);
}

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

/* Table primitives (main content only) */
main table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border-radius: 10px;
  overflow: hidden;
}

main th,
main td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
}

main th {
  font-weight: 600;
  color: var(--text-1);
}

main td {
  color: var(--text-2);
}

main tr:last-child td {
  border-bottom: none;
}

main .table-wrap {
  overflow-x: auto;
}

/* Demo frame — reusable product preview (structure only) */
.demo-frame {
  background: var(--bg-surface);
  border-radius: 10px;
  padding: var(--space-5);
}

.demo-frame__inner {
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-section);
}

.demo-frame img,
.demo-frame video,
.demo-frame iframe {
  display: block;
  width: 100%;
  height: auto;
}

.demo-frame__placeholder {
  padding: var(--space-5);
  margin: 0;
  color: var(--text-2);
  max-width: var(--measure);
}

/* Media placeholder — reusable slot for screenshots/video */
.media {
  background: var(--bg-surface);
  border-radius: 10px;
  overflow: hidden;
}

.media__placeholder {
  padding: var(--space-6);
  margin: 0;
  color: var(--text-2);
  background: var(--bg-section);
}

.media__label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-3);
  font-size: 0.95rem;
}
