.archive-container {
  max-width: 39.39rem;
  width: 100%;
  margin: 0 auto;

  padding: 1rem;
  /* padding-right: 1rem;
  padding-bottom: 0;
  padding-left: 1rem; */
  line-height: 1.3;
}

.archive-controls {
  position: fixed;
  /* left: 50%;
  transform: translateX(-50%); */
  width: 100%;
  /* max-width: 40rem; */
  top: 6.4rem;
  background: #202020;
  margin: 0 auto;
  z-index: 10;
  padding-right: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 0.5rem;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 12px -8px rgba(0, 0, 0, 0.5);
}

input[type="text"] {
  outline: none;
  font-family: "neuzeit-grotesk", sans-serif;
}

input[type="text"]:focus,
input[type="select"]:focus,
button:focus {
  outline: none;
}

.view-mode-switch {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.15rem;
  height: 32px;
}

.view-mode-switch button:hover,
.archive-controls select:hover {
  background: #333;
  color: #e5c100;
  transition: background 0.3s ease, color 0.3s ease;
}

.archive-controls::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 300px;
  background: #202020;
  z-index: 3;
}

.archive-controls label {
  color: #d9d9d9;
}

#customSelectWrapper {
  position: relative;
  display: inline-block;
  /* margin-top: 0.5rem; */
  width: 8.5rem; /* already in rem (7.5rem ≈ 123.75px if needed) */
}

#customSelectWrapper::after {
  content: "▼";
  font-size: 0.75rem; /* 12px ≈ 0.73rem, using 0.75rem as given */
  color: var(--link-color);
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  pointer-events: none;
}

/* #customSelectWrapper select {
  color: #e5c100;
} */

/* #customSelectWrapper::after:hover {
  color: #e5c100;
}

.multi-select-header-placeholder:hover {
  color: #e5c100;
} */

.multi-select-header-placeholder {
  text-align: left;
}

#sortSelect {
  width: 100%;
  height: 32px;
  background: #2d2d2d;
  color: #4abfb7;
  font-family: "neuzeit-grotesk", sans-serif;
  font-size: 13.3333px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: background 0.3s, color 0.3s;
  padding: 0.3rem 2.5rem 0.3rem 0.5rem;
  border: 0.0625rem solid #2d2d2d; /* 1px ≈ 0.06rem */
}

#sortSelect:hover {
  background: #333;
  color: #e5c100;
}

select#sortSelect:focus {
  outline: none;
}

.archive-controls input[type="text"] {
  background: #2d2d2d;
  color: #e5c100;
  border: 1px solid #333;
  padding: 0.3rem;
  outline: none;
  width: 11rem;
  min-height: 32px;
}

.view-mode-switch button {
  background: #2d2d2d;
  color: #4abfb7;
  border: 1px solid #2d2d2d;
  padding: 0.5rem 1rem;
  cursor: pointer;
  max-height: 32px;
  font-size: 13.3333px;
  line-height: 10px;
}

.view-mode-switch button.active {
  background: #333;
  color: #e5c100;
  border: 1px solid #545454;
}

#archiveContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-right: 0.5rem;
  padding-bottom: 4rem;
  padding-left: 0.5rem;
  justify-content: center;
  position: relative;
  bottom: 70px;
  top: 160px;
}

/* We'll style the anchor as a block to make the entire item clickable */
.archive-item {
  text-decoration: none;
  color: #d9d9d9;
}

.archive-item:hover {
  background: #333;
  /* subtle hover effect */
}

/* Grid Mode */
.archive-item.grid-mode {
  width: 200px;
  border: 1px solid #444;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #2a2a2a;
  text-align: center;
  /* center text under the image */
}

.archive-item.grid-mode .thumb-wrap {
  position: relative;
  display: inline-block; /* shrink-wrap to image */
  width: auto; /* match image width, not tile width */
  line-height: 0; /* remove inline spacing */
}

.archive-item.grid-mode img {
  display: block; /* remove inline gaps */
  width: 100%; /* fill the wrapper width */
  height: auto;
  object-fit: contain;
  margin-bottom: 0.2rem;
}

/* Grid typography – align with List sizes/weights */
.archive-item.grid-mode .title {
  font-weight: 600;
}
.archive-item.grid-mode .teaser {
  font-size: 0.8rem;
  font-weight: 400;
  color: #ccc;
}
/* Teaser color must not change on overlay/link hovers */
.archive-item.grid-mode.overlay-active .teaser,
.archive-item.grid-mode.overlay-link-hovering .teaser {
  color: #ccc;
}

/* === Grid thumbnail overlay (dims + blur) === */
.archive-item.grid-mode .grid-overlay {
  position: absolute;
  inset: 0;
  display: flex; /* keep layout for transition */
  opacity: 0;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.72); /* dim layer */
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  color: #d9d9d9;
  z-index: 2;
  transition: opacity 160ms ease-in-out, visibility 160ms ease-in-out;
}

