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

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

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

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

.fas4-subtitle {
  font-size: var(--text-xs);
  line-height: 1.35;
  opacity: 0.8;
}

.fas4-view-hem {
  max-width: none;
  padding: 0;
}

/* ─── Bordsplacering, fas 4b ─────────────────────────────────────────────── */
.fas4-seating-card {
  max-width: var(--max-width);
  margin: var(--space-4) auto 0;
  padding: 0 var(--page-pad);
  perspective: 900px;
}

.fas4-seating-envelope,
.fas4-seating-result,
.fas4-seating-unassigned {
  position: relative;
  overflow: hidden;
  padding: var(--space-5) var(--space-4);
  border: 1px solid rgba(178, 87, 31, 0.35);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fffdf8, #f6ead8);
  box-shadow: 0 8px 26px rgba(61, 34, 20, 0.12);
  text-align: center;
}

.fas4-seating-envelope::before,
.fas4-seating-envelope::after {
  content: '';
  position: absolute;
  inset-inline: -15%;
  bottom: -42%;
  height: 70%;
  border-top: 1px solid rgba(178, 87, 31, 0.16);
  background: rgba(255, 255, 255, 0.42);
  transform: rotate(14deg);
  pointer-events: none;
}

.fas4-seating-envelope::after { transform: rotate(-14deg); }

.fas4-envelope-icon {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 3rem;
  line-height: 1;
}

.fas4-seating-kicker {
  margin: 0 0 0.25rem;
  color: var(--color-rust);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fas4-seating-envelope h2,
.fas4-seating-result h2,
.fas4-seating-unassigned h2 { margin-bottom: var(--space-2); }

.fas4-seating-envelope > p:not(.fas4-seating-kicker),
.fas4-seating-unassigned p {
  max-width: 32rem;
  margin: 0 auto var(--space-3);
  color: var(--color-text-muted);
}

.fas4-seating-envelope.is-opening {
  animation: seating-envelope-open 0.48s ease-in both;
}

.fas4-seating-result {
  border-color: var(--seating-color, var(--color-rust));
  background: #fffdf8;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--seating-color, #b2571f) 12%, white), transparent 58%),
    #fffdf8;
}

.fas4-seating-result.is-revealed { animation: seating-result-in 0.55s ease-out both; }

.fas4-seating-table-icon {
  display: grid;
  width: 4.25rem;
  height: 4.25rem;
  margin: var(--space-2) auto;
  place-items: center;
  border-radius: 50%;
  background: var(--seating-color, var(--color-rust));
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 5px 16px color-mix(in srgb, var(--seating-color, #b2571f) 30%, transparent);
}

.fas4-seating-result h2 {
  color: var(--seating-color, var(--color-rust-deep));
  font-size: clamp(1.7rem, 8vw, 2.4rem);
}

.fas4-seating-seat {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--seating-color, var(--color-rust));
  color: #fff;
  font-weight: 700;
}

.fas4-seating-neighbors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  max-width: 34rem;
  margin: 0 auto;
}

.fas4-seating-neighbor {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid #ece2d5;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  text-align: left;
}

.fas4-seating-neighbors > :only-child { grid-column: 1 / -1; justify-self: center; min-width: 14rem; }

.fas4-seating-avatar {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 3.25rem;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: var(--seating-color, var(--color-rust));
  color: #fff;
  font-weight: 700;
}

.fas4-seating-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fas4-seating-neighbor span, .fas4-seating-neighbor strong { display: block; }
.fas4-seating-neighbor span { color: var(--color-text-muted); font-size: var(--text-xs); }

.fas4-seating-clue {
  max-width: 34rem;
  margin: var(--space-4) auto 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-cream);
}

.fas4-seating-clue strong { color: var(--color-rust-deep); }
.fas4-seating-clue p { margin: 0.3rem 0 0; font-style: italic; }
.fas4-seating-unassigned > span { display: block; font-size: 2.5rem; }

@keyframes seating-envelope-open {
  to { opacity: 0; transform: rotateX(-12deg) translateY(-12px) scale(0.96); }
}

