/* ------------------------------------------------------------------
   RMNGL — layout / type matched to visualsociety.ch (index.css).
   Unreleased rows: ???? + checker mosaic on .t2 only.
   ------------------------------------------------------------------ */
@font-face {
  font-family: SBM;
  src: url("/src/sbm.woff") format("woff");
  font-weight: 400;
  font-style: normal;
}

:root {
  --accent-color: #1100ff;
  --field: #fff;
  --header-offset: 2.95rem;
  --infos-w: 16rem;
  /* VAS body is 0.753rem; nav + meta read small at rmngl — slight bump, titles unchanged (rem). */
  --ui-size: 0.96rem;
  /* VAS index.css — release titles scale with html root (vw breakpoints below). */
  --t2-size: 6.0241rem;
  --t2-line: 5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  touch-action: manipulation;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  font-size: 0.7vw;
}

@media only screen and (max-width: 1900px) {
  html {
    font-size: 0.9vw;
  }
}

@media only screen and (max-width: 1600px) {
  html {
    font-size: 1.1vw;
  }
}

@media only screen and (max-width: 1023px) {
  html {
    font-size: 14px;
  }
}

html,
body {
  float: left;
  clear: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  background: var(--field);
  color: #000;
  font-family: SBM, sans-serif;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* VAS sets 0.753rem on body only — not html, or rem root stays at ~12px. */
body {
  font-size: 0.753rem;
}

#site-header > a,
section.section--filters a,
.about-infos,
a.section.section--list-item > .infos,
div.section.section--list-item > .infos {
  font-size: var(--ui-size);
}

html::after,
body::after {
  content: "";
  display: table;
  clear: both;
}

a,
a:visited {
  color: inherit;
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: fixed;
  left: -100vw;
  top: 1rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--accent-color);
  color: #fff;
}

.skip-link:focus {
  left: 1rem;
}

.accent {
  color: var(--accent-color);
}

.check .accent {
  opacity: 0;
  font-size: 1rem;
  position: relative;
  top: 0.05rem;
}

.active .check .accent,
a.active .check .accent {
  opacity: 1;
}

.t2 {
  font-size: var(--t2-size);
  line-height: var(--t2-line);
  max-width: 100%;
}

main {
  float: left;
  width: 100%;
}

#container,
#page-content {
  float: left;
  clear: none;
  width: 100%;
  margin: 0;
}

#container::after,
#page-content::after,
main::after {
  content: "";
  display: table;
  clear: both;
}

.row {
  display: block;
  width: 100%;
  float: left;
}

#page-content {
  margin-top: var(--header-offset);
  padding-bottom: 1rem;
}

.contained {
  padding: 1rem;
}

/* ------------------------------------------------------------------
   About
   ------------------------------------------------------------------ */
.about-infos {
  width: 16rem;
  max-width: 100%;
  margin-bottom: 1em;
}

.about-copy {
  max-width: 100%;
}

.about-copy p {
  margin: 0 0 0.65em;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.hyphen {
  hyphens: auto;
}

.about-infos .content a,
.about-copy a {
  color: var(--accent-color);
}

.about-infos .content a:hover,
.about-infos .content a:focus-visible,
.about-copy a:hover,
.about-copy a:focus-visible {
  text-decoration: underline;
}

/* Search (VAS /search) */
#search {
  position: relative;
  float: left;
  width: 100%;
  margin: 0;
}

#search::after {
  content: "";
  display: table;
  clear: both;
}

#search input[type="search"],
#search input[type="submit"] {
  float: left;
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  box-shadow: none;
  outline: 0;
  background: transparent;
  font: inherit;
  font-family: SBM, sans-serif;
  color: var(--accent-color);
  font-size: var(--t2-size);
  line-height: var(--t2-line);
}

#search input[type="submit"] {
  display: none;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
}

#search input[type="submit"]:focus {
  display: block;
}

#search input[name="q"] {
  width: 100%;
}

.search-hint,
.search-empty {
  margin: 0.75rem 0 0;
  color: #424242;
  font-size: var(--ui-size);
}

/* Search mode: index hidden until there is a query (VAS-like focus). */
body[page-type="index.search"] #releases {
  display: none;
}

body[page-type="index.search"][data-search-has-query] #releases {
  display: block;
  float: left;
  width: 100%;
}

#releases[hidden] {
  display: none !important;
}

.section--list-item[hidden],
.section--list-item.is-filtered-out {
  display: none !important;
}

#filters[hidden] {
  display: none !important;
}

body[page-type="index.search"] #filters {
  display: none !important;
}

body[page-type="index.search"] #search-panel {
  min-height: 0;
  padding-bottom: 0.25rem;
}

body[page-type="index.search"][data-search-has-query] #search-panel {
  padding-bottom: 0.5rem;
}

body[page-type="index.search"][data-search-has-query] #releases {
  margin-top: 0;
}

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  width: 100%;
  white-space: nowrap;
  user-select: none;
  background: var(--accent-color);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