/* bottom fade/shadow shown only when scrollable (JS toggles .has-scroll) */
.archive-item.grid-mode .grid-overlay::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease-in-out;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.45));
}
.archive-item.grid-mode .grid-overlay.has-scroll::after {
  opacity: 1;
}

/* Extra adaptive dim: multiplies with the image below when overlay is visible */
.archive-item.grid-mode .thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.28);
  mix-blend-mode: multiply; /* bright thumbs dim a bit more */
  pointer-events: none;
  transition: opacity 160ms ease-in-out, visibility 160ms ease-in-out;
}

/* Show overlay when tile is active or hovered */
.archive-item.grid-mode.overlay-active .grid-overlay,
.archive-item.grid-mode:hover .grid-overlay {
  opacity: 1;
  visibility: visible;
}
.archive-item.grid-mode.overlay-active .thumb-wrap::after,
.archive-item.grid-mode:hover .thumb-wrap::after {
  opacity: 1;
  visibility: visible;
}

.archive-item.grid-mode .grid-overlay .grid-overlay-scroller {
  width: 100%;
  height: 100%;
  overflow-y: scroll; /* vertical only; track always present */
  overflow-x: hidden; /* prevent horizontal scrolling */
  padding: 0.875rem 2ch 0.7rem; /* extra top space (~1 line), doubled side margins */
  text-align: left;
  font-weight: 400;
  font-size: 0.8rem;
  line-height: 1; /* slightly tighter */
  color: #f0f0f0; /* brighter overlay text */
}

/* Overlay scroller scrollbar — visible rail and light grey pill */
.grid-overlay-scroller {
  scrollbar-width: thin;
  scrollbar-color: #bfbfbf transparent;
}
.grid-overlay-scroller::-webkit-scrollbar {
  width: 8px;
}
.grid-overlay-scroller::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}
.grid-overlay-scroller::-webkit-scrollbar-thumb {
  background: #bfbfbf; /* light grey, visible on dark and light */
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0); /* create a ~4px pill look */
}
.grid-overlay-scroller:hover::-webkit-scrollbar-thumb {
  background: #d6d6d6;
}

/* Grouping margins for sections */
.archive-item.grid-mode .overlay-media-type {
  margin-top: 0rem;
  margin-bottom: 0rem;
}

/* Section headers: add stronger separation above, tighter below */
.archive-item.grid-mode .overlay-section-title {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 400;
  color: #ffffff; /* pure white headers */
  margin-top: 0.5rem; /* clear separation from previous block */
  margin-bottom: 0rem; /* tight to its content */
}

/* Slight spacing below the post link block to separate from Tags (if present) */
.archive-item.grid-mode .overlay-post {
  margin-bottom: 0rem;
}

/* Media Type link colors: default = brighter link color; hover = standard hover color */
.archive-item.grid-mode .media-super-tag,
.archive-item.grid-mode .overlay-post a,
.archive-item.grid-mode .overlay-tags .tag-link {
  color: var(--link-color); /* brighter than base, not the hover color */
  cursor: pointer;
  display: inline;
}
.archive-item.grid-mode .media-super-tag:hover,
.archive-item.grid-mode .overlay-post a:hover,
.archive-item.grid-mode .overlay-tags .tag-link:hover {
  color: var(--link-hover-color); /* standard hover color */
}

.archive-item.grid-mode .overlay-tags .tag-link::after {
  content: ", ";
}

.archive-item.grid-mode .overlay-tags .tag-link:last-child::after {
  content: "";
}

/* Title style switching (outside overlay) */
.archive-item.grid-mode .title {
  margin-top: 0.25rem;
  /* default color matches your tile text */
  color: #d9d9d9;
  transition: color 120ms ease-in-out;
}

/* When overlay is active and NOT over a link => Title shows hover style */
.archive-item.grid-mode.overlay-active .title {
  color: var(--link-hover-color) !important;
}

/* When hovering a link inside overlay => Title returns to default */
.archive-item.grid-mode.overlay-link-hovering .title {
  color: #d9d9d9 !important;
}

/* List Mode */
.archive-item.list-mode {
  width: 58.4%;
  border-bottom: 1px solid #444;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: #2a2a2a;
  position: relative;
}

.archive-item.list-mode img {
  width: 120px;
  height: auto;
  object-fit: contain;
}

.archive-item.list-mode .list-details {
  display: flex;
  flex-direction: column;
}

.archive-item.list-mode .list-details .title {
  font-weight: 600;
}

.archive-item.list-mode .list-details .teaser {
  font-size: 0.8rem;
  color: #ccc;
}

.archive-item.list-mode .list-details .media-type {
  font-size: 0.75rem;
  color: #999;
}

.short-padding {
  padding-top: 0;
  padding-right: 1rem;
  padding-bottom: 1rem;
  padding-left: 1rem;
  width: 100%;
  margin: 0 auto;
  line-height: 1.3;
}

/* .archive-header {
  max-width: 39.39rem;
  margin: 0 auto;
  padding-right: 1rem;
  padding-left: 1rem;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  z-index: 50;
} */

.archive-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 6.1675rem;
  background-color: #202020;
  z-index: 999;
  border-bottom: 0.06rem solid #262626;
}

