:root {
  --hero-font-display: "Nanum Myeongjo", Georgia, serif;
  --hero-font-accent: "Cormorant Garamond", Georgia, serif;
  --hero-font-mono: "DM Mono", ui-monospace, monospace;
  --hero-font-body: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --hero-coral: #e45558;
  --hero-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Shared hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
  color: var(--hero-text);
  background: var(--cream, #ede6dc);
  text-align: center;
  transition: background-color 180ms ease, color 180ms ease;
}

.hero--partial-background::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: var(--hero-band-height, 42%);
  background: var(--hero-bg);
  pointer-events: none;
  transition: height 180ms ease, background-color 180ms ease;
}

.hero--partial-background > * {
  position: relative;
  z-index: 1;
}

.hero,
.hero * {
  box-sizing: border-box;
}

.hero img,
.hero-photo-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo-placeholder {
  background: var(--hero-coral);
}

/* Host drag-to-reposition: the live hero (while the edit pane is open) and the
   edit pane thumbnail, which is the only handle available on mobile. */
.focal-draggable {
  cursor: grab;
  touch-action: none;
}

.focal-draggable.is-dragging {
  cursor: grabbing;
}

.focal-draggable img {
  user-select: none;
  -webkit-user-drag: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  color: var(--hero-text);
}

