/* The selected colour belongs to the invitation, independently of its layout.
   Tint the decorative background only: uploaded photographs keep their colours. */
#invitation-preview[data-template]:not([data-template="sacred"]){background:linear-gradient(160deg,var(--design-mid),var(--design-deep));color:#faf1df}
#invitation-preview[data-template="velvet"]{background:radial-gradient(ellipse at 85% 0,#ffffff0c,transparent 45%),linear-gradient(160deg,var(--design-mid),var(--design-deep))}
#invitation-preview[data-template="moon"]{background:radial-gradient(circle at 18% 11%,#fff7 0 1px,transparent 2px) 0 0/67px 73px,linear-gradient(160deg,var(--design-mid),var(--design-deep))}
#invitation-preview[data-template="estate"]{background:repeating-linear-gradient(90deg,#ffffff05 0 1px,transparent 1px 18px),linear-gradient(160deg,var(--design-mid),var(--design-deep))}
#invitation-preview:is([data-template="silk"],[data-template="editorial"]){background:linear-gradient(160deg,var(--design-paper),var(--palette-wash));color:var(--design-ink)}
#invitation-preview[data-template="velvet"]{--template-art:url('assets/themes/velvet-hero.webp')}
#invitation-preview[data-template="silk"]{--template-art:url('assets/themes/silk-hero.webp')}
#invitation-preview[data-template="moon"]{--template-art:url('assets/themes/moon-hero.webp')}
#invitation-preview[data-template="estate"]{--template-art:url('assets/themes/estate-hero.webp')}
#invitation-preview[data-template="editorial"]{--template-art:url('assets/themes/editorial-hero.webp')}
#invitation-preview[data-template]:not([data-template="sacred"]) .preview-cover{background-color:var(--design-deep);background-image:linear-gradient(160deg,color-mix(in srgb,var(--design-mid) 86%,transparent),color-mix(in srgb,var(--design-deep) 94%,transparent)),var(--template-art);background-size:cover;background-position:center}
#invitation-preview:is([data-template="silk"],[data-template="editorial"]) .preview-cover{background-color:var(--design-paper);background-image:linear-gradient(160deg,color-mix(in srgb,var(--palette-wash) 94%,transparent),color-mix(in srgb,var(--design-paper) 90%,transparent)),var(--template-art)}
#invitation-preview:is([data-template="silk"],[data-template="editorial"]) :is(h1,h2,h3,p,small,.preview-section-title){color:var(--design-ink)}
#invitation[data-theme]:not([data-theme="sacred"]){background:linear-gradient(160deg,var(--design-mid),var(--design-deep))}
/* Keep cover geometry intact at narrow phone widths. */
#invitation-preview[data-template] .preview-date{box-sizing:border-box;min-width:0;max-width:100%;align-self:center;margin-inline:auto}
#invitation-preview[data-template] .preview-cover h1{max-width:100%;overflow-wrap:anywhere}
#invitation-preview[data-template] .preview-monogram.has-photo{position:relative;flex-shrink:0;transform:none;border-radius:50%}
#invitation-preview[data-template] .preview-monogram.has-photo .preview-cover-initials{left:auto;right:50%;transform:translateX(50%);background:var(--design-deep);color:#fcf4e4}
.custom-color.is-active{border-color:#a77930;background:#fffaf0;box-shadow:0 0 0 3px #a7793014}
.custom-color.is-active>i{background:var(--swatch);color:transparent;border:1px solid #0002;border-radius:50%}
#invitation-preview[data-template]:not([data-template="sacred"]) .preview-cover{box-sizing:border-box;min-height:100%;padding:64px clamp(20px,8%,42px);justify-content:center}
#invitation-preview[data-template]:not([data-template="sacred"]) .preview-cover h1{width:100%;min-width:0}
#invitation-preview[data-template]:not([data-template="sacred"]) .preview-message{max-width:100%;font-size:clamp(12px,4cqw,17px);line-height:1.6;margin-block:20px}
#invitation-preview[data-template]:not([data-template="sacred"]) .preview-monogram.has-photo{width:min(200px,100%);height:auto;aspect-ratio:1;flex-basis:auto;align-self:center;margin-inline:auto}
/* Avoid flashing the former dark card beneath dark copy during first render. */
#invitation-preview[data-template="sacred"] :is(.preview-story-copy,.preview-feature-card){transition:border-color .25s ease,border-radius .25s ease}
.env-scene.env-ivory{--paper:color-mix(in srgb,var(--envelope-hue,#123f33) 4%,#fffaf0)}
