
/* ==========================================================
   ENTITY MODAL
   Drupal 11 - Reusable native dialog
   Auto height / Scrollable content / Sticky layout
========================================================== */

.entity-modal {
  --em-ink: #172033;
  --em-text: #334155;
  --em-muted: #64748b;
  --em-border: #e2e8f0;
  --em-surface: #f8fafc;
  --em-primary: #0c7dab;
  --em-max-height: min(90dvh, 900px);

  position: fixed;
  inset: 0;

  box-sizing: border-box;

  width: min(1000px, calc(100% - 32px));
  max-width: none;

  /* Let content determine the height. */
  height: fit-content;
  max-height: var(--em-max-height);
  min-height: 0;

  margin: auto;
  padding: 0;

  overflow: hidden;

  border: 1px solid #dbe1e8;
  border-radius: 12px;

  background: #fff;
  color: var(--em-ink);

  box-shadow: 0 25px 80px rgb(15 23 42 / 25%);
}

.entity-modal:not([open]) {
  display: none;
}

.entity-modal::backdrop {
  background: rgb(15 23 42 / 65%);
  backdrop-filter: blur(2px);
}

/* ==========================================================
   LAYOUT
========================================================== */

.entity-modal__panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;

  width: 100%;

  /* Natural height for small content. */
  height: auto;
  max-height: calc(var(--em-max-height) - 2px);
  min-height: 0;

  overflow: hidden;
}

/* ==========================================================
   HEADER
========================================================== */

.entity-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  min-width: 0;

  padding: 20px 24px;

  border-bottom: 1px solid var(--em-border);
  background: var(--em-surface);
}

.entity-modal__title {
  margin: 0;
  min-width: 0;

  color: var(--em-ink);
  font-size: clamp(17px, 2.5vw, 22px);
  font-weight: 700;
  line-height: 1.45;

  overflow-wrap: anywhere;
}

.entity-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 38px;

  width: 38px;
  height: 38px;

  padding: 8px;
  border: 0;
  border-radius: 8px;

  background: transparent;
  color: var(--em-ink);

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.entity-modal__close svg {
  width: 22px;
  height: 22px;
}

.entity-modal__close:hover {
  background: #e2e8f0;
}

.entity-modal__close:focus-visible {
  outline: 2px solid var(--em-primary);
  outline-offset: 2px;
}

/* ==========================================================
   SCROLLABLE BODY
========================================================== */

.entity-modal__body {
  min-width: 0;
  min-height: 0;

  padding: 24px;

  overflow-x: hidden;
  overflow-y: auto;

  overscroll-behavior: contain;

  color: var(--em-text);
  font-size: 14px;
  line-height: 1.8;

  scrollbar-width: thin;
  scrollbar-color: #9ca3af transparent;
}

.entity-modal__body::-webkit-scrollbar {
  width: 7px;
}

.entity-modal__body::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #a8b0bc;
}

.entity-modal__body::-webkit-scrollbar-track {
  background: transparent;
}

/* ==========================================================
   FOOTER
========================================================== */

.entity-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;

  gap: 12px;

  padding: 16px 24px;

  border-top: 1px solid var(--em-border);
  background: var(--em-surface);
}

/* ==========================================================
   EXTERNAL LINK
========================================================== */

.entity-modal__external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 40px;

  padding: 9px 15px;
  box-sizing: border-box;

  border: 1px solid #cbd5e1;
  border-radius: 7px;

  background: #fff;
  color: var(--em-text);

  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;

  cursor: pointer;
  white-space: nowrap;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.entity-modal__external-link[hidden] {
  display: none !important;
}

.entity-modal__external-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.entity-modal__external-link:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #0f172a;
  text-decoration: none;
}

.entity-modal__external-link:focus-visible {
  outline: 2px solid var(--em-primary);
  outline-offset: 3px;
}

/* ==========================================================
   CLOSE BUTTON
========================================================== */

.entity-modal__dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;

  padding: 9px 17px;

  border: 1px solid #172033;
  border-radius: 7px;

  background: #172033;
  color: #fff;

  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.entity-modal__dismiss:hover {
  border-color: #334155;
  background: #334155;
}

.entity-modal__dismiss:focus-visible {
  outline: 2px solid var(--em-primary);
  outline-offset: 3px;
}

/* ==========================================================
   LOADING / ERROR
========================================================== */

.entity-modal__status,
.entity-modal__error {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 140px;
  margin: 0;

  font-size: 14px;
  text-align: center;
}

.entity-modal__status {
  color: var(--em-muted);
}

.entity-modal__error {
  color: #be123c;
}

/* ==========================================================
   ENTITY CONTENT
========================================================== */

