/* =========================================================
   SOBRE / BILETA DE INVITACIÓN CLÁSICA — PANTALLA COMPLETA
   Ares & Itzel · 19 diciembre 2026
   ========================================================= */

/* ── Pantalla completa que cubre la invitación ── */
#envelope-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5EFE4;
    overflow: hidden;
    pointer-events: auto;
    transition: opacity 1s ease, visibility 1s ease;
}

#envelope-screen.opened {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Puertas dobles gatefold ── */
.gatefold-door {
    position: absolute;
    top: 0; bottom: 0;
    width: 50.3vw;
    height: 100vh;
    height: 100dvh;
    background-color: #FAF6EE;
    background-image:
        repeating-linear-gradient(135deg, rgba(197,160,89,0.04) 0px, rgba(197,160,89,0.04) 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(45deg,  rgba(197,160,89,0.03) 0px, rgba(197,160,89,0.03) 1px, transparent 1px, transparent 60px);
    z-index: 2;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 1.3s cubic-bezier(0.76,0,0.24,1), box-shadow 1.3s ease;
    will-change: transform;
}

.door-left  { left: 0;  border-right: 1px solid rgba(197,160,89,0.5); box-shadow:  10px 0 40px rgba(0,0,0,0.1); }
.door-right { right: 0; border-left:  1px solid rgba(197,160,89,0.5); box-shadow: -10px 0 40px rgba(0,0,0,0.1); }

#envelope-screen.opened .door-left  { transform: translateX(-102%); box-shadow: none; }
#envelope-screen.opened .door-right { transform: translateX(102%);  box-shadow: none; }

/* ── Marco dorado doble ── */
.door-inner-border {
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(197,160,89,0.55);
    pointer-events: none;
    z-index: 3;
}
.door-inner-border::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(197,160,89,0.28);
}

.door-left  .door-inner-border { border-right: none; right: 0; }
.door-right .door-inner-border { border-left:  none; left: 0; }

/* ── Ornamentos de esquina (florales estilo invitación antigua) ── */
.door-left  .door-inner-border::before,
.door-right .door-inner-border::before {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: 44px 44px, 44px 44px, 44px 44px, 44px 44px;
    background-position: top left, top right, bottom left, bottom right;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cg fill='none' stroke='%23C5A059' stroke-width='1.1' opacity='0.65'%3E%3Cpath d='M4,4 C10,10 18,8 22,4' /%3E%3Cpath d='M4,4 C10,10 8,18 4,22' /%3E%3Ccircle cx='4' cy='4' r='2' fill='%23C5A059' opacity='0.5'/%3E%3Ccircle cx='13' cy='5' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Ccircle cx='5' cy='13' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Cpath d='M10,4 Q12,8 10,12' stroke-width='0.7'/%3E%3Cpath d='M4,10 Q8,12 12,10' stroke-width='0.7'/%3E%3Cellipse cx='10' cy='7' rx='2' ry='1' fill='rgba(197,160,89,0.12)' stroke='none'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cg fill='none' stroke='%23C5A059' stroke-width='1.1' opacity='0.65' transform='translate(50,0) scale(-1,1)'%3E%3Cpath d='M4,4 C10,10 18,8 22,4' /%3E%3Cpath d='M4,4 C10,10 8,18 4,22' /%3E%3Ccircle cx='4' cy='4' r='2' fill='%23C5A059' opacity='0.5'/%3E%3Ccircle cx='13' cy='5' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Ccircle cx='5' cy='13' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Cpath d='M10,4 Q12,8 10,12' stroke-width='0.7'/%3E%3Cpath d='M4,10 Q8,12 12,10' stroke-width='0.7'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cg fill='none' stroke='%23C5A059' stroke-width='1.1' opacity='0.65' transform='translate(0,50) scale(1,-1)'%3E%3Cpath d='M4,4 C10,10 18,8 22,4' /%3E%3Cpath d='M4,4 C10,10 8,18 4,22' /%3E%3Ccircle cx='4' cy='4' r='2' fill='%23C5A059' opacity='0.5'/%3E%3Ccircle cx='13' cy='5' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Ccircle cx='5' cy='13' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Cpath d='M10,4 Q12,8 10,12' stroke-width='0.7'/%3E%3Cpath d='M4,10 Q8,12 12,10' stroke-width='0.7'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cg fill='none' stroke='%23C5A059' stroke-width='1.1' opacity='0.65' transform='translate(50,50) scale(-1,-1)'%3E%3Cpath d='M4,4 C10,10 18,8 22,4' /%3E%3Cpath d='M4,4 C10,10 8,18 4,22' /%3E%3Ccircle cx='4' cy='4' r='2' fill='%23C5A059' opacity='0.5'/%3E%3Ccircle cx='13' cy='5' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Ccircle cx='5' cy='13' r='1.2' fill='%23C5A059' opacity='0.35'/%3E%3Cpath d='M10,4 Q12,8 10,12' stroke-width='0.7'/%3E%3Cpath d='M4,10 Q8,12 12,10' stroke-width='0.7'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── Texto dentro de cada puerta — se ubica elegantemente sobre el botón ── */
.door-header-block {
    position: absolute;
    bottom: calc(50% + 148px);
    top: auto;
    transform: none;
    width: 100%;
    max-height: calc(50vh - 160px);
    justify-content: flex-end;
    box-sizing: border-box;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.door-top-left  { right: 0; padding-right: clamp(22px,5vw,55px); align-items: flex-end;   text-align: right; }
.door-top-right { left: 0;  padding-left:  clamp(22px,5vw,55px); align-items: flex-start; text-align: left;  }

.door-header-block::before {
    content: '— ❦ —';
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.6rem,1.4vw,0.75rem);
    color: rgba(197,160,89,0.75);
    letter-spacing: 4px;
}

.door-tagline {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.58rem,1.3vw,0.7rem);
    font-weight: 600;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: #9E7D3B;
    display: block;
}

