/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

/* Balance text wrapping on headings */
h1, h2,
h3, h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input, button,
textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

:root {
  --gbg: #ffffff; /*global background*/
  --bg: var(--gbg); /*background*/
  --gbl: #ffffff80; /*global background light*/
  --bl: var(--gbl); /*background light*/
  --gfg: #000000; /*global foreground*/
  --fg: var(--gfg); /*foreground*/
  --gfl: #00000080; /*global foreground light*/
  --fl: var(--gfl); /*foreground light*/
  --gprimary: #452faa; /*global primary*/
  --primary: var(--gprimary); /*primary*/
  --gprimaryl: #452faa80; /*global primary light*/
  --primaryl: var(--gprimaryl); /*primary light*/
  --gsecondary: #fea2db; /*global secondary*/
  --secondary: var(--gsecondary); /*secondary*/
  --gsecondaryl: #fea2db80; /*global secondary light*/
  --secondaryl: var(--gsecondaryl); /*secondary light*/
}
@font-face {
  font-family: 'SourceSans';
  src: url('/font/SS3IVariable.ttf') format('truetype');
  font-weight: 200 900;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: 'SourceSans';
  src: url('/font/SS3Variable.ttf') format('truetype');
  font-weight: 200 900;
  font-style: normal;
  font-display: block;
}

body {
  font-family: 'SourceSans';
  background: var(--bg);
  color: var(--fg);
}

.tripartite {
  display: grid;
  grid-template-columns: 0fr 1fr 0fr;
  position: relative;
}

#left-sidebar, #right-sidebar {
  width: 12rem;
  max-height: 100vh;
  overflow-y: scroll;
  scrollbar-width: none;
}

#left-sidebar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-around;
}

@media (min-width: 52rem) and (max-width: 64rem) {
  .tripartite: {
    display: grid;
    grid-template-columns: 0fr 1fr;
  }
  #right-sidebar {
    display: none;
  }

  #main-content {
    margin-right: calc(100vw - 52rem);
  }
}

@media (min-width: 48rem) and (max-width: 52rem) {
  .tripartite: {
    display: grid;
    grid-template-columns: 0fr 1fr;
  }
  #right-sidebar {
    display: none;
  }
}

@media (min-width: 36rem) and (max-width: 48rem) {
  .tripartite {
    display: block;
  }
  #left-sidebar, #right-sidebar {
    display: none
  }
  #main-content {
    margin-left: calc(100vw - 36rem);
  }
}

@media (max-width: 36rem) {
  .tripartite {
    display: block;
  }
  #left-sidebar, #right-sidebar {
    display: none
  }
}


.sidebar-group {
  display:flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

#left-sidebar .sidebar-group {
  align-items: flex-end;
}

#right-sidebar .sidebar-group {
  align-items: flex-start;
}

#watched-threads button {
  position: relative;
}

#watched-threads button:hover {
  color: transparent;
}

#watched-threads button:hover::before {
  position: absolute;
  top: 0;
  right: 0;
  left: -3rem;
  text-align:right;
  overflow: visible;
  white-space: nowrap;
  color: var(--fg);
}

#watched-threads button.recent-activity:hover::before {
  content: 'sort by total activity';
}

#watched-threads button.ignore-thread:hover::before {
  left: 0;
  right: 3rem;
  text-align: left;
  content: 'click to ignore';
}

.new-thread:has(.ignore-thread:hover) .watch-thread {
  color: transparent;
}

#watched-threads button.watch-thread:hover::before {
  content: 'click to watch';
}

#watched-threads button.total-activity:hover::before {
  content: 'sort by recent activity'
}

.watched-thread, .new-thread {
  display: flex;
  width: 100%;
  justify-content: space-between;
}

.watch-thread {
  width: 90%;
  overflow: hidden;
  text-align: right;
}

#left-sidebar {
  position: relative;
  padding-right: 4px;
  overflow-y: hidden;
}

#left-sidebar::after {
  content: '';
  position: absolute;
  z-index: -3;
  left: 0;
  right:0;
  top:-50%;
  bottom:-50%;
  background: linear-gradient(0deg, var(--fg) 50%, transparent 50%);
  background-repeat: repeat-y;
  background-size: 4px 16px;
  background-position: 100% 0;
  animation: animate-up 128s infinite linear;
}

#left-sidebar::before {
  content: '';
  position: absolute;
  z-index: -3;
  left: 0;
  right: calc(100% - 4px);
  top: 0;
  bottom: var(--remaining);
  background: var(--accent);
}

@keyframes animate-up {
  0% {
    transform: translateY(25%);
  }

  99% {
    transform: translateY(-25%);
  }
}

#main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: scroll;
  scrollbar-width: none;
}

button {
  background-color: transparent;
  border: none;
  color: var(--fg);
  padding: 0;
  cursor: pointer;
}

button:hover {
  font-weight: 700;
}

input {
  background-color: transparent;
  border: none;
}

form {
  display: flex;
  flex-direction: column;
}

.form-field {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.form-field > :is(input, textarea) {
  background-color: var(--fg);
  color: var(--bg);
  flex-grow: 1;
}

.form-submit {
  margin-top: 1rem;
}

.form-submit > input {
  background-color: var(--fg);
  color: var(--bg);
}

.thread-link {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.volume-settings {
  accent-color: var(--primary);
}

.thread-tail {
  padding-bottom: 1rem;
}

.thread-tail:hover > div {
  transform: translateX(1rem);
}

.thread-tail:hover > div .time {
  transform: translateX(-1rem);
}

.thread-tail:hover {
  background: var(--accentl);
}

.thread-tail > div {
  transition-duration: .07s;
  transition-delay: 0s;
}

.thread-tail > div .time {
  transition-duration: .07s;
  transition-delay: 0s;
}

.catalog-thumb:hover::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index:-1;
  background: var(--accentl);
  transform: translateY(-0.5rem);
}

.catalog-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index:-1;
  transition-property: transform;
  transition-duration: .07s;
  transform: translateY(0rem);
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-template-rows: masonry;
}
.catalog::after {
  content: "looks best with mozilla firefox with masonry flag enabled in about:config!"
}

@supports (grid-template-rows: masonry) {
  .catalog::after {
    content: ""
  }
}

.catalog-thumb {
  padding-bottom: 1rem;
  transition-duration: .07s;
  position: relative;
}

.catalog-thumb:hover {
  transform: translateY(0.5rem);
}

:is(.catalog, .thread-tail) .topic {
  font-size: 2rem;
  word-break: break-word;
}

.catalog .tx {
  padding-bottom: 0;
}

.archived {
  opacity: 0.5;
}

.bump-limit {
  opacity: 0.75;
}

::selection {
  background: var(--primary);
}

.banned {
  font-size: 8rem;
  line-height: 1;
}

#settings-pane {
  accent-color: var(--primary);
}
