/* Nanoq Intranet – Photos (1.10.0) */

.nanoq-photos-crumbs a:hover {
  color: var(--nanoq-primary) !important;
}

.nanoq-photos-locked {
  font-size: 0.8em;
  vertical-align: 1px;
}

.nanoq-album-description {
  max-width: 760px;
  color: var(--nanoq-title);
}

/* Album tiles */
.nanoq-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 44%), 1fr));
  gap: 18px;
}

.nanoq-album {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
}

.nanoq-album-cover {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.12);
  box-shadow: 0 2px 6px rgba(67, 89, 113, 0.12);
}

.nanoq-album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.nanoq-album:hover .nanoq-album-cover img {
  transform: scale(1.04);
}

.nanoq-album-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2.6rem;
  color: rgba(127, 127, 127, 0.55);
}

.nanoq-album-name {
  margin-top: 8px;
  font-weight: 600;
  color: var(--bs-heading-color, var(--nanoq-heading));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nanoq-album:hover .nanoq-album-name {
  color: var(--nanoq-primary);
}

.nanoq-album-meta {
  font-size: 0.8rem;
  color: var(--nanoq-title);
}

/* Photo grid */
.nanoq-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 46%), 1fr));
  gap: 8px;
}

.nanoq-photo {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.12);
}

.nanoq-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.nanoq-photo:hover img,
.nanoq-photo:focus-visible img {
  transform: scale(1.05);
}

.nanoq-photo:focus-visible {
  outline: 3px solid var(--nanoq-primary);
  outline-offset: 2px;
}

.nanoq-photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nanoq-photo:hover .nanoq-photo-caption,
.nanoq-photo:focus-visible .nanoq-photo-caption {
  opacity: 1;
}

@media (hover: none) {
  .nanoq-photo-caption {
    display: none;
  }
}

.nanoq-photo-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.9rem;
}

/* Dashboard widget */
.nanoq-photo-widget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.nanoq-photo-widget-grid a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
}

.nanoq-photo-widget-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Upload */
.nanoq-photos-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 28px 16px;
  border: 2px dashed rgba(127, 127, 127, 0.35);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.nanoq-photos-drop i {
  font-size: 2.4rem;
  color: var(--nanoq-primary);
}

.nanoq-photos-drop:hover,
.nanoq-photos-drop.is-over {
  border-color: var(--nanoq-primary);
  background: rgba(102, 88, 234, 0.06);
}

.nanoq-photos-queue {
  max-height: 260px;
  overflow-y: auto;
  margin-top: 12px;
}

.nanoq-photos-qitem {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 9px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.15);
  font-size: 0.88rem;
}

.nanoq-photos-qthumb {
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.15);
}

.nanoq-photos-qthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nanoq-photos-qname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nanoq-photos-qstatus {
  color: var(--nanoq-title);
  white-space: nowrap;
}

.nanoq-photos-qitem.is-done .nanoq-photos-qstatus {
  color: #2b8a3e;
}

.nanoq-photos-qitem.is-error .nanoq-photos-qstatus {
  color: #d63638;
  white-space: normal;
  max-width: 220px;
  text-align: right;
}

.nanoq-photos-qbar {
  position: absolute;
  left: 54px;
  right: 4px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: rgba(127, 127, 127, 0.15);
  overflow: hidden;
}

.nanoq-photos-qbar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--nanoq-primary);
  transition: width 0.2s;
}

.nanoq-photos-qitem.is-done .nanoq-photos-qbar span {
  width: 100% !important;
  background: #2b8a3e;
}

.nanoq-photos-qitem.is-error .nanoq-photos-qbar {
  display: none;
}

/* Lightbox */
html.nanoq-lb-open {
  overflow: hidden;
}

.nanoq-lb {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 14, 0.94);
  color: #fff;
  outline: none;
}

.nanoq-lb[hidden] {
  display: none;
}

.nanoq-lb-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 64px 12px;
}

.nanoq-lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s;
}

.nanoq-lb.is-loading .nanoq-lb-stage img {
  opacity: 0.35;
}

.nanoq-lb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: nanoq-lb-spin 0.8s linear infinite;
}

.nanoq-lb.is-loading .nanoq-lb-spinner {
  opacity: 1;
}

@keyframes nanoq-lb-spin {
  to { transform: rotate(360deg); }
}

.nanoq-lb-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.nanoq-lb-btn:hover,
.nanoq-lb-btn:focus-visible {
  background: rgba(255, 255, 255, 0.25);
}

.nanoq-lb-btn[hidden] {
  display: none;
}

.nanoq-lb-close {
  top: 10px;
  right: 12px;
}

.nanoq-lb-prev,
.nanoq-lb-next {
  top: calc(50% - 60px);
}

.nanoq-lb-prev {
  left: 12px;
}

.nanoq-lb-next {
  right: 12px;
}

.nanoq-lb-info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 12px 20px 18px;
}

.nanoq-lb-text {
  min-width: 0;
  flex: 1 1 320px;
}

.nanoq-lb-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.nanoq-lb-caption {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.85);
  white-space: pre-line;
}

.nanoq-lb-meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.nanoq-lb-meta a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
}

.nanoq-lb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nanoq-lb-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}

.nanoq-lb-action:hover,
.nanoq-lb-action:focus-visible {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nanoq-lb-action[hidden] {
  display: none;
}

.nanoq-lb-delete:hover {
  border-color: #ff6b6b;
  color: #ff8787;
}

@media (max-width: 767px) {
  .nanoq-lb-stage {
    padding: 52px 8px 8px;
  }
  .nanoq-lb-prev,
  .nanoq-lb-next {
    top: auto;
    bottom: 120px;
    background: rgba(0, 0, 0, 0.35);
  }
  .nanoq-lb-action span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nanoq-photo img,
  .nanoq-album-cover img,
  .nanoq-lb-spinner {
    transition: none;
    animation: none;
  }
}
