#col2 {
  display: flex;
  justify-content: center;
  align-items: start;
}

#articles {
  position: sticky;
  right: 0;
  bottom: 0;
  width: 30%;
  height: calc(100vh - var(--header-height));
  flex-basis: 40%;
  background-color: var(--reader-bg);
  color: var(--reader-fg);
  overflow-x: hidden;
  overflow-y: visible;
  padding: 1rem 0.5rem 1rem 1rem;
  border-left: 1px solid var(--ui-border);
  font-weight: 100;
}

#left {
  width: 70%;
  position: relative;
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#livres {
  position: relative;
  flex-basis: 350px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--ui-border);
}

#livres-scroller-content::after {
  content: "";
  position: absolute;
  width: 100%;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
      var(--ui-bg) 0%,
      var(--ui-bg-a00) 70px,
      var(--ui-bg-a00) calc(100% - 70px),
      var(--ui-bg) 100%);
}


.cover-collection {
  display: none;
}

.covers .scroller-content {
  height: 100%;
  display: flex;
  gap: 1rem;
  padding: 1rem 1rem 1rem 1rem;
  overflow-x: visible;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

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

/* tokens: chips and tags */

#tokens-container {
  /* flex-safety */
  min-width: 0;
  padding-right: 1rem;
  height: auto;
}

#tokens-bar {
  min-width: 0;
  max-width: 100%;
  gap: 0.35rem;
}


/* Layout: chips on the left, input+dropdown on the right */
#term-bar {
  display: flex;
  justify-content: flex-start;
}

/* Container that holds chips or tags */
#tags-bar,
#term-chips {
  display: flex;
  align-items: center;
}

#tags-bar {
  flex: 0 0 auto;
  width: auto;
}

/* Home buttons */
#term-input,
.term-chip,
.tag,
.term-suggestion {
  display: block;
  height: var(--btn-height);
  padding: 0rem 0.5rem 0rem 0.5rem;
  line-height: 1.3;
  font-size: 0.9rem;
  font-weight: 100;
  min-height: unset;
  margin: 0;
}

.term-chip,
.tag,
.term-suggestion {
  background-color: var(--color-accent-lighter);
}

.term-suggestion,
.term-chip {
  border-radius: 0.5rem;
  border: 1px solid var(--btn-border);
}

#term-input {
  border-radius: 0.5rem;
}


#tags-bar .tag {
  flex: 0 0 auto;
}

.tag {
  font-weight: 100;
  box-shadow: none;
  padding-right: 0.5rem;
  border-radius: 20px;
}

.tag[aria-pressed="true"] {
  background: var(--btn-bg-pressed);
  color: var(--btn-fg-pressed);
  border-color: var(--btn-border-pressed);
  box-shadow: var(--btn-shadow-pressed);
}

.tag[aria-pressed="true"]:hover {
  border-color: var(--ui-border-hover);
  box-shadow: var(--btn-shadow-pressed), var(--ui-shadow);
}

/* Each suggestion is a full-width row */
.term-suggestion {
  width: 100%;
  text-align: left;
  user-select: text;
  font-weight: inherit;
  margin-bottom: 0.5rem;
}

.term-suggestion:hover,
.term-suggestion.active {
  border-color: var(--btn-border);
  box-shadow: 0 0 5px hsla(203, 0%, 0%, 1);
}


.term-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding-right: 0;
  margin-right: 0.35rem;
}


/* Label text inside chip */
.term-chip-label {
  display: inline-block;
  max-width: 22ch;
  /* tune; prevents chips becoming too wide */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Term chip remove button (the ×) */
.term-chip-remove {
  display: inline-grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  flex: 0 0 auto;
  min-width: unset;
  min-height: unset;
  width: var(--btn-height);
  height: var(--btn-height);
  color: var(--ui-border);
}



/* Hover/focus states */
.term-chip:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-fg-hover);
}

.term-chip-remove:hover {
  box-shadow: none;
  background-color: transparent;
  color: var(--btn-fg-hover);
}

