.at-photo-editor-host,
.at-photo-editor-host * {
  box-sizing: border-box;
}

.at-photo-editor {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 24px;
  color: #f3f6fc;
  background: linear-gradient(145deg, rgba(17, 31, 53, 0.98), rgba(7, 16, 31, 0.99));
  border: 1px solid #263956;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.at-photo-editor-heading {
  margin-bottom: 18px;
}

.at-photo-editor-title {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.25;
}

.at-photo-editor-subtitle {
  margin: 0;
  color: #9bacbf;
  line-height: 1.55;
}

.at-photo-editor-toolbar,
.at-photo-actions,
.at-photo-card-controls,
.at-photo-confirm-actions,
.at-photo-error {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.at-photo-editor-toolbar {
  margin-bottom: 18px;
}

.at-photo-file-input {
  /* POPRAVEK "Urejanje fotografij" (20. 10. 2026) — brez eksplicitnega
     top/left ta element podeduje statičen položaj iz zavijajočega flex
     orodja (.at-photo-editor-toolbar, flex-wrap:wrap), kar je pri ozkih
     širinah (375px) povzročilo vodoravno drsenje celotne strani. Natančen
     položaj ni pomemben (element je viden samo bralnikom zaslona). */
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.at-photo-count {
  margin-left: auto;
  color: #9bacbf;
  font-size: 0.92rem;
}

.at-photo-button,
.at-photo-icon-button {
  min-height: 44px;
  border: 1px solid #364b6d;
  border-radius: 9px;
  padding: 10px 14px;
  color: #f3f6fc;
  background: #111f35;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
}

.at-photo-button:hover,
.at-photo-icon-button:hover {
  border-color: #f5a623;
}

.at-photo-button:focus-visible,
.at-photo-icon-button:focus-visible,
.at-photo-card:focus-visible {
  outline: 3px solid rgba(245, 166, 35, 0.4);
  outline-offset: 2px;
}

.at-photo-button:disabled,
.at-photo-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.at-photo-button-primary {
  color: #07101f;
  background: #f5a623;
  border-color: #f5a623;
}

.at-photo-button-secondary {
  background: transparent;
}

.at-photo-button-small,
.at-photo-icon-button {
  min-height: 38px;
  padding: 8px 10px;
}

.at-photo-remove,
.at-photo-button-danger {
  color: #ffb5b5;
  border-color: rgba(255, 107, 107, 0.55);
}

.at-photo-notice,
.at-photo-error,
.at-photo-progress {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid rgba(101, 214, 179, 0.38);
  border-radius: 10px;
  color: #bcebdc;
  background: rgba(33, 117, 92, 0.13);
  line-height: 1.45;
}

.at-photo-notice.is-warning,
.at-photo-error {
  color: #ffd0cb;
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.08);
}

.at-photo-progress-text {
  margin-bottom: 9px;
  color: #dfe7f2;
  font-weight: 700;
}

.at-photo-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #07101f;
}

.at-photo-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: #f5a623;
  transition: width 120ms linear;
}

.at-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.at-photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #263956;
  border-radius: 12px;
  background: #0b1728;
  cursor: grab;
}

.at-photo-card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.at-photo-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #050d1a;
}

.at-photo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.at-photo-cover-badge,
.at-photo-new-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #07101f;
  background: #f5a623;
  font-size: 0.75rem;
  font-weight: 850;
}

.at-photo-new-badge {
  right: 9px;
  left: auto;
  color: #07101f;
  background: #65d6b3;
}

.at-photo-card-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.at-photo-position {
  color: #c9d4e2;
  font-size: 0.88rem;
  font-weight: 700;
}

.at-photo-card-controls {
  align-items: stretch;
}

.at-photo-icon-button {
  flex: 0 1 auto;
  font-size: 14px;
}

.at-photo-delete-confirm {
  padding: 12px;
  border-top: 1px solid rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.08);
}

.at-photo-delete-confirm p {
  margin: 0 0 10px;
  color: #f3f6fc;
  line-height: 1.4;
}

.at-photo-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  padding: 28px;
  text-align: center;
  border: 1px dashed #364b6d;
  border-radius: 12px;
  color: #9bacbf;
}

.at-photo-empty strong {
  color: #f3f6fc;
}

.at-photo-actions {
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #263956;
}

.at-photo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .at-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .at-photo-editor {
    padding: 17px;
  }

  .at-photo-grid {
    grid-template-columns: 1fr;
  }

  .at-photo-count {
    width: 100%;
    margin-left: 0;
  }

  .at-photo-card {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
    cursor: default;
  }

  .at-photo-media {
    min-height: 150px;
    aspect-ratio: auto;
  }

  .at-photo-delete-confirm {
    grid-column: 1 / -1;
  }

  .at-photo-actions > .at-photo-button {
    flex: 1 1 100%;
  }
}

@media (max-width: 390px) {
  .at-photo-card {
    grid-template-columns: 1fr;
  }

  .at-photo-media {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .at-photo-progress-bar {
    transition: none;
  }
}