.entity-modal__body .pn-modal__description {
  font-size: 14px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.entity-modal__body .pn-modal__description p {
  margin-bottom: 16px;
}

.entity-modal__body .pn-modal__description a {
  color: var(--em-primary);
  text-decoration: underline;
}

.entity-modal__body .pn-modal__description img {
  max-width: 100%;
  height: auto;
}

.entity-modal__body .pn-modal__description table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 640px) {
  .entity-modal {
    --em-max-height: 94dvh;

    width: calc(100% - 16px);
    border-radius: 10px;
  }

  .entity-modal__header {
    gap: 12px;
    padding: 16px;
  }

  .entity-modal__title {
    font-size: 17px;
  }

  .entity-modal__body {
    padding: 18px 16px;
    font-size: 13px;
  }

  .entity-modal__footer {
    gap: 8px;
    padding: 12px 16px;
  }

  .entity-modal__external-link,
  .entity-modal__dismiss {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 12px;
  }
}

/* ==========================================================
   ACCESSIBILITY
========================================================== */

@media (prefers-reduced-motion: reduce) {
  .entity-modal__close,
  .entity-modal__external-link,
  .entity-modal__dismiss {
    transition: none;
  }
}


/* ==========================================================
   ENTITY MODAL — EVENT CATEGORY HEADER
========================================================== */

/* Header title + optional category */

.entity-modal__heading {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-width: 0;
}

