/* Scope everything so it only affects this calendar */
.ncm-ec { max-width: 100%; }

/* ========= Calendar UI tweaks (your fc stuff) ========= */
.ncm-ec a.fc-daygrid-day-number:hover { color: #0c9fb9; }
.ncm-ec .fc-col-header-cell-cushion { color: #fff; }
.ncm-ec .fc-button-group { margin: 4px; }
.ncm-ec .fc-toolbar-title { font-size: 1.2rem !important; }

@media (max-width:1024px) {
  .ncm-ec .fc-button-group { justify-content: center; gap: 4px; }
}
@media (max-width:767px) {
  .ncm-ec .fc-header-toolbar { margin: 0 !important; }
}

/* ===========================
   Popup — Clean Layout (RENAMED)
   =========================== */
.ncm-ec-popup {
  --bg: #fff;
  --ink: #111;
  --muted: #666;
  --stroke: #e6e6e6;
  --accent: #111;
  --radius: 14px;
}

/* Force hide when JS sets overlay.hidden = true */
.ncm-ec-popup-overlay[hidden] {
  display: none !important;
}

/* Overlay */
.ncm-ec-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: grid;
  place-items: center;
  z-index: 99999;
  padding: 18px;
}

/* Shell */
.ncm-ec-popup { background: transparent; margin:0; padding:0; width: 800px; box-shadow:none; }
.ncm-ec-popup-body-wrap { padding: 18px; width: 100%; }
.ncm-ec-popup-body {
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  gap: 0;
}
.ncm-ec-popup-image { padding: 0; margin-left: 45px; display:flex; align-items:center; }
.ncm-ec-popup-image img { max-width: 220px; height: auto; display:block; }

/* Close button */
.ncm-ec-popup-close {
  position: absolute;
  cursor: pointer;
  top: 12px;
  right: 18px;
  font-size: 28px;
  line-height: 1;
  background: transparent;
  border: 0;
  color: #000;
  z-index: 1000;
}
.ncm-ec-popup-close:hover { transform: translateY(-2px); }

/* Content Stack */
.ncm-ec-popup-content {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto 1fr auto;
  gap: 0;
  height: 100%;
  padding: 40px;
  margin-right: 20px;
  border-radius: var(--radius);
  max-height: min(85vh, 1600px);
  flex: 1;
  max-width: 800px;
}

/* Meta list */
.ncm-ec-meta {
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 10px;
  margin: 0 0 14px 0;
  padding: 0;
  list-style: none;
}

.ncm-ec-meta > li {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fafafa;
}

.ncm-ec-meta-loc { grid-column: 1 / -1; }

.ncm-ec-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.ncm-ec-icon svg { width: 14px; height: 14px; fill: var(--accent); opacity: .9; }

.ncm-ec-meta-title {
  display: block;
  font-size: .72rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.ncm-ec-meta-value {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
}

/* Title */
.ncm-ec-title {
  grid-row: 2;
  border-top: 1px solid var(--stroke);
  padding-top: 16px;
  margin: 6px 0 8px;
  font-size: 1.8rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Description */
.ncm-ec-desc {
  grid-row: 3;
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.7;
  color: #1a1a1a;
  overflow: auto;
  max-height: calc(78vh - 220px);
}
.ncm-ec-desc img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin-top: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
}

/* Responsive */
@media (max-width:1024px) {
  .ncm-ec-popup { width: 85vw; }
}
@media (max-width:767px) {
  .ncm-ec-popup { width: 90vw; }
  .ncm-ec-popup-body { flex-direction: column; }
  .ncm-ec-popup-content { padding: 10px 15px 25px; margin-right: 0; }
  .ncm-ec-popup-image { margin-left: 0; justify-content: center; }
  .ncm-ec-popup-image img { max-width: 150px; padding: 25px 0 0; }
  .ncm-ec-title { font-size: 1.55rem; padding-top: 14px; }
  .ncm-ec-desc { font-size: 1rem; line-height: 1.6; max-height: calc(82vh - 210px); }
}
