.event-modal,
.event-modal * {
  box-sizing: border-box;
}

.event-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 180ms ease,
    visibility 0s linear 180ms;
}

.event-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.event-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 34, 26, 0.72);
  backdrop-filter: blur(5px);
}

.event-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1240px, 92vw);
  max-height: 90dvh;
  overflow: hidden;
  border: 1px solid rgba(211, 181, 132, 0.35);
  border-radius: 22px;
  outline: none;
  isolation: isolate;
  color: #49392e;
  background: #fbf8f3;
  box-shadow: 0 32px 100px rgba(28, 20, 14, 0.3);
}

.event-modal__header {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: max(340px, 36.9565%);
  max-width: 100%;
  min-height: 120px;
  padding: 28px 30px;
  overflow: hidden;
  border-bottom: 1px solid rgba(145, 108, 56, 0.15);
  border-top-right-radius: inherit;
  background: rgba(251, 248, 243, 0.98);
}

.event-modal__header h2 {
  max-width: calc(100% - 52px);
  margin: 10px 52px 0 0;
  color: #48362a;
  font-family: Georgia, "Noto Serif KR", serif;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.event-modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(128, 91, 47, 0.24);
  border-radius: 50%;
  color: #60472e;
  background: #fffdf9;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.event-modal__body {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.85fr);
  width: 100%;
  height: min(820px, 90dvh);
  min-height: 0;
  overflow: hidden;
}

.event-modal__poster-wrap {
  min-height: 0;
  overflow: auto;
  background: #eee4d7;
  overscroll-behavior: contain;
}

.event-modal__poster {
  display: block;
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: contain;
  object-position: center top;
  background: #fff;
}

.event-modal__info {
  min-width: 0;
  min-height: 0;
  padding: 148px 34px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.event-modal__summary {
  margin: 0;
  color: #65564b;
  font-size: 0.96rem;
  line-height: 1.78;
  white-space: pre-line;
}

.event-modal__details {
  display: grid;
  gap: 0;
  margin: 30px 0;
}

.event-modal__details div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid rgba(145, 108, 56, 0.16);
}

.event-modal__details div:last-child {
  border-bottom: 1px solid rgba(145, 108, 56, 0.16);
}

.event-modal__details dt {
  color: #9b7640;
  font-size: 0.79rem;
  font-weight: 700;
}

.event-modal__details dd {
  margin: 0;
  color: #64564b;
  font-size: 0.87rem;
  line-height: 1.65;
  white-space: pre-line;
}

.event-modal .event-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(162, 126, 68, 0.26);
  border-radius: 999px;
  color: #80602e;
  background: #f6ecdc;
  font-size: 0.7rem;
  font-weight: 700;
}

.event-modal .event-badge--always {
  color: #5d6d4d;
  background: #eef0e5;
}

.event-modal .event-badge--limited {
  color: #8b543f;
  background: #f6e6df;
}

.event-modal .event-badge--closed {
  color: #786f67;
  background: #ece8e4;
}

.event-modal .event-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 46px;
  padding: 11px 23px;
  border: 1px solid #826236;
  border-radius: 999px;
  color: #fff;
  background: #826236;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.event-modal__close:focus-visible,
.event-modal .event-button:focus-visible {
  outline: 2px solid #9b7236;
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .event-modal {
    padding: 0;
  }

  .event-modal__dialog {
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .event-modal__header {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: none;
    min-height: 96px;
    padding: 20px;
    border-top-right-radius: 0;
  }

  .event-modal__header h2 {
    max-width: calc(100% - 50px);
    margin: 7px 50px 0 0;
    font-size: 1.3rem;
  }

  .event-modal__close {
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
  }

  .event-modal__body {
    display: block;
    flex: 1 1 auto;
    height: 100%;
    overflow-y: auto;
  }

  .event-modal__poster-wrap {
    overflow: visible;
  }

  .event-modal__poster {
    min-height: 0;
  }

  .event-modal__info {
    overflow: visible;
    padding: 30px 22px calc(110px + env(safe-area-inset-bottom));
  }

  .event-modal__reservation {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-modal {
    transition: none;
  }
}
