/* Additions for the static site (replaces NextGEN gallery + plugin styling) */

/* Gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  padding: 10px 0;
}
.gallery__item { display: block; line-height: 0; background: #222; }
.gallery__item img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; transition: opacity .15s; }
.gallery__item:hover img, .gallery__item:focus img { opacity: .8; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.lightbox__stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 56px 64px; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__btn {
  position: absolute; background: rgba(0, 0, 0, .5); color: #fff; border: 0; cursor: pointer;
  font: 700 28px/1 Montserrat, sans-serif; width: 48px; height: 48px; border-radius: 50%;
}
.lightbox__btn:hover, .lightbox__btn:focus-visible { color: #FFC400; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #ccc; font-size: 14px; }
@media (max-width: 600px) { .lightbox__stage { padding: 56px 8px; } }

/* Error pages */
.error-page { text-align: center; padding-bottom: 40px; }
.error-page__code { font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: #FFC400; margin-top: 30px; }
.error-page__bears { display: flex; justify-content: center; gap: 20px; margin: 30px 0 10px; }
.error-page__bears img { height: 120px; width: auto; max-width: 28%; }
.error-page a { color: #000; text-decoration: underline; text-decoration-color: #FFC400; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.error-page a:hover { color: #b38900 !important; }
.error-page__links a { margin: 0 10px; font-weight: 700; }

/* About page: one row per person - image left, details right */
.team { max-width: 820px; margin: 30px auto 0; padding: 0 10px; }
.team-row { display: flex; align-items: center; gap: 40px; padding: 30px 0; border-bottom: 1px solid #e6e6e6; }
.team-row:last-child { border-bottom: 0; }
.team-row__image {
  flex: 0 0 180px; width: 180px; height: 180px; box-sizing: border-box;
  border: 8px solid #000; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.team-row__image img { width: 78%; height: auto; display: block; }
.team-row__content { flex: 1; min-width: 0; }
.team-row__content h2 { font-size: 22px; font-weight: 600; text-align: left; padding: 0; }
.team-row__content h3 { font-size: 16px; font-weight: 400; color: #D3A535; text-align: left; padding: 6px 0 12px; }
.team-row__description p { text-align: left; padding: 4px 0; font-size: 15px; line-height: 22px; }
.team-row__links { list-style: none; display: flex; gap: 14px; margin: 10px 0 0; padding: 0; }
.team-row__links a { display: block; width: 26px; height: 26px; color: #000; transition: color .15s; }
.team-row__links svg { display: block; width: 100%; height: 100%; }
@media (max-width: 600px) {
  .team-row__links { justify-content: center; }
  .team-row { flex-direction: column; text-align: center; gap: 16px; }
  .team-row__image { flex-basis: auto; width: 140px; height: 140px; }
  .team-row__content h2, .team-row__content h3, .team-row__description p { text-align: center; }
  .team-row__description p { font-size: 14px; line-height: 20px; }
}

/* Games page sections */
.games__section { margin-top: 40px; display: flow-root; }
.games__section:first-of-type { margin-top: 20px; }
.games__section-title { text-align: center; text-transform: uppercase; font-size: 22px; font-weight: 600; letter-spacing: 2px; margin-bottom: 20px; }

/* Sketchbook category filter (hidden unless JS is available) */
.gallery-filter { display: none; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.js .gallery-filter { display: flex; }
.gallery-filter__tab {
  color: #000; text-decoration: none; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 1px;
  padding: 9px 16px; border: 2px solid #000; border-radius: 999px; background: #fff;
}
.gallery-filter__tab span { opacity: .55; font-weight: 500; margin-left: 4px; }
/* !important is needed to beat the global `a:hover { color: #FFC400 !important }` in style.css */
.gallery-filter__tab:hover, .gallery-filter__tab:focus-visible { background: #000; color: #fff !important; }
.gallery-filter__tab.is-active:hover { color: #FFC400 !important; }
.gallery-filter__tab.is-active { background: #000; color: #FFC400; }
.gallery__item[hidden] { display: none; }

/* Buttons */
.button {
  display: inline-block; background: #000; color: #FFC400; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  text-decoration: none; padding: 14px 26px; border-radius: 4px; border: 2px solid #000;
}
.button:hover, .button:focus-visible { background: #FFC400; color: #000 !important; }

/* Links inside body text (tiles, buttons, tabs and the nav are styled separately) */
.content p a, .content li a {
  color: #000; font-weight: 600; text-decoration: underline;
  text-decoration-color: #FFC400; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
/* !important beats the global `a:hover { color: #FFC400 !important }` (yellow on white is unreadable) */
.content p a:hover, .content p a:focus-visible, .content li a:hover, .content li a:focus-visible {
  color: #b38900 !important; text-decoration-color: #b38900;
}

/* Header nav: grow with its content (4 items can wrap to two lines on phones) instead of a fixed 50px */
header .navigation { height: auto; min-height: 50px; }
header .menu-item { line-height: 1.3; }
@media (max-width: 450px) {
  header .menu-item { margin-left: 6px; margin-right: 6px; }
}

@media (max-width: 450px) {
  /* smaller filter tabs so the long category name stays on one line */
  .gallery-filter__tab { font-size: 12px; padding: 8px 12px; letter-spacing: .5px; }
  /* tiles are wide and short on phones: fit the logo instead of cropping it */
  .open-source .block-content__background-image { background-size: auto 62% !important; background-position: center 18% !important; background-repeat: no-repeat; }
}
