/* Template editor component styles (shared, non-tailwind utility styles) */

.te-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 1.5rem;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.te-slider:focus {
  outline: none;
}

.te-slider::-webkit-slider-runnable-track {
  height: 0.9rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: var(--te-slider-track, #e2e8f0);
}

.te-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.35rem;
  height: 1.15rem;
  margin-top: -0.14rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(15, 23, 42, 0.78);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3);
}

.te-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.24), 0 1px 2px rgba(15, 23, 42, 0.22);
}

.te-slider::-moz-range-track {
  height: 0.9rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: var(--te-slider-track, #e2e8f0);
}

.te-slider::-moz-range-progress {
  height: 0.9rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
}

.te-slider::-moz-range-thumb {
  width: 0.35rem;
  height: 1.15rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(15, 23, 42, 0.78);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3);
}

.te-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.24), 0 1px 2px rgba(15, 23, 42, 0.22);
}

.te-slider--alpha-overlay::-webkit-slider-runnable-track {
  height: 0.9rem;
  border: 1px solid transparent;
  background: transparent;
}

.te-slider--alpha-overlay::-webkit-slider-thumb {
  margin-top: -0.2rem;
}

.te-slider--alpha-overlay::-moz-range-track {
  height: 0.9rem;
  border: 1px solid transparent;
  background: transparent;
}

.te-slider--alpha-overlay::-moz-range-progress {
  height: 0.9rem;
  border: 1px solid transparent;
  background: transparent;
}

.te-skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 40%, #e2e8f0 80%);
  background-size: 220% 100%;
  animation: te-skeleton-shimmer 1.3s linear infinite;
}

