/* Franciscan e-cards: the maker (index), the card page, the sender's page. The card itself is drawn by ecards.js. */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Caveat:wght@500&family=Dancing+Script:wght@500&family=UnifrakturMaguntia&display=swap');
.ec { --ec-ink: #2b2420; --ec-paper: #fbf8f1; --ec-line: #e4dccd; --ec-red: #7a1f1f; --ec-brown: #5b3a29; --ec-gold: #b8892b; --ec-mute: #6b6259; }
.ec [hidden] { display: none !important }
.ec label { color: var(--ec-ink); text-transform: none; letter-spacing: normal; margin-top: 0 }
.ec-up .opt > label { display: block; font: 600 15px system-ui, sans-serif; cursor: pointer }
.ec-up .more label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font: 400 14px system-ui, sans-serif }
.ec-fonts label { flex-direction: row }
.ec h1 { margin-bottom: .2em; text-wrap: balance }
.ec .ec-lead { color: var(--ec-mute); max-width: 62ch; margin-top: 0 }

/* ---------- the card */
.ec-stagewrap { position: relative; overflow: hidden; padding: 18px 0 30px; perspective: 1800px }
.ec-stage { position: relative; margin: 0 auto; transition: height .9s ease, transform .9s ease }
.ec-card { position: absolute; left: 0; top: 0; width: var(--w); height: var(--h); transform-style: preserve-3d; transition: transform 1s cubic-bezier(.4,.1,.2,1); }
.ec-stage { width: var(--w); height: var(--h) }
.ec-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 2px; overflow: hidden }
.ec-inside { background: var(--ec-paper); box-shadow: 0 10px 28px rgba(40,25,10,.22), 0 1px 2px rgba(40,25,10,.2); transform: translateZ(0) }
.ec-flap { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.45,.05,.25,1); transform: translateZ(1px) }
.ec-front { box-shadow: 0 10px 28px rgba(40,25,10,.25), 0 1px 2px rgba(40,25,10,.2); background: #ddd }
.ec-front img { width: 100%; height: 100%; object-fit: cover; display: block }
.ec-flapback { background: linear-gradient(135deg, #f7f2e7, #efe7d6); }
.ec-back { transform: rotateY(180deg) translateZ(1px); box-shadow: 0 10px 28px rgba(40,25,10,.22) }
/* portrait cards open like a book; landscape cards open upward from a fold at the top */
.ec-p .ec-flap { transform-origin: left center }
.ec-p .ec-flapback { transform: rotateY(180deg) }
.ec-l .ec-flap { transform-origin: center top }
.ec-l .ec-flapback { transform: rotateX(180deg) }
.ec-stage[data-state="open"].ec-p .ec-flap { transform: translateZ(1px) rotateY(-178deg) }
.ec-stage[data-state="open"].ec-p { transform: translateX(var(--shift)) }
.ec-stage[data-state="open"].ec-l .ec-flap { transform: translateZ(1px) rotateX(178deg) }
.ec-stage[data-state="open"].ec-l { transform: translateY(var(--h)); margin-bottom: var(--h) }
.ec-stage[data-state="back"] .ec-card { transform: rotateY(180deg) }
.ec-stage { cursor: pointer }
.ec-stage:focus-visible { outline: 3px solid var(--ec-gold); outline-offset: 6px }

/* inside writing */
.ec-write { position: absolute; inset: 7% 9%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ec-ink); overflow: hidden; gap: .55em }
.ec-write > * { margin: 0; max-width: 100% }
.ec-verse-top { position: absolute; inset: 8% 9%; display: flex; align-items: center; justify-content: center; text-align: center; color: #2b2420; font-size: 1.15em }
.ec-verse-top .ec-verse { margin: 0; font-size: 1em; line-height: 1.45 }
.ec-verse { font-family: 'UnifrakturMaguntia', 'Old English Text MT', serif; white-space: pre-line; line-height: 1.35; font-size: .92em }
.ec-greet { font-size: 1.15em }
.ec-msg { white-space: pre-line; line-height: 1.38; overflow-wrap: anywhere }
.ec-bless { font-style: italic; color: var(--ec-brown); font-size: .86em; line-height: 1.35; font-family: 'EB Garamond', Georgia, serif }
.ec-sig { font-size: 1.1em; align-self: flex-end; text-align: right; padding-right: 4% }
.ec-photo { max-height: 34%; max-width: 70%; border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transform: rotate(-1.2deg); object-fit: cover }
.ec-f-classic { font-family: 'EB Garamond', Georgia, serif }
.ec-f-hand { font-family: 'Caveat', 'Segoe Print', cursive; font-size: 1.12em }
.ec-f-script { font-family: 'Dancing Script', 'Brush Script MT', cursive; font-size: 1.05em }
.ec-empty { color: #b3a894; font-style: italic }

/* the back: the prayer printed on the back of the note card, in a decorated frame; Peace Prayer cards in burgundy,
   St. Clare cards in Marian blue, both with gold */
.ec-back { --bk-ink: #6e1f22; --bk-gold: #b8892b; --bk-text: #3f2f27; --bk-tint: #f3e3d3;
  background: radial-gradient(ellipse at 50% 40%, #fffaf0 0%, #fbf3e4 55%, var(--bk-tint) 100%) }
.ec-back.bk-clare { --bk-ink: #2d4c7c; --bk-text: #26344a; --bk-tint: #dde6f0;
  background: radial-gradient(ellipse at 50% 40%, #fdfcf7 0%, #f3f2ec 55%, var(--bk-tint) 100%) }
.bk-deco { position: absolute; inset: 0; pointer-events: none; color: var(--bk-gold) }
.bk-frame { position: absolute; inset: 3.2%; border: .22em double var(--bk-gold) }
.bk-frame::after { content: ""; position: absolute; inset: .45em; border: 1px solid var(--bk-ink); opacity: .6 }
.bk-corner { position: absolute; width: 11%; height: auto; aspect-ratio: 1; color: var(--bk-ink) }
.bk-corner.tl { left: 5.2%; top: 5.2% } .bk-corner.tr { right: 5.2%; top: 5.2%; transform: scaleX(-1) }
.bk-corner.bl { left: 5.2%; bottom: 5.2%; transform: scaleY(-1) } .bk-corner.br { right: 5.2%; bottom: 5.2%; transform: scale(-1) }
.ec-backin { position: absolute; inset: 11% 14% 8%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .42em; color: var(--bk-text); font-family: 'EB Garamond', Georgia, serif; overflow: hidden }
.ec-backin .bk-top svg { width: 4.6em; height: auto; display: block }
.ec-backin h3 { margin: 0; font-size: 1.12em; font-weight: 600; color: var(--bk-ink); letter-spacing: .03em; font-variant: small-caps }
.ec-backin .sub { font-size: .66em; color: color-mix(in srgb, var(--bk-text) 70%, transparent); font-style: italic; margin-top: -.35em }
.ec-backin .bk-rule { color: var(--bk-gold); width: 7em } .ec-backin .bk-rule svg { width: 100%; display: block }
.ec-backin .x { white-space: pre-line; font-size: .74em; line-height: 1.4 }
.ec-backin .mark { margin-top: .4em; display: flex; align-items: center; gap: .5em; font-size: .58em; color: color-mix(in srgb, var(--bk-text) 70%, transparent) }
.ec-backin .mark img { width: 2.2em; height: auto }

/* envelope (the card page) */
.ec-env { position: relative; margin: 30px auto 10px; width: min(420px, 92%); aspect-ratio: 1.45; perspective: 1200px; cursor: pointer }
.ec-env .body { position: absolute; inset: 0; background: linear-gradient(160deg, #efe3c8, #e3d2ae); border-radius: 4px; box-shadow: 0 12px 30px rgba(40,25,10,.25) }
.ec-env .body::before, .ec-env .body::after { content: ""; position: absolute; bottom: 0; width: 0; height: 0; border-bottom: calc(min(420px, 92vw) / 1.45 * .62) solid #e8d9b8 }
.ec-env .body::before { left: 0; border-right: calc(min(420px, 92vw) * .55) solid transparent }
.ec-env .body::after { right: 0; border-left: calc(min(420px, 92vw) * .55) solid transparent }
.ec-env .flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; transform-origin: top; transition: transform .8s ease; z-index: 2 }
.ec-env .flap::before { content: ""; position: absolute; inset: 0; background: #dcc89f; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.ec-env .seal { position: absolute; left: 50%; top: 50%; translate: -50% -30%; z-index: 3; width: 62px; height: 62px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f3e3b6, #c9a24f); box-shadow: 0 2px 5px rgba(0,0,0,.35); display: grid; place-items: center; transition: opacity .4s }
.ec-env .seal img { width: 40px; height: auto }
.ec-env .to { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; z-index: 3; font: 1.15rem 'EB Garamond', Georgia, serif; color: var(--ec-brown) }
.ec-env.opened .flap { transform: rotateX(180deg) }
.ec-env.opened .seal { opacity: 0 }
.ec-env.gone { transition: opacity .6s, transform .6s; opacity: 0; transform: translateY(40px) }

/* controls under the card */
.ec-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 6px }
.ec-controls button, .ec-btn { font: 600 15px system-ui, sans-serif; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--ec-red); background: #fff; color: var(--ec-red); cursor: pointer; text-decoration: none; display: inline-block }
.ec-controls button.main, .ec-btn.main { background: var(--ec-red); color: #fff }
.ec-controls button:focus-visible, .ec-btn:focus-visible { outline: 3px solid var(--ec-gold); outline-offset: 2px }
.ec-hint { text-align: center; color: var(--ec-mute); font-size: 14px; margin: 4px 0 }

/* ---------- the maker */
.ec-make { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start }
@media (max-width: 900px) { .ec-make { grid-template-columns: minmax(0, 1fr) } }
.ec-steps { display: flex; flex-direction: column; gap: 22px; min-width: 0 }
.ec-step { background: #fffdf8; border: 1px solid var(--ec-line); border-radius: 8px; padding: 16px 18px }
.ec-step h2 { margin: 0 0 10px; font-size: 1.2rem; display: flex; gap: 10px; align-items: baseline }
.ec-step h2 .n { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--ec-brown); color: #fff; font: 600 .8rem system-ui, sans-serif; flex: none }
.ec-preview { position: sticky; top: 12px; min-width: 0 }
@media (max-width: 900px) { .ec-preview { position: static; order: -1 } }
.ec-preview .ec-tabs { display: flex; gap: 6px; justify-content: center }
.ec-tabs button { font: 600 14px system-ui, sans-serif; padding: 7px 14px; border-radius: 18px; border: 1px solid var(--ec-line); background: #fff; color: var(--ec-ink); cursor: pointer }
.ec-tabs button[aria-pressed="true"] { background: var(--ec-brown); border-color: var(--ec-brown); color: #fff }
.ec-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px }
.ec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; align-items: center }
.ec-pick { border: 2px solid transparent; border-radius: 4px; padding: 3px; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 12px/1.25 system-ui, sans-serif; color: var(--ec-mute) }
.ec-pick img { width: 100%; aspect-ratio: var(--ar); object-fit: cover; box-shadow: 0 2px 5px rgba(0,0,0,.18); display: block }
.ec-pick.p img { width: 78% }
.ec-pick[aria-pressed="true"] { border-color: var(--ec-red); background: #f6ece4; color: var(--ec-ink) }
.ec-pick:focus-visible { outline: 3px solid var(--ec-gold) }
.ec-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 600; font-size: 14px }
.ec-field small { font-weight: 400; color: var(--ec-mute) }
.ec-field input, .ec-field textarea, .ec-field select { font: 16px system-ui, sans-serif; padding: 9px 11px; border: 1px solid #c9bfae; border-radius: 6px; width: 100%; background: #fff; box-sizing: border-box }
.ec-field textarea { min-height: 120px; resize: vertical; line-height: 1.4 }
.ec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
@media (max-width: 520px) { .ec-row { grid-template-columns: 1fr } }
.ec-fonts { display: flex; gap: 8px; flex-wrap: wrap }
.ec-fonts label { border: 1px solid var(--ec-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 400; display: flex; gap: 6px; align-items: center; font-size: 18px; background: #fff }
.ec-fonts input { accent-color: var(--ec-red) }
.ec-up { display: flex; flex-direction: column; gap: 10px }
.ec-up > label, .ec-up .opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; border: 1px solid var(--ec-line); border-radius: 6px; padding: 10px 12px; background: #fff; font-size: 15px; cursor: pointer }
.ec-up .price { font-weight: 700; color: var(--ec-brown); font-variant-numeric: tabular-nums }
.ec-up .sub { display: block; color: var(--ec-mute); font-size: 13px; margin-top: 2px }
.ec-up .more { grid-column: 2 / 4; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 14px }
.ec-up input[type=checkbox], .ec-up input[type=radio] { accent-color: var(--ec-red); width: 18px; height: 18px; margin-top: 2px }
.ec-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--ec-line); padding-top: 12px; margin-top: 4px; font-size: 17px }
.ec-total b { font-size: 22px; font-variant-numeric: tabular-nums }
.ec-err { color: #a12a1b; font-weight: 600; min-height: 1.2em; margin: 8px 0 }
.ec-ok { color: #2e6b2e; font-weight: 600 }
.ec-code { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #f6efe0; border-radius: 6px; padding: 12px; margin: 10px 0 }
.ec-code input { font: 600 22px system-ui, sans-serif; letter-spacing: 6px; width: 8.5em; padding: 6px 10px; border: 1px solid #c9bfae; border-radius: 6px }
.ec-note { font-size: 13px; color: var(--ec-mute) }
.ec-count { font-weight: 400; color: var(--ec-mute) }
.ec-hide { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden }
.ec-preview-banner { background: #fff3cd; border: 1px solid #e6c96b; border-radius: 6px; padding: 8px 12px; font-size: 14px; margin-bottom: 14px }

/* sender's page and card page extras */
.ec-share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 }
.ec-share input { flex: 1 1 260px; min-width: 0; font: 14px system-ui, sans-serif; padding: 8px 10px; border: 1px solid #c9bfae; border-radius: 6px }
.ec-people { width: 100%; border-collapse: collapse; background: #fffdf8; font-size: 15px }
.ec-people td, .ec-people th { padding: 8px 10px; border-bottom: 1px solid var(--ec-line); text-align: left }
.ec-tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700 }
.ec-tag.y { background: #dbeedb } .ec-tag.n { background: #eee6d8 } .ec-tag.w { background: #ffe9b3 }
.ec-after { max-width: 640px; margin: 18px auto 0; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center }
.ec-after .from { font: 1.15rem 'EB Garamond', Georgia, serif; color: var(--ec-brown) }
.ec-after .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center }
.ec-after form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center }
.ec-after form input { font: 15px system-ui, sans-serif; padding: 9px 11px; border: 1px solid #c9bfae; border-radius: 6px; min-width: 0; flex: 1 1 220px }
.ec-shared { font-size: 13px; color: var(--ec-mute); display: flex; gap: 6px; align-items: center; justify-content: center }
.ec-shared img { width: 22px }
@media (prefers-reduced-motion: reduce) { .ec-card, .ec-flap, .ec-stage, .ec-env .flap, .ec-env.gone { transition: none !important } }
/* while the card is closed, only the front shows (the inside page waits until the card opens) */
.ec-inside { transition: visibility 0s linear 1.05s }
.ec-stage[data-state="closed"] .ec-inside { visibility: hidden }
.ec-stage[data-state="open"] .ec-inside { transition-delay: 0s }
