/* spread-cards.css
   Cards, headers, spread examples and inserter UI shared by public/admin screens. */

.spread-remove,
.btn-remove-spread {
  padding: 6px 10px;
  border-radius: var(--fx-radius-pill, 999px) !important;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--fx-card);
  color: var(--bs-danger);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  min-width: 80px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.spread-remove:hover,
.btn-remove-spread:hover {
  background: var(--fx-card);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  color: color-mix(in srgb, var(--bs-danger), black 6%);
}

.turn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ink-secondary);
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.turn-arrow:hover {
  background-color: color-mix(in srgb, var(--surface), black 5%);
  text-decoration: none;
}

.spread-card {
  border-radius: var(--fx-radius);
  border: 1px solid var(--fx-border);
  background: var(--fx-card);
  padding: 16px 18px 18px;
  margin-bottom: 24px;
  box-shadow: var(--fx-shadow-lg);
}

.spread-card + .spread-card {
  margin-top: 24px;
}

.spread-card.extra-spread {
  background: var(--fx-extra-bg);
  border-color: var(--fx-extra-border);
  box-shadow: 0 0 0 1px rgba(160, 139, 255, .25), 0 6px 20px rgba(0, 0, 0, .08);
}

.spread-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.spread-head-main {
  flex: 1;
  min-width: 0;
}

.spread-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.spread-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--surface);
  font-weight: 800;
  font-size: .9rem;
}

.spread-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bs-body-color);
}

.spread-meta {
  margin-top: 2px;
  font-size: 0.9rem;
  color: var(--fx-muted);
}

.spread-desc {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--bs-body-color);
}

.spread-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--fx-radius-pill, 999px);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.spread-badge-extra {
  background: var(--fx-extra-accent);
  color: var(--surface);
}

.spread-badge-included,
.badge-included {
  background: var(--fx-included-bg) !important;
  color: var(--fx-included-color) !important;
}

.spread-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.pill-badge,
.spread-price-pill,
.price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 6px 10px;
  border-radius: var(--fx-radius-pill);
  border: 1px solid rgba(0, 0, 0, .06);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  line-height: 1;
}

.spread-price-pill,
.price-badge {
  text-align: right;
}

.spread-head-side .btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.spread-head-side [data-remove-turn],
.spread-head-side .btn[data-remove-turn],
.spread-head-side .btn.btn-outline-danger[data-remove-turn],
.spread-head-side .btn.btn-sm[data-remove-turn] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 80px !important;
  padding: 6px 10px !important;
  border-radius: var(--fx-radius-pill) !important;
  border: 1px solid rgba(0, 0, 0, .06) !important;
  background: var(--surface) !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06) !important;
  color: var(--bs-danger) !important;
  transition: transform .12s ease, box-shadow .12s ease;
}

.spread-head-side [data-remove-turn]:hover,
.spread-head-side .btn[data-remove-turn]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  background: var(--surface) !important;
  color: color-mix(in srgb, var(--bs-danger), black 6%) !important;
  border-color: rgba(0, 0, 0, .06) !important;
}

.spread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.spread-actions .btn {
  padding: 6px 8px;
}

.spread-body {
  padding: 12px 14px;
  margin-top: 6px;
}

@media (max-width: 767.98px) {
  .spread-card {
    padding: 14px 12px 16px;
  }

  .spread-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .spread-head-side {
    align-items: flex-start;
  }
}

.tips {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--fx-radius);
  padding: 12px 14px;
}

.spread-example-label {
  font-weight: 600;
  margin-bottom: 8px;
}

.spread-gallery-wrap {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.spread-gallery {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-behavior: smooth;
}

.spread-example-img {
  flex: 0 0 220px;
  border-radius: var(--fx-image-radius);
  background: var(--surface-2);
  object-fit: cover;
  height: 140px;
  box-shadow: var(--fx-image-shadow);
}

.spread-gallery-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: center;
}

.spread-nav-btn {
  width: 42px;
  height: 32px;
  border-radius: var(--fx-radius-pill, 999px);
  border: 1px solid var(--fx-border);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spread-nav-btn:hover {
  background: color-mix(in srgb, var(--fx-card), black 3%);
}

.spread-comment {
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--fx-border);
  font-size: 0.9rem;
}

.tips-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.tips-scroll::-webkit-scrollbar {
  height: 8px;
}

.tip-item {
  flex: 0 0 calc((100% - 12px) / 2);
  scroll-snap-align: start;
}

@media (min-width: 992px) {
  .tip-item {
    flex-basis: calc((100% - 3 * 12px) / 4);
  }
}

.tip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--fx-image-radius);
}

.tip-caption {
  line-height: 1.25;
}

.spread-tips .tips-scroll {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.spread-tips .tips-scroll.tips-scroll--wrap {
  flex-wrap: wrap;
  overflow-x: hidden;
  scroll-snap-type: none;
}

.spread-tips .tips-scroll.tips-scroll--wrap .tip-item {
  width: 220px;
  max-width: 220px;
}

.spread-tips .tips-scroll.tips-scroll--wrap .tip-img {
  width: 100%;
}

.spread-tips .tips-scroll::-webkit-scrollbar {
  height: 8px;
}

.spread-tips .tip-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.spread-tips .tip-img {
  display: block;
  height: 140px;
  width: auto;
  object-fit: cover;
  border-radius: var(--fx-image-radius);
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .08);
}

@media (min-width: 992px) {
  .spread-tips .tip-img {
    height: 140px;
  }
}

.spread-types-inline {
  margin-top: 1rem;
  scroll-margin-top: 2rem;
}

.spread-types-inline .card-2025 {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spread-inserter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
}

.spread-inserter-line {
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .12), rgba(0, 0, 0, .06));
}

.spread-inserter-cta {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  padding: .5rem .75rem;
  text-align: center;
}

.btn-add-spread {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: 999px;
  padding-inline: 1rem 1.1rem;
  font-weight: 600;
  position: relative;
}

.btn-add-spread .btn-plus {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  line-height: 1;
  font-size: 1rem;
}

.btn-add-spread::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(13, 110, 253, .25);
  animation: spreadPulse 2.6s ease-out infinite;
  pointer-events: none;
  opacity: .8;
}

@keyframes spreadPulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, .25); }
  70% { box-shadow: 0 0 0 14px rgba(13, 110, 253, 0); }
  100% { box-shadow: 0 0 0 14px rgba(13, 110, 253, 0); }
}

@media (max-width: 576px) {
  .spread-inserter {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .spread-inserter-line {
    display: none;
  }

  .spread-inserter-cta {
    width: 100%;
    border-radius: 16px;
  }

  .btn-add-spread {
    width: 100%;
    justify-content: center;
    padding-block: .625rem;
  }
}
