/* Invitation collection and art directions. Loaded last on purpose. */

[data-view="studio"] .template-browser {
  margin: 0 0 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--p-ink);
  border-radius: 8px;
}

[data-view="studio"] .template-browser-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}

[data-view="studio"] .template-browser-heading h2 {
  margin: 0;
  font-family: "Manrope", "Helvetica Neue", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0;
}

[data-view="studio"] .template-browser-heading p {
  margin: 0;
  color: var(--p-muted);
  font-size: 0.76rem;
}

[data-view="studio"] .template-filters {
  display: flex;
  gap: 6px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

[data-view="studio"] .template-filters::-webkit-scrollbar { display: none; }

[data-view="studio"] .template-filters button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--p-ink);
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--p-ink);
  border-radius: 999px;
}

[data-view="studio"] .template-filters button.active {
  color: #fff;
  background: var(--p-ink);
}

[data-view="studio"] .template-browser .template-rail {
  margin: 0;
  padding: 16px 18px 18px;
  background: #f1f1ed;
  border: 0;
  border-top: 1px solid var(--p-ink);
  border-radius: 0;
}

[data-view="studio"] .template-choice {
  display: grid;
  grid-template-rows: 166px auto auto;
  align-content: start;
  flex-basis: 150px;
  min-height: 222px;
  padding: 0;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(16, 16, 16, 0.28);
  border-radius: 6px;
  box-shadow: none;
}

[data-view="studio"] .template-choice[hidden] { display: none; }

[data-view="studio"] .template-choice.active {
  color: var(--p-ink);
  background: #fff;
  border-color: var(--p-ink);
  box-shadow: 0 0 0 3px var(--p-blue);
}

[data-view="studio"] .template-choice strong {
  margin: 0;
  padding: 10px 11px 1px;
  color: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  background: transparent;
}

[data-view="studio"] .template-choice.active strong {
  color: inherit;
  background: transparent;
}

[data-view="studio"] .template-kind {
  padding: 2px 11px 10px;
  color: #6b6b66;
  font-size: 0.62rem;
  line-height: 1.2;
}

[data-view="studio"] .template-mini {
  position: relative;
  min-height: 166px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid rgba(16, 16, 16, 0.16);
  border-radius: 5px 5px 0 0;
}

[data-view="studio"] .template-mini i { display: none; }

/* Legacy theme layers forced every canvas back to 4:5. Keep format choices real. */
[data-view="studio"] .invite-preview.canvas-portrait { width: min(100%, 620px); aspect-ratio: 4 / 5; }
[data-view="studio"] .invite-preview.canvas-post { width: min(100%, 560px); aspect-ratio: 3 / 4; }
[data-view="studio"] .invite-preview.canvas-story { width: min(100%, 460px); aspect-ratio: 9 / 16; }
[data-view="studio"] .invite-preview.canvas-square { width: min(100%, 620px); aspect-ratio: 1; }
[data-view="studio"] .invite-preview.canvas-landscape { width: min(100%, 760px); aspect-ratio: 3 / 2; }
[data-view="studio"] .invite-preview.canvas-wide { width: min(100%, 820px); aspect-ratio: 16 / 9; }

.mini-editorial { background-image: url("./assets/invitations/flash-still-life.jpg") !important; }
.mini-flashparty { background-image: url("./assets/invitations/party-flash.jpg") !important; }
.mini-rooftop { background-image: url("./assets/invitations/rooftop-bluehour.jpg") !important; }
.mini-botanical { background-image: url("./assets/invitations/italian-table.jpg") !important; }
.mini-postcard { background-image: url("./assets/invitations/riso-cake.jpg") !important; }
.mini-collage { background-image: url("./assets/invitations/blue-hour-coast.jpg") !important; }
.mini-gardenstory { background-image: url("./assets/invitations/wildflower-table.jpg") !important; }
.mini-tropicaltype { background-image: url("./assets/invitations/coastal-table.jpg") !important; }
.mini-heritage { background-image: url("./assets/invitations/garden-at-dusk.jpg") !important; }
.mini-loveletters { background-image: url("./assets/invitations/studio-still-life.jpg") !important; }
.mini-pearlpage { background-image: url("./assets/invitations/coastal-table.jpg") !important; }
.mini-modern { background-image: url("./assets/invitations/chrome-cake.jpg") !important; }
.mini-archway { background-image: url("./assets/invitations/blue-hour-coast.jpg") !important; }
.mini-travelspread { background-image: url("./assets/invitations/coastal-table.jpg") !important; }
.mini-orbit { background-image: url("./assets/invitations/after-dark-still.jpg") !important; }
.mini-minimal { background-image: url("./assets/invitations/studio-still-life.jpg") !important; }
.mini-scrapbook { background-image: url("./assets/invitations/riso-cake.jpg") !important; }

