/* styles-images.css */
:root {
    --image-border-radius: 8px;
    --image-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ===== الأنماط الأساسية للصور ===== */
.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
	
}

.responsive-center {
    display: flex;
    justify-content: center;
    align-items: center;
    /* min-height: 100vh; */
    padding: 5px;
}

.responsive-center img {
    max-width: min(90%, 1200px);
    max-height: min(80vh, 800px);
    width: auto;
    height: auto;
}

.center-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.center-flex img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 10px;
}

.center-image {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 60%;       /* عرض نسبي يمكن تعديله حسب الحاجة */
  max-width: 500px; /* أقصى عرض للصورة */
  height: auto;     /* يحافظ على نسبة الأبعاد للصورة */
}


.rounded-image {
    border-radius: var(--image-border-radius);
}

.shadow-image {
    box-shadow: var(--image-shadow);
}
[data-theme="dark"] .center-image {
	    /* filter: grayscale(100%); */
    transition: var(--transition);
	opacity: 0.5;
}
/* ===== أحجام الصور القياسية ===== */

/* الصور المصغرة */
.thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.thumbnail-sm {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.thumbnail-lg {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

/* الصور المتوسطة */
.image-md {
    width: 300px;
    height: 200px;
    object-fit: cover;
}

.image-md-square {
    width: 250px;
    height: 250px;
    object-fit: cover;
}

/* الصور الكبيرة */
.image-lg {
    width: 500px;
    max-width: 100%;
    height: 300px;
    object-fit: cover;
}

.image-hero {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* الصور السائدة */
.image-fluid {
    width: 90%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
}

/* ===== إطارات الصور ===== */
.image-frame {
    border: 3px solid #f8f9fa;
    padding: 5px;
    background: white;
    box-shadow: var(--image-shadow);
}

.image-frame-primary {
    border-color: #1a2a6c;
}

.image-frame-accent {
    border-color: #25D366;
}

/* ===== تأثيرات الصور ===== */
.image-hover-zoom {
    transition: var(--transition);
    cursor: pointer;
	opacity: 0.5;
}

.image-hover-zoom:hover {
    transform: scale(1.3);
	opacity: 1.0;
}

.image-hover-shadow:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-grayscale {
    filter: grayscale(100%);
    transition: var(--transition);
}

.image-grayscale:hover {
    filter: grayscale(0%);
}

 /* Style the Image Used to Trigger the Modal */
#myImg {
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
}

#myImg:hover {opacity: 0.7;}

/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  padding-top: 100px; /* Location of the box */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

/* Modal Content (Image) */
.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
}

/* Caption of Modal Image (Image Text) - Same Width as the Image */
#caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 50px;
}

/* Add Animation - Zoom in the Modal */
.modal-content, #caption {
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)}
  to {transform:scale(1)}
}

/* The Close Button */
.close {
  position: absolute;
  top: 15px;
  right: 350px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
  .modal-content {
    width: 100%;
  }
} 

/* ===== معرض الصور ===== */
.gallery-grid {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.gallery-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--image-border-radius);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ===== الصور الدائرية ===== */
.image-circle {
    border-radius: 50%;
    object-fit: cover;
}

.circle-sm {
    width: 60px;
    height: 60px;
}

.circle-md {
    width: 100px;
    height: 100px;
}

.circle-lg {
    width: 150px;
    height: 150px;
}

.circle-xl {
    width: 200px;
    height: 200px;
}

/* ===== الصور الخلفية ===== */
.bg-image-cover {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-image-contain {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-overlay {
    position: relative;
}

.bg-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

/* ===== تحميل الصور ===== */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.image-placeholder {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-style: italic;
}

/* ===== استعلامات الوسائط للصور ===== */

/* الأجهزة اللوحية */
@media (max-width: 1024px) {
    .gallery-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .image-lg {
        width: 100%;
        height: 250px;
    }
    
    .image-hero {
        height: 300px;
    }
}

/* الأجهزة اللوحية الصغيرة */
@media (max-width: 768px) {
    .gallery-grid-3,
    .gallery-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .image-md {
        width: 100%;
        height: 180px;
    }
    
    .image-hero {
        height: 250px;
    }
}

/* الهواتف */
@media (max-width: 480px) {
    .gallery-grid-2,
    .gallery-grid-3,
    .gallery-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .image-md,
    .image-lg {
        width: 100%;
        height: 150px;
    }
    
    .image-hero {
        height: 200px;
    }
    
    .circle-xl {
        width: 150px;
        height: 150px;
    }
}

/* التوجه الأفقي للهواتف */
@media (max-height: 500px) and (orientation: landscape) {
    .image-hero {
        height: 200px;
    }
    
    .gallery-item img {
        height: 150px;
    }
}