/* By JTT — shared site chrome (tab-bar nav + footer + search), used on ALL pages.
 * Mobile-first. The bottom tab bar follows the byjtt-experiments pattern. */

/* ---- Design tokens (By JTT brand) ---- */
:root {
  --bg: #f5f2eb;
  --card: #fdfbf7;
  --border: #e3ddd2;
  --text: #161614;
  --text-soft: #6b675f;
  --accent: #be3718;
  --accent-soft: #e8834a;
  --tab-height: 64px;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, monospace;
}

/* ---- Bottom tab bar (site-wide) ---- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  background: rgba(245, 242, 235, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid #E3DDD2;
  padding-bottom: env(safe-area-inset-bottom);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tab-bar { background: var(--bg); }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 6px;
  color: #6B675F;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  transition: color 150ms ease;
}
.tab-item:hover, .tab-item:focus-visible { color: var(--text); }
.tab-item.is-active { color: #BE3718; }
.tab-item.is-active .tab-label { color: var(--text); }
.tab-item:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: -3px; border-radius: 8px; }
.tab-item:active { transform: scale(0.96); color: var(--text); }
.tab-item { transition: color 150ms ease, transform 100ms ease; }

.tab-icon { width: 24px; height: 24px; }
.tab-label { font-size: 11px; line-height: 1; }

/* content padding so nothing hides behind the fixed bar — tracks the bar's
   real height including the iPhone safe-area inset */
body { padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom)); }

@media (min-width: 641px) {
  .tab-bar { max-width: 640px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); border-radius: 14px 14px 0 0; }
  .tab-item { padding: 10px 0 8px; }
  .tab-icon { width: 26px; height: 26px; }
}

/* ---- Site footer (legal + cross-property links) ---- */
.site-footer {
  margin-top: 48px;
  padding: 24px 16px 8px;
  border-top: 1px solid #E3DDD2;
  text-align: center;
  font-size: 13px;
  color: #6B675F;
  font-family: var(--font-mono);
  line-height: 2;
}
.site-footer a { color: var(--text); font-weight: 600; text-decoration: underline; }
.site-footer a:hover { color: #BE3718; }
.site-footer .footer-links { margin-bottom: 6px; }

/* ---- Search modal (opened only from a search action) ---- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.search-modal[hidden] { display: none; }

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 55, 50, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.search-modal-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--bg);
  border: 1px solid #E3DDD2;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 14px;
}

.search-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.search-modal-title {
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
}

.search-modal-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #6B675F;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}
.search-modal-close:hover, .search-modal-close:focus-visible { color: var(--text); outline: 3px solid var(--accent-soft); }

.search-modal-input .pagefind-ui { max-width: 100%; margin: 0; padding: 0; }
.search-modal-input .pagefind-ui__search-clear,
.search-modal-input .pagefind-ui__search-input { border-radius: 8px !important; }
.search-modal-input .pagefind-ui__result { padding: 10px 0 !important; }
.search-modal-input .pagefind-ui__result-title { font-weight: bold !important; }

/* keep body from scrolling behind the modal */
body.search-open { overflow: hidden; }

/* ---- X profile hover card ---- */
.x-profile {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.x-profile__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #E3DDD2;
}
.x-profile__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.x-profile__name {
  font-weight: 600;
  font-size: 0.85rem;
}
.x-profile__handle {
  color: #6B675F;
  font-size: 0.75rem;
}
.x-profile__card {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 0;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 0.75rem;
  min-width: 240px;
  padding: 0.9rem 1rem;
  border: 1px solid #E3DDD2;
  border-radius: 12px;
  background: #FDFBF7;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.x-profile:hover .x-profile__card,
.x-profile:focus-visible .x-profile__card {
  display: flex;
}
.x-profile__card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #E3DDD2;
}
.x-profile__card-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.x-profile__card-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.x-profile__card-handle {
  color: #6B675F;
  font-size: 0.8rem;
}
.x-profile__card-follow {
  margin-left: auto;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #BE3718;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .x-profile__card { transition: none; }
}

.footer-x { margin: 0.5rem 0 0.25rem; display: flex; justify-content: center; }
