/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: "Fira Code", ui-monospace, monospace;
}

body:has(.photo-stack) {
  margin: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 4px;
}

img.photo-stack {
  display: block;
  width: 100%;
  height: auto;
}

.photo-grid img.photo-stack {
  opacity: 0;
  transition: opacity 240ms ease;
}

.photo-grid img.photo-stack.is-shown {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .photo-grid img.photo-stack {
    transition: none;
  }
}

img.admin-preview {
  display: block;
  max-width: 540px;
  max-height: 540px;
  width: auto;
  height: auto;
}

table.admin-photos {
  border-collapse: collapse;
}

table.admin-photos th,
table.admin-photos td {
  padding: 12px;
  border: 1px solid #888;
  text-align: left;
  vertical-align: top;
}

ul.admin-resolution-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

img.admin-index-preview {
  display: block;
  width: 360px;
  min-width: 360px;
  height: auto;
}

.admin-actions {
  white-space: nowrap;
}

.admin-actions a,
.admin-actions form.admin-action {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}

.admin-actions > * + * {
  margin-left: 12px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: 40px 80px;
  background: rgba(0, 0, 0, 0.75);
}

.lightbox:not(:has(.lightbox-nav[hidden])) {
  grid-template-columns: 120px minmax(0, 1fr) 120px;
  padding: 40px 16px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox img.is-sized {
  width: min(100%, calc((100vh - 80px) * var(--photo-aspect)));
  height: auto;
  aspect-ratio: var(--photo-aspect);
  object-fit: contain;
}

.lightbox-nav {
  padding: 8px;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  text-decoration: underline;
}

.lightbox-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox {
    opacity: 0;
    transition: opacity 150ms ease;
  }

  .lightbox.is-open {
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .photo-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
  }

  .photo-grid img.photo-stack[data-high-src] {
    cursor: pointer;
  }

  .photo-grid img.photo-stack[width][height] {
    width: auto;
    height: 45vh;
    max-width: 100%;
    flex: none;
    object-fit: contain;
  }
}