.term-chip-remove:focus-visible {
  outline: 2px solid var(--focus, #0969da);
  outline-offset: 2px;
}

/* Optional: active chip state (if you ever need it) */
.term-chip.is-active {
  border-color: var(--chip-active-border, #0969da);
  background: var(--chip-active-bg, #ddf4ff);
}

/* Input + dropdown wrapper */
#term-select {
  position: relative;
  /* anchor dropdown */
  min-width: 12ex;
  /* prevents collapsing too hard */
}

/* Input fills wrapper */
#term-input {
  width: 100%;
  min-width: 30ex;
  padding: 0 2rem;
  background: var(--ui-bg-highlight, #fff);
}

#term-select .icon-filter {
  position: absolute;
  left: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-hot);
}

#term-clear {
  position: absolute;
  padding: auto;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ui-border);
  background: transparent;
  border: none;
  cursor: pointer;
}

#term-clear:hover {
  color: var(--ui-fg-hover);
  box-shadow: none;
}

#term-clear[hidden] {
  display: none;
}

/*
#filter-clear {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  color: var(--ui-fg);
}
*/

#term-input[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

#term-input::placeholder {
  font-style: italic;
}

/* Dropdown under input */
#term-suggest {
  position: fixed;
  z-index: 1000;
  top: var(--ts-top, 46px);
  left: var(--ts-left, 198px);
  width: var(--ts-width, 139px);
  max-height: 16rem;
  overflow: auto;
  overflow-x: hidden;

  background-color: var(--ui-bg-highlight, #fff);
  padding: 1ex 1ex;
  /*
  border-width: 1px;
  border-color: var(--ui-border);
  border-style: none solid solid solid;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  */
}

#term-suggest[hidden] {
  display: none;
}


/** date slider */

#dates-bar {
  padding: 8px 8px 4px 0;
  height: auto;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"].year {
  width: 6ex;
  text-align: center;
  padding: 0 0.5ex;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  background-color: var(--ui-bg-highlight);
  height: 20px;
  border-radius: 3px;
}

#dates-center {
  width: 100%;
  padding: 0 12px 8px 12px;
}

.noUi-pips-horizontal {
  height: auto
}

.noUi-target {
  background: inherit;
  border-color: var(--ui-shadow-subtle, rgba(0, 0, 0, .1));
  box-shadow: none;
}

.noUi-base {
  z-index: inherit;
  background-color: inherit;
}

.noUi-pips-horizontal {
  top: 20%;
  z-index: 2;
}


.noUi-connect,
[disabled] .noUi-connect {
  background-color: var(--color-accent-lighter);
  opacity: 0.5;
}

.noUi-tooltip {
  border-color: #D9D9D9;
  background: #fff;
  color: #000;
}

.noUi-origin {
  z-index: 4;
}

.noUi-handle {
  border: 1px solid var(--ui-border);
  background: hsl(203, 20%, 60%);
  /* box-shadow: inset 0 0 1px var(--reader-bg), inset 0 1px 7px var(--ui-border-alt), 0 3px 6px -3px #000; */
  box-shadow: none;
}

.noUi-horizontal .noUi-handle {
  top: -3px;
  height: 22px;
}

/* Handle stripes; */
.noUi-handle:before,
.noUi-handle:after {
  background: var(--fg);
  top: 4px;
  height: 12px;
}

.noUi-marker {
  position: absolute;
  background: var(--fg);
}

.noUi-active {
  box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB;
}

/* Welcome page deco */
#piaget-labo {
  flex-shrink: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  height: 100%;
  padding: 1rem 1rem 2rem 0;
}

#piaget-labo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/piaget-table.png") no-repeat right bottom / auto 80%;
  z-index: -1;

  opacity: 1;
  transition: opacity .25s ease;
}

#piaget-labo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(90deg,
      var(--ui-bg) 0%,
      var(--ui-bg) 500px,
      var(--ui-bg-a00) 700px,
      var(--ui-bg-a00) 100%);

}

#piaget-labo>* {
  position: relative;
  z-index: 1;
}


#piaget-labo-text {
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--tonic);
}

#piaget-labo-graph {
  position: relative;
  flex-shrink: 1;
  flex-grow: 1;
  flex-basis: 100%;
}

#piaget-labo>img {
  flex-shrink: 1;
  display: block;
  max-height: 90%;
  flex-basis: 90%;
  margin: 0 0 0 1rem;
}
