.has-open-modal {
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}

.modal {
  backdrop-filter: blur(7px);
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 1000;
}

.modal__backdrop {
  background: rgba(15, 23, 42, 0.44);
  inset: 0;
  position: absolute;
}

.modal__panel {
  background: var(--color-surface);
  border: 1px solid #fecaca;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.2);
  max-height: min(640px, calc(100vh - 48px));
  overflow-y: auto;
  padding: 28px;
  position: relative;
  width: min(520px, 100%);
  z-index: 1;
}

.modal__header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal__header h2 {
  color: var(--color-text);
  font-size: 28px;
  line-height: 1.2;
}

.modal__close {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: var(--color-text-light);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: inherit;
  font-size: 24px;
  height: 40px;
  justify-content: center;
  line-height: 1;
  transition: var(--transition);
  width: 40px;
}

.modal__close:hover,
.modal__close:focus-visible {
  border-color: #fecaca;
  color: #b91c1c;
  outline: none;
}

.modal__text {
  color: var(--color-text-light);
  line-height: 1.5;
  margin: 0 0 22px;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===========================
    Image Modal
=========================== */

.modal--image {
  padding: 32px;
}

.modal--image .modal__backdrop {
  background: rgba(15, 23, 42, 0.82);
}

.modal__panel--image {
  display: flex;
  align-items: center;
  justify-content: center;

  width: auto;
  max-width: min(1200px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);

  padding: 0;

  overflow: visible;

  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.modal__image {
  display: block;

  max-width: 100%;
  max-height: calc(100vh - 64px);

  object-fit: contain;

  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.modal__close--image {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;

  color: #fff;

  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
}

.modal__close--image:hover,
.modal__close--image:focus-visible {
  color: #fff;

  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
}


/* Image trigger */

.company-hero__cover--clickable {
  display: block;

  width: 100%;
  padding: 0;

  border: 0;

  cursor: zoom-in;
}

.company-hero__cover--clickable .company-hero__cover-image {
  transition: transform 0.25s ease;
}

.company-hero__cover--clickable:hover .company-hero__cover-image {
  transform: scale(1.015);
}

.company-hero__logo--clickable {
  font: inherit;

  cursor: zoom-in;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.company-hero__logo--clickable:hover {
  transform: translateY(-2px);

  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.company-hero__logo--clickable:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .modal__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal__actions .button {
    width: 100%;
  }

  .modal__panel {
    border-radius: 18px;
    max-height: calc(100vh - 24px);
    padding: 22px;
  }

  .modal__header h2 {
    font-size: 24px;
  }

  .modal--image {
    padding: 16px;
  }

  .modal__panel--image {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);

    padding: 0;
  }

  .modal__image {
    max-height: calc(100vh - 32px);

    border-radius: 10px;
  }

  .modal__close--image {
    top: 8px;
    right: 8px;
  }
}
