.detail { display: grid; grid-template-columns: 360px 1fr; gap: 24px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.detail .info {
  background: #272727; border: 1px solid #3f3f3f;
  border-radius: 12px; padding: 20px; height: fit-content;
}
.detail .info h2 {
  font-size: 22px; font-weight: 500; margin-bottom: 4px;
  word-break: break-word;
}
.detail .info .date { color: #aaa; font-size: 13px; margin-bottom: 16px; }
.detail .info .field-block { margin-bottom: 16px; }
.detail .info .field-label {
  font-size: 11px; text-transform: uppercase; color: #aaa;
  letter-spacing: 1px; margin-bottom: 6px;
}
.detail .info .tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.detail .info .tag-chips .chip {
  background: #ff0000; color: #fff;
  padding: 4px 10px; border-radius: 20px; font-size: 12px;
  cursor: pointer; transition: background .12s;
}
.detail .info .tag-chips .chip:hover { background: #cc0000; }
.detail .info .urls a {
  display: block; color: #66aaff; text-decoration: none;
  font-size: 13px; padding: 4px 0; word-break: break-all;
}
.detail .info .urls a:hover { text-decoration: underline; }
.detail .info .notes {
  white-space: pre-wrap; background: #121212;
  border: 1px solid #3f3f3f; border-radius: 6px;
  padding: 10px; font-size: 13px; color: #ddd;
  max-height: 300px; overflow-y: auto;
}
.detail .info .actions {
  display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.detail .info .actions button {
  flex: 1;
  background: #3f3f3f; color: #f1f1f1; border: none;
  padding: 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; transition: background .15s;
}
.detail .info .actions button:hover { background: #555; }
.detail .info .actions button.danger { background: #aa0000; }
.detail .info .actions button.danger:hover { background: #ff0000; }

.back-link {
  display: inline-block; color: #aaa;
  text-decoration: none; font-size: 13px; margin-bottom: 16px;
}
.back-link:hover { color: #fff; }

/* Navigation Arrows in Info Card */
.nav-arrows-container {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #3f3f3f;
}

.nav-arrow-btn {
  flex: 1;
  background: #3f3f3f;
  color: #f1f1f1;
  border: none;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s;
}

.nav-arrow-btn:hover {
  background: #555;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  position: relative;
}

/* Single media item takes full width */
.gallery.single-media {
  grid-template-columns: 1fr;
}

@media (max-width: 1100px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

.gallery .item {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gallery .item .media {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  flex: 1;
}

/* For multiple media items - fill the card */
.gallery:not(.single-media) .item .media img,
.gallery:not(.single-media) .item .media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* For single media item - maximize size while maintaining aspect ratio */
.gallery.single-media .item {
  height: calc(100vh - 180px);
  min-height: 500px;
}

.gallery.single-media .item .media {
  flex: 1;
  min-height: 0;
}

.gallery.single-media .item .media img,
.gallery.single-media .item .media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery .item .item-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #2a2a2a;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.gallery .item .item-bar .filename {
  font-size: 12px; color: #aaa;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}

.gallery .item .item-bar button {
  background: transparent; color: #aaa; border: none;
  font-size: 12px; cursor: pointer;
  padding: 4px 10px; border-radius: 4px;
}

.gallery .item .item-bar button:hover { background: #3f3f3f; color: #fff; }

.item-bar-buttons {
  display: flex;
  gap: 8px;
}
