/* Interactive covers keep the original floating-card composition intact. */
.hero-art .hero-card-trigger {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  appearance: none;
  cursor: pointer;
  pointer-events: auto;
}

.hero-art .floating-tile > :not(.hero-card-trigger),
.hero-art .hero-card-trigger > *,
.hero-art .orbit,
.hero-art .art-glow,
.hero-art .orbit-point,
.hero-art .floating-caption {
  pointer-events: none;
}

.hero-art .floating-tile {
  outline: 1px solid transparent;
  outline-offset: 4px;
  transition: outline-color .18s ease;
}

@media (hover: hover) {
  .hero-art .floating-tile:hover {
    outline-color: rgba(103, 137, 157, .32);
  }
}

.hero-art .hero-card-trigger:focus-visible {
  outline: 2px solid #6688a1;
  outline-offset: 5px;
}

.hero-art .tile-front .front-copy {
  flex: 1;
  min-width: 0;
}

.hero-art .front-copy .front-kicker,
.hero-art .front-copy strong,
.hero-art .front-copy .front-sub {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-art .hero-photo-cover {
  width: 100%;
  height: 108px;
  margin-top: 25px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(199, 221, 232, .28);
}

.hero-art .hero-photo-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 64%;
}

.hero-art .hero-photo-caption {
  display: block;
  position: absolute;
  top: 17px;
  left: 21px;
  right: 21px;
  color: #5e7b8b;
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: .1px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-art [data-hero-card='note'] .tile-logo {
  color: var(--hero-accent, #62829b);
}

/* Detail and editing share one dialog, scoped away from the project editor. */
.hero-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: min(90dvh, 840px);
  padding: 34px 36px;
  color: #304955;
  background: linear-gradient(145deg, rgba(249, 249, 244, .94), rgba(228, 241, 246, .94));
  border-color: rgba(255, 255, 255, .8);
  box-shadow: 0 28px 80px rgba(65, 92, 108, .23), inset 0 1px 0 rgba(255, 255, 255, .72);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 140, 155, .35) transparent;
  -webkit-backdrop-filter: blur(22px);
}

.hero-dialog .hero-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-right: 34px;
}

