/* fas4.css — Fest: galleri, bilduppladdning, minneskort */

/* ─── Header ─────────────────────────────────────────────────────────── */

.fas4-header {
  text-align: center;
  padding: 2rem 1.25rem 1rem;
  background: var(--color-rust-deep);
  color: #fff;
}

.fas4-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.fas4-subtitle {
  font-size: var(--text-sm);
  opacity: 0.8;
}

/* ─── Upload-formulär ────────────────────────────────────────────────── */

.gallery-upload-form {
  padding: 1rem 1.25rem;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-gray-light);
  position: sticky;
  top: 0;
  z-index: 5;
}

.gallery-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.gallery-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid #D5D2C8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.gallery-file-label:hover {
  border-color: var(--color-rust);
  background: var(--color-rust-light);
}

.gallery-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.gallery-text-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #D5D2C8;
  border-radius: 10px;
  font-size: var(--text-base);
  font-family: var(--font-body);
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s;
}

.gallery-text-input:focus {
  outline: none;
  border-color: var(--color-rust);
}

.gallery-text-input::placeholder {
  color: var(--color-placeholder);
}

.gallery-submit-btn {
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--color-rust-deep);
  color: #fff;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.gallery-submit-btn:hover:not(:disabled) {
  background: var(--color-rust);
}

.gallery-submit-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Förhandsgranskning */

.gallery-preview {
  position: relative;
  margin-top: 0.75rem;
  max-width: 200px;
}

.gallery-preview-img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.gallery-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Feedback */

.gallery-feedback {
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
}

.gallery-feedback--ok {
  color: #2E7D32;
  background: var(--color-rust-light);
}

.gallery-feedback--err {
  color: var(--color-ember);
  background: #FFF0EB;
}

/* ─── Galleri (masonry-liknande grid) ────────────────────────────────── */

.gallery-grid {
  padding: 0.75rem;
  columns: 2;
  column-gap: 0.75rem;
}

.gallery-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem 1rem;
  font-size: var(--text-base);
  column-span: all;
}

/* ─── Minneskort ─────────────────────────────────────────────────────── */

.memory-card {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ECEAE3;
  transition: box-shadow 0.12s;
}

.memory-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.memory-img img {
  width: 100%;
  display: block;
  cursor: pointer;
}

.memory-body {
  padding: 0.625rem 0.75rem;
}

.memory-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.45;
  margin-bottom: 0.25rem;
}

.memory-author {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

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

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 1rem;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  object-fit: contain;
}

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

@media (min-width: 640px) {
  .gallery-grid {
    columns: 3;
    padding: 1rem;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    columns: 4;
    max-width: 1200px;
    margin: 0 auto;
  }
}