.hero-title {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  color: var(--hero-text);
  font-family: var(--hero-font-display);
  font-size: clamp(1.8rem, 5.5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-shadow: none;
  text-wrap: balance;
  text-wrap: pretty;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  box-sizing: border-box;
  hyphens: manual;
}

.hero-title-edit-btn {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  vertical-align: top;
  border: 0;
  border-radius: 0;
  color: var(--hero-text);
  background: transparent;
  opacity: 0.55;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transform: translateY(0.15em);
}

.hero-title-edit-btn:hover {
  color: var(--hero-accent, var(--hero-text));
  opacity: 1;
}

.hero-title-edit-btn:focus-visible {
  outline: 2px solid #e45558;
  outline-offset: 3px;
}

.hero-title__part {
  display: block;
  width: 100%;
}

.hero-title__amp-block {
  display: block;
  width: 100%;
  margin: 0.08em 0;
}

.hero-title__amp {
  display: inline-block;
  margin: 0 0.06em;
  color: var(--hero-accent, var(--hero-text));
  font-family: var(--hero-font-accent);
  font-style: italic;
  font-weight: 600;
  transform: translateY(0.02em);
}

.hero-subtitle {
  max-width: 34ch;
  width: 100%;
  margin: 12px auto 0;
  color: var(--hero-text);
  font-family: var(--hero-font-display);
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
  text-shadow: none;
  text-wrap: balance;
  text-wrap: pretty;
  overflow-wrap: break-word;
  word-break: normal;
  box-sizing: border-box;
}

.hero-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 18px 0 0;
  color: var(--hero-soft);
  font-family: var(--hero-font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: none;
}

.hero-date__line {
  width: 26px;
  height: 1px;
  flex: 0 0 auto;
  background: var(--hero-line);
}

.hero-welcome {
  max-width: 34ch;
  margin: 42px auto 0;
  color: var(--hero-text);
  font-family: var(--hero-font-accent);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
  text-shadow: none;
  text-wrap: balance;
  white-space: pre-line;
}

/* Host and guest render the same hero component. Keep typography parity
   explicit so page-level theme rules cannot make either version drift. */
body.registry-page .hero-title,
body.host-registry-page .hero-title,
body.registry-page .hero-subtitle,
body.host-registry-page .hero-subtitle {
  font-family: var(--hero-font-display);
  font-style: normal;
  font-weight: 400;
}

body.registry-page .hero-title__amp,
body.host-registry-page .hero-title__amp {
  font-family: var(--hero-font-accent);
  font-size: inherit;
  font-style: italic;
  font-weight: 600;
  line-height: inherit;
}

body.registry-page .hero-date,
body.host-registry-page .hero-date {
  font-family: var(--hero-font-mono);
  font-style: normal;
  font-weight: 500;
}

body.registry-page .hero-welcome,
body.host-registry-page .hero-welcome {
  font-family: var(--hero-font-accent);
  font-style: italic;
  font-weight: 400;
}

/* ── Decorative frame styles ──────────────────────────────── */
.hero--frame {
  padding: 28px 20px 52px;
}

.hero-frame-layout {
  display: grid;
  grid-template-areas: "photo" "copy";
  justify-items: center;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-frame {
  --hero-frame-short-side: min(67vw, 360px);
  --hero-frame-long-side: min(86.832vw, 466.56px);
  position: relative;
  grid-area: photo;
  width: var(--hero-frame-short-side);
  height: var(--hero-frame-long-side);
  overflow: hidden;
  line-height: 0;
  -webkit-mask-image: url("../assets/hero_frames/frame-plaque.svg");
  mask-image: url("../assets/hero_frames/frame-plaque.svg");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.hero--frame-gem .hero-frame {
  --hero-frame-short-side: min(60.3vw, 324px);
  --hero-frame-long-side: min(86.832vw, 466.56px);
  -webkit-mask-image: url("../assets/hero_frames/frame-gem.svg");
  mask-image: url("../assets/hero_frames/frame-gem.svg");
}

.hero--frame-cartouche .hero-frame {
  -webkit-mask-image: url("../assets/hero_frames/frame-cartouche.svg");
  mask-image: url("../assets/hero_frames/frame-cartouche.svg");
}

.hero--landscape .hero-frame {
  width: var(--hero-frame-long-side);
  height: var(--hero-frame-short-side);
  -webkit-mask-image: url("../assets/hero_frames/frame-plaque-landscape.svg");
  mask-image: url("../assets/hero_frames/frame-plaque-landscape.svg");
}

.hero--frame-gem.hero--landscape .hero-frame {
  -webkit-mask-image: url("../assets/hero_frames/frame-gem-landscape.svg");
  mask-image: url("../assets/hero_frames/frame-gem-landscape.svg");
}

.hero--frame-cartouche.hero--landscape .hero-frame {
  -webkit-mask-image: url("../assets/hero_frames/frame-cartouche-landscape.svg");
  mask-image: url("../assets/hero_frames/frame-cartouche-landscape.svg");
}

.hero--frame .hero-copy {
  grid-area: copy;
  margin-top: 40px;
}

/* ── Full-image styles ────────────────────────────────────── */
.hero--full {
  padding-bottom: 48px;
}

.hero-full-media {
  position: relative;
  width: 100%;
  height: 484px;
  overflow: hidden;
}

.hero-full-photo {
  position: absolute;
  inset: 0;
}

.hero-photo-wrap--editable {
  cursor: pointer;
  outline: none;
}

.hero-photo-wrap--editable:hover img {
  opacity: 0.96;
}

.hero-photo-wrap--editable:focus-visible {
  outline: 2px solid #e45558;
  outline-offset: 3px;
}

.hero-photo-edit-btn {
  display: none !important;
}

.hero--full .hero-copy {
  padding: 28px 20px 0;
}

.hero--full .hero-title {
  font-size: clamp(2.55rem, 13vw, 3rem);
}

/* ── Desktop layouts ──────────────────────────────────────── */
/* ── Desktop layouts ──────────────────────────────────────── */
@media (min-width: 1025px) {
  .hero-title {
    max-width: 100%;
    font-size: clamp(2.2rem, 3.8vw, 4.2rem);
    line-height: 1.02;
  }

  .hero-subtitle {
    max-width: 52ch;
    margin-top: 14px;
    font-size: clamp(1.35rem, 2.2vw, 2.08rem);
  }

  .hero-date {
    gap: 14px;
    margin-top: 22px;
    font-size: 13px;
  }

  .hero-date__line {
    width: 34px;
  }

  .hero-welcome {
    max-width: 58ch;
    margin-top: 46px;
    font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  }

  .hero--frame {
    padding: 60px 72px;
  }

  .hero--portrait .hero-frame-layout {
    grid-template-columns: minmax(320px, 38%) minmax(0, 62%);
    grid-template-areas: "photo copy";
    column-gap: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
  }

  .hero--portrait .hero-frame {
    width: 360px;
  }

  .hero--frame-gem.hero--portrait .hero-frame {
    width: 324px;
    justify-self: center;
  }

  .hero--portrait .hero-copy {
    min-width: 0;
    width: 100%;
    margin-top: 0;
  }

  .hero--portrait .hero-title {
    max-width: 100%;
  }

  .hero--portrait .hero-subtitle,
  .hero--portrait .hero-welcome {
    max-width: 100%;
  }

  .hero--landscape .hero-frame-layout {
    grid-template-areas: "photo" "copy";
  }

  .hero--landscape .hero-frame {
    width: var(--hero-frame-long-side);
    height: var(--hero-frame-short-side);
  }

  .hero--landscape .hero-title {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
  }

  .hero--landscape .hero-copy {
    margin-top: 34px;
  }

  .hero--full {
    padding-bottom: 60px;
  }

  .hero-full-media {
    height: 456px;
  }

  .hero--full .hero-copy {
    padding: 32px 48px 0;
  }

  .hero--full .hero-title {
    font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  }

}

/* ── Large Desktop screens (>= 1440px) ────────────────────── */
@media (min-width: 1440px) {
  .hero-title {
    font-size: clamp(2.6rem, 3.6vw, 4.5rem);
  }
}

/* ── Tablet stacked layout breakpoint ─────────────────────── */
@media (max-width: 1024px) {
  .hero--portrait .hero-frame-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "copy";
    row-gap: 28px;
    justify-items: center;
    width: 100%;
  }

  .hero--portrait .hero-copy {
    width: 100%;
    max-width: 640px;
    margin-top: 0;
    text-align: center;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5.5vw, 3rem);
    line-height: 1.05;
    max-width: 100%;
  }
}

/* ── Mobile layout breakpoint ─────────────────────────────── */
@media (max-width: 600px) {
  .hero-title {
    font-size: clamp(1.5rem, 6.5vw, 2.2rem);
    line-height: 1.08;
    max-width: 100%;
  }
}

/* ── Host design controls ─────────────────────────────────── */
.hero-design-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(86, 16, 35, 0.12);
}

