/**
 * E11_U05_1 – Eine leere Postkarte.
 * Samo flex + div (za Chrome in Firefox).
 */

/* Nastavljivi odmiki v rem za fino poravnavo elementov */
:root {
  --postcard-namige-left-offset-x: 7rem;
  --postcard-namige-left-offset-y: 6rem;
  --postcard-namige-right-offset-x: -3rem;
  --postcard-namige-right-offset-y: 17rem;
  --sort-left-offset-x: 3rem;
  --sort-left-offset-y: 5rem;
  --sort-right-offset-x: 5rem;
  --sort-right-offset-y: 15.3rem;
  --sort-list-gap: 1rem;
}

.exercise-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 75rem;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
}

/* Tri stolpci: levo namige | postcard-body | desno namige */
.postcard {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.postcard-namige-left,
.postcard-namige-right {
  flex: 0 0 10rem;
  width: 8rem;
  min-width: 8rem;
  max-width: 8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
  box-sizing: border-box;
}

.postcard-namige-left {
  transform: translate(var(--postcard-namige-left-offset-x), var(--postcard-namige-left-offset-y));
}

.postcard-namige-right {
  transform: translate(var(--postcard-namige-right-offset-x), var(--postcard-namige-right-offset-y));
}

.postcard-namige-left .postcard-label,
.postcard-namige-right .postcard-label {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.postcard-label {
  font-size: 0.8rem;
  color: #555;
  flex-shrink: 0;
  line-height: 1.2;
  word-break: break-word;
}

/* Srednji stolpec: razširjen, preostanek širine */
.postcard-body {
  flex: 1 1 auto;
  min-width: 60rem;
  width: 100%;
  min-height: 34rem;
  display: flex;
  flex-direction: row;
  gap: 2rem;
  padding: 1rem 1.5rem 1.5rem;
  border-radius: 0.5rem;
  background-image: url(background.png);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-sizing: border-box;
}

.postcard-left {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 22rem;
  display: flex;
  flex-direction: column;
}

/* Levi sort-list: širina = najdaljši stavek */
.postcard-left .sort-list {
  width: max-content;
  max-width: 100%;
  min-height: 22rem;
  flex: 0 1 auto;
}

#sort-left {
  transform: translate(var(--sort-left-offset-x), var(--sort-left-offset-y));
}

.postcard-right {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 28rem;
  display: flex;
  flex-direction: column;
}

/* Desni sort-list: širina = najdaljši vnos (naslov) */
.postcard-right .sort-list {
  width: max-content;
  max-width: 100%;
  min-height: 12rem;
  flex: 0 1 auto;
}

#sort-right {
  transform: translate(var(--sort-right-offset-x), var(--sort-right-offset-y));
}

.sort-list {
  display: flex;
  flex-direction: column;
  gap: var(--sort-list-gap);
  width: 100%;
  min-height: 26rem;
  flex: 1 1 auto;
}

/* Vlečljivi elementi – samo div, flex */
.sort-list .drag_element {
  width: 100%;
  min-height: 2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
  cursor: grab;
  font-size: 1rem;
  user-select: none;
  box-sizing: border-box;
  border: 0.15rem solid #00699F;
  border-radius: 0.9rem;
  background-color: #fff;
  transition: box-shadow 0.2s ease;
}

/* V levem stolpcu: elementi po širini vsebine, da sort-list = širina najdaljšega */
.postcard-left .sort-list .drag_element {
  width: max-content;
  max-width: 100%;
}

/* V desnem stolpcu: širina po vsebini (naslovi) */
.postcard-right .sort-list .drag_element {
  width: max-content;
  max-width: 100%;
}

.sort-list .drag_element:hover {
  box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.08);
}

.sort-list .drag_element.dragging {
  opacity: 0.6;
  cursor: grabbing;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

.sort-list .drag_element.correct {
  border-color: #258174;
  background-color: rgba(37, 129, 116, 0.08);
}

.sort-list .drag_element.incorrect {
  border-color: #e00;
  background-color: rgba(255, 0, 0, 0.06);
}

@media (hover: none) {
  .sort-list .drag_element {
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
  }
}
