/* ANARCHISM.AFRICA — sticky-hide header + mobile menu pop-up + favorites mosaic */

/* ====== Sticky topbar with auto-hide ============================== */
.topbar.topbar-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  will-change: transform;
}
.topbar-auto-hide.hidden { transform: translateY(-100%); }

/* ====== Mobile menu pop-up (full screen between header & footer) === */
.aa-mobile-menu {
  position: fixed;
  top: 56px;                 /* under the topbar */
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px clamp(12px, 4vw, 28px) 96px;
  animation: aa-mm-up .25s ease-out both;
}
.aa-mobile-menu.open { display: flex; }
@keyframes aa-mm-up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .aa-mobile-menu { animation: none; } }

/* lock body scroll while open */
body.aa-mm-open { overflow: hidden; }

/* desktop: don't show the mobile menu — desktop rail does the job */
@media (min-width: 1024px) {
  .aa-mobile-menu { display: none !important; }
}

/* ====== Square menu tiles ========================================= */
.aa-mm-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);   /* mobile: 4 per row */
}
@media (min-width: 600px) {
  .aa-mm-grid { grid-template-columns: repeat(8, 1fr); }   /* tablet: 8 per row */
}
@media (min-width: 768px) {
  .aa-mm-grid { grid-template-columns: repeat(8, 1fr); }
}

.aa-mm-tile {
  aspect-ratio: 1 / 1;       /* square */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  border-radius: 0;
  padding: 8px 6px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.aa-mm-tile:hover,
.aa-mm-tile:focus-visible {
  border-color: var(--fg);
  transform: translate(-2px, -2px);
  outline: 0;
  box-shadow: 4px 4px 0 0 var(--accent);
}
.aa-mm-tile-glyph {
  display: inline-flex;
  width: 28px; height: 28px;
}
.aa-mm-tile-glyph svg {
  width: 100%; height: 100%;
  stroke: currentColor; fill: none;
  stroke-width: 1.6;
}
.aa-mm-tile-glyph svg .fill { fill: currentColor; stroke: none; }
.aa-mm-tile-label {
  font: 700 .62rem 'JetBrains Mono', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
}

/* ====== Favorites section ========================================= */
.aa-mm-favs-head {
  margin: 26px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between;
  font: 800 .72rem 'JetBrains Mono', monospace;
  letter-spacing: .2em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.aa-mm-favs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
}
@media (min-width: 600px) { .aa-mm-favs { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 768px) { .aa-mm-favs { grid-template-columns: repeat(8, 1fr); } }

.aa-mm-fav {
  aspect-ratio: 1 / 1;
  background: var(--bg-2) center / cover no-repeat;
  border: 1px solid var(--line);
  border-radius: 0;
  position: relative;
  display: flex; align-items: flex-end;
  text-decoration: none;
  color: var(--fg);
  overflow: hidden;
  transition: border-color .12s ease, transform .12s ease;
}
.aa-mm-fav:hover, .aa-mm-fav:focus-visible {
  border-color: var(--fg);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--accent);
  outline: 0;
}
.aa-mm-fav::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 60%);
  pointer-events: none;
}
.aa-mm-fav-label {
  position: relative; z-index: 1;
  width: 100%;
  padding: 6px 8px;
  font: 700 .62rem 'JetBrains Mono', monospace;
  letter-spacing: .04em;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aa-mm-empty {
  margin: 0;
  padding: 18px 6px;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

/* ====== Bottombar — square borderless buttons on mobile/tablet ====
   No dividing lines between buttons. The row scrolls horizontally so all
   eight buttons fit on any screen width while staying square (56×56). */
@media (max-width: 1023px) {
  .bottombar button {
    aspect-ratio: 1 / 1;
    max-height: 64px;
    border-radius: 0;
    border: 0;
    flex-direction: column; gap: 2px;
  }
  .bottombar button .glyph { width: 22px; height: 22px; }
}
