/* ===== MAGAZINE MODAL OVERLAY ===== */
.mag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.mag-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll */
body.mag-modal-open {
  overflow: hidden;
}

/* ===== MODAL ===== */
.mag-modal {
  width: 750px;
  max-width: 90%;
  max-height: 90vh;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0px 25px 50px -12px #00000040;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.mag-overlay.is-open .mag-modal {
  transform: translateY(0);
}

/* ===== LEFT: IMAGE ===== */
.mag-modal-img-wrapper {
  width: 45%;
  flex-shrink: 0;
  position: relative;
}

.mag-modal-img-placeholder {
  width: 100%;
  height: 100%;
  background-color: #b5c9b7;
  overflow: hidden;
}

.mag-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== RIGHT: PANEL ===== */
.mag-modal-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===== HEADER ===== */
.mag-modal-header {
  background-color: #f9f9f9;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
}

.mag-modal-title {
  font-size: 24px;
  line-height: 125%;
  font-weight: 700;
  color: #181c20;
  margin: 0;
  padding-right: 12px;
}

/* Close Button */
.mag-modal-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.mag-modal-close-btn:hover {
  background-color: #e8e8e8;
}

/* ===== SCROLLABLE BODY ===== */
.mag-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Custom scrollbar */
.mag-modal-body::-webkit-scrollbar {
  width: 4px;
}

.mag-modal-body::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.mag-modal-body::-webkit-scrollbar-thumb {
  background-color: #c5ddc9;
  border-radius: 4px;
}

/* ===== CONTENT HEADING ===== */
.mag-modal-content-heading {
  font-size: 24px;
  line-height: 125%;
  font-weight: 700;
  color: #181c20;
  margin: 0 0 32px 0;
  text-align: left;
}

/* ===== CONTENTS LIST ===== */
.mag-modal-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0 0 32px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.mag-modal-list li {
  font-family: "Inter", sans-serif;
  font-size: 18px;
  line-height: 150%;
  color: #3e4a3c;
}

/* ===== DOWNLOAD BUTTON ===== */
.mag-modal-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 18px 0;
  background: linear-gradient(135deg, #007016 0%, #00aa34 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 100%;
  border-radius: 12px;
  text-decoration: none;
  margin-top: auto;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.mag-modal-download-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #ffffff;
}

/* ===========================
   RESPONSIVE
   =========================== */

/* Hide image on small screens */
@media (max-width: 600px) {
  .mag-modal-img-wrapper {
    display: none;
  }

  .mag-modal {
    max-width: 95%;
    border-radius: 16px;
  }

  /* Center title on mobile */
  .mag-modal-header {
    justify-content: center;
    position: relative;
    padding: 20px 24px;
  }

  .mag-modal-close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .mag-modal-title {
    font-size: 18px;
    text-align: center;
    padding-right: 0;
  }

  .mag-modal-content-heading {
    font-size: 20px;
  }

  .mag-modal-list li {
    font-size: 15px;
  }
}

@media (max-width: 400px) {
  .mag-modal-body {
    padding: 16px;
  }

  .mag-modal-title {
    font-size: 16px;
  }

  .mag-modal-content-heading {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .mag-modal-list li {
    font-size: 14px;
  }
}
