/* Creaaatives design foundation.
   Shared tokens for the public site and Admin. Prefer these names in new and
   migrated CSS; page-local token systems may alias them. Values match the
   existing visual language; --color-text-muted is the smallest neutral grey
   that keeps small text at WCAG AA (>= 4.5:1) on every surface up to #1a1a1a. */
:root {
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-surface-2: #1a1a1a;
  --color-line: #2a2a2a;
  --color-text: #ffffff;
  --color-text-secondary: #aaaaaa;
  --color-text-muted: #888888;
  --color-danger: #ff8f8f;
  --color-warning: #f1c874;
  --color-focus: #ffffff;

  --font-ui: 'Inter', Arial, sans-serif;
  --font-display: 'Anybody', 'Arial Black', sans-serif;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius-pill: 999px;
  --radius-control: 8px;
  --radius-layer: 14px;

  --page-gutter: 28px;
  --page-gutter-mobile: 16px;
}

/* 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; }
.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; }

.collection-overview-controls > .ui-select-wrap { flex: 0 0 auto; min-width: 138px; }
@media (max-width:640px) {
  /* Compact like the homepage filters: search on its own row, then sort, order and New in one row. */
  .collection-overview-controls > .ui-select-wrap { flex: 1 1 0; width: auto; min-width: 0; }
  .collection-overview-controls > .collection-primary-action { flex: 0 0 auto; }
}

/* 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: var(--color-bg);
  --color-text-primary: var(--color-text);
  --ui-mobile-page-inset: var(--page-gutter-mobile);
}

/* 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 {
  /* About a third less space below the subline than the original 367.85px / 273px. */
  --ui-page-hero-height: 330px;
  --ui-page-hero-height-mobile: 245px;
}
.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: 14px; }
@media (max-width: 700px) {
  .collection-overview { margin-top: 14px; }
}

/* 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; }
}

/* Accessibility baseline: one visible keyboard focus treatment for every
   interactive element. :is() keeps this above page-level `outline: none`
   resets so focus is never removed without a replacement. */
:is(a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"]), [role="button"], [role="tab"]):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.ui-select-option:focus-visible { outline-offset: -2px; }

/* <main> landmark wrapper that adds no layout box of its own. */
.page-main { display: contents; }

/* Shared checkbox: native element and semantics, one visible treatment.
   Unchecked = dark interior with a clear grey hairline; checked = filled white
   with a dark checkmark, so the two states never look alike. Only the
   checkbox's own small radius is intentional (8px would read as a circle). */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 1.5px solid #8a8a8a;
  border-radius: 4px;
  background: var(--color-bg) center / 14px 14px no-repeat;
  cursor: pointer;
  vertical-align: middle;
  transition: background-color .12s, border-color .12s;
}
input[type="checkbox"]:hover:not(:disabled) { border-color: var(--color-text); }
input[type="checkbox"]:checked {
  border-color: var(--color-text);
  background-color: var(--color-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.4l3 3 6-6.6' fill='none' stroke='%230a0a0a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .55; }
input[type="checkbox"]:checked:disabled { border-color: #8a8a8a; background-color: #8a8a8a; }

/* Narrowest phones: keep the header's menu button on screen (shared nav and the collection header). */
@media (max-width: 360px) {
  body .shared-nav .nav-logo { font-size: 13px !important; }
  body .shared-nav .nav-actions { gap: 4px !important; }
  .footer-links { flex-wrap: wrap !important; gap: 8px 18px !important; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
