/* Invitation card designer: gallery, editor, my designs, supplier view and the
   A5 print page. Loaded after app.css on those pages (print page loads it alone). */

@font-face { font-family: "Anek Tamil"; src: url("../fonts/anek-tamil-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Anek Tamil"; src: url("../fonts/anek-tamil-tamil-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; }
@font-face { font-family: "Arima"; src: url("../fonts/arima-latin-wght-normal.woff2") format("woff2"); font-weight: 100 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Arima"; src: url("../fonts/arima-tamil-wght-normal.woff2") format("woff2"); font-weight: 100 700; font-display: swap; unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; }

.card-svg { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- gallery */
.card-filters { margin-bottom: 18px; }
.card-filters .chips { margin-bottom: 14px; }
.card-gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.card-tile { display: block; padding: 10px; color: var(--ivory); text-decoration: none; transition: transform 0.15s, border-color 0.15s; }
.card-tile:hover, .card-tile:focus-visible { border-color: var(--gold); transform: translateY(-3px); color: var(--ivory); }
.card-tile .card-frame { border-radius: 8px; overflow: hidden; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.9); aspect-ratio: 148 / 210; background: #fff; }
.card-tile h3 { font-size: 0.98rem; margin: 10px 2px 2px; font-family: var(--font-body); font-weight: 600; line-height: 1.3; }
.card-tile .meta { margin: 0 2px; color: var(--muted); font-size: 0.85rem; display: flex; justify-content: space-between; gap: 8px; }
.card-tile .code { font-variant-numeric: tabular-nums; color: var(--gold-light); }
.card-count { color: var(--muted); margin: 0 0 12px; }

/* ----------------------------------------------------------------- editor */
.card-editor { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
@media (max-width: 960px) { .card-editor { grid-template-columns: 1fr; } }
.card-stage { position: sticky; top: 84px; padding: 16px; }
@media (max-width: 960px) { .card-stage { position: static; } }
.card-preview { width: min(100%, 440px); margin: 0 auto; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.9); aspect-ratio: 148 / 210; position: relative; }
.card-preview.busy::after { content: ""; position: absolute; inset: 0; background: rgba(8, 26, 51, 0.18); }
.card-stage .actions { justify-content: center; margin-top: 14px; }
.card-stage .tname { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 10px 0 0; }
.card-stage .tname strong { color: var(--gold-light); }
.card-form .seg { margin-bottom: 4px; }
.card-form .pair { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.card-form textarea.input { min-height: 72px; }
.card-form .field label { font-size: 0.95rem; }
.card-form .fills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-form .fills span { color: var(--muted); font-size: 0.92rem; }
.card-status { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; margin: 0; }
.card-status.err { color: #FFC2B8; }

/* ---------------------------------------------------------- my designs */
.design-list .card-tile .meta { flex-direction: column; gap: 2px; }
.design-actions { display: flex; gap: 8px; margin-top: 10px; }
.design-actions form { display: inline; }

/* ------------------------------------------------------ printers list */
.printers { display: grid; gap: 10px; }
.printer { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); cursor: pointer; }
.printer:has(input:checked) { border-color: var(--gold); background: rgba(212, 175, 55, 0.1); }
.printer input { accent-color: var(--gold); width: 18px; height: 18px; }
.printer .price { color: var(--gold-light); font-weight: 600; white-space: nowrap; }
.printer .meta { grid-column: 2 / -1; color: var(--muted); font-size: 0.9rem; margin: 0; }

/* -------------------------------------------------------------- print page */
@page { size: A5 portrait; margin: 0; }
body.card-print { margin: 0; background: #E9EDF3; color: #14233B; font-family: "Anek Tamil", "Noto Sans Tamil", system-ui, sans-serif; }
.card-print .doc-bar { display: flex; gap: 12px; justify-content: center; padding: 14px; background: #081A33; }
.card-print .doc-bar a, .card-print .doc-bar button { font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 10px; border: 1px solid #D4AF37; background: transparent; color: #F0D98A; text-decoration: none; cursor: pointer; }
.card-print .doc-bar button { background: #D4AF37; color: #081A33; }
.card-sheet { width: 148mm; height: 210mm; margin: 18px auto; box-shadow: 0 10px 30px rgba(8, 26, 51, 0.18); background: #fff; }
.card-sheet .card-svg { width: 148mm; height: 210mm; }
@media (max-width: 640px) { .card-sheet { width: calc(100vw - 24px); height: auto; margin: 12px; } .card-sheet .card-svg { width: 100%; height: auto; } }
@media print {
  body.card-print { background: #fff; }
  .card-print .doc-bar { display: none; }
  .card-sheet { margin: 0; box-shadow: none; width: 148mm; height: 210mm; }
  .card-sheet .card-svg { width: 148mm; height: 210mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
