#fotoarticle {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;

    /*  max-width: 90%;
  max-width: 1280px; */
    padding: 1rem;
    background-color: #ffffff;
    background-color: #2ecc71;
    /*  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center; */
}

.fotoarticle {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px;
}

.container-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.container-horizontal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.grid-section h2 {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #555;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 75px);
    grid-template-rows: repeat(3, 75px);
    gap: 10px;
    padding: 10px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.top-grid {
    grid-template-rows: 100px;
    /* Single row initially */
    /* To allow dynamic many items, we could use flex or auto-fill, but keeping grid structure for swapping consistency logic */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    min-width: 300px;
}

.grid-cell {
    width: 75px;
    height: 75px;
    background-color: #eee;
    border: 1px dashed #aaa;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    z-index: 3;
}

.draggable-item {
    width: 70px; 
    height: 70px;
    cursor: grab;
    z-index: 10;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draggable-item:active {
    cursor: grabbing;
}

.draggable-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.draggable-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    pointer-events: none;
}

/* Blank item styling */
.draggable-item.blank-item {
    cursor: not-allowed;
    opacity: 0.6;
    filter: grayscale(100%);
}

/* Touch feedback class */
.draggable-item.touch-dragging {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Grid Specifics */
#grid-a {
    border-color: #3498db;
}

#grid-b {
    border-color: #e74c3c;
}

#grid-c {
    border-color: #2ecc71;
}

#grid-top {
    border-color: #9b59b6;
    min-height: 120px;
}

@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(5, 80px);
    }

    .top-grid {
        grid-template-columns: repeat(3, 80px);
        /* Fallback if we used grid */
    }

    .grid-cell {
        width: 80px;
        height: 80px;
    }

    .draggable-item {
        width: 75px;
        height: 75px;
    }
}

/*************** Media Queries ******************/
/* Smartphone im Hochformat */
@media only screen and (max-width: 500px) {
    .grid-container {
        grid-template-columns: repeat(5, 50px);
        grid-template-rows: repeat(3, 50px);
        gap: 5px;
        padding: 5px;
        background-color: #fff;
        border: 2px solid #ccc;
        border-radius: 5px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    .grid-cell {
        width: 50px;
        height: 50px;
    }
    .draggable-item {
        width: 45px; 
        height: 45px;
    }
}