/* ═══════════════════════════════════════════
   DIPLOMA — "Diploma dell'Amore"
   On-page certificate; js/diploma.js fills the text from config.js and
   renders a matching high-resolution PNG on an off-screen canvas for
   the download button (no DOM-to-image library is available here —
   see that file for why the export is drawn natively instead).
   ═══════════════════════════════════════════ */

.diploma-panel {
    text-align: center;
}

.diploma-frame {
    max-width: 760px;
    margin: 0 auto;
}

.diploma-card {
    position: relative;
    background: linear-gradient(160deg, rgba(22, 4, 15, 0.96), rgba(5, 0, 5, 0.98));
    border: 1px solid rgba(255, 42, 133, 0.4);
    border-radius: 1.5rem;
    padding: clamp(2.4rem, 6vw, 4rem) clamp(1.6rem, 6vw, 3.4rem) clamp(2.2rem, 5vw, 3rem);
    box-shadow: 0 0 100px rgba(255, 42, 133, 0.18),
                inset 0 0 60px rgba(255, 42, 133, 0.04);
    overflow: hidden;
}
.diploma-card::before {
    /* inner ornamental border, echoing the double border of a real diploma */
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(255, 42, 133, 0.22);
    border-radius: 1.1rem;
    pointer-events: none;
}
.diploma-card::after {
    /* one-shot light sweep, played once when the card scrolls into view */
    content: '';
    position: absolute;
    top: -20%;
    left: 0;
    width: 40%;
    height: 140%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    pointer-events: none;
    opacity: 0;
}
.js-ready .diploma-panel.in-view .diploma-card::after {
    animation: shineSweep 1.7s ease-out 0.5s both;
}

.diploma-corner {
    position: absolute;
    font-size: 1.1rem;
    color: rgba(255, 42, 133, 0.55);
}
.diploma-corner.tl { top: 1.4rem; left: 1.4rem; }
.diploma-corner.tr { top: 1.4rem; right: 1.4rem; }
.diploma-corner.bl { bottom: 1.4rem; left: 1.4rem; }
.diploma-corner.br { bottom: 1.4rem; right: 1.4rem; }

.diploma-seal {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 1.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 0, 5, 0.9);
    border: 1px solid rgba(255, 42, 133, 0.6);
    box-shadow: 0 0 40px rgba(255, 42, 133, 0.3),
                inset 0 0 20px rgba(255, 42, 133, 0.15);
}
.diploma-seal::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(255, 42, 133, 0.35);
    border-radius: 50%;
}
.diploma-seal-glyph {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--neon);
    text-shadow: 0 0 14px var(--neon-glow);
}

.diploma-institution {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--neon);
    margin-bottom: 0.5rem;
}
.diploma-faculty {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.98rem;
    color: #aaa;
    margin-bottom: 2rem;
}

.diploma-degree {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(1.7rem, 5.4vw, 2.7rem);
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 0 26px var(--neon-glow);
}
.diploma-subtitle {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    color: #999;
    margin: 0.5rem 0 1.5rem;
}

.diploma-honor {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--neon);
    border: 1px solid rgba(255, 42, 133, 0.4);
    background: rgba(255, 42, 133, 0.08);
    padding: 0.6rem 1.6rem;
    border-radius: 100px;
    margin-bottom: 2.2rem;
}

.diploma-attest {
    font-size: 0.92rem;
    color: #888;
    margin-bottom: 0.7rem;
}
.diploma-name {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 1.8rem;
}
.diploma-name-accent {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--neon);
    text-shadow: 0 0 20px var(--neon-glow);
}

.diploma-body p {
    font-size: 0.95rem;
    line-height: 1.85;
    color: #bbb;
    max-width: 520px;
    margin: 0 auto 1.6rem;
}

.diploma-grade {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--neon);
    text-transform: uppercase;
    margin-bottom: 2.6rem;
}

.diploma-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255, 42, 133, 0.15);
    flex-wrap: wrap;
}
.diploma-foot-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
}
.diploma-foot-col.right {
    text-align: right;
}
.diploma-foot-label {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 42, 133, 0.7);
}
.diploma-foot-value {
    font-size: 0.9rem;
    color: #ccc;
}
.diploma-signature {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 0 0 16px var(--neon-glow);
    position: relative;
    padding-bottom: 0.3rem;
}
.diploma-signature::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 70%;
    height: 1px;
    background: linear-gradient(to left, rgba(255, 42, 133, 0.6), transparent);
}

/* ── Download button ── */
.diploma-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 2.4rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 42, 133, 0.12);
    border: 1px solid rgba(255, 42, 133, 0.5);
    border-radius: 100px;
    padding: 1rem 2.2rem;
    cursor: pointer;
    transition: all 0.35s ease;
}
.diploma-download:hover {
    background: rgba(255, 42, 133, 0.22);
    border-color: var(--neon);
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(255, 42, 133, 0.25);
}
.diploma-download:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 3px;
}
.diploma-download:disabled {
    cursor: wait;
    opacity: 0.85;
    transform: none;
}
.diploma-download-icon {
    display: inline-block;
    font-size: 0.95rem;
}
.diploma-download.is-loading .diploma-download-icon {
    animation: spin 0.9s linear infinite;
}
