/* ============================================
   INVITATION GENERATOR -- fonts, landing page, editor
============================================ */

@font-face { font-family: 'Cinzel SemiBold'; src: url('/fonts/invitation/cinzel-latin-600-normal.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Great Vibes'; src: url('/fonts/invitation/great-vibes-latin-400-normal.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('/fonts/invitation/playfair-display-latin-700-normal.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond Medium'; src: url('/fonts/invitation/cormorant-garamond-latin-500-normal.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Tangerine'; src: url('/fonts/invitation/tangerine-latin-700-normal.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Noto Sans Devanagari'; src: url('/fonts/invitation/noto-sans-devanagari-devanagari-400-normal.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans Devanagari'; src: url('/fonts/invitation/noto-sans-devanagari-devanagari-700-normal.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Noto Sans Gujarati'; src: url('/fonts/invitation/noto-sans-gujarati-gujarati-400-normal.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans Gujarati'; src: url('/fonts/invitation/noto-sans-gujarati-gujarati-700-normal.ttf') format('truetype'); font-weight: 700; font-display: swap; }

/* ============ LANDING PAGE ============ */
.kd-inv-hero {
  background: linear-gradient(135deg, #fdf8ec 0%, #f4e9d8 100%);
  padding: 60px 20px 70px;
  font-family: 'Poppins', sans-serif;
  text-align: center;
}
.kd-inv-hero__eyebrow { color: #a9821f; font-weight: 600; letter-spacing: 2px; font-size: 13px; text-transform: uppercase; margin-bottom: 12px; }
.kd-inv-hero__title { font-size: 42px; font-weight: 700; color: #2b2621; margin-bottom: 16px; }
.kd-inv-hero__title span { color: #7a1420; }
.kd-inv-hero__subtitle { font-size: 17px; color: #5a4632; max-width: 620px; margin: 0 auto 30px; line-height: 1.6; }
.kd-inv-hero__cta { display: inline-flex; align-items: center; gap: 8px; background: #7a1420; color: #fff; padding: 15px 32px; border-radius: 999px; font-weight: 600; text-decoration: none; font-size: 16px; transition: transform .2s ease, box-shadow .2s ease; }
.kd-inv-hero__cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(122,20,32,.25); color: #fff; }
.kd-inv-hero__note { margin-top: 14px; font-size: 13px; color: #8a7860; }

.kd-inv-themes { padding: 60px 20px; max-width: 1100px; margin: 0 auto; font-family: 'Poppins', sans-serif; }
.kd-inv-themes__header { text-align: center; margin-bottom: 36px; }
.kd-inv-themes__title { font-size: 28px; font-weight: 700; color: #2b2621; }
.kd-inv-themes__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.kd-inv-theme-card { border: 1px solid #eee0c8; border-radius: 16px; padding: 28px 22px; text-align: center; background: #fff; transition: box-shadow .2s ease, transform .2s ease; }
.kd-inv-theme-card:hover { box-shadow: 0 12px 30px rgba(0,0,0,.08); transform: translateY(-3px); }
.kd-inv-theme-card__swatches { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.kd-inv-theme-card__swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.kd-inv-theme-card__name { font-size: 18px; font-weight: 600; color: #2b2621; margin-bottom: 6px; }
.kd-inv-theme-card__desc { font-size: 14px; color: #6b5e4f; line-height: 1.5; }

.kd-inv-steps { padding: 50px 20px; background: #faf6ee; font-family: 'Poppins', sans-serif; }
.kd-inv-steps__grid { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; text-align: center; }
.kd-inv-step__num { width: 40px; height: 40px; border-radius: 50%; background: #7a1420; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 12px; }
.kd-inv-step__title { font-weight: 600; color: #2b2621; margin-bottom: 6px; }
.kd-inv-step__desc { font-size: 13px; color: #6b5e4f; }

.kd-inv-faqs { padding: 60px 20px; max-width: 800px; margin: 0 auto; font-family: 'Poppins', sans-serif; }

/* ============ EDITOR ============ */
.kd-ed { font-family: 'Poppins', sans-serif; background: #f7f5f1; padding: 24px 16px 60px; }
.kd-ed__container { max-width: 1300px; margin: 0 auto; }

.kd-ed__theme-bar { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.kd-ed__theme-pill { border: 2px solid #e4ddcf; border-radius: 12px; padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: #6b5e4f; background: #fff; transition: all .15s ease; }
.kd-ed__theme-pill.is-active { border-color: #7a1420; color: #7a1420; background: #fdf3ee; }

.kd-ed__lang-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 14px; color: #6b5e4f; }
.kd-ed__lang-bar select { border: 1px solid #e4ddcf; border-radius: 8px; padding: 6px 10px; font-size: 14px; }

/* Structure tabs (layout/frame choice) + palette chips (color/font choice within a
   structure) -- replaces the old flat .kd-ed__theme-bar now that there are 33 combos
   instead of 2. */
.kd-ed__structure-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.kd-ed__structure-tab { border: 2px solid #e4ddcf; border-radius: 10px; padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 600; color: #6b5e4f; background: #fff; transition: all .15s ease; }
.kd-ed__structure-tab.is-active { border-color: #7a1420; color: #7a1420; background: #fdf3ee; }
.kd-ed__palette-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.kd-ed__palette-chip { display: flex; align-items: center; gap: 7px; border: 2px solid #e4ddcf; border-radius: 20px; padding: 5px 12px 5px 6px; cursor: pointer; font-size: 12px; font-weight: 600; color: #6b5e4f; background: #fff; transition: all .15s ease; }
.kd-ed__palette-chip.is-active { border-color: #7a1420; color: #7a1420; background: #fdf3ee; }
.kd-ed__palette-chip__swatches { display: flex; }
.kd-ed__palette-chip__swatches span { width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-left: -5px; border: 1.5px solid #fff; }
.kd-ed__palette-chip__swatches span:first-child { margin-left: 0; }


.kd-ed__grid { display: grid; grid-template-columns: 340px 1fr 320px; gap: 20px; align-items: start; }

.kd-ed__panel { background: #fff; border: 1px solid #ece4d3; border-radius: 14px; padding: 18px; }
.kd-ed__panel-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #8a7860; margin-bottom: 14px; }

/* sections list */
.kd-ed__block-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kd-ed__block-item { display: flex; align-items: center; gap: 10px; border: 1px solid #ece4d3; border-radius: 10px; padding: 10px 12px; cursor: grab; background: #fdfcfa; }
.kd-ed__block-item.is-selected { border-color: #7a1420; background: #fdf3ee; }
.kd-ed__block-item__handle { color: #c9c0ac; }
.kd-ed__block-item__label { flex: 1; font-size: 13px; font-weight: 600; color: #2b2621; }
.kd-ed__block-item__type { font-size: 11px; color: #a99a86; text-transform: uppercase; }
.kd-ed__block-item__del { color: #c98080; background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; }
.kd-ed__block-item.sortable-ghost { opacity: .4; }

.kd-ed__add-btn { width: 100%; border: 1.5px dashed #c9a98a; border-radius: 10px; padding: 10px; background: #fff; color: #7a1420; font-weight: 600; font-size: 13px; cursor: pointer; }
.kd-ed__add-menu { display: none; margin-top: 10px; border: 1px solid #ece4d3; border-radius: 10px; overflow: hidden; }
.kd-ed__add-menu.is-open { display: block; }
.kd-ed__add-menu button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; background: #fff; border-bottom: 1px solid #f2ece0; font-size: 13px; color: #2b2621; cursor: pointer; }
.kd-ed__add-menu button:last-child { border-bottom: none; }
.kd-ed__add-menu button:hover { background: #fdf3ee; }

/* preview */
.kd-ed__preview-wrap { display: flex; justify-content: center; }
.kd-ed__preview { width: 100%; max-width: 480px; aspect-ratio: 2 / 3; background: #fff; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.12); position: relative; overflow: hidden; padding: 10%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; text-align: center; }
.kd-ed__preview-block { width: 100%; margin-bottom: 10px; }
.kd-ed__preview-block[data-block-type="divider"] { display: flex; align-items: center; justify-content: center; gap: 8px; color: #a9821f; margin: 10px 0; }
.kd-ed__preview-block[data-block-type="divider"]::before,
.kd-ed__preview-block[data-block-type="divider"]::after { content: ''; flex: 1; height: 1px; background: #a9821f; max-width: 60px; }

.kd-ed__generate-bar { margin-top: 18px; display: flex; justify-content: center; }
.kd-ed__generate-btn { background: #7a1420; color: #fff; border: none; padding: 14px 34px; border-radius: 999px; font-weight: 700; font-size: 15px; cursor: pointer; }
.kd-ed__generate-btn:disabled { opacity: .6; cursor: default; }

/* right panel: block editor */
.kd-ed__field { margin-bottom: 14px; }
.kd-ed__field label { display: block; font-size: 12px; font-weight: 600; color: #8a7860; margin-bottom: 5px; }
.kd-ed__field input[type="text"],
.kd-ed__field textarea,
.kd-ed__field select { width: 100%; border: 1px solid #e4ddcf; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.kd-ed__field textarea { min-height: 70px; resize: vertical; }
.kd-ed__field-row { display: flex; gap: 10px; }
.kd-ed__field-row .kd-ed__field { flex: 1; }
.kd-ed__field input[type="color"] { width: 100%; height: 34px; border: 1px solid #e4ddcf; border-radius: 8px; padding: 2px; }
.kd-ed__empty-hint { font-size: 13px; color: #a99a86; text-align: center; padding: 20px 10px; }

/* lead-capture modal */
.kd-ed__modal-overlay { display: none; position: fixed; inset: 0; background: rgba(20,15,10,.5); z-index: 999; align-items: center; justify-content: center; }
.kd-ed__modal-overlay.is-open { display: flex; }
.kd-ed__modal { background: #fff; border-radius: 16px; padding: 28px; width: 92%; max-width: 380px; }
.kd-ed__modal h3 { margin: 0 0 6px; font-size: 19px; color: #2b2621; }
.kd-ed__modal p { margin: 0 0 18px; font-size: 13px; color: #6b5e4f; }
.kd-ed__modal .kd-ed__field { margin-bottom: 12px; }
.kd-ed__modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.kd-ed__modal-actions button { flex: 1; padding: 12px; border-radius: 999px; border: none; font-weight: 600; cursor: pointer; }
.kd-ed__modal-cancel { background: #f2ece0; color: #6b5e4f; }
.kd-ed__modal-submit { background: #7a1420; color: #fff; }

.kd-ed__result-links { display: none; margin-top: 16px; gap: 10px; justify-content: center; flex-wrap: wrap; }
.kd-ed__result-links.is-open { display: flex; }
.kd-ed__result-links a { border: 1.5px solid #7a1420; color: #7a1420; padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: 13px; text-decoration: none; }
.kd-ed__result-links a:hover { background: #7a1420; color: #fff; }

/* mobile */
@media (max-width: 1024px) {
  .kd-ed__grid { grid-template-columns: 1fr; }
}


/* Occasion picker grid (/invitation-maker) */
.kd-occ-grid__wrap { max-width: 1100px; margin: 0 auto; padding: 20px 20px 60px; }
.kd-occ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.kd-occ-card { display: block; text-align: center; padding: 32px 18px; border-radius: 16px; background: #fff; border: 1.5px solid #eee2d0; text-decoration: none; transition: all .15s ease; box-shadow: 0 6px 18px rgba(0,0,0,.04); }
.kd-occ-card:hover { border-color: #c9971f; box-shadow: 0 10px 26px rgba(0,0,0,.08); transform: translateY(-2px); }
.kd-occ-card__icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: #fdf3ee; color: #7a1420; display: flex; align-items: center; justify-content: center; }
.kd-occ-card__icon svg { width: 26px; height: 26px; }
.kd-occ-card__label { font-weight: 700; font-size: 17px; color: #2b2621; margin-bottom: 4px; }
.kd-occ-card__tagline { font-size: 13px; color: #8a7860; }

/* Design gallery grid (/create-invitation/{occasion}) */
.kd-gal-grid__wrap { max-width: 1100px; margin: 0 auto; padding: 20px 20px 60px; }
.kd-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
.kd-gal-card { display: block; text-decoration: none; border-radius: 12px; overflow: hidden; background: #fff; border: 1.5px solid #eee2d0; transition: all .15s ease; }
.kd-gal-card:hover { border-color: #c9971f; box-shadow: 0 10px 26px rgba(0,0,0,.08); transform: translateY(-2px); }
.kd-gal-card__thumb { aspect-ratio: 2 / 3; background: #f7f3ea; overflow: hidden; }
.kd-gal-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kd-gal-card__thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c9a98a; }
.kd-gal-card__name { padding: 12px 14px; font-weight: 600; font-size: 14px; color: #2b2621; text-align: center; }

/* Lead gate overlay, shown before the editor unlocks */
.kd-ed__leadgate { display: flex; justify-content: center; padding: 40px 20px; }
.kd-ed__leadgate-card { width: 100%; max-width: 440px; background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: 0 20px 50px rgba(0,0,0,.1); }
.kd-ed__leadgate-card h2 { margin: 0 0 8px; font-size: 22px; color: #2b2621; }
.kd-ed__leadgate-card p { margin: 0 0 20px; font-size: 14px; color: #6b5e4f; }
.kd-ed__leadgate-note { margin-top: 12px; font-size: 12px; color: #a99a86; text-align: center; }

/* "Invitation Card" nav item -- new-feature blinking dot, see project feedback:
   "add new menu after contact, Invitation card and add blinking red dot on that
   so people know about new feature." */
.kd-header__nav-link--new { display: inline-flex; align-items: center; gap: 6px; }
.kd-new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e0263f; box-shadow: 0 0 0 rgba(224,38,63,.6); animation: kdNewDotPulse 1.6s infinite; flex-shrink: 0; }
@keyframes kdNewDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(224,38,63,.6); }
  70% { box-shadow: 0 0 0 6px rgba(224,38,63,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,38,63,0); }
}

/* round21: Fabric.js canvas editor. #kdEdCanvas gets wrapped by Fabric in its own
   .canvas-container div at runtime (sized to whatever setDimensions() currently is,
   see invitation_canvas_editor.js's setupResponsiveScale) -- this wrap just bounds and
   centers that, mirroring the old .kd-ed__preview's card-like frame. */
.kd-ed__preview-wrap { max-width: 480px; margin: 0 auto; box-shadow: 0 20px 50px rgba(0,0,0,.12); border-radius: 10px; overflow: hidden; }
.kd-ed__canvas-add-buttons { display: flex; gap: 8px; }
.kd-ed__canvas-add-buttons .kd-ed__add-btn { width: auto; flex: 1; }

/* Gallery cards: live Fabric.js mini-preview + style note (round21, replacing the old
   static thumbnail image approach -- see invitation_gallery_thumbs.js). */
.kd-gal-card__thumb--canvas { display: flex; align-items: center; justify-content: center; }
.kd-gal-card__note { padding: 0 14px 14px; margin-top: -6px; font-size: 12px; color: #a99a86; text-align: center; }

/* round22: right column now stacks two panels (Edit Block + Design Assistant) instead of
   one -- wrap them so they still count as a single item in .kd-ed__grid's 3-column
   layout, stacked vertically, rather than each panel trying to claim its own grid column. */
.kd-ed__right-col { display: flex; flex-direction: column; gap: 20px; }

/* Design Assistant suggestion panel (invitation_design_assistant.js) -- entirely
   rule-based, no AI calls; see that file's header comment for what it checks. */
.kd-ed__suggestion-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.kd-ed__suggestion { border: 1px solid #ece4d3; border-radius: 10px; padding: 10px 12px; background: #fdfcfa; }
.kd-ed__suggestion--warn { border-color: #e8c98a; background: #fff8ea; }
.kd-ed__suggestion--info { border-color: #cfe0d8; background: #f3faf6; }
.kd-ed__suggestion--success { border-color: #cfe0d8; background: #f3faf6; text-align: center; color: #4a7a5c; font-weight: 600; }
.kd-ed__suggestion__msg { font-size: 13px; line-height: 1.45; color: #4a4038; margin-bottom: 8px; }
.kd-ed__suggestion--success .kd-ed__suggestion__msg { margin-bottom: 0; color: inherit; }
.kd-ed__suggestion__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kd-ed__suggestion__btn { border: 1px solid #c9a98a; background: #fff; color: #7a1420; font-weight: 600; font-size: 12px; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.kd-ed__suggestion__btn:hover { background: #fdf3ee; }
.kd-ed__suggestion__dismiss { border: none; background: none; color: #a99a86; font-size: 12px; cursor: pointer; text-decoration: underline; padding: 6px 4px; }

/* Autosave restore banner + saved indicator (round24) -- see saveDraft/tryRestoreDraft in
   invitation_canvas_editor.js. Banner is empty/hidden until JS finds a saved draft and
   fills it in; the note quietly flashes "Saved just now" after each autosave then fades. */
.kd-ed__restore-banner { display: none; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1300px; margin: 0 auto 16px; padding: 12px 16px; border: 1px solid #cfe0d8; background: #f3faf6; border-radius: 10px; font-size: 13px; color: #35543f; }
.kd-ed__restore-banner.is-visible { display: flex; }
.kd-ed__restore-banner__btn { border: 1px solid #a9c4b3; background: #fff; color: #35543f; font-weight: 600; font-size: 12px; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.kd-ed__restore-banner__btn:hover { background: #eaf5ee; }
.kd-ed__autosave-note { text-align: center; margin-top: 10px; font-size: 12px; color: #8a7860; opacity: 0; transition: opacity .3s ease; }
.kd-ed__autosave-note.is-visible { opacity: 1; }
