.content-wrap-gal::-webkit-scrollbar {
    width: 0.8em;
    /*height: 1.5em;*/
}

.content-wrap-gal::-webkit-scrollbar-track {
  background: hsl(45, 10%, 84%);
  border-radius: 100vw;
  margin-block: 0.5em;
}

.content-wrap-gal::-webkit-scrollbar-thumb {
  background: hsl(180, 62%, 40%);
  border: 0.25em solid hsl(120, 7%, 61%);
  border-radius: 100vw;
}

.content-wrap-gal::-webkit-scrollbar-thumb:hover {
  background: hsl(173, 62%, 17%);
}

.ny-scroll {
    flex: 1; 
    overflow: hidden; /* Vigtigt for at den interne scroll virker */
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}

.content-wrap-gal {
    max-width: 1050px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto; /* Aktiverer scroll kun herinde */
    padding-bottom: 20px; /* Plads til luft før bunden */
    padding-right: 10px;
}

/* Containeren */
.gallery-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 15px;
    justify-content: center;
}

/* Kortet (Erstatte article {} her) */
.card {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.465);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%; 
    margin: 0 auto;
}

/* Billedet */
.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

/* Linket */
.card .gallery-link {
    display: block;
    width: 100%;
}

/* Tekst-området */
.card-content {
    padding-top: 10px;
    flex-grow: 1;
}

.card-content p {
    margin: 0;
    font-size: 14px;
    color: #444;
    line-height: 1.4;
    
    /* Forkortelse af tekst */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Admin */

.admin-edit-box{
    margin-top:10px;
    padding-top:10px;
    border-top:1px dotted #ccc;
}

.gallery-admin-textarea{
    width:100%;
    height:60px;
    border-radius:4px;
    border:1px solid #ccc;
    padding:5px;
    font-family:inherit;
    font-size:0.9em;
    resize:vertical;
}

.gallery-btn-update{
    padding:5px 10px;
    font-size:0.8em;
    margin-top:5px;
    background:#28a745;
    border:none;
    cursor:pointer;
}

.gallery-btn-update:hover{
    background:#218838;
}

.gallery-delete-form{
    margin-top:8px;
}

.gallery-delete-button{
    background:none;
    border:none;
    color:#ff4d4d;
    font-size:0.8em;
    text-decoration:none;
    cursor:pointer;
    padding:0;
    font-family:inherit;
}

.gallery-delete-button:hover{
    text-decoration:underline;
}


/* Mobil-tilpasning */
@media (max-width: 500px) {
    .card {
        max-width: 220px; 
    }
    .card img {
        height: 150px;
    }
}