.circulars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  direction: rtl;
}

.circular-card {
  background: #fff;
  border: 1px solid #15562a;
  border-radius: 12px;
  overflow: hidden;
  transition: 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.circular-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transform: translateY(-5px);
  border-color: #61ce70;
}

.circular-img {
  height: 240px;
  overflow: hidden;
}
.circular-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.4s ease;
}
.circular-card:hover .circular-img img {
  transform: scale(1.05);
}

.circular-body {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.circular-body h3 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #15562a;
  line-height: 1.5;
}
.circular-date {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.circular-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.circular-actions button {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.circular-actions button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}
.circular-actions button:hover::after {
  width: 80%;
}

.circular-actions button[data-type="details"] {
  background: #15562a;
  color: #fff;
  border: none;
}
.circular-actions button[data-type="details"]:hover {
  background: #0e3c1d;
}
.circular-actions button[data-type="image"] {
  background: #61ce70;
  border: 1px solid #15562a;
  color: #fff;
}
.circular-actions button[data-type="image"]:hover {
  background: #4bbd5f;
}

#circular-popup {
  position: fixed;
  inset: 0;
  background: rgba(21, 86, 42, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}
#circular-popup.active {
  display: flex;
}

.popup-content {
  background: #fff;
  border-radius: 12px;
  max-width: 90%;
  width: auto;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 25px;
  animation: fadeInUp 0.3s ease;
}
.popup-content img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

#close-popup {
  position: absolute;
  top: 5px;
  left: 2px;
  cursor: pointer;
  font-size: 15px;
  color: #fff;
  background: #61ce70;
  border-radius: 50%;
  padding: 0px 10px;
  z-index: 10000;
  transition: 0.3s;
}
#close-popup:hover {
  background: #4bbd5f;
}

@keyframes fadeInUp {
  from {opacity:0; transform: translateY(20px);}
  to {opacity:1; transform: translateY(0);}
}

@media (max-width: 992px) {
  .circulars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .circulars-grid {
    grid-template-columns: 1fr;
  }
  .circular-img {
    height: 200px;
  }
  .popup-content {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 15px;
  }
  .popup-content img {
    max-height: 100%;
  }
}