.te-parent-panel-highlight {
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 0 0 / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 0 100% / 100% 1px no-repeat,
    repeating-linear-gradient(0deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 0 0 / 1px 100% no-repeat,
    repeating-linear-gradient(0deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 100% 0 / 1px 100% no-repeat;
  animation: te-parent-panel-dash 1.2s linear infinite;
}

.te-helper-outline {
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 0 0 / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 0 100% / 100% 1px no-repeat,
    repeating-linear-gradient(0deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 0 0 / 1px 100% no-repeat,
    repeating-linear-gradient(0deg, rgba(16, 185, 129, 0.48) 0 7px, transparent 7px 14px) 100% 0 / 1px 100% no-repeat;
  animation: te-parent-panel-dash 1.2s linear infinite;
}

.te-grid-guide-cell {
  border-radius: 6px;
  position: relative;
}

.te-grid-runtime-overlay {
  opacity: 0;
  transition: opacity 90ms ease-out;
}

.te-grid-runtime-overlay--active {
  opacity: 1;
}

.te-grid-runtime-drop-cell {
  transition: background-color 80ms ease-out, box-shadow 80ms ease-out;
}

.te-grid-runtime-drop-cell--active {
  background-color: color-mix(in srgb, #0ea5e9 24%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #0ea5e9 70%, transparent);
}

.te-grid-runtime-drop-cell--active-span {
  background-color: color-mix(in srgb, #0ea5e9 15%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #0ea5e9 58%, transparent);
}

.te-grid-runtime-drop-cell--blocked {
  background-color: color-mix(in srgb, #dc2626 28%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #dc2626 82%, transparent);
}

.te-grid-center-anchor--runtime {
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms ease-out;
}

.te-grid-runtime-drop-cell--active .te-grid-center-anchor--runtime {
  opacity: 1;
}

.te-grid-guide-span {
  border-radius: 8px;
  position: relative;
  z-index: 2;
  background-color: transparent;
  pointer-events: none;
}

.te-grid-drop-target {
  background-color: color-mix(in srgb, #0ea5e9 12%, transparent);
}

.te-grid-drop-target--candidate {
  background-color: color-mix(in srgb, #0ea5e9 22%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #0ea5e9 60%, transparent);
    min-height: 50px;
    min-width:50px;
}

.te-grid-drop-target--blocked {
  background-color: color-mix(in srgb, #dc2626 30%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #dc2626 90%, transparent);
}

/* Table mode previews should look like the auto-grid dashed ghost and sit inset from cell borders. */
[data-te-grid-mode='table'] .te-grid-drop-target--candidate,
[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--active,
[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--active-span,
[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--blocked {
  background-color: transparent;
  box-shadow: none;
}

[data-te-grid-mode='table'] .te-grid-drop-target--candidate::after,
[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--active::after,
[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--active-span::after,
[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--blocked::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  pointer-events: none;
}

[data-te-grid-mode='table'] .te-grid-drop-target--candidate::after {
  border: 1px dashed color-mix(in srgb, #0ea5e9 54%, transparent);
  background: color-mix(in srgb, #bae6fd 12%, transparent);
}

[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--active-span::after {
  border: 1px dashed color-mix(in srgb, #0ea5e9 58%, transparent);
  background: color-mix(in srgb, #bae6fd 15%, transparent);
}

[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--active::after {
  border: 2px dashed color-mix(in srgb, #0ea5e9 80%, transparent);
  background: color-mix(in srgb, #bae6fd 22%, transparent);
}

[data-te-grid-mode='table'] .te-grid-runtime-drop-cell--blocked::after {
  border: 2px dashed color-mix(in srgb, #dc2626 86%, transparent);
  background: color-mix(in srgb, #fecaca 24%, transparent);
}

.te-grid-center-anchor {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  z-index: 10001;
}

.te-grid-assign-target {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, #0ea5e9 78%, transparent);
  background: color-mix(in srgb, #0ea5e9 16%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, #0369a1 34%, transparent);
  overflow: visible;
  z-index: 10002;
}

.te-grid-assign-target--idle {
  width: 28px;
  height: 28px;
  border-color: color-mix(in srgb, #0ea5e9 44%, transparent);
  background: color-mix(in srgb, #0ea5e9 10%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, #0369a1 20%, transparent);
  animation: te-grid-idle-pulse 900ms ease-in-out infinite;
}

.te-grid-assign-dot {
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #0ea5e9 72%, transparent);
}

.te-grid-assign-target--active::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, #0ea5e9 78%, transparent);
  transform: rotate(-90deg);
  clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 0, 50% 0);
  animation: te-grid-assign-progress var(--te-grid-assign-duration, 500ms) linear forwards;
}

.te-grid-assign-target--blocked {
  border-color: color-mix(in srgb, #dc2626 88%, transparent);
  background: color-mix(in srgb, #dc2626 38%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, #dc2626 52%, transparent);
}

.te-grid-assign-target--blocked::before {
  border-color: color-mix(in srgb, #dc2626 92%, transparent);
}

.te-grid-assign-spinner {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 3px solid transparent;
  border-top-color: color-mix(in srgb, #0369a1 88%, transparent);
  animation: te-grid-assign-spin 0.7s linear infinite, te-grid-assign-fade-out 120ms ease-out var(--te-grid-assign-duration, 500ms) forwards;
}

.te-grid-assign-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, #0369a1 92%, transparent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: scale(0.85);
  animation: te-grid-assign-check-in 160ms ease-out var(--te-grid-assign-duration, 500ms) forwards;
}

.te-grid-assign-target--blocked .te-grid-assign-spinner {
  display: none;
}

.te-grid-assign-target--blocked .te-grid-assign-check {
  display: none;
  animation: none;
}

.te-grid-assign-label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-32%) translateY(0);
  white-space: nowrap;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.01em;
  background: color-mix(in srgb, #f8fafc 98%, transparent);
  border: 1px solid color-mix(in srgb, #0ea5e9 44%, transparent);
  box-shadow: 0 4px 10px rgb(15 23 42 / 0.22);
  opacity: 1;
  animation: none;
  z-index: 10003;
  pointer-events: none;
}

.te-grid-assign-target--armed .te-grid-assign-label {
  opacity: 1;
}

.te-grid-assign-target--armed {
  border-color: color-mix(in srgb, #16a34a 86%, transparent);
  background: color-mix(in srgb, #16a34a 68%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, #15803d 54%, transparent);
}

.te-grid-assign-target--armed::before {
  inset: -6px;
  border-color: color-mix(in srgb, #22c55e 88%, transparent);
  clip-path: none;
  animation: te-grid-assign-armed-ring 180ms ease-out forwards;
}

.te-grid-assign-target--armed .te-grid-assign-spinner {
  display: none;
}

.te-grid-assign-target--armed .te-grid-assign-check {
  opacity: 1;
  transform: scale(1);
  animation: none;
  color: #f0fdf4;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}

@keyframes te-grid-assign-progress {
  from {
    clip-path: polygon(50% 50%, 50% 0, 50% 0, 50% 50%, 50% 50%, 50% 50%, 50% 0);
  }
  to {
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 0, 50% 0);
  }
}

@keyframes te-grid-assign-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes te-grid-assign-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes te-grid-assign-check-in {
  from {
    opacity: 0;
    transform: scale(0.75);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes te-grid-idle-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

@keyframes te-grid-assign-armed-ring {
  from {
    opacity: 0.9;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.te-rich-text-display {
  display: contents;
  white-space: inherit;
}

.te-rich-text-display p,
.te-rich-text-display div,
.te-rich-text-editor p,
.te-rich-text-editor div {
  margin: 0;
}
.te-rich-text-display img.emoji, .te-rich-text-editor img.emoji {
  display: inline-block;
}

.te-rich-text-editor {
  display: contents;
}

.te-rich-text-editor .ProseMirror {
  caret-color: currentColor;
}

.te-rich-text-editor:focus {
  outline: none;
}

.te-rich-text-editor .te-rich-text-editor-content {
  min-height: inherit;
  height: inherit;
  width: 100%;
  outline: none;
  background: transparent;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: inherit;
  text-align: inherit;
  white-space: inherit;
}

.te-rich-text-editor .ProseMirror {
  min-height: inherit;
  height: inherit;
  width: 100%;
  flex: 1 1 auto;
  outline: none;
  display: flex;
  flex-direction: column;
  justify-content: inherit;
  text-align: inherit;
  white-space: inherit;
}

.te-rich-text-editor .selection {
  background: Highlight;
}

.te-simple.te-handlebars-token{
    background: color-mix(in srgb, #14b8a6 22%, transparent);
}

.te-rich-text-editor .te-handlebars-token,
.te-rich-text-display .te-handlebars-token {
  background: color-mix(in srgb, #14b8a6 22%, transparent);
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, #0f766e 70%, transparent);
}

.te-rich-text-editor .te-handlebars-token--helper,
.te-rich-text-display .te-handlebars-token--helper {
  background: color-mix(in srgb, #6366f1 18%, transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, #4338ca 70%, transparent);
}

.te-rich-text-editor .te-handlebars-token--close,
.te-rich-text-display .te-handlebars-token--close {
  background: color-mix(in srgb, #6366f1 18%, transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, #4338ca 70%, transparent);
}

.te-rich-text-editor .te-handlebars-token--helper-keyword,
.te-rich-text-display .te-handlebars-token--helper-keyword {
  font-weight: 600;
}

@keyframes te-skeleton-shimmer {
  0% {
    background-position: 220% 0;
  }

  100% {
    background-position: -220% 0;
  }
}

@keyframes te-parent-panel-dash {
  to {
    background-position:
      14px 0,
      -14px 100%,
      0 14px,
      100% -14px;
  }
}

.te-runtime-drag-source-hidden {
  opacity: 0 !important;
}

.te-runtime-drag-proxy {
  pointer-events: none !important;
  user-select: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.te-runtime-drag-proxy [data-te-resize-handle],
.te-runtime-drag-proxy [data-te-rotate-handle="1"],
.te-runtime-drag-proxy [data-te-rotate-stem="1"],
.te-runtime-drag-proxy .te-helper-outline:not(.te-grid-guide-cell),
.te-runtime-drag-proxy .te-parent-panel-highlight {
  display: none !important;
}

#template-editor-shell.te-runtime-dragging [data-te-rotate-handle="1"] {
  opacity: 0 !important;
  pointer-events: none !important;
}

#template-editor-shell.te-runtime-dragging [data-te-rotate-stem="1"] {
  opacity: 0 !important;
}

#template-editor-shell.te-runtime-hide-grid-track-selectors [data-te-grid-track-selector-button="1"] {
  opacity: 0 !important;
  pointer-events: none !important;
}

[data-te-interaction-preview] {
  &[data-te-guide-kind] {
    --te-guide-line-width: 1px;
    --te-guide-line-style: dashed;
    z-index: 97;
    background: transparent;
    color: var(--te-guide-color);
  }

  &[data-te-guide-kind="center"] {
    --te-guide-color: rgba(14, 116, 144, 0.9);
    opacity: 0.92;
  }

  &[data-te-guide-kind="shape"] {
    --te-guide-color: rgba(5, 150, 105, 0.9);
    --te-guide-line-style: dotted;
    opacity: 0.9;
  }

  &[data-te-guide-kind="spacing"] {
    --te-guide-color: rgba(14, 116, 144, 0.85);
    opacity: 0.88;
  }

  &[data-te-guide-kind="spacing"][data-te-guide-emphasis="active"] {
    --te-guide-color: rgba(2, 132, 199, 0.98);
    --te-guide-line-width: 2px;
    opacity: 0.98;
  }

  &[data-te-interaction-preview="align-x"][data-te-guide-kind] {
    border-left: var(--te-guide-line-width) var(--te-guide-line-style) var(--te-guide-color);
  }

  &[data-te-interaction-preview="align-y"][data-te-guide-kind] {
    border-top: var(--te-guide-line-width) var(--te-guide-line-style) var(--te-guide-color);
  }
}

[data-te-guide-arrow] {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

[data-te-guide-label="1"] {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border: 1px solid var(--te-guide-color);
  border-radius: 4px;
  background: rgba(248, 250, 252, 0.95);
  color: rgba(15, 23, 42, 0.88);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

[data-te-guide-axis="x"] {
  & [data-te-guide-arrow] {
    left: 50%;
    transform: translateX(-50%);
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
  }

  & [data-te-guide-arrow="start"] {
    top: -5px;
    border-bottom: 5px solid currentColor;
  }

  & [data-te-guide-arrow="end"] {
    bottom: -5px;
    border-top: 5px solid currentColor;
  }

  & [data-te-guide-label="1"] {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
  }
}

[data-te-guide-axis="y"] {
  & [data-te-guide-arrow] {
    top: 50%;
    transform: translateY(-50%);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
  }

  & [data-te-guide-arrow="start"] {
    left: -5px;
    border-right: 5px solid currentColor;
  }

  & [data-te-guide-arrow="end"] {
    right: -5px;
    border-left: 5px solid currentColor;
  }

  & [data-te-guide-label="1"] {
    left: 50%;
    top: -16px;
    transform: translateX(-50%);
  }
}

[data-te-guide-emphasis="active"] {
  & [data-te-guide-label="1"] {
    background: rgba(224, 242, 254, 0.97);
    color: rgba(12, 74, 110, 0.98);
  }
}

.te-extra-css-readonly-line {
    background-color: rgba(148, 163, 184, 0.14);
    opacity: 0.8;
}

.stock-photo-query-host {
    container-name: stock-photo-gallery;
    container-type: inline-size;
    position: relative;
}

.stock-photo-mosaic {
    display: grid;
    --stock-photo-cols: 2;
    --stock-photo-gap-size: 0.5rem;
    --stock-photo-gap-total: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 8px;
    gap: 0.5rem;
    --stock-photo-row-size: 8px;
    align-items: start;
    grid-auto-flow: dense;
}

.stock-photo-mosaic--loading {
    align-content: start;
}

.stock-photo-card {
    position: relative;
    min-width: 0;
    min-height:180px;
    --stock-photo-tile-width: calc((100cqw - var(--stock-photo-gap-total, 0.5rem)) / var(--stock-photo-cols, 2));
    --stock-photo-row-span: clamp(6, calc(((var(--stock-photo-tile-width) / var(--stock-photo-aspect, 1)) + var(--stock-photo-gap-size, 0.5rem)) / (var(--stock-photo-row-size, 8px) + var(--stock-photo-gap-size, 0.5rem))), 72);
    grid-column-end: span var(--stock-photo-col-span, 1);
    grid-row-end: span var(--stock-photo-row-span);
}

.stock-photo-card--loading {
    border-radius: 1rem;
}

.stock-photo-card-button,
.stock-photo-card-frame,
.stock-photo-card-image {
    width: 100%;
    height: 100%;
}

.stock-photo-card-button {
    display: block;
}

.stock-photo-card-frame {
    position: relative;
}

.stock-photo-card-image {
    display: block;
}

@container stock-photo-gallery (min-width: 42rem) {
    .stock-photo-mosaic {
        --stock-photo-cols: 3;
        --stock-photo-gap-size: 0.6rem;
        --stock-photo-gap-total: 1.2rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 8px;
        gap: 0.6rem;
    }
}

@container stock-photo-gallery (min-width: 56rem) {
    .stock-photo-mosaic {
        --stock-photo-cols: 4;
        --stock-photo-gap-size: 0.625rem;
        --stock-photo-gap-total: 1.875rem;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 8px;
        gap: 0.625rem;
    }
}

.grid-bg-layer[data-te-grid-track-overlay="1"]{
    z-index: 44 !important;
}

.grid-bg-layer{
    display:grid;
    /*position: absolute;*/
    /*inset:0;*/
    grid-template-rows: subgrid;
    grid-template-columns: subgrid;
    column-gap: inherit;
    row-gap: inherit;
    grid-column: 1/-1;
    grid-row: 1/-1;
    pointer-events: none;
}
.grid-bg-layer>*{
    user-select: none;
}

.grid-bg-layer>.te-grid-track.te-row{
    grid-row:var(--te-track-num);
    grid-column:1/-1;
}
.grid-bg-layer>.te-grid-track.te-col{
    grid-column:var(--te-track-num);
    grid-row:1/-1;
}

[data-te-block-type="Shape"][data-te-polygon="1"]{
    background:transparent !important;
}

[data-te-image-placeholder='1']>[data-te-target='b_surface']{
    height:100% !important;
}