/* .archive-header::before {
  content: "";
  display: block;
  height: 3rem;
} */

/* #archive-scroll-indicator-top {
  position: fixed;
  top: 8rem;
  left: 0;
  width: 100%;
  height: 3.03rem;
  background: linear-gradient(
    to bottom,
    rgba(32, 32, 32, 0.9),
    rgba(32, 32, 32, 0)
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.85s ease-in-out;
} */

.tag-row {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: #aaa;
  position: absolute;
  bottom: 0.2rem; /* Adjust as needed */
  right: 0.2rem; /* Adjust as needed */
  display: flex;
  flex-wrap: wrap; /* Ensures tags wrap naturally */
  justify-content: flex-end; /* Aligns the tags to the right */
}

.tag-row .tag-link {
  margin-right: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  color: #4abfb7;
  white-space: nowrap;
}

.tag-row .tag-link:last-child {
  margin-right: 0.2rem; /* Adjust this as needed */
}

.tag-row .tag-link:hover {
  color: #e5c100;
}

.tag-row .tag-selected {
  color: #e5c100; /* Use the hover color */
  pointer-events: none; /* Disable further pointer events */
}

.blog-post-link:hover {
  color: #e5c100;
}

.custom-multi-select {
  position: relative;
  display: inline-block;
  width: 10.75rem;
  /* margin-top: 0.5rem; */
  font-family: "neuzeit-grotesk", sans-serif;
  font-size: 13.3333px;
  color: #4abfb7;
  background: #2d2d2d;
  /* border: 1px solid #2d2d2d; */
}

/* Header (the area that shows the currently selected options) */
.custom-multi-select .multi-select-header {
  padding: 0.25rem 2.5rem 0.25rem 0.5rem;
  max-height: 32px;
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  background: #2d2d2d;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: background 0.3s, color 0.3s;
  align-items: center;
  align-content: center;
  /* justify-content: center; */
}

.multi-select-header:hover {
  background: #333;
  color: #e5c100;
}

/* Add the custom arrow */
.custom-multi-select .multi-select-header::after {
  content: "▼";
  font-size: 13.3333px;
  color: var(--link-color);
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* When header is active (dropdown open) */
.custom-multi-select .multi-select-header.multi-select-header-active {
  border-color: #c1c9d0;
}
.custom-multi-select .multi-select-header.multi-select-header-active::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Dropdown options container */
.custom-multi-select .multi-select-options {
  display: none; /* hidden by default */
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 999;
  background: inherit;
  border: 1px solid #2d2d2d;
  max-height: 200px;
  overflow-y: auto;
}

/* Show options when header is active */
.custom-multi-select
  .multi-select-header.multi-select-header-active
  + .multi-select-options {
  display: flex;
  flex-direction: column;
}

/* Option items */
.custom-multi-select .multi-select-options .multi-select-option {
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-bottom: 1px solid #444;
  color: inherit;
  background: inherit;
  display: flex;
  align-items: center;
  transition: all 0.095s ease-in;
  background: #2d2d2d;
}

/* Option hover */
.custom-multi-select .multi-select-options .multi-select-option:hover {
  background: #333;
  color: #e5c100;
  transition: all 0.095s ease-in;
}

input:focus {
  outline: none;
}

/* Styling for a selected option */
.multi-select .multi-select-options .multi-select-option.multi-select-selected {
  background-color: #368f89;
  color: #333;
  transition: all 0.095s ease-in;
}
.multi-select
  .multi-select-options
  .multi-select-option.multi-select-selected:hover {
  background-color: #368f89;
  color: #eee;
  transition: all 0.095s ease-in-out;
}

input[type="text"].multi-select-search {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0;
  margin-bottom: 0;
  background: #2c2c2c;
  border: 0.0625rem solid #444; /* 1px to rem */
  color: var(--text-color);
  font-size: 0.7rem; /* 16.5px to rem */
  line-height: 1.3;
  font-family: "neuzeit-grotesk", sans-serif;
}

/* Zoom input and label styling */
.percent-input-wrapper {
  position: relative;
  display: inline-block;
}

.zoom-label {
  margin-right: 6px;
  color: #e5c100; /* or #4abfb7, if you prefer */
}

#zoomAmount {
  color: #e5c100;
  font-size: 12px;
  background: rgba(33, 33, 33, 1);
  border: 1px solid #333;
  border-radius: 5px;
  font-family: "neuzeit-grotesk", sans-serif;
  height: 22.8px;
  width: 45px;
  padding: 0px 2px 0px 4px;
  margin-bottom: 0px;
}

.percent-sign {
  position: absolute;
  top: 50%;
  right: 5px; /* adjust as needed */
  transform: translateY(-50%);
  pointer-events: none;
  color: #999;
  font-size: inherit;
}
.percent-input-wrapper:hover .percent-sign {
  color: #e5c100;
  transition: all 0.095s ease-in-out;
}
.percent-input-wrapper input:not(:placeholder-shown) + .percent-sign {
  color: #e5c100;
}
