/* Fonte Liana - Configuração @font-face */
@font-face {
    font-family: 'Liana';
    src: url('liana.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    background: linear-gradient(to bottom, #F6F1E9 0%, #F5EFE5 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Melhora scroll no iOS */
}

@media (max-width: 600px) {
    body {
        padding: 0;
        align-items: stretch;
    }
}

.container {
    position: relative;
    width: 100%;
    max-width: 600px;
    perspective: 1000px;
}

@media (max-width: 600px) {
    .container {
        width: 100%;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Envelope (Carta Fechada) */
.envelope {
    position: relative;
    width: 400px;
    height: 500px;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

@media (max-width: 600px) {
    .envelope {
        width: 100%;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }
}

.envelope:hover {
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .envelope:hover {
        transform: none;
    }
}

.envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #F6F1E9 0%, #F5EFE5 100%);
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

@media (max-width: 600px) {
    .envelope-back {
        border-radius: 0;
        box-shadow: none;
    }
}

.envelope-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #F6F1E9 0%, #F5EFE5 100%);
    border-radius: 5px;
    z-index: 2;
    transform-origin: bottom;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@media (max-width: 600px) {
    .envelope-front {
        border-radius: 0;
    }
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, #F6F1E9 0%, #F5EFE5 50%);
    border-radius: 5px 5px 0 0;
    transform-origin: top;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 3;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

@media (max-width: 600px) {
    .envelope-flap {
        border-radius: 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
}

.envelope-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    z-index: 4;
    pointer-events: none;
}

.envelope-content > * {
    pointer-events: none;
}

.envelope-text {
    position: absolute;
    top: calc(50% + 75px);
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1em;
    color: #4a3728;
    font-style: italic;
    text-align: center;
    letter-spacing: 0.8px;
    pointer-events: none;
    font-weight: 400;
    line-height: 1.6;
    width: 100%;
    padding: 0 20px;
}

/* Selo */
.seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.5s ease;
    animation: pulse 2s infinite;
    width: 125px;
    height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: all !important;
    touch-action: manipulation;
}

.seal:hover {
    transform: translate(-50%, -50%) scale(1.1);
}


.seal-logo-wrapper {
    position: relative;
    width: 125px;
    height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: visible;
    cursor: pointer;
    pointer-events: all !important;
    touch-action: manipulation;
}

.seal-logo {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    background: transparent;
    image-rendering: -webkit-optimize-contrast;
    /* Remove fundo branco - darken funciona melhor com fundos claros */
    mix-blend-mode: darken;
    /* Garante que não há fundo branco visível */
    background-color: transparent !important;
    cursor: pointer;
    pointer-events: all !important;
    touch-action: manipulation;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Estado Aberto */
.envelope.opened .envelope-flap {
    transform: rotateX(-180deg);
}

.envelope.opened .envelope-front {
    transform: rotateX(-180deg);
}

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

/* Conteúdo do Convite */
.invitation-content {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    opacity: 0;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.8s ease;
    z-index: 10;
    pointer-events: none;
    -webkit-overflow-scrolling: touch; /* Melhora scroll no iOS */
}

.invitation-content.show {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    pointer-events: all;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.invitation-card {
    background: 
        linear-gradient(to bottom, rgba(246, 241, 233, 0.4) 0%, rgba(246, 241, 233, 0.5) 100%),
        url('background.png');
    background-size: 100% 100%, 100% 100%;
    background-position: center top, center top;
    background-repeat: no-repeat, no-repeat;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 25px 70px rgba(139, 105, 20, 0.25), 0 0 0 1px rgba(139, 105, 20, 0.1);
    text-align: center;
    animation: slideUp 0.8s ease;
    border: 2px solid rgba(184, 134, 11, 0.2);
    position: relative;
    overflow: hidden;
}

.invitation-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(184, 134, 11, 0.15);
    border-radius: 10px;
    pointer-events: none;
    z-index: 0;
}

.invitation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    border-radius: 10px;
    z-index: 0;
}

.invitation-card > * {
    position: relative;
    z-index: 1;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.invitation-header {
    padding-top: calc(5%);
    padding-left: 50px;
    padding-right: 50px;
    padding-bottom: 20px;
    min-height: 30%;
}

/* A) Headline / topo */
.headline-text {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.1em; /* reduzido de 1.76em */
    letter-spacing: 0.01em; /* tracking +4 */
    color: #4A4138; /* cinza quente */
    margin-bottom: 12px;
    text-align: center;
    white-space: nowrap; /* mantém na mesma linha */
}

.decorative-line {
    width: 120px;
    height: 1px;
    background: rgba(184, 154, 91, 0.4); /* dourado fosco com 40% opacidade */
    margin: 18px auto;
}

/* B) Nomes dos pais */
.parents-names {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.parent-line {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-size: 0.88em; /* 80% do corpo do texto institucional (1.1em * 0.8) */
    line-height: 1.3;
    letter-spacing: 0.1em; /* tracking +10 */
    color: rgba(74, 65, 56, 0.85); /* cinza quente com 85% opacidade */
    margin: 0;
    font-weight: 400;
}

.invitation-body {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    color: rgba(74, 65, 56, 0.9); /* cinza quente com 90% opacidade */
    line-height: 1.5; /* ajustado para 1.45-1.6 */
    font-size: 0.99em; /* reduzido 5-8% de 1.05em */
    padding: 0 50px 30px 50px;
}

.names-container {
    margin: 16px 0; /* margem normal */
    padding: 20px 5px; /* padding aumentado para dar respiro */
    display: flex;
    flex-direction: column; /* voltou para coluna */
    align-items: center;
    justify-content: center;
    gap: 0px; /* sem espaço entre as linhas */
}

/* C) Nomes dos noivos */
.names {
    font-family: 'Liana', 'Allura', 'Playfair Script', 'Great Vibes', cursive;
    font-size: 1.9em !important; /* reduzido ainda mais para caber em uma linha */
    color: #B89A5B; /* dourado champagne */
    margin: 0;
    padding: 2px 0; /* padding vertical reduzido */
    font-weight: 200; /* aumentado de 400 para 600 (semi-bold) */
    letter-spacing: 0.15em; /* tracking reduzido um pouco */
    line-height: 3.2; /* reduzido para aproximar as linhas */
    white-space: nowrap; /* força a ficar em uma linha */
    text-shadow: 0 3px 10px rgba(184, 154, 91, 0.5), 0 5px 20px rgba(184, 154, 91, 0.3); /* sombras mais intensas para destaque */
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.2)); /* sombra adicional mais pronunciada */
}

/* D) Texto institucional */
.date-label {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-size: 0.99em; /* reduzido 5-8% de 1.1em */
    color: rgba(74, 65, 56, 0.9); /* cinza quente com 90% opacidade */
    margin: 25px 0;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.05em; /* tracking +5 */
    line-height: 1.5; /* 1.45-1.6 */
}

.date-info {
    margin: 35px 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 0 30px;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 0;
    position: relative;
}

.date-item::after {
    content: '•';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    color: #B89A5B;
    font-size: 0.8em;
    opacity: 0.6;
}

.date-item:last-child::after {
    display: none;
}

/* E) Labels DATA / HORÁRIO / LOCAL */
.date-label-small {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-size: 0.88em; /* ligeiramente menor que texto institucional */
    color: #4A4138; /* cinza quente (não dourado) */
    text-transform: uppercase;
    letter-spacing: 0.6em; /* tracking +60 (entre +40 e +80) */
    font-weight: 400;
    font-variant: small-caps; /* small caps se disponível */
}

/* E) Valores DATA / HORÁRIO / LOCAL */
.date-value {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-size: 1.04em; /* +5% em relação ao texto institucional (0.99em * 1.05) */
    color: #B89A5B; /* dourado */
    font-weight: 600; /* Semibold */
    letter-spacing: 0.1em; /* tracking +10 (entre +5 e +15) */
}

.date-value-local {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-size: 1.01em; /* +5% em relação ao texto institucional (0.99em * 1.05) */
    color: #B89A5B; /* dourado */
    font-weight: 400; /* Semibold */
    letter-spacing: 0.1em; /* tracking +10 (entre +5 e +15) */
}

/* F) Rodapé */
.closing {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-size: 0.99em; /* igual ou 5% menor que texto institucional */
    color: rgba(74, 65, 56, 0.88); /* cinza quente com 85-90% opacidade */
    margin: 25px 0;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.05em;
    position: relative;
    padding-top: 20px;
}

.closing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 0.5px;
    background: rgba(184, 154, 91, 0.3); /* linha dourada ultrafina com 30% opacidade */
}

.rsvp {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 0.5px solid rgba(184, 154, 91, 0.3);
}

.rsvp p {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    color: rgba(74, 65, 56, 0.9);
    margin-bottom: 10px;
    font-size: 0.88em;
    letter-spacing: 0.05em;
}

.rsvp-date {
    font-family: 'Cormorant Garamond', 'Libre Baskerville', 'Playfair Display', serif;
    font-size: 1.04em;
    color: #B89A5B; /* dourado para data */
    font-weight: 600;
    margin: 15px 0;
    letter-spacing: 0.1em;
}

.rsvp-button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #B89A5B 0%, #9a7d4a 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1em;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    letter-spacing: 1px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 12px rgba(184, 154, 91, 0.3);
}

.rsvp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(184, 154, 91, 0.4);
}

/* Responsividade */
@media (max-width: 600px) {
    .envelope-content {
        padding: 0;
    }
    
    .envelope-text {
        font-size: 1em;
        top: calc(50% + 65px);
        padding: 0 20px;
    }
    
    .seal-logo-wrapper {
        width: 105px;
        height: 105px;
    }
    
    .seal-logo {
        width: 100%;
        height: 100%;
    }
    
    .invitation-card {
        padding: 30px 20px;
    }
    
    .headline-text {
        white-space: normal; /* permite quebra de linha em mobile */
        font-size: 0.95em;
    }
    
    .invitation-header h1 {
        font-size: 2em;
    }
    
    .names {
        font-size: 2.0em; /* reduzido para mobile */
    }
    
    .date-value {
        font-size: 1.1em;
    }
}

@media (max-width: 400px) {
    .envelope-content {
        padding: 0;
    }
    
    .envelope-text {
        font-size: 0.95em;
        top: calc(50% + 60px);
        padding: 0 15px;
    }
    
    .seal-logo-wrapper {
        width: 95px;
        height: 95px;
    }
    
    .seal-logo {
        width: 100%;
        height: 100%;
    }
}
