/* ==========================================================================
   APEXION — shared components ("Press Room" system)
   ========================================================================== */

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.logo__mark {
  width: 26px; height: 26px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo__mark::before {
  content: "A";
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.85rem;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.nav__links {
  display: flex;
  gap: var(--sp-3);
  list-style: none;
  margin: 0; padding: 0;
}

.nav__links a {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-muted);
  transition: color .15s ease;
}
.nav__links a:hover { color: var(--text); }

.nav__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-small);
  color: var(--text-faint);
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  transition: all .15s ease;
}
.cart-link:hover { color: var(--surface); background: var(--text); }
.cart-badge {
  background: var(--text);
  color: var(--surface);
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}
.cart-link:hover .cart-badge { background: var(--surface); color: var(--text); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 8px 10px;
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all .15s ease;
}

.btn--primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.btn--primary:hover { opacity: .82; }

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

/* on dark sections, flip the binary so buttons stay legible */
.section--dark .btn--primary { background: var(--surface); color: var(--text); border-color: var(--surface); }
.section--dark .btn--primary:hover { opacity: .85; }
.section--dark .btn--ghost { border-color: var(--border-dark); color: var(--text-inverse); }
.section--dark .btn--ghost:hover { background: var(--surface); color: var(--text); border-color: var(--surface); }

.btn--sm { padding: 8px 16px; font-size: var(--fs-caption); }
.btn--block { width: 100%; justify-content: center; }

/* ---------- pills / filters ---------- */
.pillbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: transparent;
  transition: all .15s ease;
}
.pill:hover { background: var(--surface-2); }
.pill.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

/* ---------- badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.badge--accent { border-color: var(--text); color: var(--text); background: var(--surface-2); }

/* ---------- card ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* ---------- thumb ---------- */
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.thumb__glyph {
  position: absolute;
  left: 16px; top: 16px;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--text);
  color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}

/* ---------- table ---------- */
.datatable { width: 100%; border-collapse: collapse; }
.datatable th, .datatable td {
  text-align: left;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-body);
}
.datatable th {
  font-size: var(--fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
}
.datatable td.num, .datatable th.num { text-align: right; font-variant-numeric: tabular-nums; }
.datatable tr:hover td { background: var(--surface-2); }

.section--dark .datatable th,
.section--dark .datatable td { border-color: var(--border-dark); }
.section--dark .datatable th { color: var(--text-faint-inverse); }
.section--dark .datatable tr:hover td { background: rgba(255,255,255,.06); }
.section--dark .datatable a { color: var(--text-inverse); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color .15s ease; }
.section--dark .datatable a:hover { text-decoration-color: currentColor; }

/* ---------- preview bar (template pages) ---------- */
.preview-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--text);
  color: var(--surface);
}
.preview-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 10px 0;
  font-size: var(--fs-small);
}
.preview-bar__back { font-weight: 600; }
.preview-bar__back:hover { text-decoration: underline; }
.preview-bar__label { opacity: .8; display: none; }
@media (min-width: 640px) { .preview-bar__label { display: inline; } }
.preview-bar .btn--primary {
  background: var(--surface);
  color: var(--text);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: var(--sp-8) 0 var(--sp-4);
}
.site-footer .logo,
.site-footer .logo__mark { color: var(--text-inverse); }
.site-footer .logo__mark { background: var(--text-inverse); color: var(--bg-dark); }
.site-footer .logo__mark::before { color: var(--bg-dark); }
.site-footer .text-faint { color: var(--text-faint-inverse); }
.site-footer .eyebrow { color: var(--text-faint-inverse); }
.site-footer h2 { color: var(--text-inverse); }
.site-footer .btn--primary { background: var(--surface); color: var(--text); border-color: var(--surface); }
.site-footer .btn--primary:hover { opacity: .85; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--sp-4);
  padding-bottom: var(--sp-6);
}
.site-footer__col h4 {
  font-size: var(--fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint-inverse);
  margin-bottom: var(--sp-2);
}
.site-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer__col a { color: var(--text-muted-inverse); font-size: var(--fs-small); }
.site-footer__col a:hover { color: var(--text-inverse); }
.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-dark);
  font-size: var(--fs-caption);
  color: var(--text-faint-inverse);
  flex-wrap: wrap;
  gap: 8px;
}

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

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translate(-50%, 16px);
  background: var(--text);
  color: var(--surface);
  font-size: var(--fs-small);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
  z-index: 100;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- pagination (shared: shop grid, journal list) ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: var(--sp-6);
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pagination__ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--text-faint);
  font-weight: 600;
  font-size: var(--fs-small);
  flex-shrink: 0;
}
.pagination button {
  flex-shrink: 0;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-small);
  transition: all .15s ease;
}
.pagination button:hover:not(:disabled) { background: var(--text); color: var(--surface); }
.pagination button.is-active { background: var(--text); color: var(--surface); border-color: var(--text); }
.pagination button:disabled { opacity: .3; cursor: not-allowed; }
