/* Gallery Manager — printable documents (proforma invoice, public RSVP). */
* { box-sizing: border-box; }
body {
    font-family: Helvetica, Arial, sans-serif; color: #1a1a1a; margin: 0;
    background: #eceef1; font-size: 13px; line-height: 1.5;
}
.doc {
    position: relative;
    max-width: 820px; margin: 24px auto; background: #fff; padding: 56px 64px;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.pf-paid-stamp {
    position: absolute; top: 150px; right: 40px; z-index: 5;
    border: 3px solid #027a48; color: #027a48; border-radius: 8px;
    font-size: 26px; font-weight: 800; letter-spacing: .12em; padding: .12em .4em;
    opacity: .85;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.toolbar-print { display: flex; justify-content: space-between; margin: -24px auto 12px; max-width: 820px; }
.toolbar-print a { color: #4338ca; text-decoration: none; font-size: 13px; }
.toolbar-print button { background: #4338ca; color: #fff; border: none; border-radius: 6px; padding: .5rem .9rem; cursor: pointer; }

/* Proforma */
.pf-wordmark { text-align: center; font-size: 22px; letter-spacing: .28em; font-weight: 400; margin-bottom: 28px; }
.pf-banner { background: #f3f4f6; text-align: center; font-weight: 700; padding: 10px; letter-spacing: .02em;
    border-top: 2px solid #111; border-bottom: 1px solid #111; margin-bottom: 24px; }
.pf-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 1px solid #ddd; padding-bottom: 18px; }
.pf-issuer { white-space: pre-line; }
.pf-issuer { font-weight: 400; }
.pf-meta { text-align: right; color: #333; }
.pf-meta span { color: #777; }
.pf-parties { display: flex; gap: 40px; margin: 22px 0; }
.pf-party { flex: 1; }
.pf-party h4 { font-size: 12px; font-weight: 700; border-bottom: 1px solid #111; padding-bottom: 6px; margin: 0 0 10px; }
.pf-addr { white-space: pre-line; }
.pf-items { width: 100%; border-collapse: collapse; margin: 18px 0; }
.pf-items th { font-size: 11px; color: #333; text-transform: uppercase; border-bottom: 1px solid #111; padding: 8px 6px; text-align: right; }
.pf-items th.l { text-align: left; } .pf-items th.c { text-align: center; }
.pf-items td { padding: 12px 6px; vertical-align: top; text-align: right; border-bottom: 1px solid #eee; }
.pf-items td.l { text-align: left; } .pf-items td.c { text-align: center; }
.aw-artist { font-weight: 700; }
.pf-totals { width: 300px; margin-left: auto; margin-top: 8px; }
.pf-totals .row { display: flex; justify-content: space-between; padding: 6px 0; }
.pf-totals .row.muted { color: #777; }
.pf-totals .row.total { border-top: 1px solid #111; margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 15px; }
.pf-caption { text-align: right; color: #888; font-size: 11px; margin-top: 6px; }
.pf-section { border-top: 1px solid #ddd; margin-top: 28px; padding-top: 16px; }
.pf-section h4 { font-size: 12px; font-weight: 700; margin: 0 0 8px; }
.pf-footer { border-top: 1px solid #ddd; margin-top: 32px; padding-top: 14px; text-align: center; color: #999; font-size: 11px; }
.muted { color: #888; }

/* Public RSVP / VIP form */
.vip { max-width: 760px; margin: 24px auto; background: #fff; padding: 48px 56px; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.vip h1 { font-size: 26px; line-height: 1.3; font-weight: 600; margin: 0 0 6px; }
.vip .lead { font-size: 18px; color: #333; margin: 0 0 28px; }
.vip .ask { text-align: right; font-size: 22px; color: #111; margin: 18px 0; }
.vip-event { display: flex; justify-content: space-between; gap: 24px; padding: 18px 0; border-bottom: 1px solid #eee; }
.vip-event h3 { margin: 0 0 4px; font-size: 17px; }
.vip-event .meta { color: #555; white-space: pre-line; }
.vip-event a { color: #4338ca; text-decoration: none; }
.cal-add { display: inline-block; margin-top: 4px; font-size: 13px; color: #4338ca; text-decoration: none; }
.cal-add:hover { text-decoration: underline; }
.vip-choices { display: flex; gap: 18px; align-items: center; white-space: nowrap; }
.vip-choices label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.vip-fields { display: flex; gap: 16px; margin: 24px 0; flex-wrap: wrap; }
.vip-fields input { flex: 1; min-width: 220px; padding: .65rem .8rem; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }
.vip-submit { background: #111; color: #fff; border: none; border-radius: 8px; padding: .8rem 1.6rem; font-size: 16px; cursor: pointer; }
.vip-ok { background: #ecfdf3; color: #027a48; border: 1px solid #a6f4c5; padding: 1rem; border-radius: 8px; margin-bottom: 20px; }
.form-contact-foot { margin-top: 30px; padding-top: 16px; border-top: 1px solid #e6e9f0; text-align: center; }
.form-contact-foot .ff-name { font-weight: 700; font-size: 15px; color: #1d2433; }
.form-contact-foot .ff-lines { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; font-size: 14px; }
.form-contact-foot .ff-lines a { color: #4338ca; text-decoration: none; }
.vip-foot { text-align: center; color: #aaa; font-size: 12px; margin-top: 28px; }

@media print {
    /* Real A4 page with classic margins. */
    @page { size: A4; margin: 16mm 15mm; }
    html, body { background: #fff; }
    .no-print { display: none !important; }
    .doc { box-shadow: none; margin: 0; max-width: none; width: 100%; padding: 0; font-size: 12px; }
    /* Keep the document's two-column layout when printing. */
    .pf-head, .pf-parties { flex-direction: row !important; }
    .pf-totals { width: 300px !important; }
    /* Paginate cleanly: never split a line item, a party block, the totals,
       a section or the footer across A4 pages; repeat the table header. */
    .pf-items thead { display: table-header-group; }
    .pf-items tr, .pf-party, .pf-totals, .pf-section, .pf-footer,
    .aw-artist, .pf-issuer, .pf-meta { break-inside: avoid; page-break-inside: avoid; }
    .pf-section h4, .pf-party h4 { break-after: avoid; }
    .pf-paid-stamp { top: 150px; }
}

/* Public custom-form fields */
.pub-field { display: block; margin: 14px 0; }
.pub-field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.pub-field input[type=text], .pub-field input[type=email], .pub-field input[type=number],
.pub-field input[type=date], .pub-field select, .pub-field textarea {
    width: 100%; padding: .6rem .7rem; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; font-family: inherit; }
.pub-field .check { font-weight: 400; }

/* Cover photo + logo on a public form */
.form-cover { margin: -10px 0 18px; }
.form-cover img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; display: block; }
.form-logo { text-align: center; margin: 6px 0 16px; }
/* Per-form content alignment (default left). */
.vip.al-left  { text-align: left; }
.vip.al-center{ text-align: center; }
.vip.al-right { text-align: right; }
.vip.al-left  .form-logo, .vip.al-left  .form-contact-foot { text-align: left; }
.vip.al-left  .form-contact-foot .ff-lines { align-items: flex-start; }
.vip.al-center .form-logo, .vip.al-center .form-contact-foot { text-align: center; }
.vip.al-center .form-contact-foot .ff-lines { align-items: center; }
.vip.al-right .form-logo, .vip.al-right .form-contact-foot { text-align: right; }
.vip.al-right .form-contact-foot .ff-lines { align-items: flex-end; }
.form-logo img { width: 25%; min-width: 120px; max-width: 240px; height: auto; }
.form-from { color: #667085; font-size: 13px; margin-bottom: 2px; }
.pub-phone { display: flex; gap: 8px; }
.pub-phone select { flex: 0 0 auto; width: auto; min-width: 110px; padding: .65rem .8rem; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; background: #fff; color: inherit; font-family: inherit; }
.pub-phone input { flex: 1; }
.pub-newsletter { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0; padding: 12px 14px; background: #f6f7f9; border-radius: 8px; font-size: 14px; }
.pub-newsletter input { margin-top: 2px; }

/* Square option style: render radios & checkboxes as squares with a tick. */
.opt-square input[type=radio], .opt-square input[type=checkbox] {
    appearance: none; -webkit-appearance: none; width: 19px; height: 19px;
    border: 2px solid #9aa1ab; border-radius: 4px; vertical-align: -4px;
    margin-right: 6px; cursor: pointer; position: relative; background: #fff; }
.opt-square input[type=radio]:checked, .opt-square input[type=checkbox]:checked {
    background: #111; border-color: #111; }
.opt-square input[type=radio]:checked::after, .opt-square input[type=checkbox]:checked::after {
    content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Public forms catalog landing */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.catalog-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid #e5e7eb; border-radius: 12px; text-decoration: none; color: inherit; background: #fff; transition: box-shadow .15s, border-color .15s; }
.catalog-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: #c7d2fe; }
.catalog-card h3 { margin: 0; font-size: 16px; font-weight: 600; color: #111; }
.catalog-card .muted { color: #666; font-size: 13px; margin: 0; }
.catalog-go { margin-top: auto; color: #4338ca; font-weight: 600; font-size: 14px; }

/* Studio-visit works picker */
.sv-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 6px; margin: 8px 0 14px; }
.sv-works .check { font-weight: 400; }

/* Mobile: public forms, invoices & catalogs (screen only — never in print) */
@media screen and (max-width: 640px) {
    body { font-size: 14px; }
    .doc { margin: 0; padding: 20px 16px; box-shadow: none; }
    .vip { margin: 0; padding: 24px 18px; box-shadow: none; }
    .vip h1 { font-size: 21px; }
    .vip .lead { font-size: 16px; }
    .vip-fields { flex-direction: column; gap: 10px; }
    .vip-fields input { min-width: 0; width: 100%; }
    .vip-event { flex-direction: column; gap: 8px; }
    .vip-choices { gap: 14px; }
    .vip-submit { width: 100%; }
    .catalog { grid-template-columns: 1fr; }
    .pf-head, .pf-parties { flex-direction: column; gap: 14px; }
    .pf-totals { width: 100%; }
    .toolbar-print { padding: 0 12px; }
    .sv-works { grid-template-columns: 1fr; }
}
