.hide {
    display: none !important;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: no-repeat url(img/paper.webp) 0 0;
    background-size: 100%;
    background-repeat: repeat;
    color: #b24d64;
    background-color: #f7eede;

    /* Main font */
    font-family: "Ms Madi", cursive;

    /* Main card */
    /* font-family: "Mea Culpa", cursive; */
    /* font-family: "Dancing Script", cursive; */

    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}
.loader {
    width: 100vw;
    height: 100vh;
    display: grid;
    justify-items: center;
    align-items: center;
    transition: opacity 0.75s, visibility 0.75s;
}
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-icon {
    grid-area: 1/1/2/2;
    width: 100px;
}
.loader-spiner {
    grid-area: 1/1/2/2;
    width: 140px;
    height: 140px;
    border: 5px whitesmoke solid;
    border-color: transparent;
    border-top-color: #b24d64;
    border-radius: 100vh;
    animation-name: spiner;
    animation-duration: 1s;
    animation-timing-function: ease;
    animation-iteration-count: infinite;
}

@keyframes spiner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}

button {
    font-family: "Ms Madi", cursive;
    font-size: 1.5rem;
}

/* Spacing utility classes */

.marginTop--s {
    margin-top: 0.75rem;
}
.marginTop--m {
    margin-top: 1.2rem;
}
.marginTop--l {
    margin-top: 1.5rem;
}
.marginTop--xl {
    margin-top: 1.75rem;
}
.marginTop--xxl {
    margin-top: 2rem;
}
.marginTop--only-button {
    margin-top: 17rem;
}
.marginTop--card {
    margin-top: 4rem;
}

.paddingTop--m {
    padding-top: 1rem;
}
.paddingTop--s {
    padding-top: 0.5rem;
}
.paddingTop--l {
    padding-top: 1.5rem;
}
.paddingTop--xl {
    padding-top: 1.75rem;
}
.paddingTop--xxl {
    padding-top: 2rem;
}
.paddingTop--card {
    padding-top: 4rem;
}

.font--s{
    font-size: 1rem;
}
.font--m{
    font-size: 1.25rem;
}
.font--l{
    font-size: 1.5rem;
}
.font--xl{
    font-size: 1.75rem;
}
.font--xxl{
    font-size: 2rem;
}
.font--xxxl{
    font-size: 2.5rem;
}

.font--bold {
    font-weight: bold;
}

/* Main panel */
.main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    min-height: 100svh;
    /* Ensures visibility */
    max-height: 100lvh;
    /* Uses maximum space when available */
}

.title {
    font-family: "Mea Culpa", cursive;
    font-size: 42pt;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    opacity: 0;
    animation-delay: 0s;
    animation-name: appear-from-below;
    animation-duration: 1500ms;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}

.img_main {
    /* margin: 30px 0px; */
    opacity: 0;
    min-height: 40svh;
    max-height: 70svh;
    max-width: 95svw;
    animation-delay: 1000ms;
    animation-name: fade-in;
    animation-duration: 2s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
    /* animation: name duration timing-function delay iteration-count direction fill-mode; */
}

.date {
    font-family: "Mea Culpa", cursive;
    font-size: 24pt;
    margin: 0px 0px 1rem;
    opacity: 0;
    animation-delay: 2.5s;
    animation-name: appear-from-below;
    animation-duration: 2s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

.place {
    font-family: "Mea Culpa", cursive;
    opacity: 0;
    font-size: 2.4rem;
    animation-delay: 3s;
    animation-name: fade-in;
    animation-duration: 2s;
    animation-fill-mode: forwards;
}

/* Main Grid Container */
.gridContainer {
    display: grid;
    justify-items: center;
    row-gap: 3rem;
}

.sectionTitle {
    padding-top: 4rem;
    font-size: 2.5rem;
    /* 
     * Remove margin on small screens like iPhone SE
     */
    margin: 0;
}
.sectionTitle--topless {
    padding-top: 1rem;
    font-size: 2.5rem;
}

.btn-flip {
    color: #b24d64;
    background-color: transparent;
    text-decoration: none;
    text-align: center;
    font-size: 1.75rem;
    margin-top: 15rem;
    border: 1px solid;
    border-radius: 100vh;
    padding-inline: 1rem;

    animation: 1.5s ease-in-out tilt-shaking infinite;
}

#invitation-tickets {
    font-size: 2.5rem;
}

