
@media (min-width: 800px) {
  .image-alt-text-dialog.bottom-sheet {
    max-width: 600px;
    max-height: none;
  }
}

.image-alt-text-dialog {
  display: flex;
  flex-direction: column;
}

.image-alt-text-dialog-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

@media (min-width: 800px) {
  .image-alt-text-dialog-content {
    max-height: 80vh;
  }
}

.image-alt-text-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-alt-text-dialog-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.image-alt-text-dialog-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  padding: 0 8px;
  opacity: 0.6;
}

@media (min-width: 800px) {
  .image-alt-text-dialog-close {
    display: inline-flex;
    align-items: center;
  }
}

@media (hover: hover) {
  .image-alt-text-dialog-close:hover {
    opacity: 1;
  }
}

.image-alt-text-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.image-alt-text-dialog-image-container {
  width: 100%;
  max-height: 300px;
  border-radius: var(--image-preview-border-radius);
  overflow: hidden;
  border: var(--hair) solid var(--post-border-color);
  background-color: light-dark(var(--light-gray), var(--dark-gray));
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-alt-text-dialog-image-container img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.image-alt-text-dialog-input-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-alt-text-dialog-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: var(--hair) solid var(--post-border-color);
  border-radius: var(--text-input-border-radius);
  background-color: light-dark(var(--white), var(--mid-gray));
  color: var(--text-color);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.image-alt-text-dialog-textarea:focus {
  border-color: var(--highlight-color);
}

.image-alt-text-dialog-footer .word-count-text {
  min-width: 32px;
  text-align: right;
}

.image-alt-text-dialog-footer-buttons {
  display: flex;
  gap: 8px;
}

.image-alt-text-dialog-footer-buttons .rounded-button {
  padding: 12px 20px;
}

.image-alt-text-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.toast {
  position: fixed;
  display: flex;
  align-items: center;
  opacity: 0;
  touch-action: none;
  top: calc(
    env(safe-area-inset-top, 0px) + 8px + var(--toast-stack-offset, 0px)
  );
  left: 8px;
  right: 8px;
  width: auto;
  margin: 0;
  background: light-dark(var(--white), var(--mid-gray));
  border: var(--hair) solid var(--post-border-color);
  color: var(--text-color-muted);
  padding: 12px 16px;
  border-radius: var(--toast-border-radius);
  box-shadow:
    0 1px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transform: translateY(-150%);
  transition:
    top 0.3s linear,
    transform 0.3s linear,
    opacity 0.3s linear;
  z-index: var(--toast-z-index);
}

.toast.active {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: light-dark(
    color-mix(in srgb, var(--highlight-color) 8%, var(--white)),
    color-mix(in srgb, var(--highlight-color) 8%, var(--mid-gray))
  );
  border-color: var(--highlight-color);
  color: var(--highlight-color);
}

.toast.error {
  background: light-dark(
    color-mix(in srgb, var(--error-color) 12%, var(--white)),
    color-mix(in srgb, var(--error-color) 12%, var(--mid-gray))
  );
  border-color: var(--error-color);
  color: var(--error-color);
}

.toast.warning {
  background: light-dark(
    color-mix(in srgb, var(--warning-color) 12%, var(--white)),
    color-mix(in srgb, var(--warning-color) 12%, var(--mid-gray))
  );
  border-color: var(--warning-color);
  color: var(--warning-color);
}

.toast.warning .toast-icon {
  color: var(--warning-color);
}

@media (min-width: 800px) {
  .toast {
    width: fit-content;
    padding-right: 20px;
    top: auto;
    left: 16px;
    right: auto;
    bottom: var(--toast-stack-offset, 0px);
    transform: translateY(150%);
    transition:
      bottom 0.3s linear,
      transform 0.3s linear,
      opacity 0.3s linear;
  }

  .toast.active {
    transform: translateY(-16px);
  }
}

.toast-icon {
  display: inline-block;
  width: 21px;
  height: 21px;
  margin-right: 8px;
}

.toast-with-link {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toast-with-link a {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
  display: inline-block;
  margin-left: 2px;
}

.lightbox {
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background-color: var(--overlay-color-darkest);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: var(--lightbox-z-index);
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
  box-shadow: var(--shadow-color-lightbox);
  touch-action: none;
  will-change: transform;
}

.lightbox img.lightbox-image-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.lightbox-alt-text {
  color: var(--off-white);
  font-size: 14px;
  padding: 1em;
  max-height: 20vh;
  overflow-y: auto;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--overlay-text-color);
  cursor: pointer;
  background: var(--overlay-color);
  width: 40px;
  height: 40px;
  border-radius: var(--icon-button-border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--lightbox-close-z-index);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--overlay-text-color);
  background: var(--overlay-color);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--icon-button-border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: var(--lightbox-close-z-index);
  transition: background 0.2s ease;
}

@media (hover: hover) {
  .lightbox-nav:hover:not(:disabled) {
    background: var(--overlay-color-heavy);
  }
}

.lightbox-nav-prev {
  left: 20px;
}

.lightbox-nav-next {
  right: 20px;
}

.lightbox-nav .icon {
  width: 24px;
  height: 24px;
}

.lightbox-nav .icon path {
  stroke: var(--white);
  stroke-width: 3;
}