#site-header > a {
  flex: 1;
  padding: 1rem;
  background: var(--accent-color);
  color: #fff;
}

#site-header > a.active {
  border-radius: 0 1rem 0 0;
  background: #fff;
  color: #000;
}

#site-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff !important;
  color: #000 !important;
}

#site-title h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.logo__symbol {
  display: block;
  flex-shrink: 0;
  height: 1.22rem;
  aspect-ratio: 729 / 444;
  background-color: #000;
  -webkit-mask-image: url("/src/rmngl-symbol.png");
  mask-image: url("/src/rmngl-symbol.png");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  position: relative;
  top: 0.12rem;
}

.logo__word {
  display: block;
  height: 1.12rem;
  aspect-ratio: 867 / 326;
  background-color: #000;
  -webkit-mask-image: url("/src/rmngl-wordmark.png");
  mask-image: url("/src/rmngl-wordmark.png");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  position: relative;
  top: 0.2rem;
  padding: 0.1rem;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.2);
}

#site-header.opened {
  flex-wrap: wrap;
  align-items: flex-start;
}

#site-header.opened > a {
  flex-basis: 100%;
  height: 3rem;
}

#site-header.opened > #site-title,
#site-header.opened > .menu {
  flex-basis: 50%;
}

#site-header.opened + .overlay {
  display: block;
}

@media only screen and (max-width: 1023px) {
  #site-header {
    background: #fff;
  }

  #site-header > a.tab:not(.menu) {
    display: none !important;
  }

  #site-header > a.active {
    border-radius: 0;
  }

  #site-header .menu {
    display: block;
    background: var(--accent-color);
    color: #fff;
  }

  #site-header.opened {
    background: var(--accent-color);
  }

  #site-header.opened > a.tab:not(.menu) {
    display: block !important;
  }

  #page-content {
    padding-bottom: 0;
  }
}

@media only screen and (min-width: 1024px) {
  #site-header .menu {
    display: none !important;
  }
}

/* ------------------------------------------------------------------
   Filters (sticky on home)
   ------------------------------------------------------------------ */
body[page-type="home"] #filters {
  position: sticky;
  position: -webkit-sticky;
  top: var(--header-offset);
  padding-top: 1rem;
  padding-bottom: 1rem;
  background: #fff;
  z-index: 10;
}

@media only screen and (max-width: 1023px) {
  body[page-type="home"] #filters {
    position: static;
  }
}

section.section--filters {
  display: flex;
  flex-wrap: wrap;
  padding: 0 1rem;
}

section.section--filters a {
  white-space: nowrap;
}

section.section--filters a:not(:last-child) {
  padding-right: 2em;
}

section.section--filters a:not(.active) {
  color: #424242;
}

section.section--filters a.active {
  color: #000;
}

/* ------------------------------------------------------------------
   List items (VAS section.section--list-item)
   ------------------------------------------------------------------ */
section.section.section--list-items {
  float: left;
  clear: none;
  width: 100%;
  margin: 0;
  overflow: hidden;
}

section.section.section--list-items::after {
  content: "";
  display: table;
  clear: both;
}

a.section.section--list-item,
div.section.section--list-item {
  display: flex;
  float: left;
  clear: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-left: 1rem;
  padding-right: 1rem;
  color: inherit;
  min-width: 0;
}

a.section.section--list-item:first-child,
div.section.section--list-item:first-child {
  margin-top: 0.5rem;
}

a.section.section--list-item:not(:last-child),
div.section.section--list-item:not(:last-child) {
  padding-bottom: 0.5rem;
}

a.section.section--list-item:hover > .title .t2 {
  color: var(--accent-color);
}

a.section.section--list-item > .infos,
div.section.section--list-item > .infos {
  width: var(--infos-w);
  flex: 0 0 var(--infos-w);
  float: left;
}

a.section.section--list-item > .title,
div.section.section--list-item > .title {
  width: calc(100% - var(--infos-w));
  max-width: calc(100% - var(--infos-w));
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  pointer-events: none;
  min-width: 0;
  overflow: hidden;
}

a.section.section--list-item > .title .t2,
div.section.section--list-item > .title .t2 {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 0.25rem;
}

.info-row {
  display: flex;
}

.info-row:not(:last-child) {
  margin-bottom: 0.2rem;
}

.info-row .title {
  flex: 0 0 6.9rem;
  width: 6.9rem;
}

.info-row .content {
  color: var(--accent-color);
  white-space: nowrap;
  min-width: 0;
}

.info-row .content::before {
  content: "[";
  color: #000;
}

.info-row .content::after {
  content: "]";
  color: #000;
}

.index-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  pointer-events: auto;
}

@supports (overflow-x: clip) {
  .index-name {
    overflow-x: clip;
    overflow-y: visible;
  }
}

.index-name--mark {
  color: var(--accent-color);
}

.index-ticker {
  display: inline-block;
}

.section--list-item > .title .images {
  display: none;
}

