/* ============================================================
   Building detail — iOS-style bottom sheet.
   Spring-in from bottom, backdrop blur, drag-to-dismiss.
   ============================================================ */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.sheet-root.is-open { display: block; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}
.sheet-root.is-open .sheet-backdrop { opacity: 1; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform .42s cubic-bezier(.32, .72, 0, 1);
  will-change: transform;
}
.sheet-root.is-open .sheet { transform: translateY(0); }
.sheet.is-dragging { transition: none; }

.sheet-grab-zone {
  padding: 10px 0 6px;
  display: grid;
  place-items: center;
  flex: none;
  cursor: grab;
  touch-action: none;
}

.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.sheet-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 var(--gutter) calc(24px + var(--safe-bottom));
}

.sheet-hero {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-3);
  display: grid;
  place-items: center;
  color: var(--brass-deep);
  margin-bottom: 18px;
}
.sheet-hero img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.sheet-hero svg { width: 46px; height: 46px; opacity: .4; }

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sheet-title {
  font-size: 25px;
  line-height: 1.15;
}

.sheet-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-size: 13px;
  color: var(--ink-3);
  flex-wrap: wrap;
}

.sheet-era {
  font-weight: 700;
  color: var(--brass-deep);
}

.sheet-desc {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

.sheet-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.sheet-actions .btn { width: 100%; }

.portal-note {
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  margin-top: -2px;
}

.info-card {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.info-card h4 {
  font-size: 16px;
  margin-bottom: 7px;
}
.info-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.info-card img {
  width: 100%;
  border-radius: 10px;
  margin-top: 12px;
}

.mission-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brass) 16%, transparent);
  color: var(--brass-deep);
  font-size: 13px;
  font-weight: 600;
}

/* Unfolded / landscape: the sheet becomes a side panel rather than
   a full-width drawer, so it doesn't swallow a wide screen. */
@media (min-width: 700px) and (orientation: landscape) {
  .sheet {
    left: auto;
    right: 0;
    top: 0;
    width: min(440px, 50vw);
    max-height: none;
    height: 100svh;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    transform: translateX(100%);
  }
  .sheet-root.is-open .sheet { transform: translateX(0); }
  /* Drag-down-to-dismiss is meaningless on a side panel — the close
     button carries it instead. */
  .sheet-grab-zone { display: none; }
  .sheet-scroll { padding-top: calc(18px + var(--safe-top)); }
}