/* Links */
a.telephone{
    display: flex;
    text-decoration: none;
    justify-content: center;
    align-items: center;
    color: #b24d64;
    font-size: 1.5rem;
    margin-bottom: 0rem;
}
.rsvp-form{
    display: flex;
    text-decoration: none;
    justify-content: center;
    align-items: center;
    color: #b24d64;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    border: solid 1px;
    border-radius: 100vh;
    padding-inline: 1rem;
}
a.btn-img-text {
    text-decoration: none; 
    display: flex;
    justify-content: center;
    align-items: center;
    color: #b24d64;
    font-size: 1.75rem;
    padding-block: 1rem;
    border: 1px solid #b24d64;
    border-radius: 100px;
    padding: 0.1rem 1rem;
    gap: 0.5rem;
}
a.btn-img {
    text-decoration: none; 
    display: flex;
    justify-content: center;
    background-color: #b24d64;
    color: #f7eede;
    font-size: 1.5rem;
    width: 150px;
    border-radius: 100px;
    padding: 0.5rem 1rem;
}
.btn-img-left {
    height: 30px;
}

.btn-img {
    width: 100%;
}

/* Cards */
.card {
    display: grid;
    transform-style: preserve-3d;
    transition: all 350ms ease-in;
    width: 100%;
    height: 80svh;
    min-height: 580px;
}

.minute-to-minute {
    display: grid;
    width: 100%;
}

.card.flip {
    transform: rotateY(180deg);
}

.card-subtitle {
    font-weight: 600;
    font-size: 2.25rem;
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
}
.hour {
    font-size: 2rem;
    padding-block: 0.25rem;
    max-width: 16rem;
    text-align: center;
}

.title-hotel {
    font-weight: 600;
    font-size: 2rem;
    padding: 0;
}

.card-text {
    font-size: 1.7rem;
    padding-block: 0.25rem;
    max-width: 17rem;
    text-align: center;
}

.card-front {
    grid-area: 1/1/2/2;
    overflow: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 4rem;
}
.card-front.has-buttons {
    justify-content: space-around;
}


.card-back {
    grid-area: 1/1/2/2;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    display: flex;
    /* justify-content: center; */
    align-items: center;
    flex-flow: column;
    padding-top: 0.5rem;
}