@keyframes seating-result-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 460px) {
  .fas4-seating-neighbors { grid-template-columns: 1fr; }
  .fas4-seating-neighbors > :only-child { grid-column: auto; justify-self: stretch; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fas4-seating-envelope.is-opening,
  .fas4-seating-result.is-revealed { animation: none; }
}

.fas4-home-card {
  max-width: var(--max-width);
  margin: var(--space-4) auto;
  padding: var(--space-4) var(--page-pad);
  text-align: center;
}

.fas4-checkin-card {
  max-width: var(--max-width);
  margin: var(--space-4) auto 0;
  padding: 0 var(--page-pad);
}

.fas4-checkin-card > div {
  padding: var(--space-4);
  background: #fff;
  border: 1px solid var(--color-amber);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 18px rgba(39, 80, 10, 0.08);
}

.fas4-checkin-card h2 {
  margin-bottom: var(--space-1);
}

.fas4-checkin-card > div > p {
  color: var(--color-text-muted);
}

.fas4-checkin-profile {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  background: var(--color-cream);
  border-radius: var(--radius-md);
}

.fas4-checkin-profile .profil-bild-wrapper {
  flex-direction: row;
  align-items: center;
  text-align: left;
}

.fas4-checkin-profile .profil-bild-circle {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
}

.fas4-checkin-profile-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fas4-checkin-profile-copy strong {
  color: var(--color-rust-deep);
}

.fas4-checkin-profile-copy span {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.fas4-checkin-feedback {
  margin-top: var(--space-2);
  color: #b3261e;
  font-size: var(--text-sm);
}

.fas4-home-icon {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 2.5rem;
  line-height: 1;
}

.fas4-home-card h2 {
  margin-bottom: var(--space-2);
}

.fas4-home-card p,
.fas4-view-dela .section-header p {
  color: var(--color-text-muted);
}

.fas4-view-flode .section-header p {
  color: var(--color-text-muted);
}

.fas4-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.fas4-feed-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid #ECEAE3;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(39, 80, 10, 0.05);
}

.fas4-feed-card--checkin {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-color: var(--color-amber);
  background: linear-gradient(135deg, #fff 0%, var(--color-amber-light) 100%);
}

.fas4-feed-checkin-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border: 3px solid var(--color-amber);
  border-radius: 50%;
  background: var(--color-rust-deep);
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
}

.fas4-feed-checkin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fas4-feed-checkin-text {
  margin: 0 0 2px;
  color: var(--color-rust-deep);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  line-height: 1.25;
}

.fas4-feed-image-button {
  display: block;
  width: 100%;
  padding: 0;
  background: #eeeae1;
}

.fas4-feed-image {
  width: 100%;
  max-height: 70dvh;
  object-fit: contain;
}

.fas4-feed-body {
  padding: var(--space-3);
}

.fas4-feed-text {
  margin-bottom: var(--space-1);
  color: var(--color-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fas4-feed-meta {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.fas4-feed-status {
  padding: var(--space-5) var(--space-2);
  color: var(--color-text-muted);
  text-align: center;
}

.fas4-feed-more {
  order: 2;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  color: var(--color-rust-deep);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ─── Bildbingo ──────────────────────────────────────────────────────── */

.bingo-section {
  padding: 1.25rem 1.25rem 0.5rem;
  text-align: center;
}

.bingo-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--color-rust-deep);
  margin-bottom: 0.25rem;
}

.bingo-intro {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 0.875rem;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.bingo-rules {
  list-style: disc;
  text-align: left;
  margin: 0 0 0.875rem 1.25rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.bingo-cell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: 1.5px solid var(--color-rust);
  border-radius: 10px;
  background: #fff;
  color: var(--color-text);
  font-size: 0.75rem;
  line-height: 1.3;
  font-family: var(--font-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.bingo-cell:active {
  transform: scale(0.96);
}

.bingo-cell--checked {
  background: var(--color-rust);
  color: #fff;
  border-color: var(--color-rust-deep);
}

.bingo-cell--busy {
  opacity: 0.6;
  pointer-events: none;
}

.bingo-cell-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bingo-cell-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bingo-cell-text {
  position: relative;
  z-index: 1;
}

.bingo-cell--checked .bingo-cell-text {
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
}

.bingo-feedback {
  margin-bottom: 0.75rem;
  font-size: var(--text-sm);
}

.bingo-feedback--ok { color: var(--color-text-muted); }
.bingo-feedback--err { color: #b3261e; }

.bingo-tiebreak-form {
  text-align: left;
  margin-bottom: 1rem;
}

.bingo-tiebreak-question {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.bingo-tiebreak-row {
  display: flex;
  gap: 0.5rem;
}

.bingo-tiebreak-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.bingo-tiebreak-btn {
  padding: 0.5rem 0.875rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-rust);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
}

.bingo-result {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--color-amber-light);
  border: 1px solid var(--color-amber);
  border-radius: var(--radius-md);
  text-align: left;
}

.bingo-result-title {
  font-size: var(--text-base);
  margin-bottom: 0.25rem;
}

.bingo-result-text {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.bingo-winner {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--color-amber-light);
  border: 1px solid var(--color-amber);
  border-radius: var(--radius-md);
  color: var(--color-amber-deep);
  font-weight: 600;
}

.bingo-leaderboard {
  text-align: left;
}

.bingo-leaderboard-title {
  font-size: var(--text-base);
  margin-bottom: 0.5rem;
}

.bingo-leaderboard-list {
  list-style: decimal;
  padding-left: 1.25rem;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.bingo-leaderboard-list li {
  margin-bottom: 4px;
}

.bingo-leaderboard-empty {
  list-style: none;
  color: var(--color-text-muted);
  font-style: italic;
  margin-left: -1.25rem;
}

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

.gallery-upload-form {
  padding: 1rem 1.25rem;
  background: var(--color-cream);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-md);
}

.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;
  }
}