.hero-dialog .hero-dialog-badge {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 14px;
  color: var(--hero-accent, #668598);
  background: linear-gradient(135deg, rgba(233, 243, 248, .9), rgba(190, 214, 225, .45));
  box-shadow: 0 6px 14px rgba(105, 135, 151, .08);
}

.hero-dialog .hero-dialog-badge svg {
  width: 22px;
  height: 22px;
}

.hero-dialog .hero-dialog-label {
  color: #617d8c;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 1.6px;
  overflow-wrap: anywhere;
}

.hero-dialog #hero-dialog-title {
  margin: 23px 0 9px;
  padding-right: 14px;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.hero-dialog .hero-dialog-subtitle {
  color: #617c8b;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hero-dialog .hero-detail-visual {
  margin: 23px 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(255, 255, 255, .26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.hero-dialog .palette-visual {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-dialog .hero-swatch {
  display: grid;
  min-width: 0;
  gap: 10px;
  text-align: center;
}

.hero-dialog .hero-swatch i {
  display: block;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 12px;
  box-shadow: 0 5px 12px rgba(91, 119, 136, .07);
}

.hero-dialog .hero-swatch span {
  color: #577181;
  font: 11px/1.6 'Consolas', monospace;
  overflow-wrap: anywhere;
}

.hero-dialog .photo-visual {
  padding: 10px;
}

.hero-dialog .photo-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62dvh;
  object-fit: contain;
  border-radius: 11px;
}

.hero-dialog .hero-editor-photo {
  height: 158px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 13px;
}

.hero-dialog .hero-editor-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 64%;
}

.hero-dialog .hero-detail-body {
  margin-top: 23px;
  color: #486372;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hero-dialog .hero-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.hero-dialog .hero-dialog-actions .primary-button,
.hero-dialog .hero-dialog-actions .secondary-button {
  min-height: 42px;
  font-size: 12px;
}

.hero-dialog .hero-editor-form {
  min-width: 0;
  margin-top: 22px;
}

.hero-dialog .hero-editor-form > .hero-field,
.hero-dialog .hero-editor-form > .hero-form-grid {
  margin-top: 16px;
}

.hero-dialog .hero-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.hero-dialog .hero-field {
  display: block;
  min-width: 0;
}

.hero-dialog .hero-field small {
  display: block;
  margin-top: 7px;
  color: #617c8b;
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.hero-dialog .hero-field > span,
.hero-dialog .hero-field > label,
.hero-dialog .hero-field label > span {
  display: block;
  margin: 0 0 8px;
  color: #577180;
  font-size: 12px;
  line-height: 1.6;
}

.hero-dialog .hero-field input:not([type='color']),
.hero-dialog .hero-field textarea,
.hero-dialog .hero-field select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(153, 181, 194, .3);
  border-radius: 11px;
  color: #375564;
  background: rgba(255, 255, 255, .46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
  font-size: 13px;
  line-height: 1.65;
  transition: border-color .18s ease, background-color .18s ease;
}

.hero-dialog .hero-field textarea {
  min-height: 108px;
  resize: vertical;
}

.hero-dialog .hero-field input::placeholder,
.hero-dialog .hero-field textarea::placeholder {
  color: #8095a0;
}

.hero-dialog .hero-field input:focus-visible,
.hero-dialog .hero-field textarea:focus-visible,
.hero-dialog .hero-field select:focus-visible {
  border-color: #8ba9ba;
  background-color: rgba(255, 255, 255, .65);
  outline: 2px solid #6688a1;
  outline-offset: 2px;
}

.hero-dialog .hero-color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-dialog .hero-field input[type='color'] {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(153, 181, 194, .3);
  border-radius: 11px;
  background: rgba(255, 255, 255, .46);
  cursor: pointer;
}

.hero-dialog .hero-field input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

.hero-dialog .hero-field input[type='color']::-webkit-color-swatch {
  border: 0;
  border-radius: 7px;
}

.hero-dialog .hero-field input[type='color']::-moz-color-swatch {
  border: 0;
  border-radius: 7px;
}

.hero-dialog .hero-color-grid output,
.hero-dialog .hero-color-grid small,
.hero-dialog .hero-color-value {
  display: block;
  margin-top: 7px;
  color: #577180;
  font: 11px/1.6 'Consolas', monospace;
  overflow-wrap: anywhere;
}

.hero-dialog .hero-section-label {
  display: block;
  margin: 22px 0 10px;
  color: #486573;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.hero-dialog .hero-editor-note,
.hero-dialog .hero-preview-note {
  margin-top: 12px;
  color: #617c8b;
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.hero-dialog .hero-form-error {
  margin-top: 13px;
  color: #a04e59;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.hero-dialog .hero-form-error:empty {
  display: none;
}

@media (max-width: 600px) {
  .hero-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 28px 22px;
    border-radius: 23px;
  }

  .hero-dialog #hero-dialog-title {
    font-size: 23px;
  }

  .hero-dialog .hero-form-grid,
  .hero-dialog .hero-color-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-dialog .palette-visual {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-dialog .hero-swatch i {
    height: 72px;
  }

  .hero-dialog .hero-detail-visual {
    padding: 14px;
  }

  .hero-dialog .hero-dialog-actions {
    gap: 8px;
  }

  .hero-dialog .hero-dialog-actions .primary-button,
  .hero-dialog .hero-dialog-actions .secondary-button {
    flex: 1 1 auto;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art .floating-tile,
  .hero-dialog .hero-field input,
  .hero-dialog .hero-field textarea,
  .hero-dialog .hero-field select {
    transition: none;
  }
}
