/* Modal and lightbox styles */
.modal[aria-hidden="true"] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.modal-dialog {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1000px;
  margin: 6vh auto;
  width: min(95%, 1000px);
  max-height: calc(100vh - 12vh);
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
}
.modal-content {
  display: grid;
  grid-template-columns: 1fr;
  overflow: auto;
  max-height: calc(100vh - 12vh);
  -webkit-overflow-scrolling: touch;
}
.modal-media {
  display: block;
}
.modal-media img {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 0.75rem;
}
.modal-media .video-wrap {
  margin-top: 0.75rem;
}
.modal-media > :first-child {
  margin-top: 0 !important;
}
.video-wrap {
  position: relative;
  width: 100%;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.video-wrap::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}
.video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.modal-text {
  padding: 1rem;
}
.modal-text .meta {
  color: var(--muted);
  margin-top: 0.25rem;
}
.modal-text h4 {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.2px;
}
.modal-text ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.modal-text li {
  margin: 0.35rem 0;
}
.modal-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.modal-links a {
  color: #0a0a0a;
  background: var(--accent);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}
.img-lightbox[aria-hidden="true"] {
  display: none;
}
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
}
.img-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}
.img-lightbox-dialog {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.img-lightbox-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: bold;
}
@media (max-width: 700px), (pointer: coarse) {
  .img-lightbox-close {
    display: inline-flex;
    height: 3rem;
    width: 3rem;
    right: 0.75rem;
    top: 0.75rem;
    font-size: 1.5rem;
    min-height: 44px;
    min-width: 44px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
  }
}
.img-lightbox-close:hover {
  background: var(--panel);
}
.img-lightbox-controls {
  position: absolute;
  left: 1rem;
  top: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.img-lightbox.zoomed .img-lightbox-controls {
  opacity: 1;
  pointer-events: auto;
}
.img-lightbox-zoom-indicator {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 3rem;
  text-align: center;
}
.img-lightbox-reset {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background 0.2s;
}
.img-lightbox-reset:hover {
  background: rgba(0, 0, 0, 0.9);
}
.img-lightbox-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: #000;
  box-shadow: none;
  touch-action: none;
}
.img-lightbox-content img {
  display: block;
  max-width: none;
  will-change: transform;
  transform-origin: 0 0;
  user-select: none;
  cursor: pointer;
}
.img-lightbox.zoomed .img-lightbox-content {
  cursor: grab;
}
.img-lightbox.zoomed .img-lightbox-content:active {
  cursor: grabbing;
}
