/* The museum page (KXE-80): a compact head, one row of filter chips, a sticky jump bar, groups of a dense uniform gallery.
   Linked from /bao-tang only (PageMeta.styles). Tokens and .card come from styles.css. */

.mhead {
  padding-top: clamp(1rem, 3vw, 1.75rem);
}

.mhead h1 {
  font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.25rem);
  margin-bottom: 0.35rem;
}

.mhead__text {
  max-width: 62ch;
  font-size: 1.05rem;
}

.mhead__count {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-quiet);
}

/* Filters: loại, hãng and xếp theo in one wrapping row of chips. */
.mfilter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.5rem;
  margin-top: 1rem;
}

.mfilter__group,
.mjump ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mfilter a,
.mjump a {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink);
  font-size: var(--step-small);
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}

.mfilter a:hover,
.mjump a:hover {
  border-color: var(--ink);
}

.mfilter a[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--raised);
}

.count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.75;
}

/* The jump bar sticks under the top of the screen; it scrolls sideways when it is longer than the screen. */
.mjump {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 1rem 0 0;
  padding: 0.5rem 0;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

.mjump__label {
  flex: none;
  align-self: center;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

.mjump ul {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.mjump a {
  background: var(--tint);
  border-color: transparent;
}

.group {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  scroll-margin-top: 4rem;
}

.group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--ink);
}

.group__head h2 {
  margin: 0;
  font-size: var(--step-sub);
  line-height: 1.15;
}

.group__head .mono {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* 4 columns from 1280, 3 from 1024, 2 below (a phone gallery is two-up: one column made 58 photos 22,000 px tall). */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .gallery {
    gap: 1rem;
  }
}

/* Two-up on a phone: a tighter body, the name a step smaller. */
@media (max-width: 639px) {
  .gcard__body {
    padding: 0.45rem 0.55rem 0.55rem;
  }

  .gcard__name {
    font-size: 0.95rem;
  }

  .gcard__meta {
    font-size: 0.72rem;
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
  }
}

.gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* The name's link covers the whole card; the photo and its credit sit above it so their own links still work. */
.gcard__fig {
  position: relative;
  z-index: 1;
  margin: 0;
}

.gcard__photo,
.gcard__photo img {
  display: block;
  width: 100%;
}

.gcard__photo img {
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  background: var(--tint);
}

.gcard__body {
  padding: 0.6rem 0.8rem 0.75rem;
}

.gcard__name {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.gcard__name a {
  color: var(--ink);
  text-decoration: none;
}

.gcard__name a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.gcard__name a:focus-visible {
  outline: none;
}

.gcard:has(.gcard__name a:focus-visible) {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.gcard__meta {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-quiet);
}

@media (hover: hover) {
  .gcard:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgb(21 25 29 / 0.06), 0 14px 28px -16px rgb(21 25 29 / 0.38);
  }

  .gcard:hover .gcard__name a {
    color: var(--link);
  }
}

.mfoot {
  max-width: 72ch;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: var(--step-small);
  color: var(--ink-quiet);
}
