/* assets/css/postcard.css: the virtual postcards (/cartolina, /cartolina/<code>, pages/postcard.php, 16 Oct 2026).
   The card: two faces stacked in one grid cell with a 3:2 sizer, the taller face sets the height, .is-flipped turns it over.
   Sizes in cqw (container query units) so the card keeps its proportions from the phone to the desktop. */
@font-face { font-family: "Caveat"; src: url("/assets/fonts/caveat-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Caveat"; src: url("/assets/fonts/caveat-var-ext.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+2113; }

.pc { --pc-ink: #1f3a68; --pc-line: #cdbfa6; --pc-paper: #fffaf0; container-type: inline-size; perspective: 1800px; width: 100%; max-width: 720px; margin: 0 auto; }
.pc-inner { display: grid; grid-template-columns: minmax(0, 1fr); position: relative; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.pc-inner::before { content: ""; grid-area: 1 / 1; aspect-ratio: 3 / 2; }
.pc.is-flipped .pc-inner { transform: rotateY(180deg); }
.pc-face { grid-area: 1 / 1; position: relative; border-radius: 6px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 3px rgba(23, 37, 44, .12), 0 20px 44px rgba(23, 37, 44, .2); }
.pc-back { transform: rotateY(180deg); }
@media (prefers-reduced-motion: reduce) { .pc-inner { transition: none; } }

/* front: the photos (1 to 4) and the title */
.pc-front { display: flex; background: var(--pc-paper); }
.pc-photos { flex: 1; display: grid; gap: 1cqw; min-height: 0; }
.pc[data-n="2"] .pc-photos { grid-template-columns: 1fr 1fr; }
.pc[data-n="3"] .pc-photos { grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; }
.pc[data-n="3"] .pc-ph:first-child { grid-row: span 2; }
.pc[data-n="4"] .pc-photos { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pc-ph { margin: 0; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--sea-deep), var(--sea)); min-height: 0; }
.pc-ph[hidden] { display: none; }
.pc-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-title { position: absolute; left: 0; right: 0; margin: 0; pointer-events: none; z-index: 2; }

/* vintage: white frame, warm photos, big lettering */
.pc-vintage .pc-front { padding: 3.4cqw; background: #fffdf7 radial-gradient(ellipse at 30% 20%, #fff 0, #f6eedd 100%); }
.pc-vintage .pc-ph img { filter: sepia(.18) saturate(.9) contrast(1.04); }
.pc-vintage .pc-title { bottom: 6cqw; text-align: center; padding: 0 6cqw; }
.pc-vintage .pc-title span { display: inline-block; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 7.4cqw; line-height: 1; letter-spacing: -.01em; color: #ffc65c; transform: rotate(-3deg);
  text-shadow: .35cqw .35cqw 0 #8a2d18, .7cqw .7cqw 0 rgba(8, 40, 46, .55), 0 0 3cqw rgba(0, 0, 0, .35); -webkit-text-stroke: .12cqw #8a2d18; }

/* moderna: photos edge to edge, clean title on a shade */
.pc-moderna .pc-front { background: #fff; }
.pc-moderna .pc-photos { gap: .5cqw; }
.pc-moderna .pc-front::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(8, 30, 36, .78)); pointer-events: none; }
.pc-moderna .pc-title { bottom: 4.5cqw; padding: 0 5cqw; }
.pc-moderna .pc-title span { display: inline-block; font-family: var(--font); font-weight: 800; font-size: 6.2cqw; line-height: 1.05; letter-spacing: -.02em; color: #fff; padding-top: 1.6cqw; border-top: .8cqw solid var(--coral); }

/* back: the message on the left, stamp, postmark and address on the right */
.pc-back { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4cqw; padding: 5cqw; background: var(--pc-paper); color: var(--pc-ink); }
.pc-msg { display: flex; flex-direction: column; padding-right: 4cqw; border-right: .25cqw solid var(--pc-line); min-width: 0; }
.pc-text { margin: 0; font-family: "Caveat", "Segoe Print", cursive; font-weight: 500; font-size: max(17px, 3.6cqw); line-height: 1.22; overflow-wrap: anywhere; }
.pc-sign { margin: auto 0 0; padding-top: 2cqw; text-align: right; font-family: "Caveat", cursive; font-weight: 700; font-size: max(19px, 4.2cqw); }
.pc-side { display: flex; flex-direction: column; min-width: 0; }
.pc-stamps { position: relative; display: flex; justify-content: flex-end; align-items: flex-start; min-height: 17cqw; }
.pc-stamp { position: relative; display: flex; flex-direction: column; width: 13cqw; min-width: 64px; aspect-ratio: 4 / 5; padding: .9cqw .9cqw 0; transform: rotate(3deg);
  background: radial-gradient(circle at .55cqw .55cqw, transparent .42cqw, #fff .48cqw) -.55cqw -.55cqw / 1.1cqw 1.1cqw; filter: drop-shadow(0 1px 1.5px rgba(23, 37, 44, .3)); }
.pc-stamp img { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.pc-stamp span { font: 700 max(8px, 1.4cqw) / 1.6 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--coral-dark); text-align: center; }
.pc-mark { position: absolute; right: 9cqw; top: 3.5cqw; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 15cqw; min-width: 72px; aspect-ratio: 1;
  border: .3cqw solid rgba(31, 58, 104, .55); border-radius: 50%; color: rgba(31, 58, 104, .7); transform: rotate(-14deg); text-align: center; line-height: 1.15; }
.pc-mark::after { content: ""; position: absolute; left: 92%; top: 30%; width: 11cqw; height: 40%; border-block: .3cqw solid rgba(31, 58, 104, .4); border-radius: 40%; }
.pc-mark-town { font: 700 max(8px, 1.35cqw) var(--font); letter-spacing: .06em; text-transform: uppercase; max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-mark-date { font: 600 max(8px, 1.3cqw) var(--font); }
.pc-to { margin: auto 0 0; display: grid; gap: .3cqw; padding-bottom: .8cqw; border-bottom: .22cqw solid var(--pc-line); }
.pc-to small { font: 700 max(9px, 1.3cqw) var(--font); letter-spacing: .14em; text-transform: uppercase; color: #9b8f7c; }
.pc-to span { font-family: "Caveat", cursive; font-weight: 700; font-size: max(20px, 4.6cqw); line-height: 1.05; overflow-wrap: anywhere; }
.pc-lines { margin: 0; }
.pc-lines span { display: block; height: max(18px, 4cqw); border-bottom: .22cqw solid var(--pc-line); }
.pc-brand { margin: 2cqw 0 0; text-align: right; font: 700 max(8px, 1.25cqw) var(--font); letter-spacing: .14em; text-transform: uppercase; color: #9b8f7c; }

/* moderna back: clean type, a round photo sticker, a straight postmark */
.pc-moderna .pc-back { --pc-ink: var(--ink); --pc-line: #e6dfd2; background: #fff; }
.pc-moderna .pc-msg { border-right-color: var(--coral); }
.pc-moderna .pc-text { font-family: var(--font); font-weight: 450; font-size: max(14px, 2.5cqw); line-height: 1.5; }
.pc-moderna .pc-sign { font-family: var(--font); font-weight: 750; font-size: max(15px, 2.6cqw); }
.pc-moderna .pc-stamp { transform: none; padding: 0; background: none; border-radius: 50%; overflow: hidden; width: 13cqw; aspect-ratio: 1; filter: none; box-shadow: 0 0 0 .5cqw #fff, 0 0 0 .75cqw var(--sea); }
.pc-moderna .pc-stamp span { display: none; }
.pc-moderna .pc-mark { position: static; order: -1; margin-right: auto; width: auto; min-width: 0; aspect-ratio: auto; border: 0; border-radius: 0; transform: none; align-items: flex-start; color: var(--sea); }
.pc-moderna .pc-mark::after { display: none; }
.pc-moderna .pc-mark-town { max-width: none; }
.pc-moderna .pc-to span { font-family: var(--font); font-weight: 750; font-size: max(16px, 3.2cqw); }

/* the phone: the back stacks (message, then stamp and address) */
@container (max-width: 520px) {
  .pc-back { grid-template-columns: 1fr; gap: 4cqw; }
  .pc-msg { padding: 0 0 4cqw; border-right: 0; border-bottom: .4cqw solid var(--pc-line); }
  .pc-moderna .pc-msg { border-bottom-color: var(--coral); }
  .pc-stamps { min-height: 0; }
  .pc-mark { right: 22cqw; top: 1cqw; }
  .pc-to { margin-top: 3cqw; }
  .pc-lines { display: none; }
}

.pc-credits { max-width: 720px; margin: 1rem auto 0; font-size: .74rem; color: var(--muted); text-align: center; }
.pc-credits a { color: inherit; }
.pc-preview-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem .9rem; margin: 1.1rem 0 0; }
.pc-preview-tools small { color: var(--muted); }

/* the editor */
.pc-editor-wrap { padding-top: 1.4rem; }
.pc-editor { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.2rem; align-items: start; }
.pc-preview-sticky { position: sticky; top: 160px; }
.pc-form { gap: 1.4rem; }
.pc-step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: .8rem; }
.pc-step legend { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-size: 1.25rem; font-weight: 600; margin-bottom: .2rem; padding: 0; }
.pc-n { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--sea); color: #fff; font: 700 .95rem var(--font); }
.pc-hint { margin: 0; font-size: .86rem; color: var(--muted); }
.pc-count { color: var(--sea-deep); }
.pc-form input[type=checkbox], .pc-form input[type=radio] { width: auto; padding: 0; }
.pc-styles { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.pc-form .pc-style-opt { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; align-items: center; padding: .75rem; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; background: #fff; }
.pc-style-opt:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); }
.pc-style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pc-style-opt:has(input:focus-visible) { outline: 2px solid var(--sea); outline-offset: 2px; }
.pc-style-swatch { grid-row: span 2; width: 52px; height: 36px; border-radius: 4px; }
.pc-sw-vintage { background: linear-gradient(135deg, #d9a05b, #7a9cb0) padding-box; border: 4px solid #fffaf0; box-shadow: 0 0 0 1px #d9cfbd; }
.pc-sw-moderna { background: linear-gradient(transparent 50%, rgba(8, 30, 36, .8)), linear-gradient(135deg, #2b8fa0, #f2a33a); }
.pc-style-opt b { font-size: .98rem; }
.pc-style-opt small { font-size: .8rem; line-height: 1.35; }
.pc-pick-tools { display: flex; flex-wrap: wrap; gap: .5rem; }
.pc-pick-tools .search { flex: 1 1 200px; max-width: none; }
.pc-pick-tools select { width: auto; flex: 0 1 220px; border-radius: 999px; }
.pc-pick { list-style: none; margin: 0; padding: .3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .5rem; max-height: 440px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--sand); }
.pc-pick li[hidden] { display: none; }
.pc-form .pc-pick-opt { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; cursor: pointer; background: var(--sea-deep); font-weight: 400; }
.pc-pick-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pc-pick-opt img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.pc-pick-opt:hover img { transform: scale(1.05); }
.pc-pick-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem .45rem .35rem; background: linear-gradient(transparent, rgba(8, 30, 36, .85)); color: #fff; font-size: .72rem; font-weight: 600; line-height: 1.2;
}
.pc-pick-name > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-pick-badge { position: absolute; top: .35rem; right: .35rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font: 800 .85rem var(--font); color: #fff; background: rgba(8, 30, 36, .35); border: 2px solid #fff; }
.pc-pick-badge:empty { background: rgba(8, 30, 36, .2); }
.pc-pick-opt:has(input:checked) { box-shadow: inset 0 0 0 3px var(--coral); }
.pc-pick-opt:has(input:checked) .pc-pick-badge { background: var(--coral); }
.pc-pick-opt:has(input:focus-visible) { outline: 3px solid var(--sea); outline-offset: 2px; }
.pc-pick.is-full .pc-pick-opt:not(:has(input:checked)) { opacity: .45; }
.pc-occ { margin: 0; }
.pc-form .pc-occ .chip { display: inline-flex; font-weight: 550; cursor: pointer; }
.pc-occ .chip input { position: absolute; opacity: 0; pointer-events: none; }
.pc-occ .chip:has(input:checked) { background: var(--sea); border-color: var(--sea); color: #fff; }
.pc-occ .chip:has(input:focus-visible) { outline: 2px solid var(--sea); outline-offset: 2px; }
.pc-field > span { display: flex; justify-content: space-between; gap: 1rem; }
.pc-field small { font-weight: 500; }
.pc-form textarea { resize: vertical; min-height: 8rem; }
.pc-people { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.pc-friends { display: grid; gap: .5rem; padding: 1rem 1.1rem; border-radius: 12px; background: var(--sun-soft); border: 1px solid #f3d9a6; }
.pc-friends-h { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: #8a5300; }
.pc-form .nl-consent { font-weight: 400; }
.pc-form .nl-consent input { accent-color: var(--coral); }
.pc-submit { margin: 0; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1.08rem; }
.pc-submit .btn { width: 100%; justify-content: center; }
@media (max-width: 900px) {
  .pc-editor { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .pc-preview-sticky { position: static; }
}
@media (max-width: 600px) {
  .pc-styles, .pc-people { grid-template-columns: 1fr; }
  .pc-pick { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 360px; }
  .pc-form { padding: 1.1rem; }
}

/* the postcard received */
.pc-view-head { padding-bottom: .4rem; }
.pc-view { padding-top: 1.2rem; }
.pc-sent { margin: 0 auto 1.6rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: #e3f4e8; color: #17552b; text-align: left; }
.pc-sent-h { margin: 0 0 .2rem; font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.pc-sent p { margin: 0; }
.pc-share { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.pc-share input { flex: 1 1 240px; min-width: 0; font: inherit; font-size: .9rem; padding: .7rem .9rem; border: 1px solid #b9d9c2; border-radius: 10px; background: #fff; color: var(--ink); }
.pc-join .nl-row input { border-color: #cfc7b8; }
.pc-join .nl-consent input { accent-color: var(--coral); }
.pc-join h2 { margin-bottom: .3rem; }
.pc-join .alert { margin-top: 1rem; }
.pc-again h2 { margin-bottom: .3rem; }
.pc-text { white-space: pre-line; }
.pc-front, .pc-back { cursor: pointer; }
.pc-shake { display: inline-block; animation: pc-shake .4s; color: var(--coral-dark); }
@keyframes pc-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
