/*
 * Template previews (PRD section 13.7, DESIGN.md section 14). Each preview
 * is a miniature page drawn from assets/js/template-previews.js in the
 * template's own palette. Sizes use container query units (cqw), so one
 * drawing scales from a mosaic tile to the quick view without change.
 * Site pages only: no template loads this file.
 */

.tp-frame {
  container-type: inline-size;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
}

.tp {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 2.4cqw;
  padding-bottom: 3cqw;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff);
  line-height: 1.1;
  text-align: left;
  pointer-events: none;
}

.tp i,
.tp b {
  display: block;
  font-style: normal;
}

/* Header bar */
.tp-bar {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  flex: 0 0 auto;
  padding: 2.2cqw 4cqw;
  border-bottom: 1px solid var(--ln);
}

.tp-bar-fill {
  border-bottom: 0;
}

.tp-logo {
  font-family: var(--fd);
  font-size: 2.8cqw;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tp-nav {
  display: flex;
  gap: 1.6cqw;
  margin-left: auto;
}

.tp-nav i {
  width: 6cqw;
  height: 0.9cqw;
  border-radius: 1cqw;
  background: var(--mu);
  opacity: 0.5;
}

.tp-nav-light i {
  background: #f5ecd9;
}

/* Text */
.tp-h {
  font-family: var(--fd);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
  overflow: hidden;
}

.tp-light { font-weight: 300; }
.tp-italic { font-style: italic !important; font-weight: 400; }
.tp-upper { text-transform: uppercase; letter-spacing: 0; }

.tp-num {
  font-family: var(--fd);
  font-size: 3cqw;
  font-weight: 700;
  white-space: nowrap;
}

.tp-l {
  height: 1cqw;
  flex: 0 0 auto;
  border-radius: 1cqw;
  background: var(--mu);
  opacity: 0.4;
}

.tp-l-ac { background: var(--ac); opacity: 1; }
.tp-l-link { background: var(--ac); opacity: 0.8; }

.tp-rule {
  height: 1px;
  width: 100%;
  background: var(--ln);
}

/* Structure */
.tp-pad { padding: 0 4cqw; flex: 0 0 auto; }
.tp-body {
  display: flex;
  gap: 2.4cqw;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 4cqw;
}
.tp-flush { padding: 0; }
.tp-row { display: flex; align-items: center; gap: 2cqw; min-width: 0; }
.tp-wrap { flex-wrap: wrap; }
.tp-col { display: flex; flex-direction: column; gap: 1.6cqw; flex: 1; min-width: 0; min-height: 0; }
.tp-gap-s { gap: 1cqw; }
.tp-gap-m { gap: 2cqw; }
.tp-center { align-items: center; text-align: center; }
.tp-center-all { align-items: center; justify-content: center; }
.tp-grid {
  display: grid;
  grid-template-columns: repeat(var(--c, 3), minmax(0, 1fr));
  gap: 1.6cqw;
  flex: 1;
  min-height: 0;
}
.tp-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2cqw 4cqw;
}

.tp-card {
  min-width: 0;
  background: var(--sf);
  border: 1px solid var(--ln);
  border-radius: var(--r);
}

.tp-padded { padding: 1.8cqw; }
.tp-wide { width: 70%; padding: 4cqw; }
.tp-offset { box-shadow: 0.8cqw 0.8cqw 0 var(--ink); border: 0.4cqw solid var(--ink); }
.tp-tilt { transform: rotate(2deg); }

.tp-rail {
  display: flex;
  flex-direction: column;
  gap: 1.4cqw;
  flex: 0 0 20cqw;
  padding: 2.5cqw;
  background: var(--sf);
  border-right: 1px solid var(--ln);
}

.tp-rail-plain {
  background: transparent;
  border: 0;
  padding: 0;
  flex-basis: 14cqw;
}

/* Controls */
.tp-btn {
  width: 11cqw;
  height: 3.6cqw;
  flex: 0 0 auto;
  border-radius: var(--r);
  background: var(--ac);
}

.tp-btn-ghost { background: transparent; border: 1px solid var(--mu); }
.tp-btn-a2 { background: var(--a2); }
.tp-btn-ink { background: var(--ink); }

.tp-input {
  height: 3.6cqw;
  border: 1px solid var(--ln);
  border-radius: var(--r);
  background: var(--sf);
}

.tp-input-big { width: 100%; height: 5cqw; border-radius: 3cqw; box-shadow: 0 0.6cqw 2cqw rgba(36, 26, 74, 0.12); }

.tp-chip {
  width: 8cqw;
  height: 2.6cqw;
  border: 1px solid var(--ln);
  border-radius: var(--r);
  background: var(--sf);
}

.tp-pill { width: 18cqw; height: 2.6cqw; border-radius: 2cqw; }
.tp-tag { width: 10cqw; height: 1.2cqw; }
.tp-dot { width: 3.4cqw; height: 3.4cqw; border-radius: 50%; flex: 0 0 auto; }
.tp-sw { width: 3.6cqw; height: 3.6cqw; border-radius: 50%; border: 1px solid var(--ln); }
.tp-slot { flex: 1; height: 3.4cqw; border: 1px solid var(--ln); border-radius: var(--r); background: var(--bg); }
.tp-slot-round { border-radius: 3cqw; }
.tp-avatar { width: 4cqw; height: 4cqw; border-radius: 50%; background: var(--a2); flex: 0 0 auto; }
.tp-count { width: 4cqw; height: 2.4cqw; border-radius: 1cqw; background: var(--ac); opacity: 0.85; }
.tp-tab { width: 14cqw; height: 3cqw; border: 1px solid var(--ln); border-radius: var(--r); }
.tp-tab-on { background: var(--ac); border-color: var(--ac); }