/* Event category badge */
.entity-modal__category:not([hidden]) {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid #bae6fd;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Hide category when not provided */

.entity-modal__category[hidden] {
  display: none !important;
}

/* Mobile */

@media (max-width: 640px) {

  .entity-modal__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .entity-modal__category:not([hidden]) {
    padding: 4px 10px;
    font-size: 11px;
  }

}

/* FILOTHEI_UNIFIED_EVENT_MODAL_V2 */
/* Only event dialogs use the narrow poster-first layout. */
.entity-modal.entity-modal--event {
  --event-accent: #3b4cc0;
  --event-accent-rgb: 59, 76, 192;
  --em-primary: var(--event-accent);
  width: min(520px, calc(100vw - 24px));
  max-height: 92dvh;
  border-radius: 16px;
}
.entity-modal--event[data-section="culture"] { --event-accent: #3b4cc0; --event-accent-rgb: 59, 76, 192; }
.entity-modal--event[data-section="sports"] { --event-accent: #c8553d; --event-accent-rgb: 200, 85, 61; }
.entity-modal--event[data-section="education"] { --event-accent: #f4b400; --event-accent-rgb: 244, 180, 0; }
.entity-modal--event[data-section="green"] { --event-accent: #2e9e6b; --event-accent-rgb: 46, 158, 107; }
.entity-modal--event[data-section="cleaning"] { --event-accent: #6cb8e6; --event-accent-rgb: 108, 184, 230; }
.entity-modal--event[data-section="solidarity"] { --event-accent: #ee7b30; --event-accent-rgb: 238, 123, 48; }
.entity-modal--event[data-section="kep"] { --event-accent: #1f2a4a; --event-accent-rgb: 31, 42, 74; }
.entity-modal--event[data-section="ombudsman"] { --event-accent: #178a94; --event-accent-rgb: 23, 138, 148; }
.entity-modal--event .entity-modal__panel {
  width: 100%;
  max-height: calc(92dvh - 2px);
}
.entity-modal--event .entity-modal__header {
  align-items: flex-start;
  padding: 17px 18px 12px;
  background: #fff;
}
.entity-modal--event .entity-modal__heading {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}
.entity-modal--event .entity-modal__title { font-size: 19px; line-height: 1.35; }
.entity-modal--event .entity-modal__category:not([hidden]),
.entity-modal--event .event-modal__type {
  color: var(--event-accent);
  background: rgba(var(--event-accent-rgb), .12);
  border: 1px solid rgba(var(--event-accent-rgb), .2);
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 12px;
  width: fit-content;
}
.entity-modal--event .entity-modal__body {
  padding: 0 18px 16px;
  overflow-y: auto;
  line-height: 1.55;
}
.entity-modal--event .event-modal {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;

}
.entity-modal--event .event-modal__image,
.entity-modal--event .event-modal__image > div { width: 100%; max-width: 100%; }
.entity-modal--event .event-modal__image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  border-radius: 10px;
}
.entity-modal--event .event-modal__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 0;
}
.entity-modal--event .event-modal__details,
.entity-modal--event .event-modal__description { margin: 0; }
.entity-modal--event .event-modal__detail {
  padding: 12px;
  border-radius: 10px;
  background: rgba(var(--event-accent-rgb), .09);
}
.entity-modal--event .event-modal__detail-icon,
.entity-modal--event .event-modal__address svg { color: var(--event-accent); }
.entity-modal--event .event-modal__address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 0;
}
.entity-modal--event .event-modal__address svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.entity-modal--event .entity-modal__footer {
  gap: 8px;
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid var(--em-border);
}
.entity-modal--event .entity-modal__footer .event-modal__actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}
.entity-modal--event .entity-modal__footer .event-location__button,
.entity-modal--event .entity-modal__footer .event-modal__calendar {
  color: var(--event-accent);
  border-color: rgba(var(--event-accent-rgb), .35);
}
.entity-modal--event .entity-modal__dismiss {
  margin-left: auto;
  color: #fff;
  border-color: var(--event-accent);
  background: var(--event-accent);
}
.entity-modal--event .entity-modal__dismiss:hover {
  border-color: var(--event-accent);
  background: var(--event-accent);
  filter: brightness(.9);
}
@media (max-width: 640px) {
  .entity-modal.entity-modal--event { width: calc(100vw - 16px); max-height: 94dvh; }
  .entity-modal--event .entity-modal__panel { max-height: calc(94dvh - 2px); }
  .entity-modal--event .entity-modal__header { padding: 15px 14px 10px; }
  .entity-modal--event .entity-modal__body { padding: 0 14px 12px; }
  .entity-modal--event .entity-modal__footer { padding: 10px 14px; }
}

/* FILOTHEI_MODAL_V3: compact title header, poster breathing room, inline tags, full-width date. */
.entity-modal--event .entity-modal__header {
  padding: 12px 18px 10px;
  gap: 10px;
  border-bottom: 0;
}
.entity-modal--event .entity-modal__heading { gap: 0; }
.entity-modal--event .entity-modal__title {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
}
.entity-modal--event .entity-modal__close {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  padding: 5px;
}
.entity-modal--event .entity-modal__body {
  padding-top: 9px; /* air between header and event poster */
}
.entity-modal--event .event-modal__content {
  width: 100%;
  align-items: stretch;
  gap: 10px;
}
.entity-modal--event .event-modal__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.entity-modal--event .event-modal__tags .entity-modal__category,
.entity-modal--event .event-modal__tags .event-modal__type {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  margin: 0;
  line-height: 1.4;
}
.entity-modal--event .event-modal__tags .entity-modal__category[hidden] { display: none !important; }
.entity-modal--event .event-modal__details,
.entity-modal--event .event-modal__details .event-modal__detail {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}
.entity-modal--event .event-modal__detail {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.entity-modal--event .event-modal__detail-info { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) {
  .entity-modal--event .entity-modal__header { padding: 11px 14px 8px; }
  .entity-modal--event .entity-modal__title { font-size: 16px; }
  .entity-modal--event .entity-modal__body { padding-top: 8px; }
}

/* Remove spacing below event image */
.entity-modal .event-modal__image {
padding: 8px;
  margin-bottom: 0 !important;
}

/* Event details occupy full available width */
.entity-modal .event-modal__details {
  display: block;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  box-sizing: border-box;
}

.entity-modal .event-modal__detail {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
/* ==========================================================
   UNIFIED EVENT MODAL FOOTER
========================================================== */

.entity-modal.entity-modal--event .entity-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
  border-top: 1px solid var(--em-border);
}

.entity-modal.entity-modal--event .entity-modal__footer .event-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.entity-modal.entity-modal--event .entity-modal__footer .event-location {
  display: flex;
  align-items: center;
  margin: 0;
}

.entity-modal.entity-modal--event .entity-modal__footer .event-location__button,
.entity-modal.entity-modal--event .entity-modal__footer .entity-modal__external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid var(--modal-accent, #3B4CC0);
  border-radius: 8px;
  background: #fff;
  color: var(--modal-accent, #3B4CC0);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.entity-modal.entity-modal--event .entity-modal__footer .event-location__button:hover,
.entity-modal.entity-modal--event .entity-modal__footer .entity-modal__external-link:hover {
  background: color-mix(in srgb, var(--modal-accent, #3B4CC0) 8%, white);
  text-decoration: none;
}

.entity-modal.entity-modal--event .entity-modal__footer .event-location__icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.entity-modal.entity-modal--event .entity-modal__footer .entity-modal__dismiss {
  min-height: 40px;
  margin: 0;
  padding: 9px 17px;
  border: 1px solid var(--modal-accent, #3B4CC0);
  border-radius: 8px;
  background: var(--modal-accent, #3B4CC0);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.entity-modal.entity-modal--event .entity-modal__footer .entity-modal__dismiss:hover {
  background: color-mix(in srgb, var(--modal-accent, #3B4CC0) 85%, black);
}

.entity-modal.entity-modal--event .entity-modal__footer [hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .entity-modal.entity-modal--event .entity-modal__footer {
    padding: 12px 14px;
    gap: 8px;
  }

  .entity-modal.entity-modal--event .entity-modal__footer .event-modal__actions {
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
  }

  .entity-modal.entity-modal--event .entity-modal__footer .event-modal__calendar {
    white-space: normal;
  }
}