.card_church {
    background-image: url(img/tarjeta-iglesia.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.card_reception {
    background-image: url(img/tarjeta-recepcion.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.card_dress {
    background-image: url(img/tarjeta-vestimenta.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.card_hotel {
    background-image: url(img/tarjeta-hotel.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.card_tulancingo {
    background-image: url(img/tarjeta-tulancingo.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.card_gifts {
    background-image: url(img/tarjeta-regalos.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.card_photos {
    background-image: url(img/tarjeta-fotos.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.bow_margin {
    background-image: url(img/marco.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform-style: preserve-3d;
    /* transition: all 1s ease-in; */
}

.bow_margin2 {
    background-image: url(img/bowMargin.svg);
    background-repeat: no-repeat;
    background-position: center;
    /* background-size: 90%; */
}

.bow_margin3 {
    background-image: url(img/bowMargin6.svg);
    background-repeat: no-repeat;
    background-position: center;
    /* background-size: 90%; */
}

.quote {
    font-size: 28pt;
    text-align: center;
    margin-top: 5rem;
    margin-inline: 1rem;
}

/* Parents */
.parents-container {
    display: flex;
    justify-content: space-around;
    flex-direction: row;
    gap: 1.5rem;
}
@media (max-width: 450px) {
    .parents-container {
        flex-direction: column;
    }
}

.parent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.parent-title {
    font-size: 2.25rem;
    font-family: "Dancing Script", cursive;
    /* font-weight: bold; */
    text-align: center;
}
.parent-name {
    /* font-family: "Dancing Script", cursive; */
    font-size: 1.7rem;
    text-align: center;
    padding-block: 0.25rem;
    max-width: 17rem;
    text-align: center;
}
.parent {
    text-align: center;
}

.weddingDate {
    font-family: "Indie Flower";
}

/* Countdown */
.countdown {
    margin-top: 0px;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.time {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 22pt;
}

.time>h2 {
    margin: 0;

}

.time>p {
    margin: 0;
    font-family: "Indie Flower";
}

/* 
 * 
 * Itinerary
 * 
 */
.itinerary-container {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 3rem;
    /* width: 80%; */
}

.itinerary-item {
    display: flex;
    width: 100%;
    text-align: start;
    height: 150px;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}
.itinerary-item--right {
    text-align: end;
}
.itinerary-text {
    text-align: center;
}
.itinerary-item-full {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
}
.img_hora {
    /* max-height: 100%; */
    max-height: 150px;
    max-width: 100%;
}


/* 
 * 
 * Envelope 
 * 
 */

.envelopeNames {
    margin: 0px; 
    font-size: 2.8rem;
}
.envelopeMessage {
    font-size: 1.75rem;
    padding-block: 0.25rem;
    max-width: 16rem;
    text-align: center;
    margin-bottom: 1.5rem; 
}
#envelope{
    position: relative;
    width: 340px;
    height: 230px;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    margin-left: auto;
    margin-right: auto;
    /* top: 150px; */
    background-color: #ab4a61;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
#envelope:hover {
    cursor:pointer;
}

.waxStamp {
    z-index: 5;
    position: relative;
    width: 20%;
    margin-left: 40%;
    margin-top: 30%;
}

.front{
    position: absolute;
    width: 0;
    height: 0;
    z-index: 3;
}
.flap{
    border-left: 170px solid transparent;
    border-right: 170px solid transparent;
    border-bottom: 82px solid transparent;
    border-top: 150px solid #95364c;
    transform-origin: top;
}
.pocket{
    border-left: 170px solid #b24d64;
    border-right: 170px solid #b24d64;
    border-bottom: 120px solid #ab4a61;
    border-top: 120px solid transparent;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.letter{
    position: relative;
    background-color: #f7eede;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    margin-top: -38%;
    height: 100%;
    top: -20%;
    border-radius: 6px;
    box-shadow: 0 2px 26px rgba(0,0,0,0.12);
}
.letter:after{
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.00) 25%,
                     rgba(255,227,239,0.70) 55%, rgba(215,227,239,1.00) 100%);
}
.open .flap{
    transform: rotateX(180deg);
    transition: transform 0.4s ease, z-index 0.6s;
    z-index: 1;
}
.close .flap{
    transform: rotateX(0deg);
    transition: transform 0.4s 0.6s ease, z-index 1s;
    z-index: 5;
}
.close .letter{
    transform: translateY(0px);
    transition: transform 0.4s ease, z-index 0s;
    z-index: 1;
}
.open .letter{
    /* scaleY so it gets taller and covers the flap and text below */
    transform: scale(1,1.3) translateY(-100px);
    transition: transform 0.4s 0.6s ease, z-index 0.6s;
    z-index: 2;
}

/* 
 * 
 * Envelope hearts
 * 
 */
.hearts{
    position: absolute;
    top: 130px;
    left: 0;
    right: 0;
    z-index: 2;
}
.heart{
    background: no-repeat url(img/hearts.webp) 0 0;
    background-size: 200px;
    position: absolute;
    bottom: 0;
    right: 10%;
}
.heart::before, .heart::after{
    position: absolute;
    content: "";
    left: 50px;
    top: 0;
    /* width: 50px;
    height: 80px; */
    /* border-radius: 50px 50px 0 0; */
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}
.heart::after{
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}
.close .heart{
    opacity: 0;
    animation: none;
}
.a1{
    left: 20%;
    transform: scale(0.8);
    opacity: 1;
    animation: animate 4s linear 1, sideSway 2s ease-in-out 4 alternate;
    animation-fill-mode: forwards;
    animation-delay: 0.5s;
}
.a2{
    left: 0%;
    transform: scale(1);
    opacity: 1;
    animation: animate 5s linear 1, sideSway 3s ease-in-out 2 alternate;
    animation-fill-mode: forwards;
    animation-delay: 1.2s;
}
.a3{
    left: 25%;
    transform: scale(0.8);
    opacity: 1;
    animation: animate 6s linear 1, sideSway 2s ease-in-out 6 alternate;
    animation-fill-mode: forwards;
    animation-delay: 1.6s;
}
.a4{
    left: 5%;
    transform: scale(0.5);
    opacity: 1;
    animation: animate 7s linear 1, sideSway 2s ease-in-out 6 alternate;
    animation-fill-mode: forwards;
    animation-delay: 1.2s;
}
.a5{
    left: 30%;
    transform: scale(0.9);
    opacity: 1;
    animation: animate 6s linear 1, sideSway 5s ease-in-out 1 alternate;
    animation-fill-mode: forwards;
    animation-delay: 0.5s;
}
@keyframes animate{
    0%{
        top: 0;
    }
    100%{
        top: -600px;
    }
}
@keyframes sideSway{
    0%{
        /* margin-left: 0px; */
        margin-left: 0px;
    }
    100%{
        /* margin-left: 30px; */
        margin-left: 30px;
    }
}

.envelope-wrapper{
    height: 270px;
}
.envelope-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.reset{
    text-align: center;
}
.reset button{
    transition: all 0.1s linear;
    --webkit-appearance: none;
    background-color: transparent;
    border: 2px solid #b24d64;
    border-radius: 4px;
    color: #b24d64;
    display: inline-block;
    margin: 5px;
    padding: 10px;
    line-height: 1em;
    text-decoration: none;
    min-width: 120px;
    outline: none;
}
.reset button:hover{
    background-color: #b24d64;
    color: #fff;
}

/* 
 * 
 * Transitions (Texts)
 * 
 */
.transition {
    transition-property: all;
    transition-timing-function: ease-in;
}

.transition.transition--short {
    transition-duration: 0.5s;
}
.transition.transition--med {
    transition-duration: 1s;
}
.transition.transition--long {
    transition-duration: 1.5s;
}

.transition.transition--delay--short {
    transition-delay: 0.5s;
}
.transition.transition--delay--med {
    transition-delay: 1s;
}
.transition.transition--delay--long {
    transition-delay: 1.5s;
}

/* 
 * 
 * Utility classes for animation
 * 
 */
.animated-section {
}
.animated-section--from-right {
}

.animated-section--from-left {
}
.invisible {
    opacity: 0;
}

/* 
 * 
 * Animations (2 or more steps animations)
 * 
 */
.animate {
    animation-duration: 1s;
    /* animation-fill-mode: forwards; */
    animation-fill-mode: both;
}

.animate--fast {
    animation-duration: 0.5s;
}
.animate--med {
    animation-duration: 1.5s;
}
.animate--slow {
    animation-duration: 2s;
}

.animate--infinite {
    animation-iteration-count: infinite;
}

.animate--delay {
    animation-delay: 1s;
}
.animate--delay--1-5s {
    animation-delay: 1.5s;
}
.animate--delay--2s {
    animation-delay: 2s;
}
.animate--delay--3s {
    animation-delay: 3s;
}
.animate--delay--4s {
    animation-delay: 4s;
}

.fade-in {
    animation-name: fade-in;
    animation-timing-function: ease-in;
}
.fade-from-left {
    animation-name: fade-from-left;
    animation-timing-function: ease-in;
}
.fade-from-right {
    animation-name: fade-from-right;
    animation-timing-function: ease-in;
}
.tilt-shaking {
    animation-name: tilt-shaking;
    animation-timing-function: ease-in-out;
}
.scale-big-out {
    animation-name: scale-big-out;
    animation-timing-function: ease-in-out;
}
.pulse {
    animation-name: pulse;
    animation-timing-function: ease-in-out;
}
.pulse-small {
    animation-name: pulse-small;
    animation-timing-function: ease-in-out;
}
.fade-out {
    animation-name: fade-out;
    animation-timing-function: ease;
}

.example {
    animation-name: key;
    animation-timing-function: ease-out;
}

@keyframes appear-from-below {
    from {
        transform: translateY(50%);
        opacity: 0;
    }

    to {
        transform: translateY(0%);
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(50%);
    }

    to {
        opacity: 1;
        transform: translateY(0%);
    }
}
@keyframes fade-from-left {
    from {
        opacity: 0;
        transform: translateX(-50%);
    }

    to {
        opacity: 1;
        transform: translateX(0%);
    }
}
@keyframes fade-from-right {
    from {
        opacity: 0;
        transform: translateX(50%);
    }

    to {
        opacity: 1;
        transform: translateX(0%);
    }
}

@keyframes scale-big-out {
    from {
        opacity: 1;
    }

    to {
        scale: 10;
        opacity: 0;
    }
}

@keyframes scale-big-out {
    from {
        opacity: 1;
    }

    to {
        scale: 10;
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulse-small {
    0% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1);
    }
    100% {
        transform: scale(0.95);
    }
}

@keyframes fade-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes tilt-shaking {
    0% { transform: translateX(0) }
    25% { transform: translateY(-3px) }
    35% { transform: translateY(-3px) rotate(2deg) }
    55% { transform: translateY(-3px) rotate(-2deg) }
    65% { transform: translateY(-3px) rotate(2deg) }
    75% { transform: translateY(-3px) rotate(-2deg) }
    100% { transform: translateY(0) rotate(0)}
}
