/* ═══════════════════════════════════════
   ЗАНАВЕС — hub.css
   Раскладка главной страницы + иконки
   ═══════════════════════════════════════ */

/* ─── Пазл SVG ─────────────────────────── */
.puzzle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  filter:
    drop-shadow(0 18px 46px rgba(0,0,0,0.34))
    drop-shadow(0 0 24px rgba(196,168,130,0.10));
}

.puzzle-wrap.hub-icons--left,
.puzzle-wrap { justify-self: end; }
.puzzle-wrap + .hub-center { }

.puzzle-svg {
  width: clamp(220px, 22vw, 330px);
  height: clamp(220px, 22vw, 330px);
  overflow: visible;
  display: block;
}

/* Hover эффект на деталях пазла */
.pz-piece {
  transition: filter 0.22s ease;
}
.pz-piece:hover {
  filter: brightness(1.06) contrast(1.04);
}
.pz-piece .pz-hover {
  transition: fill 0.18s ease;
}
.pz-piece:hover .pz-hover {
  fill: rgba(255,245,228,0.09);
}

/* ─── Трёхколоночная сетка ─────────────── */
.hub-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0 clamp(12px, 2vw, 40px);
  min-height: 100dvh;
  padding: clamp(14px, 2.4vmin, 34px) clamp(14px, 2.4vw, 44px);
  max-width: 1480px;
  margin: 0 auto;
}

.hub-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* ─── Сетки иконок (2 × 2 пазл) ────────── */
.hub-icons {
  display: inline-grid;
  grid-template-columns: repeat(2, clamp(92px, 9.2vw, 140px));
  gap: 5px;
  padding: 6px;
  background: rgba(107, 83, 68, 0.055);
  border: 1px solid rgba(107, 83, 68, 0.15);
  border-radius: 22px;
  box-shadow:
    0 16px 48px rgba(107, 83, 68, 0.13),
    0 4px 14px rgba(107, 83, 68, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

.hub-icons--left  { justify-self: end; }
.hub-icons--right { justify-self: start; }

#hub-left  { justify-self: end; }
#hub-right { justify-self: start; }

/* ─── Одиночная иконка под часами ─────── */
#hub-bottom {
  display: flex;
  justify-content: center;
}

/* ─── Карточка-иконка ─────────────────── */
.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.icon-card:hover  { transform: scale(1.06) translateY(-3px); }
.icon-card:active { transform: scale(0.95); }

/* ─── Пазл: карточки внутри сетки ─────── */
.hub-icons .icon-card {
  position: relative;
  gap: 0;
  align-items: center;
  justify-content: center;
}

/* ─── Изображение (пазл — крупнее) ─────── */
.icon-img {
  width: clamp(92px, 9.2vw, 140px);
  height: clamp(92px, 9.2vw, 140px);
  border-radius: 3px;          /* пазл переопределяет через nth-child */
  overflow: hidden;
  background: var(--paper-warm);
  border: 1px solid rgba(107, 83, 68, 0.14);
  box-shadow:
    0 2px 8px rgba(107, 83, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: filter 0.2s ease;
}

.icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: sepia(0.18) contrast(0.96);
  display: block;
}

/* ─── Углы пазла (2 × 2) ──────────────── */
/* верхний-левый  */
.hub-icons .icon-card:nth-child(1) .icon-img {
  border-radius: 16px 3px 3px 3px;
}
/* верхний-правый */
.hub-icons .icon-card:nth-child(2) .icon-img {
  border-radius: 3px 16px 3px 3px;
}
/* нижний-левый   */
.hub-icons .icon-card:nth-child(3) .icon-img {
  border-radius: 3px 3px 3px 16px;
}
/* нижний-правый  */
.hub-icons .icon-card:nth-child(4) .icon-img {
  border-radius: 3px 3px 16px 3px;
}

/* ─── Название — оверлей поверх картинки ─ */
.hub-icons .icon-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(38, 27, 18, 0.72));
  color: rgba(255, 246, 232, 0.96);
  font-family: "Jost", sans-serif;
  font-size: clamp(0.38rem, 0.50vw, 0.46rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  padding: 18px 4px 6px;
  pointer-events: none;
}

/* Нижние углы оверлея совпадают с углами img */
.hub-icons .icon-card:nth-child(3) .icon-name { border-radius: 0 0 0 15px; }
.hub-icons .icon-card:nth-child(4) .icon-name { border-radius: 0 0 15px 0; }

/* ─── Нижняя одиночная иконка ─────────── */
#hub-bottom .icon-card {
  position: relative;
  gap: 0;
}

#hub-bottom .icon-img {
  width: clamp(100px, 9.8vw, 148px);
  height: clamp(100px, 9.8vw, 148px);
  border-radius: 18px;
  box-shadow:
    0 14px 40px rgba(107, 83, 68, 0.14),
    0 4px 12px rgba(107, 83, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#hub-bottom .icon-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(38, 27, 18, 0.72));
  color: rgba(255, 246, 232, 0.96);
  font-family: "Jost", sans-serif;
  font-size: clamp(0.38rem, 0.50vw, 0.46rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  padding: 18px 4px 6px;
  pointer-events: none;
  border-radius: 0 0 17px 17px;
}

/* ─── «время идёт» ─────────────────────── */
.time-caption {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(0.85rem, 2.2vw, 1.45rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.30em;
  text-indent: 0.30em;
  color: rgba(196, 168, 130, 0.82);
  text-align: center;
  opacity: 0;
  transition: opacity 2s ease;
}

.time-caption.visible { opacity: 1; }

/* ─── Мобильные ───────────────────────── */
@media (max-width: 900px) {
  .hub-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    justify-items: center;
    gap: 24px 0;
    padding: 24px 16px 48px;
    min-height: unset;
  }

  .hub-icons {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 5px;
    border-radius: 18px;
  }

  /* На мобиле — ряд из 4, сбросить угловые стили пазла */
  .hub-icons .icon-card:nth-child(1) .icon-img { border-radius: 14px 3px 3px 3px; }
  .hub-icons .icon-card:nth-child(2) .icon-img { border-radius: 3px 3px 3px 3px; }
  .hub-icons .icon-card:nth-child(3) .icon-img { border-radius: 3px 3px 3px 3px; }
  .hub-icons .icon-card:nth-child(4) .icon-img { border-radius: 3px 14px 14px 3px; }

  .hub-icons--left  { order: 2; width: 100%; }
  .hub-icons--right { order: 3; width: 100%; }
  .hub-center       { order: 1; }
}

@media (max-width: 540px) {
  .hub-icons { grid-template-columns: repeat(2, 1fr); }

  .hub-icons .icon-card:nth-child(1) .icon-img { border-radius: 14px 3px 3px 3px; }
  .hub-icons .icon-card:nth-child(2) .icon-img { border-radius: 3px 14px 3px 3px; }
  .hub-icons .icon-card:nth-child(3) .icon-img { border-radius: 3px 3px 3px 14px; }
  .hub-icons .icon-card:nth-child(4) .icon-img { border-radius: 3px 3px 14px 3px; }

  .icon-img { width: clamp(72px, 36vw, 110px); height: clamp(72px, 36vw, 110px); }
}
