.ui.grid .sticky.fixed {
  left: 0 !important;
}

.floatright {
  float: right;
}
.floatleft {
  float: left;
}
.clearboth {
  clear: both;
}

.ui.vertical.menu .menu {
  padding-top: 0.5em;
}

.ui.vertical.menu .menu .item {
  padding-right: 2px;
}

.invisible {
  visibility: hidden;
}

.small.divider {
  margin: 0rem;
  margin-bottom: 0.8rem;
}

/* make button equally high as input */
.ui.main.menu .primary.big.button {
  line-height: 1.21428571em;
}

/* why is set to negative margin in semantic.ui.css? */
.ui.menu:not(.vertical) .item > .button {
  margin: 0;
}

.ui.main.menu .search input:not(:placeholder-shown) {
  min-width: 30rem;
}

.ui.label > a.nohover {
  opacity: 1;
  filter: alpha(opacity=1.0);
}

.ui.comments {
  max-width: initial;
}

em {
  font-weight: bold;
}

.contentcondtitles {
  margin-left: auto;
  display: block;
  text-align: right;
}

#wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
}

#navbar {
  width: 90%;
  max-width: 1750px;
  height: 20%;
}

#searchContainer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  max-width: 1750px;
  width: 90%;
  margin: auto;
  height: 80%;
}

#wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
}

@media (max-width: 768px) {
  #searchContainer {
    flex-direction: column;
  }

  #searchContainer div {
    width: 100% !important;
  }
}

/* ========================================
   Expandable Media (Images & Tables)
   ======================================== */

.expandable-media {
  position: relative;
  cursor: pointer;
}

.expandable-image {
  display: inline-block;
  max-width: 100%;
}

.expandable-table {
  display: block;
}

.expandable-media:focus {
  outline: 2px solid var(--primary-color, #2185d0);
  outline-offset: 2px;
}

.expandable-media:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   Media Viewer Modal
   ======================================== */

#media-viewer-modal.ui.modal {
  width: 95vw !important;
  max-width: none;
  margin: 0 auto !important;
  top: 2.5vh !important;
  left: 2.5vw !important;
  right: 2.5vw !important;
  height: 95vh;
}

#media-viewer-modal .content {
  height: 100%;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1b1c1d;
  overflow: hidden;
}

#media-viewer-modal .close.icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  font-size: 1.5em;
  z-index: 100;
  cursor: pointer;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

#media-viewer-modal .close.icon:hover {
  background: rgba(0, 0, 0, 0.8);
}

#media-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

#media-viewer-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

#media-viewer-container.table-viewer table {
  max-width: 100%;
  max-height: 100%;
  background-color: white;
  user-select: none;
  -webkit-user-drag: none;
}

#media-viewer-caption {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 4px;
  font-size: 0.95em;
  text-align: center;
  z-index: 100;
  display: none;
}

.media-viewer-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

.media-viewer-controls .ui.button {
  background: rgba(0, 0, 0, 0.6);
  color: white;
}

.media-viewer-controls .ui.button:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Tablet: full viewport */
@media (max-width: 1024px) {
  #media-viewer-modal.ui.modal {
    width: 100vw !important;
    height: 100vh;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 0;
  }

  #media-viewer-modal .content {
    height: 100%;
  }
}
