/* Sub-pages: Submit Ram Naam + Memory Wall */
.page-hero { text-align: center; padding: 46px 0 30px; background: linear-gradient(180deg, #FBF6EC, #F3E8D4); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(34px, 5vw, 56px); color: var(--maroon); }
.page-hero p { color: var(--ink-soft); max-width: 640px; margin: 10px auto 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--gold-text); text-decoration: none; margin-bottom: 14px; }
.crumb:hover { color: var(--maroon); }

/* ---------- Writing studio ---------- */
.studio { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; padding: 34px 0 20px; }
.panel { background: #fff8ec; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.panel h2 { font-size: 20px; color: var(--maroon); margin: 0 0 10px; }
.panel + .panel { margin-top: 16px; }
.tool-label { display: block; font-size: 15px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--gold-text); margin: 16px 0 8px; }
.tool-label:first-child { margin-top: 0; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { position: relative; aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--maroon), 0 0 0 4px var(--gold-light); }
.swatch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.swatch.custom { background: conic-gradient(#e2671b, #b3121f, #4a1218, #1f3a93, #2e6b3a, #b8862b, #e2671b); overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { font: inherit; font-size: 15px; padding: 9px 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.2; }
.seg button small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { border-color: var(--maroon); background: var(--paper); box-shadow: inset 0 0 0 1px var(--maroon); }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row input[type=range] { flex: 1; accent-color: var(--maroon); }
.size-dot { width: 34px; height: 34px; display: grid; place-items: center; }
.size-dot i { display: block; border-radius: 50%; background: var(--maroon); }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 16px; cursor: pointer; margin-top: 10px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--maroon); }

.board-wrap { position: relative; }
.board {
  position: relative; width: 100%; max-width: 720px; margin: 0 auto; aspect-ratio: 1;
  border-radius: 6px; overflow: hidden; background: #FFFBF2;
  box-shadow: 0 1px 0 #fff inset, 0 24px 50px -28px rgba(46,10,16,.55); border: 1px solid var(--line);
}
.board canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.board .hint-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: rgba(74,18,24,.38); font-size: 18px; text-align: center; transition: opacity .3s; }
.board .hint-overlay svg { width: 40px; height: 40px; margin: 0 auto 6px; }
.board-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 16px auto 0; max-width: 720px; }
.icon-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 15px; padding: 10px 16px; border: 1px solid var(--line); background: #fff; border-radius: 99px; cursor: pointer; color: var(--ink); }
.icon-btn:hover:not(:disabled) { border-color: var(--gold); background: var(--paper); }
.icon-btn:disabled { opacity: .45; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

.details { max-width: 720px; margin: 34px auto 0; }
.details h2 { font-size: 28px; color: var(--maroon); text-align: center; margin-bottom: 6px; }
.details > p { text-align: center; color: var(--ink-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-top: 20px; }
.field label { display: block; font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.field label small { font-weight: 400; color: var(--ink-soft); }
.field input, .field select { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--maroon); outline: none; box-shadow: 0 0 0 3px rgba(194,154,85,.3); }
.field.full { grid-column: 1 / -1; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; color: var(--ink-soft); }
.consent input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--maroon); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #9b1c1c; background: #fdecec; border: 1px solid #f2c4c4; padding: 10px 14px; border-radius: 6px; margin-top: 16px; display: none; }
.form-error.show { display: block; }
.submit-row { text-align: center; margin: 26px 0 70px; }
.submit-row .btn { min-width: 280px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.spinner { width: 20px; height: 20px; border: 2px solid rgba(246,234,211,.4); border-top-color: var(--on-dark); border-radius: 50%; animation: spin .8s linear infinite; display: none; }
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
.success { display: none; max-width: 760px; margin: 40px auto 80px; text-align: center; }
.success.show { display: block; }
.success img { width: min(420px, 100%); margin: 24px auto; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.success h2 { font-size: clamp(30px, 4vw, 44px); color: var(--maroon); }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Memory Wall ---------- */
.wall-bar { position: sticky; top: 72px; z-index: 20; background: rgba(251,246,236,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.wall-bar .wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 15px; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: var(--on-dark); }
.chip .n { opacity: .7; font-size: 13px; margin-left: 4px; }
.search { position: relative; flex: 0 1 300px; }
.search input { width: 100%; font: inherit; font-size: 16px; padding: 10px 14px 10px 40px; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gold-text); }
.wall-count { text-align: center; padding: 30px 0 4px; color: var(--ink-soft); }
.wall-count strong { font-family: var(--serif-en); font-size: 34px; color: var(--maroon); display: block; line-height: 1.1; }
.masonry { columns: 4 240px; column-gap: 16px; padding: 24px 0; }
.wcard { break-inside: avoid; margin: 0 0 16px; background: #fff8ec; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: zoom-in; transition: transform .2s, box-shadow .2s; display: block; width: 100%; padding: 0; text-align: left; font: inherit; color: inherit; }
.wcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.wcard img { width: 100%; height: auto; background: var(--stone); }
.wcard .meta { padding: 10px 14px 12px; }
.wcard .who { font-family: var(--serif-hi); font-size: 18px; color: var(--maroon); line-height: 1.3; }
.wcard .where { font-size: 14px; color: var(--ink-soft); }
.badge { display: inline-block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-top: 6px; }
.wall-empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); display: none; }
.wall-empty.show { display: block; }
.wall-empty .big { font-family: var(--serif-hi); font-size: 64px; color: var(--gold); line-height: 1; }
.more-row { text-align: center; padding: 10px 0 50px; }
.ig-panel { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center; }
.ig-panel h2 { font-size: clamp(28px, 3.4vw, 40px); }
.ig-steps { display: grid; gap: 12px; }
.ig-step { display: flex; gap: 14px; align-items: flex-start; border: 1px solid rgba(230,201,143,.3); border-radius: 6px; padding: 14px 16px; }
.ig-step b { font-family: var(--serif-en); font-size: 28px; color: var(--gold-light); line-height: 1; }
.ig-step span { color: var(--on-dark-soft); font-size: 16px; }

dialog.lightbox { border: 0; padding: 0; max-width: min(900px, 94vw); width: auto; background: var(--ivory); border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
dialog.lightbox::backdrop { background: rgba(30, 6, 10, .82); }
.lb-inner { display: grid; grid-template-columns: 1.3fr 1fr; }
.lb-inner img { width: 100%; height: 100%; max-height: 82vh; object-fit: contain; background: #1e0a0d; }
.lb-info { padding: 28px 24px; }
.lb-info h3 { font-size: 28px; color: var(--maroon); }
.lb-info p { color: var(--ink-soft); }
.lb-close { position: absolute; top: 10px; right: 10px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(251,246,236,.92); font-size: 24px; cursor: pointer; color: var(--maroon); }

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; padding-top: 20px; }
  .panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .panel + .panel { margin-top: 0; }
  .ig-panel { grid-template-columns: 1fr; }
  .lb-inner { grid-template-columns: 1fr; }
  .lb-inner img { max-height: 60vh; }
  .wall-bar { top: 72px; }
}
@media (max-width: 620px) {
  .panel-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(8, 1fr); gap: 6px; }
  .search { flex: 1 1 100%; }
  .submit-row .btn { width: 100%; min-width: 0; }
  .masonry { columns: 2 150px; column-gap: 10px; }
  .wcard { margin-bottom: 10px; }
  .wcard .who { font-size: 16px; }
}

/* ---------- Family photo upload ---------- */
.field-label { display: block; font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.field-label small { font-weight: 400; color: var(--ink-soft); }
.photo-pick { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1.5px dashed var(--gold); border-radius: 8px; background: #fff; cursor: pointer; color: var(--ink); transition: background .2s; }
.photo-pick:hover { background: var(--paper); }
.photo-pick svg { width: 40px; height: 40px; flex: none; color: var(--gold-text); }
.photo-pick small { color: var(--ink-soft); font-size: 14px; }
#photo:focus-visible + .photo-pick { outline: 2px solid var(--saffron); outline-offset: 3px; }
.photo-preview { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.photo-preview img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; }
.field input.invalid, .field select.invalid { border-color: #b3121f; box-shadow: 0 0 0 3px rgba(179,18,31,.15); }

/* ---------- Thank-you popup ---------- */
dialog.thanks { border: 0; padding: 0; width: min(560px, 94vw); max-height: 92vh; border-radius: 12px; background: var(--ivory); box-shadow: 0 30px 80px rgba(0,0,0,.45); overflow: auto; }
dialog.thanks::backdrop { background: rgba(30, 6, 10, .78); }
.thanks-inner { padding: 34px 28px 26px; text-align: center; border: 1px solid var(--gold); border-radius: 12px; margin: 8px; }
.thanks-mark { width: 54px; height: 54px; color: var(--gold); margin: 0 auto 6px; }
.thanks h2 { font-size: clamp(30px, 6vw, 40px); color: var(--maroon); }
.thanks-msg { font-family: var(--serif-hi); font-size: clamp(19px, 3.6vw, 22px); line-height: 1.6; color: var(--ink); margin: 12px 0 18px; }
.thanks-media { display: flex; justify-content: center; gap: 12px; margin-bottom: 10px; }
.thanks-media img { width: min(46%, 200px); aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.thanks-note { font-size: 15px; color: var(--ink-soft); margin: 8px 0 16px; }
.thanks .success-actions .btn { min-height: 46px; padding: 10px 18px; font-size: 16px; }
.thanks-tags { font-size: 14px; color: var(--gold-text); margin: 16px 0 0; }
@media (max-width: 560px) { .thanks .success-actions .btn { width: 100%; } }

/* ---------- Family photo carousel (Memory Wall): one 800 x 600 landscape slide, centred ---------- */
.carousel-sec { padding: 44px 0 36px; background: linear-gradient(180deg, #F3E8D4, #FBF6EC); border-bottom: 1px solid var(--line); }
.car-head { text-align: center; margin-bottom: 22px; }
.car-head h2 { font-size: clamp(28px, 3.4vw, 40px); color: var(--maroon); }
.car-head p:not(.eyebrow) { color: var(--ink-soft); margin: 4px 0 0; }
.car-stage { position: relative; width: min(800px, calc(100% - 32px)); margin: 0 auto; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  aspect-ratio: 4 / 3; border-radius: 10px; border: 1px solid var(--gold); background: #1e0a0d; box-shadow: 0 24px 50px -26px rgba(46,10,16,.6); }
.car-track::-webkit-scrollbar { display: none; }
.car-track:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
.car-card { position: relative; flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; overflow: hidden; border: 0; padding: 0; margin: 0; cursor: zoom-in; background: #1e0a0d; font: inherit; color: inherit; text-align: left; }
.car-card .bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(18px) brightness(.55); }
.car-card .fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.car-card .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 24px 18px; background: linear-gradient(transparent, rgba(30,6,10,.85)); color: #fff; }
.car-card .who { font-family: var(--serif-hi); font-size: clamp(20px, 2.6vw, 28px); line-height: 1.25; }
.car-card .where { font-size: 15px; color: var(--gold-light); }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--gold); background: rgba(251,246,236,.92); color: var(--maroon); cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.car-btn:hover { background: #fff; }
.car-btn svg { width: 24px; height: 24px; }
.car-btn.prev { left: -25px; }
.car-btn.next { right: -25px; }
.car-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 16px auto 0; max-width: 800px; padding: 0 16px; }
.car-dots button { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--gold); background: transparent; padding: 0; cursor: pointer; }
.car-dots button[aria-selected="true"] { background: var(--maroon); border-color: var(--maroon); width: 24px; border-radius: 6px; }
@media (max-width: 880px) {
  .car-btn.prev { left: 8px; }
  .car-btn.next { right: 8px; }
  .car-btn { width: 42px; height: 42px; }
}

.photo-drop { position: relative; }
.photo-drop #photo { left: 0; top: 0; margin: 0; padding: 0; border: 0; }

/* ======================= v3/v4: upload, field checks ======================= */
.link-btn { background: none; border: 0; color: var(--maroon); text-decoration: underline; cursor: pointer; font: inherit; font-size: 15px; padding: 0; }
.link-btn:disabled { color: var(--ink-soft); text-decoration: none; cursor: default; }
.form-error .en { display: block; font-size: 14px; opacity: .85; margin-top: 2px; }
.ink-rule { max-width: 1180px; margin: 12px auto 0; font-size: 15px; color: var(--ink-soft); text-align: center; }
.ink-rule b { color: var(--maroon); }

.up-card { max-width: 720px; margin: 34px auto 0; }
.file-drop { position: relative; border: 2px dashed var(--gold); border-radius: 10px; background: #fff; padding: 26px 18px; text-align: center; cursor: pointer; }
.file-drop.has { border-style: solid; background: #FFFBF2; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop svg { width: 40px; height: 40px; color: var(--gold-text); margin: 0 auto 6px; }
.file-drop b { color: var(--maroon); display: block; font-size: 18px; }
.file-drop small { color: var(--ink-soft); }
.file-name { margin-top: 8px; font-weight: 600; color: #1d5a2a; word-break: break-all; }
.dl-strip { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }

.field-hint { font-size: 14px; margin-top: 5px; line-height: 1.45; min-height: 0; }
.field-hint.good { color: #1d5a2a; }
.field-hint.bad { color: #9b1c1c; }
.field-hint.warn { color: #8a5a12; }
.field-hint .link-btn { font-size: 14px; font-weight: 600; }
