/* =========================================================================
   location.css — اجزای پازل‌های مدارک + صفحه‌ی آرام (بام)
   ========================================================================= */

/* کارت پازل */
.puzzle-card { margin-top: var(--space-5); }

.puzzle-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.9;
}

/* سؤال پازل (بالای کادر پاسخ) */
.puzzle-question {
  font-size: var(--text-md);
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-3);
  line-height: 1.9;
}

/* ---------------- پازل ۱: لاگ تماس‌ها (مورس) ---------------- */
.call-log {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 0;
  padding: var(--space-5) var(--space-4);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-height: 64px;
}

.call-group { display: flex; gap: 7px; }

.call-bar {
  height: 26px;
  border-radius: 3px;
  background: var(--accent-amber);
  box-shadow: 0 0 10px -2px rgba(212, 162, 78, .5);
}

.call-bar.short { width: 12px; }
.call-bar.long { width: 34px; }

.call-gap { width: 18px; }

/* راهنمای مورس (جدول کامل) */
.collapse {
  margin-top: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, .2);
}

.collapse summary {
  cursor: pointer;
  padding: var(--space-3) var(--space-4);
  color: var(--accent-amber);
  font-size: var(--text-sm);
  font-weight: 600;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.collapse[open] summary { border-bottom: 1px solid var(--border-subtle); }

.morse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 6px;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.morse-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: .3rem .5rem;
  background: rgba(0, 0, 0, .25);
}

.morse-cell b {
  color: var(--text-primary);
  font-weight: 700;
  font-size: .85rem;
  font-family: var(--font-body);
}

/* ---------------- پازل ۲: رمز سزار ---------------- */
.observed-label {
  font-size: .68rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-1);
}

.observed-date {
  font-size: var(--text-2xl);
  font-weight: 900;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.cipher-box {
  font-size: var(--text-xl);
  text-align: center;
  padding: var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, .3);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

/* نوار الفبا — هر حرف جدا (فاصله با padding، نه letter-spacing) */
.alphabet-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.alphabet-strip span {
  display: inline-block;
  padding: .15em .28em;
  font-size: var(--text-md);
  color: var(--text-primary);
}

/* ---------------- پازل ۳: ویدیو ---------------- */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #141210;
  border: 1px solid var(--border-subtle);
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, .35);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.video-fallback[hidden] { display: none; }

.video-fallback svg {
  width: 28px;
  height: 28px;
  color: var(--accent-amber);
}

/* ---------------- پازل ۴: شهادت شاهدها ---------------- */
.witness-frag {
  margin: 0 0 var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-inline-start: 2px solid var(--border-strong);
  background: rgba(212, 162, 78, .05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: var(--text-md);
  line-height: 2;
}

.witness-frag:last-child { margin-bottom: 0; }

/* ---------------- پازل ۶: تقویم ---------------- */
.cal-hint {
  font-size: var(--text-md);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-5);
  line-height: 2;
}

.cal-head {
  text-align: center;
  font-weight: 800;
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.cal-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.cal-dow {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .25);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}

.cal-cell:not(.empty):hover {
  border-color: var(--accent-amber);
  color: var(--text-primary);
}

.cal-cell:not(.empty):focus-visible {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(212, 162, 78, .16);
}

.cal-cell.empty { border-color: transparent; background: transparent; pointer-events: none; }

/* ---------------- صفحه‌ی آرام: بام (مدرک ۵) ---------------- */
.page-quiet { max-width: 560px; }

.quiet-card {
  text-align: center;
  padding: clamp(2rem, 7vw, 3.2rem);
  border-style: dashed;
}

.quiet-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: var(--space-5);
  letter-spacing: .03em;
}

.quiet-text {
  font-size: var(--text-md);
  font-weight: 300;
  line-height: 2.2;
  color: var(--text-primary);
}

.quiet-btn {
  margin-top: var(--space-6);
  min-width: 200px;
}

@media (max-width: 520px) {
  .observed-date { font-size: var(--text-xl); }
  .cipher-box { font-size: var(--text-lg); }
}

/* افکت تایپ — بام */
.quiet-text.typing::after {
  content: "▍";
  display: inline-block;
  color: var(--accent-amber);
  margin-right: 3px;
  animation: caret-blink 0.9s steps(1) infinite;
}
@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