.mini-editorial::after,
.mini-flashparty::after,
.mini-rooftop::after,
.mini-tropicaltype::after,
.mini-gardenstory::after,
.mini-heritage::after,
.mini-loveletters::after,
.mini-pearlpage::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end start;
  padding: 12px;
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 0.95;
  content: "YOUR EVENT";
  background: linear-gradient(transparent 45%, rgba(0, 0, 0, 0.68));
}

.mini-rooftop::after { color: #f4ff4b; content: "NOW 26"; }
.mini-tropicaltype::after { color: #ff75a8; content: "COOL PLACES"; }
.mini-gardenstory::after {
  place-items: start center;
  color: #302c24;
  content: "garden dinner";
  background: linear-gradient(#f7f1e5 0 34%, transparent 34%);
}
.mini-heritage::after { content: "HOUSE STORY"; }
.mini-loveletters::after { color: #6f203d; content: "love letters"; background: linear-gradient(#f4d8df 0 36%, transparent 36%, rgba(82, 19, 45, 0.45)); }
.mini-pearlpage::after { color: #294a70; content: "PEARL ITINERARY"; background: linear-gradient(#eff4f1 0 36%, transparent 36%, rgba(28, 55, 80, 0.38)); }

.mini-poolmenu { background: #20bccc !important; }
.mini-poolmenu::after {
  position: absolute;
  inset: 14px 18px;
  display: grid;
  place-items: center;
  padding: 14px;
  color: #d31572;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 700;
  text-align: center;
  content: "poolside\A menu";
  white-space: pre;
  background: #f8b6d2;
  border: 2px solid #d31572;
  border-radius: 34px 14px 28px 18px;
  transform: rotate(-2deg);
}

.mini-beachclub {
  background-color: #f3ead5 !important;
  background-image: repeating-linear-gradient(90deg, #52bbb3 0 9px, #f3ead5 9px 22px) !important;
}
.mini-beachclub::after {
  position: absolute;
  inset: 18px 14px;
  display: grid;
  place-items: center;
  color: #e85d3f;
  font-family: "Manrope", sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
  content: "THE BEACH\A CLUB";
  white-space: pre;
  background: #f3ead5;
  border: 1px solid #e85d3f;
}

.mini-nautical {
  color: #173e6e;
  background-color: #f5f0e6 !important;
  background-image: repeating-linear-gradient(90deg, #c6d8e5 0 7px, #f5f0e6 7px 16px) !important;
}
.mini-nautical::after {
  position: absolute;
  inset: 13px;
  display: grid;
  place-items: center;
  padding: 10px;
  color: #ae3030;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  content: "CAPE\A WEEKEND";
  white-space: pre;
  background: #f7f2e8;
  border: 3px double #173e6e;
}

.mini-oceanic {
  background: #f7f2ea !important;
}
.mini-oceanic::before {
  position: absolute;
  inset: 8px;
  content: "";
  border: 1px solid #6687a8;
  border-radius: 18px 2px;
}
.mini-oceanic::after {
  position: absolute;
  inset: 24px 17px;
  display: grid;
  place-items: center;
  color: #52779a;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  text-align: center;
  content: "Tidal\A vows";
  white-space: pre;
  background: linear-gradient(150deg, transparent 0 62%, #dce9ef 62%);
}

/* Shared photo-poster behavior */
.invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo {
  position: relative;
  display: grid;
  padding: 0 !important;
  overflow: hidden;
  color: #fff;
  background: #111;
}

.invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo::before {
  z-index: 4;
  inset: 18px;
  border-color: rgba(255, 255, 255, 0.35);
}

.invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  content: "";
  background: linear-gradient(transparent 35%, rgba(0, 0, 0, 0.78));
}

.invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo #invitePhoto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo .invite-copy {
  z-index: 3;
  align-self: end;
  padding: clamp(28px, 6vw, 62px);
}

.invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo h3 {
  max-width: 100%;
  margin: 12px 0 18px;
  color: inherit;
  font-family: "Manrope", sans-serif;
  font-size: clamp(3rem, 6vw, 5.3rem);
  font-weight: 900;
  line-height: 0.82;
  overflow-wrap: anywhere;
}

.invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo p {
  max-width: 32ch;
  color: inherit;
  font-size: 0.88rem;
  opacity: 0.9;
}

.template-flashparty.has-photo { --invite-ink: #fff; }
.template-flashparty.has-photo .preview-kicker {
  display: inline-block;
  width: fit-content;
  padding: 6px 9px;
  color: #101010;
  background: #ff684f;
}
.template-flashparty.has-photo h3 { color: #fff; }

.template-rooftop.has-photo { --invite-ink: #f3ff53; }
.template-rooftop.has-photo::after { background: linear-gradient(transparent 25%, rgba(7, 25, 72, 0.9)); }
.template-rooftop.has-photo h3 { color: #f3ff53; }
.template-rooftop.has-photo .preview-kicker { color: #fff; }

.template-tropicaltype.has-photo { --invite-ink: #ff77a7; }
.template-tropicaltype.has-photo::after { background: rgba(8, 35, 26, 0.24); }
.template-tropicaltype.has-photo .invite-copy {
  align-self: center;
  text-align: center;
}
.template-tropicaltype.has-photo h3 {
  max-width: 10ch;
  margin-inline: auto;
  color: #ff77a7;
  text-transform: uppercase;
}
.template-tropicaltype.has-photo .preview-kicker,
.template-tropicaltype.has-photo p,
.template-tropicaltype.has-photo #previewFooter {
  color: #f0f45b;
}

/* Illustrated and stationery directions */
.invite-preview.template-poolmenu {
  --invite-paper: #24b9c7;
  --invite-ink: #cc176f;
  place-items: center;
  padding: 34px;
  background: #24b9c7;
  border-color: #24b9c7;
}
.template-poolmenu::before {
  inset: 6%;
  background: #f6b4d0;
  border: 3px solid #cc176f;
  border-radius: 72px 28px 64px 36px;
  transform: rotate(-1.5deg);
}
.template-poolmenu::after {
  position: absolute;
  z-index: 1;
  right: 11%;
  bottom: 10%;
  display: block;
  color: #cc176f;
  font-family: "Manrope", sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  content: "DRINKS · DINNER · DANCING";
  transform: rotate(-4deg);
}
.template-poolmenu .invite-copy {
  z-index: 2;
  width: 72%;
  text-align: center;
  transform: rotate(-1deg);
}
.template-poolmenu h3 {
  max-width: 100%;
  margin: 12px auto 20px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.3rem, 7vw, 6.5rem);
  font-style: italic;
  line-height: 0.78;
}
.template-poolmenu p { margin-inline: auto; font-size: 0.82rem; }

.invite-preview.template-beachclub {
  --invite-paper: #f4ead5;
  --invite-ink: #e45b3b;
  padding: 58px;
  text-align: center;
  background-color: #f4ead5;
  background-image: repeating-linear-gradient(90deg, #5fc2bb 0 18px, #f4ead5 18px 42px);
  border-color: #f4ead5;
}
.template-beachclub::before {
  inset: 34px;
  background: #f4ead5;
  border: 2px solid #e45b3b;
}
.template-beachclub::after {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 12%;
  display: block;
  width: 30%;
  height: 12%;
  content: "";
  border-top: 4px solid #e45b3b;
  border-radius: 50% 50% 0 0;
  transform: translateX(-50%);
}
.template-beachclub .invite-copy { z-index: 2; }
.template-beachclub h3 {
  max-width: 100%;
  margin: 14px auto 20px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.8rem, 5.2vw, 4.8rem);
  font-weight: 900;
  line-height: 0.82;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.template-beachclub p { margin-inline: auto; font-weight: 650; }

.invite-preview.template-nautical {
  --invite-paper: #f6f0e6;
  --invite-ink: #173e6e;
  padding: clamp(54px, 8vw, 86px);
  text-align: center;
  background-color: #f6f0e6;
  background-image: repeating-linear-gradient(90deg, #c9d9e6 0 16px, #f6f0e6 16px 34px);
  border-color: #f6f0e6;
}
.template-nautical::before {
  inset: 28px;
  background: #f7f2e8;
  border: 5px double #173e6e;
}
.template-nautical::after {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 10%;
  display: block;
  color: #ae3030;
  font-family: "Manrope", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  content: "GOOD FOOD · COLD DRINKS · COASTAL AIR";
  transform: translateX(-50%);
  white-space: nowrap;
}
.template-nautical .invite-copy { z-index: 2; }
.template-nautical h3 {
  max-width: 100%;
  margin: 16px auto 24px;
  color: #ae3030;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(2.75rem, 5.1vw, 4.7rem);
  font-weight: 600;
  line-height: 0.82;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.template-nautical p { margin-inline: auto; }

.invite-preview.template-oceanic {
  --invite-paper: #f7f3eb;
  --invite-ink: #54789b;
  padding: clamp(58px, 8vw, 92px);
  text-align: center;
  background-color: #f7f3eb;
  background-image: linear-gradient(150deg, transparent 0 68%, #dbe8ef 68%);
  border-color: #f7f3eb;
}
.template-oceanic::before {
  inset: 22px;
  border: 1px solid #6687a8;
  border-radius: 30px 4px;
}
.template-oceanic::after {
  position: absolute;
  right: -4%;
  bottom: 4%;
  display: block;
  width: 48%;
  height: 27%;
  content: "";
  border-top: 1px solid #7f9fba;
  border-left: 1px solid #7f9fba;
  border-radius: 70% 0 0;
  transform: rotate(-8deg);
}
.template-oceanic .invite-copy { z-index: 2; }
.template-oceanic h3 {
  max-width: 10ch;
  margin: 28px auto 22px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(4rem, 8vw, 7rem);
  font-style: italic;
  font-weight: 500;
  line-height: 0.78;
}
.template-oceanic p { margin-inline: auto; }
.template-oceanic .invite-decoration {
  border-color: #8aa8bf;
  border-radius: 70% 5%;
}

/* Narrative layouts use the 9:16 canvas and show more than a cover. */
.invite-preview.template-gardenstory {
  --invite-paper: #f4efe3;
  --invite-ink: #302c24;
  display: grid;
  align-content: start;
  padding: 0;
  background: #f4efe3;
  border-color: #f4efe3;
}
.template-gardenstory::before { inset: 18px; z-index: 4; border-color: rgba(48, 44, 36, 0.36); }
.template-gardenstory.has-photo #invitePhoto {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 56%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}
.template-gardenstory .invite-copy {
  z-index: 3;
  width: 100%;
  padding: 12% 10% 0;
  text-align: center;
}
.template-gardenstory h3 {
  max-width: 10ch;
  margin: 16px auto 18px;
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: 0.82;
}
.template-gardenstory p { max-width: 34ch; margin-inline: auto; font-size: 0.78rem; }
.template-gardenstory #previewFooter {
  display: inline-block;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid currentColor;
}

.invite-preview.template-heritage {
  --invite-paper: #ebe8df;
  --invite-ink: #483328;
  display: grid;
  grid-template-rows: 45% 55%;
  align-content: stretch;
  padding: 0;
  background: #ebe8df;
  border-color: #514034;
}
.template-heritage::before { inset: 20px; z-index: 4; border-color: rgba(72, 51, 40, 0.45); }
.template-heritage.has-photo #invitePhoto {
  grid-row: 1;
  width: 72%;
  height: 90%;
  margin: 8% auto 0;
  object-fit: cover;
  clip-path: ellipse(46% 48% at 50% 50%);
  border-radius: 0;
  filter: sepia(0.22) saturate(0.8);
}
.template-heritage .invite-copy {
  grid-row: 2;
  z-index: 3;
  align-self: center;
  padding: 7% 12% 10%;
}
.template-heritage h3 {
  max-width: 8ch;
  margin: 10px 0 16px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.82;
}
.template-heritage p { font-family: Georgia, serif; font-size: 0.76rem; }

.invite-preview.template-loveletters {
  --invite-paper: #d99aab;
  --invite-ink: #64223d;
  display: grid;
  grid-template-rows: 31% 35% 34%;
  align-content: stretch;
  padding: 0;
  background: #d99aab;
  border-color: #64223d;
}
.template-loveletters::before {
  inset: 17px;
  z-index: 5;
  border: 2px dotted #fff2ea;
  border-radius: 0;
}
.template-loveletters.has-photo #invitePhoto {
  grid-row: 2;
  width: 72%;
  height: 90%;
  margin: auto;
  object-fit: cover;
  border: 10px solid #fff0e7;
  border-radius: 0;
  box-shadow: 8px 8px 0 #8e405e;
  transform: rotate(-2deg);
}
.template-loveletters .invite-copy {
  display: contents;
}
.template-loveletters .preview-kicker,
.template-loveletters h3 {
  position: relative;
  z-index: 3;
  grid-row: 1;
  justify-self: center;
  text-align: center;
}
.template-loveletters .preview-kicker { align-self: start; margin-top: 12%; }
.template-loveletters h3 {
  align-self: center;
  width: 82%;
  max-width: none;
  margin: 0;
  padding-top: 18px;
  font-size: clamp(3rem, 5.2vw, 4.8rem);
  font-style: italic;
  line-height: 0.76;
  overflow-wrap: normal;
  text-wrap: balance;
}
.template-loveletters p,
.template-loveletters #previewFooter {
  position: relative;
  z-index: 3;
  grid-row: 3;
  justify-self: center;
  width: 72%;
  text-align: center;
}
.template-loveletters p {
  display: -webkit-box;
  align-self: start;
  max-height: 6.2em;
  margin-top: 9%;
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.template-loveletters #previewFooter { align-self: end; margin-bottom: 12%; padding-top: 10px; border-top: 1px solid currentColor; }

.invite-preview.template-pearlpage {
  --invite-paper: #e5edf2;
  --invite-ink: #315675;
  display: grid;
  grid-template-rows: 43% 57%;
  align-content: stretch;
  padding: 0;
  background: #e5edf2;
  border-color: #fff;
}
.template-pearlpage::before { inset: 18px; z-index: 5; border: 3px double #7792aa; border-radius: 42px 42px 3px 3px; }
.template-pearlpage::after {
  position: absolute;
  z-index: 3;
  right: 8%;
  bottom: 8%;
  left: 8%;
  display: block;
  padding-top: 12px;
  color: #315675;
  font-family: "Manrope", sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  content: "ARRIVAL 17:00   ·   DINNER 19:00   ·   DANCING 22:00";
  border-top: 1px solid #7792aa;
}
.template-pearlpage.has-photo #invitePhoto {
  grid-row: 1;
  width: 78%;
  height: 84%;
  margin: 9% auto 0;
  object-fit: cover;
  border: 8px solid #f8f5ee;
  border-radius: 48% 48% 4px 4px;
}
.template-pearlpage .invite-copy {
  grid-row: 2;
  z-index: 3;
  align-self: start;
  padding: 7% 12% 16%;
  text-align: center;
}
.template-pearlpage h3 {
  max-width: 100%;
  margin: 12px auto 18px;
  font-size: clamp(2.6rem, 4.2vw, 3.8rem);
  font-style: italic;
  line-height: 0.78;
  overflow-wrap: normal;
  text-wrap: balance;
}
.template-pearlpage p { margin-inline: auto; font-size: 0.76rem; }

[data-view="studio"] .image-library {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 330px;
  overflow-y: auto;
}

[data-view="studio"] .image-library button {
  min-width: 0;
}

@media (max-width: 760px) {
  [data-view="studio"] .canvas-stage { min-height: 0; }

  [data-view="studio"] .template-browser-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  [data-view="studio"] .template-choice {
    flex-basis: 138px;
    grid-template-rows: 148px auto auto;
    min-height: 204px;
  }

  [data-view="studio"] .template-mini { min-height: 148px; }

  .invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo h3 {
    font-size: clamp(3.1rem, 15vw, 4.4rem);
  }

  .invite-preview:is(.template-flashparty, .template-rooftop, .template-tropicaltype).has-photo .invite-copy {
    padding: 26px;
  }

  .template-loveletters h3 {
    width: 86%;
    padding-top: 10px;
    font-size: 2.65rem;
  }

  .template-loveletters p {
    margin-top: 7%;
    font-size: 0.65rem;
    -webkit-line-clamp: 4;
  }

  .template-nautical::after {
    max-width: 70%;
    font-size: 0.54rem;
    white-space: normal;
  }

  [data-view="studio"] .image-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
