/* Транспортная галерея (этап 3A) — крупные тапы, мягкая палитра */

.transport-page {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--warm-white, #f8f6f0) 0%, #eef3f9 100%);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.transport-header {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 8px;
  padding: 12px calc(14px + env(safe-area-inset-right)) 8px
    calc(14px + env(safe-area-inset-left));
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(248, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(74, 144, 217, 0.12);
}

.transport-header--tight {
  padding-top: 8px;
}

.transport-header__btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
  cursor: pointer;
}

.transport-header__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.01em;
  color: var(--text-strong, #2d2d2d);
}

.transport-header__title--narrow {
  font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ——— Главная ——— */

.transport-home__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 18px calc(28px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
}

.transport-home-tile {
  aspect-ratio: 1;
  max-height: 180px;
  border: none;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.08));
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.transport-home-tile:active {
  transform: scale(0.98);
}

.transport-home-tile--accent {
  background: linear-gradient(145deg, #fff9eb, #fdebd4);
}

.transport-home-tile__emoji {
  font-size: 56px;
  line-height: 1;
}

.transport-home-tile__label {
  font-weight: 800;
  font-size: 0.95rem;
  color: #2d2d2d;
}

.transport-home-tile__count {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-want, #4a90d9);
}

/* ——— Категория ——— */

.transport-category__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
  max-width: 640px;
  margin: 0 auto;
}

.transport-chip {
  border: 2px solid rgba(74, 144, 217, 0.25);
  background: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.transport-chip--on {
  background: rgba(74, 144, 217, 0.18);
  border-color: #4a90d9;
  color: #1a4f8a;
}

.transport-category__hint {
  padding: 0 20px 8px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted, #6b6b6b);
}

.transport-category__gallery {
  padding: 8px 12px 32px;
  max-width: 640px;
  margin: 0 auto;
}

.transport-loading,
.transport-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted, #6b6b6b);
}

.transport-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 380px) {
  .transport-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.transport-gallery-tile {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: center;
}

.transport-gallery-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #e8eef5;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.transport-gallery-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.transport-gallery-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.transport-tile-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 1rem;
  line-height: 1;
}

.transport-tile-badge--paint {
  left: auto;
  right: 6px;
  top: 6px;
}

.transport-tile-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.transport-gallery-caption {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.28;
  color: #333;
  max-height: 2.56em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ——— Карточка item ——— */

.transport-item__hero-wrap {
  padding: 0 14px;
  margin-top: 10px;
}

.transport-item__hero {
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  background: #dde6f3;
  min-height: 200px;
  box-shadow: 0 6px 24px rgba(45, 90, 140, 0.12);
  cursor: zoom-in;
}

.transport-item__hero img {
  width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  vertical-align: middle;
  background: #101820;
}

.transport-item__hero--empty {
  display: grid;
  place-items: center;
  min-height: 200px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #557;
}

.transport-item__strip-wrap {
  margin-top: 14px;
  padding: 0 4px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.transport-item__strip {
  display: flex;
  gap: 10px;
  padding-bottom: 6px;
}

.transport-thumb {
  flex: 0 0 auto;
  position: relative;
  width: 72px;
}

.transport-thumb--plus {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: #fff;
  border: 2px dashed rgba(74, 144, 217, 0.4);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  cursor: pointer;
  color: #4a90d9;
}

.transport-thumb-img {
  width: 72px;
  height: 72px;
  padding: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: #e8eef5;
}

.transport-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.transport-thumb-menu {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.transport-thumb-paint {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 0.9rem;
}

.transport-description-block {
  margin: 18px 14px;
  padding: 16px;
  padding-left: 56px;
  position: relative;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff9e6, #fcefc4);
  box-shadow: 0 4px 16px rgba(180, 140, 60, 0.12);
  cursor: pointer;
}

.transport-description-block:active {
  filter: brightness(0.97);
}

.transport-speak-btn {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  font-size: 1.35rem;
  background: rgba(74, 144, 217, 0.15);
  cursor: pointer;
}

.transport-speak-btn.playing {
  animation: transportPulse 1s infinite;
}

@keyframes transportPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.06);
  }
}

.transport-sub {
  font-weight: 800;
  color: #5a4630;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.transport-desc {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  color: #3d3828;
}

.transport-item__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px;
}

.transport-btn-secondary {
  min-height: 48px;
  border-radius: 14px;
  border: none;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 8px;
}

.transport-btn-secondary--fullwidth {
  grid-column: 1 / -1;
}

.transport-item-meta {
  text-align: center;
  padding: 4px 12px 20px;
  font-size: 0.82rem;
  color: var(--muted, #6b6b6b);
}

/* PhotoSwipe источники (скрыто, триггерим click из JS) */
.transport-pswp-root {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.transport-pswp-a {
  position: absolute;
  width: 1px;
  height: 1px;
}

/* Модалки */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 30, 40, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

@media (min-height: 520px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal {
  background: #fff;
  border-radius: 22px;
  padding: 20px;
  width: min(440px, 100%);
  max-height: min(86vh, 640px);
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.transport-modal-edit h3,
.transport-photo-menu h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.transport-modal-edit label {
  display: block;
  font-weight: 700;
  margin: 10px 0 4px;
  font-size: 0.85rem;
}

.transport-modal-edit input,
.transport-modal-edit textarea,
.transport-modal-edit select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 2px solid #e5e9f2;
  padding: 10px;
  font: inherit;
}

.transport-modal-edit .transport-modal-actions,
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}

.transport-btn-cancel {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 2px solid #ddd;
  background: #fafafa;
  font-weight: 700;
  cursor: pointer;
}

.transport-btn-save {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: #4a90d9;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.transport-photo-menu .transport-menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: none;
  background: #f3f6fa;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.transport-menu-btn--danger {
  background: #ffecef;
}

/* Студия-заглушка */

.transport-studio__spacer {
  width: 48px;
}

.transport-studio-stub {
  padding: 32px 20px;
  max-width: 420px;
  margin: 0 auto;
}

.transport-studio-stub__lead {
  font-size: 1.05rem;
  line-height: 1.45;
  color: #333;
}

.transport-studio-stub__meta code {
  font-size: 0.75rem;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 6px;
}
