:root {
    --c1: #243253;
}

.gallery {
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
    padding: 100px 0 0 0;
    overflow: hidden;
    background-color: var(--c1);
}

.gallery:before,
.gallery:after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid transparent;
    border-width: 0 0 3px 3px;
    transform: rotate(45deg);
    left: 15px;
    top: 11px;
    border-radius: 2px;
    opacity: 0.5;
    animation: hide-s 2s ease 6s 1;
    animation-fill-mode: forwards;
}

.gallery:after {
    left: inherit;
    right: 15px;
    transform: rotate(-135deg);
}

.resizer {
    position: absolute;
    top: 0;
    width: calc(100% - 45px);
    height: 36px;
    overflow: hidden;
    text-align: center;
    color: #fff;
    line-height: 38px;
    font-weight: 500;
    letter-spacing: 1px;
    animation: letter-s 2s ease 0s 3 alternate, hide-s 2s ease 6s 1;
    animation-fill-mode: backwards, forwards;
    opacity: 0.5;
}

.resizer:before,
.resizer:after {
    content: "";
    position: absolute;
    width: calc(50% - 125px);
    border-bottom: 4px dotted #fff;
    margin-left: 20px;
    top: 18px;
    left: 0;
    animation: lines-s 2s ease 0s 3 alternate;
}

.resizer:after {
    right: 15px;
    left: inherit;
    margin-right: 7px;
}

@keyframes letter-s {
    0% {
        letter-spacing: 8px;
    }

    100% {
        letter-spacing: 1px;
    }
}

@keyframes lines-s {
    0% {
        width: calc(50% - 175px);
    }

    100% {
        width: calc(50% - 125px);
    }
}

@keyframes hide-s {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 0.2;
    }
}

.items {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0; /* إزالة المسافات بين العناصر */
}

.item {
    width: calc(236px - 20px);
    height: auto; /* تغيير الارتفاع إلى auto */
    min-height: 16vh; /* تعيين ارتفاع أدنى */
    margin: 10px;
    overflow: hidden;
    position: relative;
    border: none; /* إزالة الحدود إذا كانت غير ضرورية */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    padding: 0; /* إزالة المساحات الداخلية إذا كانت غير ضرورية */
    background: white;
}

.item img {
    width: 100%; /* تعيين العرض إلى 100% */
    height: 100%; /* تعيين الارتفاع إلى 100% */
    object-fit: cover; /* تغطية المساحة دون تشويه الصورة */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pagination {
    text-align: center;
}

.pagination ul {
    padding: 0;
    margin: 10px 0 0;
}

.pagination ul li {
    display: inline;
    display: inline-flex;
    margin: 5px;
    color: var(--c1);
}

.pagination li a {
    padding: 5px;
    background: #fff;
    border: 1px solid #4d6aad;
    color: var(--c1);
    text-decoration: none;
    border-radius: 3px;
}

.pagination li.page_link a:hover {
    background: var(--c1);
    color: #fff;
    transition: 200ms all;
    border: 1px solid #fff
}

.pagination li.active_page a {
    background: var(--c1);
    color: #fff;
    border: 1px solid #fff
}

.pagination li>span {
    font-weight: bold;
    font-size: 15px;
    top: -4px;
    position: relative;
    color: #fff;
}

.pagination li a span {
    min-width: 20px;
    display: inline-block;
}

.pagination li.page_link.active_page.active a {
    cursor: default;
}

li.previous_link a,
li.next_link a,
li.first_link a,
li.last_link a {
    background: #fff0;
    color: #fff0;
    display: block;
    padding: 10px 12px;
}

li.previous_link a:before,
li.next_link a:before,
li.first_link a:before,
li.last_link a:before {
    content: "";
    border: 2px solid #fff;
    width: 12px;
    height: 12px;
    display: block;
    position: absolute;
    border-width: 3px 0 0 3px;
    transform: rotate(-45deg);
    margin-top: 3px;
    margin-left: 3px;
    border-radius: 2px;
}

li.next_link a:before,
li.last_link a:before {
    transform: rotate(135deg);
    margin-left: -3px;
}

li.first_link a:before,
li.last_link a:before {
    filter: drop-shadow(5px 5px 0 #fff);
    margin-left: 0px;
}

li.previous_link a:hover,
li.next_link a:hover,
li.first_link a:hover,
li.last_link a:hover {
    opacity: 0.8;
    transition: 200ms all;
}

li.no_more.disabled {
    opacity: 0.5;
    pointer-events: none;
}

li.page_link.first.active_page.active a {
    cursor: default;
}

@media screen and (orientation: landscape) and (max-width: 400px) {
    .pagination ul {
        margin-top: 20px;
    }

    .resizer {
        top: 5px;
    }

    .gallery:before,
    .gallery:after {
        top: 16px;
    }
}

li.previous_link a:before,
li.next_link a:before,
li.first_link a:before,
li.last_link a:before {
    border-color: #ffffff;
}

li.first_link a:before,
li.last_link a:before {
    filter: drop-shadow(5px 5px 0px #ffffff);
}

.first_link a,
.last_link a,
.next_link a,
.previous_link a {
    border: none !important;
}

@supports (-ms-ime-align: auto) {
    /* خصائص خاصة بمتصفح Edge */
    .item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}