.images {
  max-width: 100%;
  overflow: hidden;
}

.images .inner {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.images .inner::-webkit-scrollbar {
  display: none;
}

.thumb {
  flex: 0 0 auto;
  height: 4rem;
  margin-right: 1rem;
  background: var(--accent-color);
}

.thumb--1 {
  width: 5rem;
}

.thumb--2 {
  width: 4rem;
  opacity: 0.7;
}

.thumb--3 {
  width: 3.2rem;
  opacity: 0.45;
}

.thumb--ascii-1 {
  width: 4.5rem;
  background: #000;
}

.thumb--ascii-2 {
  width: 3.5rem;
  background: #333;
}

@media only screen and (max-width: 1023px) {
  :root {
    --infos-w: 100%;
    --t2-size: 3.01205rem;
    --t2-line: 2.5rem;
  }

  a.section.section--list-item,
  div.section.section--list-item {
    flex-wrap: wrap;
  }

  a.section.section--list-item:not(:last-child),
  div.section.section--list-item:not(:last-child) {
    padding-bottom: 2rem;
  }

  a.section.section--list-item > .title,
  div.section.section--list-item > .title {
    order: 1;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    white-space: nowrap;
    overflow: visible;
  }

  a.section.section--list-item > .infos,
  div.section.section--list-item > .infos {
    order: 2;
    width: 100%;
    flex: 0 0 100%;
    float: none;
  }

  a.section.section--list-item > .title .t2,
  div.section.section--list-item > .title .t2 {
    width: 100%;
    padding-top: 0.2em;
    padding-bottom: 0.2em;
    padding-right: 0;
  }
}

/* Narrow phones: meta table + filters */
@media only screen and (max-width: 520px) {
  .info-row .title {
    flex: 0 0 5.25rem;
    width: 5.25rem;
  }

  .info-row .content {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  section.section--filters a:not(:last-child) {
    padding-right: 1.25em;
  }
}

/* Desktop but squeezed (e.g. half-screen window): shrink infos column */
@media only screen and (min-width: 1024px) and (max-width: 1180px) {
  :root {
    --infos-w: 13rem;
  }

  .info-row .title {
    flex: 0 0 5.5rem;
    width: 5.5rem;
  }
}

/* TBD row */
.section--list-item--tbd .t2,
.section--list-item--tbd .info-row .content {
  color: #b42318;
}

.section--list-item--tbd {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(180, 35, 24, 0.07) 0,
    rgba(180, 35, 24, 0.07) 2px,
    transparent 2px,
    transparent 10px
  );
}

/* Unreleased ? + mosaic */
.section--list-item--unnamed .mosaic-surface {
  position: relative;
}

.section--list-item--unnamed .mosaic-surface::after {
  --tile: 0.0923em;
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(45deg, var(--field) 25%, transparent 0, transparent 75%, var(--field) 0),
    linear-gradient(45deg, var(--field) 25%, transparent 0, transparent 75%, var(--field) 0);
  background-position: 0 0, calc(var(--tile) / 2) calc(var(--tile) / 2);
  background-size: var(--tile) var(--tile);
}

@media (prefers-reduced-motion: no-preference) {
  .section--list-item.is-overflowing:hover .index-ticker,
  .section--list-item.is-overflowing:focus-within .index-ticker {
    animation: index-ticker var(--ticker-duration, 9s) steps(var(--ticker-steps, 10)) infinite
      alternate;
  }
}

@keyframes index-ticker {
  to {
    transform: translateX(calc(var(--ticker-steps, 10) * -1ch));
  }
}

.index-ruler {
  position: fixed;
  top: -200px;
  left: 0;
  width: 1ch;
  font-family: SBM, sans-serif;
  font-size: var(--t2-size);
  visibility: hidden;
  pointer-events: none;
}

/* All widths: long titles tick instead of wrapping (MSCHF-style). */
.section--list-item--unnamed .index-name,
.section--list-item:not(.section--list-item--unnamed) .index-name {
  overflow: hidden;
  white-space: nowrap;
}

/* Touch (no hover): drag the title instead of animating it. Placed after the
   nowrap rule so it wins at equal specificity. The ancestor .title already
   clips vertically, so only x becomes scrollable. */
@media (prefers-reduced-motion: no-preference) and (hover: none) {
  .section--list-item.is-overflowing .index-name {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .section--list-item.is-overflowing .index-name::-webkit-scrollbar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section--list-item.is-overflowing .index-ticker {
    animation: none;
  }

  .section--list-item.is-overflowing .index-name {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* The unnamed run is notation, not a name: keep it on one clipped line so the
     long run cannot wrap into a stack of question marks. Clipped on x only —
     `--t2-line` is shorter than the type, so `overflow: hidden` would crop ink. */
  .section--list-item--unnamed.is-overflowing .index-name {
    overflow-x: clip;
    overflow-y: visible;
    white-space: nowrap;
    overflow-wrap: normal;
  }
}