.wishlist-details-body > .wishlist-details-hero:first-child {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  column-gap: 18px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.hero-design-heading {
  grid-column: 1 / -1;
  margin-bottom: 14px;
  color: #561023;
  font-family: var(--hero-font-display);
  font-size: 1.05rem;
}

.hero-control-section {
  padding: 16px 0 4px;
  border-bottom: 1px solid rgba(86, 16, 35, 0.1);
}

.hero-control-section:last-child {
  border-bottom: 0;
}

.hero-control-section.is-disabled {
  opacity: 0.48;
}

.hero-control-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: rgba(86, 16, 35, 0.58);
  font-family: var(--hero-font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-style-option:focus-visible,
.hero-format-option:focus-visible,
.hero-swatch:focus-visible,
.hero-change-photo-btn:focus-visible {
  outline: 2px solid #e45558;
  outline-offset: 2px;
}

.hero-style-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-style-option {
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: flex-start;
  padding: 5px 8px;
  border: 1.5px solid rgba(86, 16, 35, 0.18);
  border-radius: 0;
  color: rgba(86, 16, 35, 0.72);
  background: #fff;
  cursor: pointer;
}

.hero-style-option.sel {
  border-color: #561023;
  color: #561023;
  box-shadow: 3px 3px 0 rgba(86, 16, 35, 0.16);
}

.hero-style-option__name {
  font-family: var(--hero-font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-align: left;
  text-transform: uppercase;
}

.hero-format-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hero-format-option {
  min-height: 40px;
  border: 1.5px solid rgba(86, 16, 35, 0.18);
  color: rgba(86, 16, 35, 0.7);
  background: #fff;
  font-family: var(--hero-font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.hero-format-option + .hero-format-option {
  border-left: 0;
}

.hero-format-option.sel {
  border-color: #e45558;
  color: #561023;
  background: color-mix(in oklab, #e45558 10%, #fff);
  font-weight: 700;
}

.hero-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px;
}

.hero-swatch {
  position: relative;
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(86, 16, 35, 0.16);
  cursor: pointer;
  transition: transform 110ms var(--hero-ease), box-shadow 110ms var(--hero-ease);
}

.hero-swatch:hover {
  transform: scale(1.1);
}

.hero-swatch.sel {
  z-index: 1;
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px #561023, 4px 5px 0 rgba(86, 16, 35, 0.2);
}

.hero-swatch.sel::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #561023;
  color: #fff;
  font-family: var(--hero-font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.hero-change-photo-btn {
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 1.5px solid rgba(86, 16, 35, 0.16);
  color: #561023;
  background: #fff;
  font-family: var(--hero-font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.hero-photo-control {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  width: 144px;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hero-photo-preview-stage {
  display: grid;
  width: 144px;
  height: 144px;
  flex: 0 0 144px;
  place-items: center;
}

#heroControls {
  display: contents;
}

#heroControls .hero-control-section:first-child {
  grid-column: 2;
  grid-row: 2;
  padding-top: 0;
  border-bottom: 0;
}

#heroControls .hero-control-section:nth-child(n + 2) {
  grid-column: 1 / -1;
}

.hero-photo-preview {
  --hero-preview-short-side: 111.111px;
  --hero-preview-long-side: 144px;
  position: relative;
  width: var(--hero-preview-short-side);
  height: var(--hero-preview-long-side);
  overflow: hidden;
  background: rgba(86, 16, 35, 0.06);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.hero-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo-preview img[hidden],
.hero-photo-preview__placeholder[hidden] {
  display: none;
}

.hero-photo-drag-hint {
  margin: 0;
  color: rgba(86, 16, 35, 0.56);
  font-family: var(--hero-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hero-photo-drag-hint[hidden] {
  display: none;
}

.hero-photo-preview__placeholder {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: rgba(86, 16, 35, 0.56);
  font-family: var(--hero-font-mono);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.hero-photo-preview--frame-plaque {
  -webkit-mask-image: url("../assets/hero_frames/frame-plaque.svg");
  mask-image: url("../assets/hero_frames/frame-plaque.svg");
}

.hero-photo-preview--frame-cartouche {
  -webkit-mask-image: url("../assets/hero_frames/frame-cartouche.svg");
  mask-image: url("../assets/hero_frames/frame-cartouche.svg");
}

.hero-photo-preview--frame-gem {
  --hero-preview-short-side: 100px;
  -webkit-mask-image: url("../assets/hero_frames/frame-gem.svg");
  mask-image: url("../assets/hero_frames/frame-gem.svg");
}

.hero-photo-preview--landscape {
  width: var(--hero-preview-long-side);
  height: var(--hero-preview-short-side);
}

.hero-photo-preview--frame-plaque.hero-photo-preview--landscape {
  -webkit-mask-image: url("../assets/hero_frames/frame-plaque-landscape.svg");
  mask-image: url("../assets/hero_frames/frame-plaque-landscape.svg");
}

.hero-photo-preview--frame-cartouche.hero-photo-preview--landscape {
  -webkit-mask-image: url("../assets/hero_frames/frame-cartouche-landscape.svg");
  mask-image: url("../assets/hero_frames/frame-cartouche-landscape.svg");
}

.hero-photo-preview--frame-gem.hero-photo-preview--landscape {
  -webkit-mask-image: url("../assets/hero_frames/frame-gem-landscape.svg");
  mask-image: url("../assets/hero_frames/frame-gem-landscape.svg");
}

.hero-photo-preview--full-image-hard-cut {
  width: 144px;
  height: 108px;
  -webkit-mask-image: none;
  mask-image: none;
}

.hero-photo-control .hero-change-photo-btn {
  width: fit-content;
  margin: 0;
  padding: 8px 10px;
  justify-self: start;
  font-size: 12px;
  letter-spacing: 0.08em;
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero-swatch {
    transition: none;
  }
}
