/* Shared page-system primitives derived from the homepage/archive controls. */
.ui-page-title {
  font-family: var(--display, 'Anybody', Arial, sans-serif);
  font-variation-settings: 'wdth' 150, 'wght' 900;
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: .9;
  text-transform: uppercase;
}

.ui-page-hero > .ui-page-subline {
  font-family: var(--font, Inter, Arial, sans-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: normal;
  color: var(--color-text-primary, #FFFFFF);
  margin: 0 auto;
  max-width: 660px;
  text-align: center;
}

.ui-control {
  box-sizing: border-box;
  border: 1px solid #444;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: 12px var(--font, Inter, Arial, sans-serif);
  padding: 8px 14px;
  outline: none;
}

.ui-control:focus { border-color: #666; }

.ui-action {
  border: 1px solid #444;
  border-radius: 9px;
  background: transparent;
  color: #fff;
  font: 600 12px var(--font, Inter, Arial, sans-serif);
  cursor: pointer;
}

.ui-action-primary { background: #fff; border-color: #fff; color: #111; }
.ui-action-danger { background: #381616; border-color: #381616; color: #ff8d88; }

/* Shared action-menu alignment: labels lead and icons trail. */
.card-menu button,
.card-menu a,
.collection-menu button {
  justify-content: space-between;
}
.card-menu button img,
.card-menu a img,
.collection-menu button img {
  order: 2;
  margin-left: auto;
}

/* Shared dark popup treatment for action menus and custom selects. */
.card-menu,
.collection-menu,
.ui-select-menu { background: #222; color: #fff; }
.card-menu button:hover,
.card-menu a:hover,
.collection-menu button:hover,
.ui-select-option:hover,
.ui-select-option:focus-visible,
.ui-select-option[aria-selected="true"] { background: #3a3a3a; }
.card-menu button,
.card-menu a,
.collection-menu button,
.ui-select-option { color: #fff; }
.card-menu img,
.collection-menu button:not(.danger) img,
.ui-select-trigger img,
.ui-select-option img { filter: none; }

.ui-select-wrap { position: relative; min-width: 0; }
.dropdowns-row > .ui-select-wrap { width: 100%; min-width: 0; }
.ui-select-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.ui-select-trigger { width: 100%; min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #444; border-radius: 999px; background: transparent; color: #fff; padding: 7px 12px; font: 12px var(--font, Inter, Arial, sans-serif); cursor: pointer; }
.ui-select-trigger:hover,.ui-select-trigger:focus-visible { border-color: #777; outline: none; }
.ui-select-trigger img,.ui-select-option img { width: 14px; height: 14px; object-fit: contain; flex: 0 0 14px; }
.ui-select-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 100%; max-height: min(60vh, 360px); overflow-y: auto; overflow-x: hidden; padding: 5px; border: 1px solid #3a3a3a; border-radius: 8px; background: #222; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.ui-select-menu[hidden] { display: none; }
.ui-select-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 5px; background: transparent; color: #fff; padding: 8px 9px; font: 12px var(--font, Inter, Arial, sans-serif); text-align: left; white-space: nowrap; cursor: pointer; }
.ui-select-option:hover,.ui-select-option:focus-visible,.ui-select-option[aria-selected="true"] { background: #3a3a3a; outline: none; }

.collection-overview-controls > .ui-select-wrap { flex: 0 0 auto; min-width: 138px; }
@media (max-width:640px) {
  .collection-overview-controls > .ui-select-wrap { width: 100%; min-width: 0; }
}

/* Shared font loading and minimal foundations. Font files remain unchanged. */
@font-face {
  font-family: 'Anybody';
  src: url('/fonts/Anybody-Variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --font: 'Inter', Arial, sans-serif;
  --display: 'Anybody', 'Arial Black', sans-serif;
  --color-background-primary: #0A0A0A;
  --color-text-primary: #FFFFFF;
  --ui-mobile-page-inset: 16px;
}

/* Canonical Creaaatives Page Hero typography. Layout remains page-specific. */
h1.ui-page-title {
  font-family: var(--display);
  font-variation-settings: 'wdth' 150, 'wght' 900;
  font-weight: 900;
  font-size: 118px;
  line-height: 111.6px;
  letter-spacing: -6px;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (max-width:700px) {
  h1.ui-page-title {
    font-size: 48px;
    line-height: 45.4px;
    letter-spacing: -2.4px;
    white-space: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    text-align: center;
  }
}

/* Shared mobile content boundary and single-column transition for creator
 * and collection grids. The homepage grid defines these values. */
@media (max-width: 760px) {
  #grid.grid { padding-left: var(--ui-mobile-page-inset); padding-right: var(--ui-mobile-page-inset); }
  .collection-overview, .collection-view { padding-left: var(--ui-mobile-page-inset); padding-right: var(--ui-mobile-page-inset); }
}
@media (max-width: 480px) {
  #grid.grid, .collection-grid { grid-template-columns: 1fr; }
}

:root { --ui-page-hero-top: 92px; }

/* Shared Page Hero positioning. The homepage hero establishes the vertical
 * rhythm: 92px from the viewport top on desktop and 70px on narrow screens.
 * Page-specific wrappers keep their existing inner spacing and content flow. */
.ui-page-hero {
  width: 100%;
  box-sizing: border-box;
  margin-top: 64px;
  padding-top: var(--ui-page-hero-top);
  text-align: center;
}
/* Named Collection Detail has its own content-title rhythm. */
.ui-page-hero.collection-detail-hero {
  margin-top: 0;
}
@media (max-width: 700px) {
  :root { --ui-page-hero-top: 70px; }
}

/* Canonical page structure: navigation, fixed-height page header, then body. */
:root {
  --ui-page-hero-height: 367.85px;
  --ui-page-hero-height-mobile: 273px;
}
.ui-page-hero {
  min-height: var(--ui-page-hero-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.ui-page-hero > .ui-page-title { flex: 0 0 auto; }
.ui-page-hero > .ui-page-subline { flex: 0 0 auto; }
.ui-page-body { box-sizing: border-box; }
.ui-page-hero.collection-detail-hero { min-height: 0; }
@media (max-width: 700px) {
  .ui-page-hero { min-height: var(--ui-page-hero-height-mobile); height: auto; padding-left: 16px; padding-right: 16px; }
  .ui-page-hero.collection-detail-hero { min-height: 0; }
}

/* Canonical Page Header internals for normal page variants. */
.ui-page-hero > .ui-page-title { margin: 0 0 28px; }
.ui-page-hero.collection-detail-hero > .ui-page-title { margin: 0; }
.page .ui-page-hero > h1 { margin: 0; }
/* Preserve the overview's existing separation while keeping header geometry canonical. */
.collection-overview { margin-top: 96px; }
@media (max-width: 700px) {
  .collection-overview { margin-top: 32px; }
}

/* Keep legal body wrappers from adding a second navigation offset. */
.page.ui-page-body { margin-top: 0; }
/* Match the homepage header rhythm on the overview state while retaining its body gap. */
.hero.collection-overview-hero { padding-bottom: 54px; }
@media (max-width: 700px) {
  .hero.collection-overview-hero { padding-bottom: 42px; }
}
