/* Event and calendar presentation. */

/*--------------------------------------------------------------
# Events
--------------------------------------------------------------*/

.cim-event-tz-wrapper {
  position: relative;
  overflow: visible;
  display: flex;
  row-gap: 0.5rem;
  flex-direction: column;

  &:not(.cim-event-tz-wrapper--with-icon) {
    align-items: flex-start;
  }
}

.wp-block-group.is-linked:has(.cim-event-tz-wrapper) > .wp-block-group__link {
  z-index: 1;
}

.wp-block-group.is-linked:has(.cim-event-tz-wrapper) .cim-event-tz-wrapper,
.wp-block-group.is-linked:has(.cim-event-tz-wrapper) .cim-event-timezone-toggle {
  position: relative;
  z-index: 3;
}

.cim-event-tz-wrapper--with-icon {
  flex-direction: row;
  column-gap: 0.5rem;
  flex-wrap: wrap;
  row-gap: 0.2rem;
}

.cim-event-timezone-toggle {
    background: none;
    border: none;
    color: var(--wp--preset--color--rich-black);
    font-size: var(--wp--preset--font-size--medium);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    text-align: left;
}

.cim-event-tz-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;

  &:hover,
  &:focus-visible {
    color: var(--wp--preset--color--dark-gray);
  }
}

.cim-event-tz-separator {
  font-size: 0.65rem;
  line-height: 2.2;
}

.cim-event-tz-modal-filter {
  display: block;
  position: relative;
  gap: 0;
  padding: 0 1rem;

  input {
    width: stretch;
    padding: 0.75rem 2.75rem 0.75rem 1rem;
    border: 1px solid var(--wp--preset--color--rich-black);
    border-radius: 0.25rem;
    font-weight: 400;
    font-size: var(--wp--preset--font-size--medium);
    font-family: inherit;
    outline: none;
  }
}

.cim-event-tz-modal-filter-submit {
  position: absolute;
  top: 50%;
  right: 1.75rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--wp--preset--color--rich-black);
  cursor: pointer;

  svg {
    display: block;
    pointer-events: none;
  }
}

.cim-event-tz-modal-empty {
  padding: 0 1rem;
  font-weight: 400;
  font-size: var(--wp--preset--font-size--medium);
}

.cim-event-tz-modal {
  box-sizing: border-box;
  border: 1px solid var(--wp--preset--color--mid-gray);
  background-color: #fff;
  position: absolute;
  z-index: 100;
  isolation: isolate;
  min-height: auto;
  width: 20rem;
  box-shadow: 0 0.938rem 2.188rem rgba(49,49,93,0.1),
  0 0.313rem 0.938rem rgba(0,0,0,0.08);
  border-radius: 0.4rem;
  max-width: 90vw;
}
@media (max-width: 600px) {

  .cim-event-tz-modal {
    left: var(--wp--style--root--padding-left) !important;
    right: var(--wp--style--root--padding-right) !important;
    width: auto;
    max-width: 100vw;
  }
}

.cim-event-tz-modal-list {
  margin: 1rem 0 0;
  padding: 0;
  min-height: 10rem;
  max-height: 18rem;
  overflow-y: auto;
  list-style: none;
}

.cim-event-tz-modal-list [role="option"] {
  position: relative;
  display: block;
  padding: 0.5rem 1rem;
  line-height: 1.4;
  cursor: pointer;
  outline-offset: -0.3rem !important;
}

.cim-event-tz-modal-list [role="option"].focused,
.cim-event-tz-modal-list [role="option"]:focus-visible,
.cim-event-tz-modal-list [role="option"]:hover {
  text-decoration: underline;
}

.current-timezone {
  font-weight: 700;
}

.offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dialog-label {
  font-size: var(--wp--preset--font-size--medium);
  font-weight: 700;
  letter-spacing: normal;
  padding: 0.5rem 1.25rem;
}

/*--------------------------------------------------------------
# Events, calendar
--------------------------------------------------------------*/

.wp-block-cimcorp-calendar-export {

  ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
}
