/* WCL gift certificate.
 *
 * One stylesheet, three consumers: the sample on the landing page, the live
 * preview on /gift that fills in as she types, and the real personalised one
 * the Worker serves at /gift/certificate. Keeping the look in one file is the
 * only reason those three can never drift apart.
 *
 * Sized in container query units, so the same markup is a thumbnail on a phone
 * and a full sheet on A4 without a single breakpoint. The px values in each
 * rule are the fallback for anything that does not know cqw yet.
 */

.wclcert {
    container-type: inline-size;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    /* The dark card wants a little air around it or it reads as a banner. */
    padding: 0;
}

.wclcert__frame {
    position: relative;
    aspect-ratio: 1 / 1.32;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(230, 200, 139, .17), transparent 62%),
        linear-gradient(158deg, #43182C 0%, #5E2340 44%, #2C1220 100%);
    box-shadow: 0 18px 44px rgba(46, 18, 32, .34);
    color: #F6E9EF;
    font-family: Georgia, 'Times New Roman', serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* The footer is absolutely positioned, so without reserving its height the
       flex centring centres against the whole card and the block floats high,
       leaving a hole above the rule. Reserve it and the empty state balances
       as well as the filled one. */
    padding: 9% 8% 17%;
    isolation: isolate;
}

/* Two hairlines rather than one border: a single rule reads as a box, a pair
   reads as engraving. */
.wclcert__frame::before,
.wclcert__frame::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border: 1px solid rgba(230, 200, 139, .5);
    border-radius: 7px;
}

.wclcert__frame::before {
    inset: 4.2%;
}

.wclcert__frame::after {
    inset: 5.6%;
    border-color: rgba(230, 200, 139, .22);
}

/* The seal holds the real monogram, not the letters W C L set in Georgia.
   A certificate is the one place the mark has to be the mark. */
.wclcert__seal {
    width: 72px;
    width: 16cqw;
    height: 72px;
    height: 16cqw;
    border-radius: 50%;
    border: 1px solid rgba(230, 200, 139, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5%;
    background: radial-gradient(circle at 50% 35%, rgba(230, 200, 139, .16), transparent 70%);
    /* Georgia at .14em tracking was the old text seal. Any text still inside is
       a fallback for a logo that failed to load, so keep it legible. */
    font-family: Georgia, serif;
    font-size: 15px;
    font-size: 3.4cqw;
    letter-spacing: .14em;
    text-indent: .14em;
    color: #E6C88B;
}

.wclcert__seal img,
.wclcert__seal svg {
    width: 62%;
    height: auto;
    display: block;
}

.wclcert__kicker {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
    font-size: 2.15cqw;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: #E6C88B;
    text-indent: .34em;
}

.wclcert__for {
    font-size: 13px;
    font-size: 3cqw;
    font-style: italic;
    color: rgba(246, 233, 239, .62);
    margin-top: 7%;
}

.wclcert__name {
    font-size: 30px;
    font-size: 7.4cqw;
    line-height: 1.12;
    color: #fff;
    margin-top: 1.4%;
    text-wrap: balance;
    /* A long name must shrink the line, never break the card. */
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.wclcert__rule {
    width: 26%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(230, 200, 139, .85), transparent);
    margin: 5.5% 0;
}

.wclcert__gift {
    font-size: 17px;
    font-size: 4.1cqw;
    color: #E6C88B;
    line-height: 1.35;
}

.wclcert__dates {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-size: 2.5cqw;
    letter-spacing: .07em;
    color: rgba(246, 233, 239, .68);
    margin-top: 2.2%;
    line-height: 1.6;
}

.wclcert__msg {
    font-size: 12.5px;
    font-size: 3cqw;
    font-style: italic;
    line-height: 1.55;
    color: rgba(246, 233, 239, .82);
    margin-top: 6%;
    max-width: 84%;
    /* Four lines is the most a certificate can hold before it stops being one. */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wclcert__from {
    font-size: 13px;
    font-size: 3.1cqw;
    color: rgba(246, 233, 239, .78);
    margin-top: 6%;
}

.wclcert__from b {
    color: #fff;
    font-weight: normal;
}

.wclcert__foot {
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 7.2%;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 8px;
    font-size: 1.95cqw;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(230, 200, 139, .62);
}

.wclcert__ref {
    letter-spacing: .1em;
    font-variant-numeric: tabular-nums;
}

/* Print: one certificate, centred, no page furniture. */
@media print {
    .wclcert {
        max-width: 165mm;
    }

    .wclcert__frame {
        box-shadow: none;
        /* Backgrounds are dropped by default when printing, and this card is
           nothing without its ground. */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