.door-half-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.9rem,6.5vw,3.8rem);
    font-weight: 600;
    font-style: italic;
    color: #380811;
    line-height: 1;
}

.door-date {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.58rem,1.3vw,0.7rem);
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #C5A059;
    display: block;
}

/* ── Sello central / Broche con monograma nuevo ── */
.gatefold-seal-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#envelope-screen.opened .gatefold-seal-wrapper {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    pointer-events: none;
}

/* ── Broche del sobre: medallón dorado con ícono A♡I ── */
.gatefold-wax-seal-wine {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #FAF7F2;
    box-shadow:
        0 0 0 2px rgba(197,160,89,0.85),
        0 0 0 6px rgba(250,247,242,0.98),
        0 0 0 8px rgba(197,160,89,0.4),
        0 18px 50px rgba(53,8,17,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s ease;
    animation: sealPulse 3s infinite ease-in-out;
}

@keyframes sealPulse {
    0%,100% { box-shadow: 0 0 0 2px rgba(197,160,89,0.85), 0 0 0 6px rgba(250,247,242,0.98), 0 0 0 8px rgba(197,160,89,0.4), 0 18px 50px rgba(53,8,17,0.22); }
    50%      { box-shadow: 0 0 0 3px rgba(197,160,89,1),    0 0 0 7px rgba(250,247,242,0.99), 0 0 0 10px rgba(197,160,89,0.3), 0 22px 60px rgba(53,8,17,0.28); }
}

.gatefold-seal-wrapper:hover .gatefold-wax-seal-wine {
    transform: scale(1.06);
}

/* ── ÍCONO A♡I: llena el círculo limpiamente como un icono de alta definición ── */
.seal-heart-monogram {
    width: 82%;
    height: 82%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(90, 18, 32, 0.12));
    transition: transform 0.3s ease;
}

.gatefold-seal-wrapper:hover .seal-heart-monogram {
    transform: scale(1.05);
}

/* ── "Abre aquí" — texto tipo invitación clásica ── */
.gatefold-seal-hint {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.05rem, 2.8vw, 1.35rem);
    font-weight: 400;
    font-style: italic;
    color: #5A1220;
    letter-spacing: 2.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: hintFloat 2.6s infinite ease-in-out;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

/* Líneas ornamentales flanqueando el texto */
.gatefold-seal-hint::before,
.gatefold-seal-hint::after {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(197,160,89,0.7));
}
.gatefold-seal-hint::after {
    background: linear-gradient(90deg, rgba(197,160,89,0.7), transparent);
}

@keyframes hintFloat {
    0%,100% { opacity: 0.85; transform: translateY(0); }
    50%      { opacity: 1;    transform: translateY(5px); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    /* Sello móvil: 150px · radio=75px · gap=16px → bottom = 50%+91px */
    .door-header-block { bottom: calc(50% + 91px); }
    .gatefold-wax-seal-wine { width: 150px; height: 150px; }
    .seal-heart-monogram { width: 82%; height: 82%; }
    .gatefold-seal-hint { font-size: 1rem; gap: 8px; }
    .gatefold-seal-hint::before,
    .gatefold-seal-hint::after { width: 18px; }
    .door-half-name { font-size: clamp(1.4rem,9vw,2.2rem); }
}

@media (max-width: 360px) {
    /* Sello pequeño: 120px · radio=60px · gap=16px → bottom = 50%+76px */
    .door-header-block { bottom: calc(50% + 76px); }
    .gatefold-wax-seal-wine { width: 120px; height: 120px; }
    .seal-heart-monogram { width: 82%; height: 82%; }
}
