.gallery-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.policy-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  border: 1px solid var(--border-gold);
}
.policy-public { background: rgba(39,174,96,0.12); color: #a8e6cf; }
.policy-members { background: rgba(201,162,39,0.12); color: var(--gold-light); }
.policy-closed { background: rgba(192,57,43,0.12); color: #f5b7b1; }
.gallery-post-date { color: var(--gold-light); font-size: 0.88rem; }

.gallery-page { padding: 1.5rem 0 3rem; }

.gallery-hero { margin-bottom: 1.25rem; }
.gallery-tagline { color: var(--text-muted); line-height: 1.75; margin: 0.5rem 0 1rem; max-width: 640px; }
.gallery-hint { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.75rem; }
.gallery-hint a { color: var(--gold); }

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-chip {
  padding: 0.45rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.filter-chip:hover, .filter-chip.active {
  background: rgba(201,162,39,0.15);
  color: var(--gold-light);
  border-color: var(--gold);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}
.gallery-feed-card {
  padding: 0;
  overflow: hidden;
  scroll-margin-top: 5rem;
}
.gallery-feed-head {
  padding: 1.15rem 1.25rem 0.75rem;
}
.gallery-feed-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.gallery-feed-head-text {
  flex: 1;
  min-width: 0;
}
.gallery-feed-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(0, 0, 0, 0.25);
  color: var(--gold-light);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
  line-height: 1.2;
  transition: border-color 0.2s, background 0.2s;
}
.gallery-feed-toggle:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.12);
}
.gallery-feed-toggle-icon {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.2rem;
  transition: transform 0.2s;
}
.gallery-feed-card.is-collapsed .gallery-feed-toggle-icon {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}
.gallery-feed-card.is-collapsed .when-expanded { display: none; }
.gallery-feed-card:not(.is-collapsed) .when-collapsed { display: none; }
.gallery-feed-card.is-collapsed .gallery-feed-body { display: none; }
.gallery-feed-card.is-collapsed .gallery-feed-head {
  padding-bottom: 1.15rem;
  border-bottom: none;
}
.gallery-feed-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  max-width: 760px;
  margin: 0 auto 1rem;
}
.gallery-feed-title {
  color: var(--gold);
  font-size: 1.2rem;
  margin: 0.45rem 0 0.35rem;
}
.gallery-feed-content {
  padding: 0 1.25rem 1rem;
  line-height: 1.85;
  color: var(--text-muted);
}
.gallery-feed-card .gallery-media-preview {
  margin: 0;
}
.gallery-feed-card .gallery-show-image {
  max-height: 480px;
}
.gallery-post-comments {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(201, 162, 39, 0.18);
  background: rgba(0, 0, 0, 0.12);
}
.gallery-post-comments-compact .gallery-comments-title {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  color: var(--gold-light);
}
.gallery-comments-title {
  font-size: 1rem;
  margin: 0 0 0.85rem;
  color: var(--gold-light);
}
.gallery-feed-card .post-comment-form textarea {
  min-height: 72px;
}

.gallery-grid-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.gallery-grid-card .gallery-card-media {
  position: relative;
  aspect-ratio: 16/10;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.gallery-grid-media {
  width: 100%;
  height: 100%;
  position: relative;
}
.gallery-grid-media img,
.gallery-grid-media .gallery-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-card-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.gallery-card-audio-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.35);
}
.gallery-card-audio {
  width: 100%;
  max-width: 100%;
}
.gallery-card-youtube {
  width: 100%;
  height: 100%;
  position: relative;
}
.gallery-card-youtube-poster {
  position: absolute;
  inset: 0;
}
.gallery-card-youtube-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-card-play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.gallery-card-play-btn:hover {
  background: rgba(201, 162, 39, 0.35);
  transform: scale(1.05);
}
.gallery-card-youtube-player {
  position: absolute;
  inset: 0;
}
.gallery-card-youtube-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.gallery-card-file {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gold);
  text-decoration: none;
  font-size: 1rem;
}
.gallery-card-text-snippet {
  padding: 1rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.gallery-grid-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.gallery-grid-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}
.gallery-grid-title-link {
  color: var(--gold);
  text-decoration: none;
}
.gallery-grid-title-link:hover {
  color: var(--gold-light);
}
.gallery-grid-author {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.gallery-grid-author-label {
  opacity: 0.85;
}
.gallery-grid-author strong {
  color: var(--gold-light);
  font-weight: 600;
}
.gallery-grid-datetime {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.9;
}
.gallery-grid-datetime time {
  color: var(--gold-light);
}
.gallery-grid-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(201, 162, 39, 0.15);
}
.gallery-react-btn,
.gallery-comments-open {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  line-height: 1.2;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.gallery-react-btn:hover,
.gallery-comments-open:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}
.gallery-react-btn.is-active {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.18);
  color: var(--gold-light);
}
.gallery-react-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.gallery-react-btn.is-active .gallery-react-icon {
  transform: scale(1.08);
}
.gallery-react-count,
.gallery-comment-count {
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}
.gallery-comments-open {
  margin-inline-start: auto;
}

.gallery-grid-item {
  display: flex;
  flex-direction: column;
  scroll-margin-top: 5rem;
}