.tp-img {
  min-height: 4cqw;
  border-radius: var(--r);
  background: var(--sf);
  border: 1px solid var(--ln);
}

.tp-progress {
  height: 1.8cqw;
  border-radius: 1cqw;
  background: var(--ln);
  overflow: hidden;
}

.tp-progress i { height: 100%; background: var(--a2); }

/* Signature shapes, one or two per template */
.tp-board {
  display: flex;
  gap: 1.2cqw;
  height: 100%;
  padding: 1.6cqw;
}

.tp-chip-card {
  height: 4.6cqw;
  border-radius: calc(var(--r) * 0.7);
  background: var(--sf);
  border: 1px solid var(--ln);
  border-left: 0.6cqw solid var(--ac);
}

.tp-code {
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  padding: 2cqw;
  border-radius: var(--r);
  background: var(--a2);
}

.tp-code .tp-l { background: #9fb3aa; opacity: 0.8; }
.tp-code .tp-l:nth-child(2) { background: var(--ac); }

.tp-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  background: radial-gradient(circle at 50% 40%, #fffdf8, var(--sf));
}

.tp-mug {
  width: 14cqw;
  height: 14cqw;
  border-radius: 1cqw 1cqw 4cqw 4cqw;
  background: var(--ac);
  box-shadow: inset -2cqw 0 0 rgba(0, 0, 0, 0.12);
  position: relative;
}

.tp-mug::after {
  content: "";
  position: absolute;
  right: -4cqw;
  top: 3cqw;
  width: 5cqw;
  height: 7cqw;
  border: 1.4cqw solid var(--ac);
  border-left: 0;
  border-radius: 0 3cqw 3cqw 0;
}

.tp-thumb { flex: 1; height: 5cqw; border-radius: var(--r); background: var(--sf); border: 1px solid var(--ln); }

.tp-band {
  height: 1.6cqw;
  width: 40%;
  background: linear-gradient(90deg, var(--ac), var(--a2));
}

.tp-arch {
  flex: 0 0 26cqw;
  border-radius: 13cqw 13cqw 0 0;
  background: linear-gradient(180deg, var(--a2), #2b5140);
  border: 0.8cqw solid #d8ae5e;
}

.tp-menu {
  display: flex;
  align-items: center;
  gap: 1cqw;
  font-size: 1.8cqw;
  font-family: var(--fd);
}

.tp-menu .tp-l { background: var(--ink); opacity: 0.7; }
.tp-dots { flex: 1; border-bottom: 0.3cqw dotted var(--mu); }

.tp-house {
  flex: 0 0 12cqw;
  height: 9cqw;
  border-radius: var(--r);
  background: linear-gradient(160deg, #cfdcd6 0 55%, #b9c9a8 55%);
  position: relative;
}

.tp-map {
  flex: 0 0 40%;
  position: relative;
  border-radius: var(--r);
  background:
    linear-gradient(90deg, transparent 48%, #e8dfcd 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 58%, #e8dfcd 58% 62%, transparent 62%),
    #efe9dd;
  border: 1px solid var(--ln);
}

.tp-pin {
  position: absolute;
  width: 2.6cqw;
  height: 2.6cqw;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--ac);
}

.tp-pin:nth-child(2) { background: var(--a2); }

.tp-sticker {
  flex: 0 0 auto;
  padding: 1.6cqw 2cqw;
  background: var(--ac);
  color: var(--ink);
  font-family: var(--fd);
  font-size: 2.4cqw;
  font-weight: 900;
  transform: rotate(-6deg);
  border: 0.4cqw solid var(--ink);
}

.tp--course .tp-btn { background: var(--ink); }
.tp--course .tp-card { background: var(--ac); }
.tp--course .tp-card:nth-child(2) { background: var(--sf); }

.tp-sheet {
  display: flex;
  flex-direction: column;
  gap: 1.4cqw;
  flex: 1;
  margin: 3cqw 10cqw 0;
  padding: 3.4cqw 4cqw;
  background: var(--sf);
  box-shadow: 0 1cqw 3cqw rgba(27, 42, 74, 0.18);
}

.tp-sheet .tp-chip { width: 7cqw; background: var(--a2); border: 0; }

.tp-leaf {
  width: 5cqw;
  height: 5cqw;
  border-radius: 0 60% 0 60%;
  background: var(--ac);
}

.tp--waitlist .tp-l:last-child { background: var(--a2); opacity: 1; }

.tp-steps { display: flex; gap: 1cqw; margin-left: auto; }
.tp-steps i { width: 6cqw; height: 0.9cqw; border-radius: 1cqw; background: var(--ln); }
.tp-steps i.on { background: var(--ac); }

.tp-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.8cqw;
  height: 100%;
}

.tp-chart i { flex: 1; border-radius: 0.4cqw 0.4cqw 0 0; background: var(--ac); opacity: 0.85; }
.tp-chart i:nth-child(3n) { background: var(--a2); }

.tp-tiles {
  flex: 0 0 34cqw;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1cqw;
  align-content: center;
}

.tp-tiles i { aspect-ratio: 1; }
.tp-tiles i.tri { background: linear-gradient(135deg, var(--t) 50%, transparent 50%); }

.tp-hero-wash {
  flex: 0 0 auto;
  background: linear-gradient(180deg, #e7e0ff, var(--bg));
}

.tp-hero-wash .tp-bar { border-bottom: 0; }

.tp-banner {
  padding: 2.4cqw;
  border-radius: var(--r);
  background: linear-gradient(120deg, var(--a2), #3a3369);
}
