/* ---------------- BASE MODAL ---------------- */

/* Hide the entire section by default */
#post-modal-section.hidden {
  display: none;
}

/* Modal hidden state */
#post-modal-section .modal.hidden {
  display: none;
}

/* Full-screen modal container */
#post-modal.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

/* Visible state */
#post-modal.modal:not(.hidden) {
  display: flex;
}

/* Dark translucent backdrop (glass effect) */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6); /* dark glass */
  backdrop-filter: blur(3px);     /* glass blur effect */
}

/* White modal card */
.modal-panel {
  position: relative;
  z-index: 1001;
  width: 92%;
  max-width: 900px; 
  max-height: 90vh;
  overflow-x: hidden;  /* kill horizontal scrolling */
  overflow-y: auto;    /* keep vertical scrolling */
  padding: 2rem;

  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* ---------------- MEDIA FILES ---------------- */
/* Wrap main Swiper like a card */


/* ---------------- INFO ---------------- */
.single-post-section .post__category__rating {
    margin: 1rem 0;
}

.single-post-section .category__button {
    background: var(--color-white);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--color-bg);
    transition: var(--transition);
}


/* ---------------- SCROLL BAR ---------------- */
.modal-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.3) transparent;
}
.modal-panel::-webkit-scrollbar {
  width: 6px;
}
.modal-panel::-webkit-scrollbar-track {
  background: transparent;
}
.modal-panel::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.3);
  border-radius: 6px;
}
.modal-panel::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,0,0,0.5);
}

/* ---------------- CLOSE BTN ---------------- */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);

  font-size: 20px;
  font-weight: bold;
  color: #333;

  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #000;
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.modal-close:active {
  transform: scale(0.95);
}

/* ---------------- ANIMATIONS ---------------- */

/* Opening animation (modal panel) */
.modal.open .modal-panel {
  animation: modal-fade-in 250ms ease-out forwards;
}

/* Closing animation (modal panel) */
.modal.closing .modal-panel {
  animation: modal-fade-out 220ms ease-in forwards;
}

@keyframes modal-fade-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes modal-fade-out {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(8px); opacity: 0; }
}

/* Backdrop fade */
.modal.open .modal-backdrop {
  animation: backdrop-fade-in 250ms ease-out forwards;
}
.modal.closing .modal-backdrop {
  animation: backdrop-fade-out 220ms ease-in forwards;
}
@keyframes backdrop-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes backdrop-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ---------------- MOBILE ---------------- */
@media (max-width: 600px) {
  #post-modal.modal {
    z-index: 1002; /* lower than post-display-map model popup */
  }
  .modal-backdrop {
    position: absolute;
    z-index: 10000;
  }
  .modal-panel {
    position: relative;
    z-index: 10020;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;         
    padding: 12px;            
    box-shadow: none;         
    transform: translateY(100%);
  }

  .modal.open .modal-panel {
    animation: modal-slide-up 260ms cubic-bezier(.2,.85,.3,1) forwards;
  }
  .modal.closing .modal-panel {
    animation: modal-slide-down 220ms cubic-bezier(.2,.85,.3,1) forwards;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    font-size: 24px;
  }

  @keyframes modal-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  @keyframes modal-slide-down {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
  }
}