.gallery-comments-dialog {
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 0;
  max-width: min(520px, calc(100vw - 2rem));
  width: 100%;
  background: var(--bg-card, #1a1612);
  color: inherit;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  z-index: 1200;
}
.gallery-comments-dialog[open],
.gallery-comments-dialog.gallery-dialog-fallback-open {
  display: block;
  margin: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: min(90vh, 680px);
}
.gallery-comments-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
.gallery-comments-dialog.gallery-dialog-fallback-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: -1;
}
.gallery-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 1300;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: rgba(26, 22, 18, 0.96);
  color: var(--gold-light);
  font-size: 0.92rem;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
  max-width: min(92vw, 420px);
  text-align: center;
}
.gallery-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.gallery-comments-dialog-inner {
  max-height: min(85vh, 640px);
  display: flex;
  flex-direction: column;
}
.gallery-comments-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}
.gallery-comments-dialog-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--gold-light);
  line-height: 1.45;
}
.gallery-dialog-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.gallery-dialog-close:hover {
  color: var(--gold);
}
.gallery-comments-dialog-body {
  overflow-y: auto;
  padding: 0 1rem 1rem;
}
.gallery-comments-dialog .gallery-post-comments {
  padding: 0.75rem 0 0;
  border: none;
  background: transparent;
}
.gallery-comments-dialog .gallery-comments-title {
  display: none;
}
.gallery-compose-dialog .gallery-comment-form-compose {
  margin-bottom: 0.75rem;
}
.gallery-compose-dialog .gallery-comment-form-compose textarea {
  min-height: 100px;
}
.gallery-comments-prev {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(201, 162, 39, 0.15);
  padding-top: 0.5rem;
}
.gallery-comments-prev summary {
  cursor: pointer;
  color: var(--gold-light);
  font-size: 0.9rem;
  padding: 0.35rem 0;
  list-style: none;
}
.gallery-comments-prev summary::-webkit-details-marker {
  display: none;
}
.gallery-comments-prev[open] summary {
  margin-bottom: 0.5rem;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, border-color 0.25s;
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.gallery-card-media {
  position: relative;
  aspect-ratio: 16/10;
  background: rgba(0,0,0,0.45);
  overflow: hidden;
}
.gallery-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  background: rgba(201,162,39,0.06);
}
.gallery-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--gold);
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-card:hover .gallery-play { opacity: 1; }

.gallery-type-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  background: rgba(13,11,8,0.85);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  color: var(--gold-light);
}

.gallery-card-body { padding: 1.1rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.gallery-card-body h2 { color: var(--gold); font-size: 1.05rem; margin-bottom: 0.5rem; }
.gallery-card-body p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.65; flex: 1; }
.gallery-card-body footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gallery-empty { text-align: center; padding: 2.5rem; color: var(--text-muted); }
.gallery-empty .btn { margin-top: 1rem; }

.gallery-breadcrumb { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }
.gallery-breadcrumb a { color: var(--gold); text-decoration: none; }

.gallery-show { padding: 0; overflow: hidden; }
.gallery-show-head { padding: 1.5rem 1.5rem 1rem; }
.gallery-show-meta { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

.gallery-player {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.gallery-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.gallery-player-native {
  width: 100%;
  max-height: 480px;
  background: #000;
  display: block;
}
.gallery-player-audio {
  width: 100%;
  display: block;
  margin: 0;
}
.gallery-media-preview {
  margin-bottom: 1rem;
}
.gallery-media-file-link {
  margin: 0.75rem 0;
}

.moderation-page .moderation-card {
  margin-bottom: 1.25rem;
}
.moderation-preview-wrap {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}
.moderation-preview-label {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--gold-light);
}
.moderation-text {
  margin-bottom: 1rem;
}

.gallery-show-image {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: rgba(0,0,0,0.35);
}
.gallery-show-content {
  padding: 1.25rem 1.5rem 1.5rem;
  line-height: 1.85;
  white-space: pre-wrap;
}
.gallery-show-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.post-comments-section { margin-top: 1.25rem; padding: 1.25rem 1.5rem; }
.post-comment-form textarea {
  width: 100%;
  margin: 0.65rem 0;
  min-height: 88px;
  resize: vertical;
}
.post-comment-attachments {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}
.post-comment-attach-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.post-comment-attach-label input[type="file"] { font-size: 0.85rem; max-width: 100%; }
.post-comment-image-preview img {
  max-width: 220px;
  max-height: 160px;
  border-radius: 6px;
  margin-top: 0.35rem;
  border: 1px solid rgba(201, 162, 39, 0.25);
}
.post-audio-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.post-audio-preview-wrap { margin-top: 0.5rem; }
.post-audio-preview,
.post-comment-audio { width: 100%; max-width: 420px; }
.post-comments-list { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; }
.post-comment {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}
.post-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}
.post-comment-delete { margin-inline-start: auto; }
.post-comment-body {
  margin: 0 0 0.5rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.post-comment-image {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
  display: block;
}
.post-comment-media-link { display: inline-block; margin-top: 0.35rem; }

.emoji-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.emoji-chip {
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}
.emoji-chip:hover { background: rgba(201, 162, 39, 0.15); border-color: var(--gold); }

@media (max-width: 768px) {
  .gallery-feed { max-width: 100%; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-show-actions .btn { flex: 1 1 100%; text-align: center; }
  .gallery-hero .btn-row .btn { width: 100%; }
}

@media (max-width: 480px) {
  .gallery-card-body { padding: 0.85rem; }
  .gallery-show-media iframe { min-height: 200px; }
}
