/*
Theme Name: Morcode
Theme URI: https://morcode.pt/
Author: Morcode
Author URI: https://morcode.pt/
Description: Morcode
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: Morcode
*/

/* ==========================================================================
   Base
   ========================================================================== */
body {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

body.convite-envelope-closed {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* ==========================================================================
   Página Convite – envelope interativo
   ========================================================================== */
.convite-page {
    min-height: 100vh;
    padding: 0;
}

.convite-page .container {
    max-width: 100%;
    padding: 0;
}

.convite-page .container .row {
    margin: 0;
}

.convite-page .container .row [class*="col-"] {
    max-width: 100%;
    padding: 0;
}

/* Scene full width/height */
.convite-envelope-scene{
    perspective: 1400px;
    width: 100vw;
    min-height: 100vh;
    position: relative;
    left: 50%;
    margin-left: -50vw;
  }
  
  /* Envelope container – fundo numa camada à parte para blur só na imagem */
  .convite-envelope{
    position: relative;
    width: 100%;
    height: 105vh;
    overflow: hidden;
    transform-style: preserve-3d;
    --open-dur: 950ms;
  }

  .convite-envelope::before{
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--env-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: filter var(--open-dur) cubic-bezier(.2,.8,.2,1);
  }

  .convite-envelope-scene.envelope-opened .convite-envelope::before{
    filter: blur(4px);
  }
  

  
  
  /* FLAP (tampa) – 3D */
  .envelope-flap{
    position:absolute;
    left:0; right:0; top:0;
    height: 45vh;
    min-height: 200px;
    transform-origin: 50% 0%;
    transform: rotateX(0deg);
    clip-path: polygon(0 0, 100% 0, 50% 86%, 0 0);
    box-shadow:
      0 10px 30px rgba(0,0,0,.10),
      inset 0 1px 0 rgba(255,255,255,.45);
    border-bottom: 1px solid rgba(0,0,0,.08);
    transition: transform var(--open-dur) cubic-bezier(.2,.8,.2,1);
  }
  
  /* sombra do flap sobre o envelope */
  .envelope-flap::after{
    content:"";
    position:absolute; inset:0;
    background: radial-gradient(900px 260px at 50% 100%, rgba(0,0,0,.22), transparent 65%);
    opacity: .35;
    pointer-events:none;
  }
  
  /* SELO */
  .envelope-seal-wrap{
    position:absolute;
    left:50%;
    top: calc(45vh + 120px); /* encosta na dobra do flap */
    transform: translateX(-50%);
    text-align:center;
    z-index: 5;
  }

  @media (min-width: 768px) and (max-width: 1600px){
    .envelope-seal-wrap{
      top: calc(45vh + 90px);
    }
  }
  
  .envelope-seal{
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: radial-gradient(circle at 30% 30%, #f3ede3, #ded3c3 55%, #cfc2b0 100%);
    box-shadow:
      0 18px 40px rgba(0,0,0,.18),
      inset 0 2px 6px rgba(255,255,255,.55),
      inset 0 -3px 10px rgba(0,0,0,.10);
    transition:
      transform 220ms ease,
      opacity 320ms ease,
      filter 320ms ease;
  }
  
  .envelope-seal:hover{ transform: scale(1.2); }
  .seal-monogram{
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: rgba(0,0,0,.35);
    text-shadow: 0 1px 0 rgba(255,255,255,.6);
  }
  
  .envelope-exclusive-text{
    font-family: 'Great Vibes', cursive;
    font-size: 3.65rem;
    color: #E3DAB7;
    margin: 6.2rem 0 .3rem;
  }
  .envelope-seal-hint{
    font-size: 1.78rem;
    color: #E3DAB7;
    letter-spacing: .04em;
  }


  
  /* CARTA (fica dentro e sobe ao abrir) */
  .envelope-letter{
    position:absolute;
    left:50%;
    bottom: -12vh;
    transform: translateX(-50%) translateY(30px);
    width: min(720px, 92vw);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    scroll-margin-top: 24px;
    transition:
      transform var(--open-dur) cubic-bezier(.2,.8,.2,1),
      opacity 500ms ease,
      top 0.85s cubic-bezier(.2,.8,.2,1);
  }
  
  .envelope-letter-card{
    border-radius: 18px;
    background: rgba(254,253,251,.96);
    box-shadow:
      0 26px 70px rgba(0,0,0,.18),
      0 0 0 1px rgba(0,0,0,.06);
    padding: 2.2rem 2rem;
    border: 1px solid rgba(0,0,0,.04);
  }
  
  /* ESTADO ABERTO */
  .convite-envelope-scene.envelope-opened .envelope-flap{
    transform: rotateX(-165deg);
  }
  
  .convite-envelope-scene.envelope-opened .envelope-seal{
    opacity: 0;
    transform: scale(.92);
    filter: blur(1px);
    pointer-events:none;
  }
  
  .convite-envelope-scene.envelope-opened .envelope-exclusive-text,
  .convite-envelope-scene.envelope-opened .envelope-seal-hint{
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 250ms ease, transform 250ms ease;
  }
  
  /* Aberto: carta ancorada ao topo (não usar translateY negativo grande — cortava no viewport) */
  .convite-envelope-scene.envelope-opened .convite-envelope{
    overflow-x: hidden;
    min-height: 100vh;
    height: auto;
    max-height: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: clamp(24px, 6vh, 48px);
  }

  body.convite-envelope-opened{
    overflow: hidden;
    height: 100vh;
    touch-action: none;
  }

  .convite-envelope-scene.envelope-opened .envelope-letter{
    opacity: 1;
    z-index: 999;
    pointer-events: auto;
    top: clamp(12px, 5vh, 56px);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    max-height: calc(100vh - clamp(24px, 10vh, 80px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile: imagem de envelope específica + selo mais acima no ecrã */
  @media (max-width: 768px){
    .convite-envelope::before{
      background-image: var(--env-bg-mobile, var(--env-bg));
    }
    .envelope-flap{ height: 42vh; min-height: 170px; }
    .envelope-seal-wrap{
      top: calc(32vh + -20px);
    }
    .envelope-seal{ width: 76px; height: 76px; }
    .seal-monogram{ font-size: 1.35rem; }
    .envelope-exclusive-text{ font-size: 3.35rem; }
    .envelope-seal-hint{ font-size: 1.00rem; }
    .convite-envelope-scene.envelope-opened .envelope-letter{
      top: clamp(8px, 4vh, 40px);
      transform: translateX(-50%);
    }
  }

  @media (max-width: 480px){
    .envelope-seal-wrap{
      top: calc(28vh + 96px);
    }
  }

/* ==========================================================================
   Convite – modal (imagem + Sim/Não + enviar)
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.envelope-letter-card--modal {
    padding: 1.5rem 1.25rem 2rem;
    overflow: visible;
}

.convite-modal-inner {
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
}

.convite-modal-figure {
    margin: 0 0 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(35, 72, 51, 0.12);
}

.convite-modal-img {
    display: block;
    width: 100%;
    height: auto;
}

.convite-modal-saudacao {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.125rem;
    color: #234833;
    margin: 0 0 1rem;
}

.convite-modal-heading {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #234833;
    margin: 0 0 1.25rem;
    text-align: left;
}

.convite-modal-footer {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #234833;
    margin: 0 0 1.25rem;
    text-align: left;
}

.convite-form--modal {
    margin: 0;
}

.convite-choice-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 1.5rem;
}

.convite-pill {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    user-select: none;
}

.convite-pill input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.convite-pill__text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 2px solid #234833;
    background: rgba(227, 218, 183, 0.35);
    color: #234833;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.05rem;
    font-weight: 600;
    pointer-events: none;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
}

.convite-pill:hover .convite-pill__text {
    background: rgba(35, 72, 51, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(35, 72, 51, 0.18);
}

.convite-pill input:focus-visible + .convite-pill__text {
    outline: 3px solid rgba(35, 72, 51, 0.45);
    outline-offset: 3px;
}

.convite-pill input:checked + .convite-pill__text {
    background: #234833;
    color: #E3DAB7;
    border-color: #234833;
    box-shadow: 0 10px 28px rgba(35, 72, 51, 0.35);
}

.convite-pill:active .convite-pill__text {
    transform: translateY(0) scale(0.98);
}

.convite-submit-wrap {
    margin-top: 0.25rem;
}

.convite-submit-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    padding: 16px 28px;
    border-radius: 12px;
    background: #234833;
    color: #E3DAB7;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow:
        0 4px 14px rgba(35, 72, 51, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.22s ease,
        background 0.22s ease,
        filter 0.22s ease;
}

.convite-submit-btn:hover {
    background: #1a3629;
    transform: translateY(-3px);
    box-shadow:
        0 14px 32px rgba(35, 72, 51, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.convite-submit-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 18px rgba(35, 72, 51, 0.4);
}

.convite-submit-btn:focus-visible {
    outline: 3px solid #E3DAB7;
    outline-offset: 4px;
}

@media (max-width: 480px) {
    .convite-choice-row {
        flex-direction: column;
        align-items: stretch;
    }

    .convite-pill__text {
        width: 100%;
        min-width: 0;
    }

    .convite-submit-btn {
        max-width: none;
    }
}

/* ==========================================================================
   Convite – ecrã obrigado fullscreen (obrigado.webp)
   ========================================================================== */

/* Evita scroll por baixo do ecrã de agradecimento */
body:has(.convite-obrigado-fullscreen) {
    overflow: hidden !important;
}

.convite-obrigado-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: #1a1a1a;
}

.convite-obrigado-bg-img {
    position: absolute;
    inset: 0;
    width: 114%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.convite-obrigado-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: clamp(1rem, 5vw, 3rem);
    background: linear-gradient(
        180deg,
        rgba(250, 248, 242, 0.15) 0%,
        rgba(35, 72, 51, 0.25) 45%,
        rgba(35, 72, 51, 0.45) 100%
    );
    pointer-events: auto;
}

.convite-obrigado-content{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.convite-obrigado-message {
    margin: 0;
    max-width: 28em;
    font-family: 'Great Vibes', cursive;
    color: #E3DAB7;
    font-size: 55px;
    font-weight: 400;
    line-height: 1.45;
    text-align: center;
    background: #00000060;
    padding: 10px 20px;
    border-radius: 10px;
}

@media (max-width: 768px){
    .convite-obrigado-message {
      line-height: 1;
    }
}

.convite-obrigado-actions{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.convite-action-pill{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 2px solid #E3DAB7;
    background: rgba(0, 0, 0, 0.30);
    color: #E3DAB7;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
}

.convite-action-pill:hover{
    background: rgba(227, 218, 183, 0.10);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,.30);
    color: #E3DAB7;
    text-decoration: none;
}

.convite-action-pill:active{
    transform: translateY(0) scale(0.98);
}

.convite-action-pill:focus-visible{
    outline: 3px solid rgba(227, 218, 183, 0.45);
    outline-offset: 3px;
}

.convite-detalhes-modal{
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px);
}

.convite-detalhes-modal.is-open{
    display: flex;
}

.convite-detalhes-backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
}

.convite-detalhes-panel{
    position: relative;
    width: min(920px, 94vw);
    max-height: min(90vh, 900px);
    overflow: auto;
    border-radius: 18px;
    background: rgba(254,253,251,.97);
    box-shadow: 0 26px 70px rgba(0,0,0,.28);
    border: 1px solid rgba(0,0,0,.10);
}

.convite-detalhes-body{
    padding: 44px clamp(20px, 5vw, 40px) 28px;
    box-sizing: border-box;
}

.convite-detalhes-title{
    margin: 0 0 12px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #234833;
    text-align: center;
}

.convite-detalhes-content{
    color: #234833;
    text-align: center;
}

.convite-detalhes-hero{
    text-align: center;
    margin: 0 0 8px;
}

.convite-detalhes-hero-img{
    display: inline-block;
    max-width: min(100%, 420px);
    width: 100%;
    height: auto;
    vertical-align: top;
    border-radius: 10px;
}

.convite-detalhes-grid{
    display: flex;
    flex-direction: column;
    gap: 20px 28px;
    color: #234833;
    font-family: 'Times New Roman', Times, serif;
    font-size: 0.98rem;
    line-height: 1.45;
    margin: 0 0 20px;
}

@media (min-width: 769px) {
    .convite-detalhes-grid{
        flex-direction: row;
        align-items: flex-start;
    }
    .convite-detalhes-col{
        flex: 1 1 0;
        min-width: 0;
    }
    .convite-detalhes-col--info{
        padding: 0 20px 0 8px;
    }
    .convite-detalhes-col--horario{
        padding: 0 8px 0 20px !important;
        border-left: 1px solid rgba(35, 72, 51, 0.12);
    }
}

.convite-detalhes-col p{
    margin: 0 0 0.5em;
}

.convite-detalhes-block-title{
    font-weight: 700;
    margin: 0 0 0.35em;
    font-size: 1.02rem;
}

.convite-detalhes-block-title--spaced{
    margin-top: 1.1em;
    margin-bottom: 0.35em;
}

.convite-detalhes-link{
    color: #1a5c3a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.convite-detalhes-link:hover{
    color: #234833;
}

.convite-detalhes-horario-list{
    margin: 0 0 0.8em;
    padding: 0;
    list-style: none;
}

.convite-detalhes-horario-list li{
    margin: 0 0 0.35em;
    padding: 0;
}

.convite-detalhes-surprise{
    font-style: italic;
    font-weight: 600;
    margin: 0.5em 0 0;
    line-height: 1.4;
}

.convite-detalhes-col--info{
    text-align: left;
}

.convite-detalhes-col--horario{
    text-align: left;
}

.convite-detalhes-cta{
    text-align: center;
    margin: 0 0 18px;
    padding: 14px 12px;
    color: #234833;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.05rem;
    font-weight: 600;
    border-top: 1px solid rgba(35, 72, 51, 0.12);
    border-bottom: 1px solid rgba(35, 72, 51, 0.12);
}

.convite-detalhes-actions{
    text-align: center;
    margin: 0 0 6px;
}

.convite-detalhes-actions .convite-action-pill{
    min-width: 200px;
    background: #234833;
    color: #fff;
    border-color: #1a3d2a;
}

.convite-detalhes-actions .convite-action-pill:hover,
.convite-detalhes-actions .convite-action-pill:focus-visible{
    background: #2d5a42;
    color: #fff;
    border-color: #234833;
    box-shadow: 0 10px 28px rgba(26, 61, 42, 0.35);
}

.convite-detalhes-actions .convite-action-pill:focus-visible{
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 3px;
}

.convite-detalhes-actions .convite-action-pill:active{
    background: #1a3d2a;
    color: #fff;
}

.convite-detalhes-close{
    position: absolute;
    right: 10px;
    top: 8px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 0;
    background: rgba(35, 72, 51, 0.10);
    color: #234833;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.convite-detalhes-close:hover{
    background: rgba(35, 72, 51, 0.16);
}

@media (max-width: 768px) {
    .convite-obrigado-message {
      font-size: 55px;
    }
    .convite-action-pill{
      min-width: 180px;
      width: 100%;
      max-width: 320px;
    }
}
