/* Hub pages: the Neocities blog layout, ported from Neocities/index.html and the
   three gallery pages with the rules unchanged. Body class picks the variant:
   .hub-home (one centered content card) or .hub-page (a column of cards).
   Link /assets/css/base.css first. Reasoning lives in docs/STYLE_GUIDE.md. */

html, body {
  margin: 0;
  padding: 0;
  font-family: Tahoma, sans-serif;
  background: url('/assets/img/hub-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #000;
}
html { height: 100%; }

/* Column so the footer sits under the cards (on Neocities it was a stray flex
   item off to the right). min-height, not height, so a tall sidebar can never
   be centered off the top of a short screen. */
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
body.hub-page { justify-content: flex-start; }

.container {
  display: flex;
  max-width: 1400px;
  width: 100%;
  padding: 60px 20px;
  box-sizing: border-box;
}
.hub-page .container { align-items: flex-start; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 380px;
  background-color: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 2px 2px 5px #ccc;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
/* The galleries pinned the sidebar; only do it when the whole sidebar fits on screen. */
@media (min-width: 769px) and (min-height: 900px) {
  .hub-page .sidebar { position: sticky; top: 60px; height: fit-content; }
}

.sidebar > a > img {
  width: 100%;
  max-width: 256px;
  height: auto;
  border-radius: 10px;
  display: block;
}

.nav {
  margin-top: 30px;
  width: 100%;
  text-align: left;
}

.nav a {
  display: block;
  margin: 6px 0;
  text-decoration: underline;
  color: black;
  font-size: 16px;
  transition: color 0.3s;
}

.nav a:hover {
  color: #888;
}

/* Additions: divider between the blog links and the site sections, icons, blinkies. */
.nav .divider { margin: 12px 0; text-align: left; }
.nav .pixel-icon { width: 24px; height: 24px; object-fit: none; }
.sidebar .blinkie-strip { margin-top: 24px; }

/* ---------- content ---------- */
.content {
  flex-grow: 1;
  margin-left: 40px;
}

.hub-home .content,
.hub-card {
  background-color: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 2px 2px 5px #ccc;
  box-sizing: border-box;
}

.hub-page .content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hub-card { width: 100%; max-width: 800px; margin: 0 auto; }

/* Home additions */
.content .divider img { max-width: min(100%, 450px); }
.updates, .friends { margin-top: 28px; }
.updates h2, .friends h2 { font-size: 18px; margin: 0 0 8px; }
.updates ul { list-style: none; margin: 0; padding: 0; }
.updates li { margin: 4px 0; }
.updates time { color: #555; font-size: 14px; margin-right: .5em; }
.friends a { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; color: black; }
.friends a:hover { color: #888; }
.friends img { width: 100px; height: 100px; image-rendering: pixelated; }

/* ---------- galleries (unchanged from Neocities) ---------- */
.gallery-container {
  background-color: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 2px 2px 5px #ccc;
  text-align: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.gallery-container img {
  height: 300px;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.gallery-container p {
  margin-top: 10px;
  font-size: 15px;
}

.pyramid-base {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pyramid-image img {
  height: 150px;
  width: auto;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.side-by-side-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.side-by-side-container {
  background-color: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 2px 2px 5px #ccc;
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.side-image {
  flex: 1;
  max-width: 50%;
}

.side-by-side-container img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.side-by-side-container p {
  font-size: 15px;
}

#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

/* ---------- shop ---------- */
.shop-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 24px 0; }
.shop-grid a { width: 130px; color: black; font-size: 14px; text-align: center; }
.shop-grid a:hover { color: #888; }
.shop-grid img { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 0 10px rgba(0,0,0,0.1); margin-bottom: 6px; }
.button {
  display: inline-block;
  padding: 10px 22px;
  border: 2px solid black;
  border-radius: 20px;
  color: black;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s, border-color 0.3s;
}
.button:hover { color: #888; border-color: #888; }

/* ---------- credits, 404, coming-soon ---------- */
.display-heading { font-family: var(--font-display); font-weight: normal; font-size: 44px; margin: 0 0 8px; }
.hub-card h2 { font-size: 20px; margin: 28px 0 8px; }
.hub-card li { margin: 4px 0; }
.stamp-shelf { justify-content: center; margin-top: 20px; }
.not-found { text-align: center; }

/* ---------- footer ---------- */
.footer {
  margin: 0 20px 30px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.85);
  border-radius: 20px;
  font-size: 14px;
  text-align: center;
}
.footer a { color: black; }
.footer a:hover { color: #888; }

/* ---------- mobile (values unchanged from Neocities) ---------- */
@media (max-width: 768px) {
  body {
    align-items: stretch;
    justify-content: flex-start;
  }

  .container {
    flex-direction: column;
    padding: 20px 10px;
  }

  .sidebar {
    width: 100%;
    padding: 20px;
    margin-bottom: 20px;
  }

  .content {
    margin-left: 0;
    width: 100%;
  }

  .hub-home .content,
  .hub-card {
    padding: 20px;
  }

  /* Fix: on Neocities the cards were 100% wide plus padding, so phones scrolled sideways. */
  .gallery-container,
  .side-by-side-container {
    padding: 20px;
    box-sizing: border-box;
  }

  .gallery-container p {
    font-size: 18px;
  }

  .nav a {
    font-size: 18px;
  }

  body, p {
    font-size: 18px;
  }

  h1 {
    font-size: 26px;
  }
}
