/**
 * Andgreen patterns — Header / Footer / DemoBanner / PageShell
 * Depends on foundations/tokens.css (+ primitives recommended)
 */

/* ── Page shell ── */
.ag-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ag-bg);
  color: var(--ag-fg);
  font-family: var(--ag-font);
}

.ag-shell-main {
  flex: 1;
  width: 100%;
  padding-block: var(--ag-space-6);
}

/* ── Header ── */
.ag-header {
  position: sticky;
  top: 0;
  z-index: var(--ag-z-header);
  min-height: var(--ag-header-h);
  display: flex;
  align-items: center;
  background: oklch(1 0 0 / 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ag-border);
}

.ag-skin-dark .ag-header {
  background: oklch(0.14 0.02 150 / 0.9);
}

.ag-header-inner {
  width: 100%;
  max-width: var(--ag-container);
  margin-inline: auto;
  padding-inline: var(--ag-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ag-space-4);
}

.ag-brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--ag-space-2);
  text-decoration: none;
  color: var(--ag-fg);
  font-weight: var(--ag-weight-bold);
  font-size: var(--ag-text-lg);
}

.ag-brand-mark {
  color: var(--ag-primary);
}

.ag-brand-sub {
  font-size: var(--ag-text-xs);
  font-weight: var(--ag-weight-medium);
  color: var(--ag-fg-muted);
}

.ag-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ag-space-1) var(--ag-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.ag-nav a {
  text-decoration: none;
  color: var(--ag-fg-muted);
  font-size: var(--ag-text-sm);
  font-weight: var(--ag-weight-medium);
  padding: var(--ag-space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--ag-duration) var(--ag-ease);
}

.ag-nav a:hover {
  color: var(--ag-primary);
}

.ag-nav a[aria-current="page"] {
  color: var(--ag-primary);
  border-bottom-color: var(--ag-primary);
}

.ag-nav a:focus-visible {
  outline: none;
  box-shadow: var(--ag-ring);
  border-radius: 4px;
}

/* ── Demo banner ── */
.ag-demo-banner {
  background: var(--ag-primary-soft);
  color: var(--ag-primary-hover);
  font-size: var(--ag-text-sm);
  text-align: center;
  padding: var(--ag-space-3) var(--ag-space-4);
  border-bottom: 1px solid var(--ag-border);
}

.ag-demo-banner strong {
  font-weight: var(--ag-weight-semibold);
}

.ag-demo-banner a {
  color: inherit;
  font-weight: var(--ag-weight-semibold);
}

/* ── Footer ── */
.ag-footer {
  margin-top: auto;
  background: var(--ag-surface-2);
  border-top: 1px solid var(--ag-border);
  padding-block: var(--ag-space-6);
  font-size: var(--ag-text-sm);
  color: var(--ag-fg-muted);
}

.ag-footer-inner {
  max-width: var(--ag-container);
  margin-inline: auto;
  padding-inline: var(--ag-space-4);
  display: grid;
  gap: var(--ag-space-5);
  grid-template-columns: 1.2fr 1fr 1fr;
}

@media (max-width: 768px) {
  .ag-footer-inner {
    grid-template-columns: 1fr;
  }
}

.ag-footer-brand {
  font-weight: var(--ag-weight-bold);
  color: var(--ag-fg);
  font-size: var(--ag-text-md);
  margin-bottom: var(--ag-space-2);
}

.ag-footer-site {
  font-weight: var(--ag-weight-semibold);
  color: var(--ag-fg);
  margin-bottom: var(--ag-space-1);
}

.ag-footer a {
  color: var(--ag-fg-muted);
  text-decoration: none;
}

.ag-footer a:hover {
  color: var(--ag-primary);
}

.ag-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ag-space-2);
}

.ag-footer-links a[aria-current="page"] {
  color: var(--ag-primary);
  font-weight: var(--ag-weight-semibold);
}

.ag-footer-meta {
  margin-top: var(--ag-space-5);
  padding-top: var(--ag-space-4);
  border-top: 1px solid var(--ag-border);
  max-width: var(--ag-container);
  margin-inline: auto;
  padding-inline: var(--ag-space-4);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--ag-space-3);
  font-size: var(--ag-text-xs);
}

.ag-footer-honest {
  color: var(--ag-fg-subtle);
}
