/* QR Memorial Plaque — Live Preview Styles v1.3.0 */

#qrm-preview { width: 100%; }

@media (min-width: 1024px) {
    #qrm-preview { position: sticky; top: 100px; }
}

/* ── Plaque wrapper — FIXED aspect ratio, never grows ── */
.qrm-wrap {
    position: relative;
    width: 100%;
    /* 16:9 approximation of a real plaque */
    padding-bottom: 56%;
    border-radius: 16px;
    border: 2px solid #9a6858;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Gradient bg — fills entire wrap ── */
.qrm-plaque-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #c49080 0%, #b07868 40%, #cc9888 70%, #9a6858 100%);
    transition: background 0.45s ease;
    z-index: 0;
}

/* Brushed metal texture */
.qrm-plaque-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.045) 0px,
        rgba(255,255,255,0.045) 1px,
        transparent 1px,
        transparent 4px
    );
    pointer-events: none;
}

/* ── Content — absolutely fills the wrap, never pushes height ── */
.qrm-plaque-content {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: 6% 5%;
    gap: 0;
    overflow: hidden; /* critical — clips long text */
}

/* ── QR side ── */
.qrm-qr-side {
    flex: 0 0 30%;
    max-width: 30%;
}

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

/* ── Divider ── */
.qrm-divider {
    flex-shrink: 0;
    width: 1px;
    align-self: stretch;
    border-left: 1px solid rgba(255,255,255,0.3);
    margin: 0 5%;
}

/* ── Text side — clips overflow, never wraps onto new lines ── */
.qrm-text-side {
    flex: 1;
    min-width: 0; /* allows flex children to shrink */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6%;
}

.qrm-name {
    font-family: Georgia, serif;
    font-size: clamp(7px, 1.4vw, 13px);
    letter-spacing: 0.15em;
    margin: 0;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qrm-ins {
    font-family: Georgia, serif;
    font-size: clamp(10px, 2.2vw, 22px);
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qrm-dates {
    font-family: Georgia, serif;
    font-size: clamp(7px, 1.1vw, 11px);
    letter-spacing: 0.08em;
    margin: 0;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qrm-heart {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: clamp(10px, 1.8vw, 20px);
    opacity: 0.7;
    line-height: 1;
}

/* ── Labels ── */
.qrm-label {
    font-family: Arial, sans-serif;
    font-size: 9px;
    letter-spacing: 2px;
    color: #999;
    text-align: center;
    margin: 12px 0 4px;
    text-transform: uppercase;
}

.qrm-sub {
    font-family: Georgia, serif;
    font-size: 13px;
    color: #555;
    text-align: center;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* ── Character counters ── */
.qrm-counters {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.qrm-cnt {
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.qrm-cnt.qrm-warn {
    color: #c0392b;
    border-color: #e74c3c;
    background: #fff5f5;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    #qrm-preview { margin-top: 24px; }
}
