.galleria-admin-bar {
  display: none;
  margin-bottom: var(--space-3);
}

body.is-admin .galleria-admin-bar {
  display: block;
}

.galleria-status {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-3) 0;
}

.galleria-status[hidden] {
  display: none;
}

.galleria-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.75rem, 1fr));
  gap: var(--space-3);
}

.galleria-card {
  position: relative;
}

.galleria-card__open {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 3px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ddd;
  overflow: hidden;
  cursor: pointer;
}

.galleria-card__open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.galleria-card__open:hover img,
.galleria-card__open:focus-visible img {
  transform: scale(1.04);
}

.galleria-card__admin-controls {
  display: none;
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  gap: 0.4rem;
}

body.is-admin .galleria-card__admin-controls {
  display: flex;
}

body.galleria-modal-open {
  overflow: hidden;
}

.galleria-lightbox[hidden] {
  display: none;
}

.galleria-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.galleria-lightbox__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 12, 6, 0.8);
}

.galleria-lightbox__dialog {
  position: relative;
  background: var(--color-bg);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  width: min(56.25rem, 100%);
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.galleria-lightbox__close {
  position: absolute;
  top: 0.4rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-brown-dark);
  padding: 0.2rem;
}

.galleria-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  height: auto;
  margin: var(--space-3) auto var(--space-2);
  object-fit: contain;
  border: 3px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ddd;
}

.galleria-lightbox__date {
  margin: 0 0 0.4rem;
  font-family: var(--font-heading);
  font-weight: 600;
}

.galleria-lightbox__description {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.galleria-lightbox__description[hidden] {
  display: none;
}

.galleria-editor__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.galleria-editor__file-input:focus-visible + .image-editor__file-label {
  outline: 3px solid var(--color-brown);
  outline-offset: 2px;
}

.galleria-editor__hint {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.galleria-editor__counter {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-align: right;
}

@media (max-width: 520px) {
  .galleria-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .galleria-lightbox {
    padding: 0.75rem;
  }

  .galleria-lightbox__image {
    max-height: 55vh;
  }
}

.galleria-editor__check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-weight: 600;
  cursor: pointer;
}

.galleria-editor__check input {
  width: 1.1rem;
  height: 1.1rem;
}
