/* ── Living Archive interactive styles ──────────────────────────────── */
/* Appended to the existing styles.css by the archive enhancement pass. */

/* ── Comment widgets ───────────────────────────────────────────────── */

.comment-widget {
  margin-top: 12px;
  border-top: 1px solid var(--line, #d6dde2);
  padding-top: 8px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--soft-ink, #52606d);
  user-select: none;
  transition: color 0.2s;
}

.comment-header:hover {
  color: var(--forest, #24483f);
}

.comment-header svg {
  flex-shrink: 0;
}

.comment-body {
  margin-top: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  backdrop-filter: blur(6px);
}

.comment-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.comment-entry {
  padding: 8px 0;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.comment-entry:last-child {
  border-bottom: none;
}

.comment-meta {
  font-size: 0.78rem;
  color: var(--soft-ink, #52606d);
  margin-bottom: 4px;
}

.comment-entry p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.no-comments, .comment-error {
  font-size: 0.85rem;
  color: var(--soft-ink, #888);
  font-style: italic;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form input,
.comment-form textarea {
  padding: 8px 12px;
  border: 1px solid var(--line, #d6dde2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.8);
  transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--forest, #24483f);
}

.comment-form button {
  align-self: flex-end;
  padding: 8px 20px;
  background: var(--forest, #24483f);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.comment-form button:hover {
  background: var(--blue, #274c77);
  transform: translateY(-1px);
}

.comment-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Lightbox ──────────────────────────────────────────────────────── */

#lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: absolute;
  top: -1.5rem;
  right: -1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
  transition: transform 0.15s;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: #e0e0e0;
  margin-top: 12px;
  font-size: 1rem;
  text-align: center;
  font-style: italic;
}

.lightbox-comments {
  width: 100%;
  max-width: 500px;
  margin-top: 16px;
  color: #e0e0e0;
}

.lightbox-comments .comment-widget {
  border-top-color: rgba(255,255,255,0.2);
}

.lightbox-comments .comment-header {
  color: #bbb;
}

.lightbox-comments .comment-header:hover {
  color: #fff;
}

.lightbox-comments .comment-body {
  background: rgba(255,255,255,0.08);
}

.lightbox-comments .comment-entry {
  border-bottom-color: rgba(255,255,255,0.1);
}

.lightbox-comments .comment-form input,
.lightbox-comments .comment-form textarea {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}

.lightbox-comments .comment-form input::placeholder,
.lightbox-comments .comment-form textarea::placeholder {
  color: #999;
}

/* ── Message board ─────────────────────────────────────────────────── */

.message-list {
  margin: 24px 0;
}

.message-entry {
  padding: 16px 20px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  border-left: 3px solid var(--forest, #24483f);
  backdrop-filter: blur(4px);
  transition: transform 0.15s, box-shadow 0.15s;
}

.message-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.message-meta {
  font-size: 0.8rem;
  color: var(--soft-ink, #52606d);
  margin-bottom: 6px;
}

.message-entry h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--ink, #1f2933);
}

.message-entry p {
  margin: 0;
  line-height: 1.6;
}

.message-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
  margin-top: 20px;
}

.message-form input,
.message-form textarea {
  padding: 10px 14px;
  border: 1px solid var(--line, #d6dde2);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.8);
  transition: border-color 0.2s;
}

.message-form input:focus,
.message-form textarea:focus {
  outline: none;
  border-color: var(--forest, #24483f);
}

.message-form button {
  align-self: flex-start;
  padding: 10px 28px;
  background: var(--forest, #24483f);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.message-form button:hover {
  background: var(--blue, #274c77);
  transform: translateY(-1px);
}

/* ── Upload widget ─────────────────────────────────────────────────── */

.upload-form {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.upload-form input {
  padding: 10px 14px;
  border: 1px solid var(--line, #d6dde2);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.8);
}

.upload-form button {
  align-self: flex-start;
  padding: 10px 28px;
  background: var(--forest, #24483f);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.upload-form button:hover {
  background: var(--blue, #274c77);
  transform: translateY(-1px);
}

.upload-drop-zone {
  border: 2px dashed var(--line, #ccc);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: rgba(255,255,255,0.4);
}

.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
  border-color: var(--forest, #24483f);
  background: rgba(36, 72, 63, 0.06);
}

.upload-drop-zone p {
  margin: 0;
  font-size: 1rem;
  color: var(--soft-ink, #52606d);
}

#upload-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--forest, #24483f);
  font-weight: 500;
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: var(--paper, #f7f8f5);
  font-size: 0.9rem;
  color: var(--soft-ink, #52606d);
  border-radius: 6px;
}

/* ── Responsive adjustments ────────────────────────────────────────── */

@media (max-width: 600px) {
  .lightbox-content {
    max-width: 98vw;
    padding: 0.5rem;
  }
  .lightbox-img {
    max-height: 55vh;
  }
  .lightbox-comments {
    max-width: 100%;
  }
  .message-form, .upload-form {
    max-width: 100%;
  }
}
