.rzym-tool { max-width: 1200px; margin: 2rem auto 4rem; }
.rzym-tool label { display: block; font-weight: 700; }
.rzym-tool input, .rzym-tool select { display: block; width: 100%; max-width: 34rem; margin-top: .45rem; padding: .75rem; border: 1px solid #697a67; border-radius: 4px; background: #fff; color: #263326; font: inherit; }
.rzym-tool button { min-height: 44px; padding: .65rem 1rem; border: 0; border-radius: 4px; background: #314b2f; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.rzym-tool button:hover { background: #536b1f; }
.rzym-tool button:disabled { background: #777; cursor: not-allowed; }
.rzym-tool-note { max-width: 68ch; color: #526353; }
.rzym-tool-status { min-height: 1.5em; font-weight: 700; }
.rzym-wishes-group[hidden] { display: none; }
.rzym-wish[hidden] { display: none; }
.rzym-wishes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.rzym-wish { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 1.5rem; border: 1px solid #dde3d7; background: #fbf8f0; }
.rzym-wish p { margin-top: 0; }
.rzym-wish button { align-self: flex-start; }
.rzym-obituary-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
.rzym-obituary-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.rzym-obituary-layout > br, .rzym-obituary-fields > br { display: none; }
.rzym-obituary-fields input, .rzym-obituary-fields select { max-width: none; }
.rzym-obituary-fields button { justify-self: start; }
.rzym-obituary-fields > .rzym-tool-note, .rzym-obituary-fields > .rzym-tool-status { grid-column: 1 / -1; }
.rzym-obituary { --rzym-obituary-ink: #111111; --rzym-obituary-motif: #303030; }
.rzym-obituary-sheet { width: min(100%, 1000px); aspect-ratio: 297 / 210; margin-inline: auto; padding: 10px; background: var(--rzym-obituary-ink); color: var(--rzym-obituary-ink); font-family: Georgia, 'Times New Roman', serif; text-align: center; overflow-wrap: anywhere; }
.rzym-obituary-card { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; padding: clamp(25px, 4vw, 48px) clamp(35px, 6vw, 70px); border: 5px double var(--rzym-obituary-ink); background: #fff; }
.rzym-obituary-sheet h2 { margin: .2rem 0 1rem; color: var(--rzym-obituary-ink); font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2rem, 5vw, 4.6rem); font-weight: 400; line-height: 1.12; overflow-wrap: anywhere; }
.rzym-obituary-sheet h2.is-long { font-size: clamp(1.6rem, 3.5vw, 3.2rem); }
.rzym-obituary-sheet p { max-width: 62ch; margin: .35rem 0; color: var(--rzym-obituary-ink); font-size: clamp(.85rem, 1.6vw, 1.3rem); line-height: 1.35; }
.rzym-obituary-intro { margin-top: 0 !important; }
.rzym-obituary-emblem { display: grid; justify-items: center; min-height: clamp(82px, 11vw, 128px); margin: .1rem 0 .35rem; color: var(--rzym-obituary-ink); }
.rzym-obituary-emblem > span { font-size: clamp(1.05rem, 2vw, 1.65rem); font-style: italic; font-weight: 700; letter-spacing: .16em; }
.rzym-obituary-motif { display: block; flex: none; margin-top: .1rem; overflow: visible; color: var(--rzym-obituary-motif); }
.rzym-obituary-motif[hidden], .rzym-obituary-emblem > span[hidden] { display: none !important; }
.rzym-obituary-motif-religious { width: clamp(54px, 7vw, 82px); height: auto; aspect-ratio: 317 / 497; }
.rzym-obituary-motif-neutral { width: clamp(112px, 17vw, 190px); height: auto; aspect-ratio: 673 / 273; margin-top: .65rem; }
.rzym-obituary-service { margin-top: .2rem; }
.rzym-obituary-sheet .rzym-obituary-main { font-weight: 700; }
.rzym-obituary-sheet .rzym-obituary-family { align-self: flex-end; margin-top: auto; text-align: right; }
.rzym-obituary-family span, .rzym-obituary-family strong { display: block; }
.rzym-obituary-family strong { font-weight: 700; }
.rzym-obituary-corner { position: absolute; width: clamp(38px, 6vw, 66px); height: auto; color: var(--rzym-obituary-motif); overflow: visible; }
.rzym-obituary-corner path { fill: currentColor; }
.rzym-obituary-corner .rzym-obituary-corner-stem, .rzym-obituary-corner .rzym-obituary-corner-curl { fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.rzym-obituary-corner-tl { top: 10px; left: 10px; }
.rzym-obituary-corner-tr { top: 10px; right: 10px; transform: rotate(90deg); }
.rzym-obituary-corner-bl { bottom: 10px; left: 10px; transform: rotate(-90deg); }
.rzym-obituary-corner-br { right: 10px; bottom: 10px; transform: rotate(180deg); }
@media screen and (min-width: 1050px) {
  .rzym-obituary-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem; }
  .rzym-obituary-sheet { width: 100%; }
  .rzym-obituary-card { padding: 18px 24px; }
  .rzym-obituary-sheet h2 { font-size: clamp(1.35rem, 2.4vw, 2.1rem); margin-bottom: .5rem; }
  .rzym-obituary-sheet h2.is-long { font-size: clamp(1.15rem, 2vw, 1.7rem); }
  .rzym-obituary-sheet p { font-size: clamp(.68rem, 1vw, .95rem); }
  .rzym-obituary-emblem { min-height: 0; margin-bottom: .2rem; }
  .rzym-obituary-emblem > span { font-size: clamp(.85rem, 1.25vw, 1.1rem); }
  .rzym-obituary-motif-religious { width: clamp(40px, 4.4vw, 58px); }
  .rzym-obituary-motif-neutral { width: clamp(95px, 11vw, 145px); }
  .rzym-obituary-corner { width: clamp(30px, 3.5vw, 46px); }
}@media (max-width: 850px) { .rzym-wishes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rzym-wishes-grid, .rzym-obituary-fields { grid-template-columns: 1fr; } .rzym-obituary-card { padding: 12px 18px; border-width: 3px; } .rzym-obituary-sheet { padding: 5px; } .rzym-obituary-sheet p { font-size: clamp(.55rem, 2.5vw, .85rem); } .rzym-obituary-sheet h2 { font-size: clamp(1.2rem, 6vw, 2rem); } .rzym-obituary-corner { display: none; } }
/* Keep the preview proportional to its own column, not to the viewport.
   Screen-only sizing deliberately leaves the physical A4 print rules below intact. */
.rzym-obituary-card > p:empty, .rzym-obituary-emblem > br { display: none; }
@media screen {
  .rzym-obituary-sheet { container-type: inline-size; padding: 0; min-width: 0; aspect-ratio: 297 / 210; }
  .rzym-obituary-card { box-sizing: border-box; height: auto; aspect-ratio: 297 / 210; padding: 3.5cqw 6cqw; border: 1.2cqw solid var(--rzym-obituary-ink); }
  .rzym-obituary-card::before { content: ''; position: absolute; inset: 1cqw; border: .45cqw double var(--rzym-obituary-ink); pointer-events: none; }
  .rzym-obituary-sheet h2 { font-size: 5cqw; line-height: 1.12; margin: .7cqw 0 1.2cqw; }
  .rzym-obituary-sheet h2.is-long { font-size: 3.8cqw; }
  .rzym-obituary-sheet p { font-size: 1.8cqw; line-height: 1.35; margin: .4cqw 0; }
  .rzym-obituary-emblem { min-height: 0; margin: .4cqw 0; gap: .3cqw; }
  .rzym-obituary-emblem > span { font-size: 2.4cqw; line-height: 1.2; }
  .rzym-obituary-motif-religious { width: 8cqw; height: auto; margin: 0; }
  .rzym-obituary-motif-neutral { width: 17cqw; height: auto; margin: 1cqw 0; }
  .rzym-obituary-service { margin-top: .3cqw; }
  .rzym-obituary-sheet .rzym-obituary-family { margin-top: auto; }
  .rzym-obituary-corner { display: block; width: 5cqw; }
  .rzym-obituary-corner-tl { top: 2cqw; left: 2cqw; }
  .rzym-obituary-corner-tr { top: 2cqw; right: 2cqw; }
  .rzym-obituary-corner-bl { bottom: 2cqw; left: 2cqw; }
  .rzym-obituary-corner-br { bottom: 2cqw; right: 2cqw; }
}
@page { size: A4 landscape; margin: 0; }
@media print {
  body:has([data-rzym-obituary]), body:has([data-rzym-obituary]) .wp-site-blocks { width: 297mm !important; max-width: 297mm !important; height: 210mm !important; max-height: 210mm !important; margin: 0 !important; padding: 0 !important; background: #fff !important; box-shadow: none !important; overflow: hidden !important; }
  body:has([data-rzym-obituary]) * { visibility: hidden !important; }
  .rzym-obituary-sheet, .rzym-obituary-sheet * { visibility: visible !important; }
  .rzym-obituary-sheet { position: fixed !important; top: 0 !important; left: 0 !important; width: 297mm !important; height: 210mm !important; min-height: 0 !important; max-height: 210mm !important; aspect-ratio: auto !important; margin: 0 !important; padding: 4mm !important; border: 0 !important; box-shadow: none !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; page-break-inside: avoid; }
  .rzym-obituary-card { padding: 10mm 20mm !important; border-width: 2mm !important; }
  .rzym-obituary-sheet h2 { font-size: 42pt !important; }
  .rzym-obituary-sheet h2.is-long { font-size: 31pt !important; }
  .rzym-obituary-sheet p { font-size: 15pt !important; }
  .rzym-obituary-emblem span { font-size: 20pt !important; }
  .rzym-obituary-motif-religious { width: 24mm !important; }
  .rzym-obituary-motif-neutral { width: 46mm !important; }
  .rzym-obituary-corner { display: block !important; width: 18mm !important; }
}
