/**
 * Custom Card Image Templates CSS
 *
 * Styles for image-based custom eCard templates.
 * Replaces CSS-generated themes with image backgrounds and overlays.
 */

/* ── Page 1: Front cover with photo overlay ── */
.cc-img-page-front {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* User photo overlay - positioned from saved placement data. */
.cc-img-page-front .cc-user-photo-frame {
    position: absolute;
    top: 26.857%;
    left: 17.6%;
    width: 64.8%;
    height: 46.286%;
    z-index: 1;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 2px;
    box-shadow:
        0 0 0 1px rgba(45, 58, 74, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.55),
        0 8px 18px rgba(45, 58, 74, 0.16);
    box-sizing: border-box;
    overflow: hidden;
    transform-origin: center center;
}

.cc-img-page-front .cc-user-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder styling when no photo uploaded */
.cc-img-page-front .cc-user-photo-frame--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    border: 2px dashed rgba(0, 0, 0, 0.3);
    box-shadow: none;
    z-index: 1;
}

.cc-img-page-front .cc-user-photo-frame--placeholder span {
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    text-align: center;
}

.cc-img-page-front .cc-user-photo-frame.is-adjustable {
    cursor: grab;
    touch-action: none;
}

.cc-img-page-front .cc-user-photo-frame.is-adjustable:active {
    cursor: grabbing;
}

/* ── Page 2: Inside-left greeting overlay (matches page-3 viewer-message) ── */
.cc-page2-message {
    position: absolute;
    top: 8%;
    bottom: 8%;
    left: 9%;
    right: 9%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    color: #222;
    pointer-events: none;
    z-index: 10;
}

.cc-page2-message-inner {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
    font-family: 'Varela Round', 'Quicksand', sans-serif;
    font-size: 1.75rem;
    line-height: 1.28;
    text-shadow: 0 1px 2px rgba(255, 255, 255, .85);
}
