/* 섹션 경계의 위·아래 호흡을 일정하게 유지합니다. */
:root {
    --section-space: clamp(4.5rem, 14vw, 5.75rem);
}

/* PC에서 청첩장 바깥 양옆은 INVITATION 글자와 같은 로즈 테마색 */
body {
    background-color: #e8dddb !important;
}

/* 첫 화면의 한글 이름은 기존보다 2pt 작게 표시 */
.names-kr-box .names,
.names-kr-box .names:nth-child(2) {
    font-size: calc(1.4rem + 2.33px) !important;
}

/* 각 섹션 내부 카드와 버튼은 같은 폭과 중심선을 사용합니다. */
.couple-profile-section,
.wedding-calendar,
.gallery-carousel,
.location-reference-header,
.location-map-card,
.location-reference-buttons,
.location-guide-list,
.account-description,
.account-accordion-container,
.guestbook-section .messages-section,
.rsvp-inline-intro,
.share-button-container {
    width: 100% !important;
    max-width: var(--block-max-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.share-button-container .share-kakao-button,
.share-button-container .share-link-button {
    width: 100% !important;
    max-width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    background: #ffffff !important;
    border: 1px solid rgba(185, 148, 147, 0.2) !important;
    border-radius: 12px !important;
    color: #4d4643 !important;
    box-shadow: none !important;
    font-family: 'Nanum Myeongjo', serif !important;
    font-weight: 400 !important;
}

.share-button-container {
    background: transparent !important;
    gap: 1em !important;
}

.share-button-container .share-kakao-button span,
.share-button-container .share-link-button span {
    color: #4d4643 !important;
    font-family: 'Nanum Myeongjo', serif !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
}

.share-button-container .share-kakao-button:hover,
.share-button-container .share-link-button:hover {
    background: #fffaf7 !important;
    opacity: 1 !important;
}

section.letter,
.couple-section,
.calendar,
.gallery,
.location,
.account-trapezoid,
.guestbook-section,
.rsvp-inline-section {
    padding-top: var(--section-space) !important;
    padding-bottom: var(--section-space) !important;
}

/* 공유 섹션은 제목이 별도 헤더 안에 있어 헤더와 하단에 간격을 나눠 적용합니다. */
.share-section {
    padding-top: 0 !important;
    padding-bottom: var(--section-space) !important;
}

.share-header {
    padding-top: var(--section-space) !important;
    padding-bottom: 2.5em !important;
}

/* 같은 위계의 한글 섹션 제목 색상을 하나로 통일합니다. */
.invitation-korean,
.couple-profile-title,
.wedding-calendar-section-title h2,
.gallery .title,
.location-reference-header h2,
.account-title,
.guestbook-section .title,
.rsvp-inline-title,
.share-title {
    color: #3f302d !important;
}

/* 주요 콘텐츠 섹션 제목은 기존 서체를 유지하고 크기와 굵기만 통일합니다. */
.wedding-calendar-section-title h2,
.gallery .title,
.location-reference-header h2,
.account-title,
.guestbook-section .title,
.rsvp-inline-title,
.share-title {
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    letter-spacing: 1px !important;
}

.gallery-description {
    font-size: clamp(0.68rem, 3.1vw, 0.86rem) !important;
    white-space: nowrap;
}

/* 참석 의사 팝업을 방명록 작성 팝업과 같은 카드형 디자인으로 통일합니다. */
.rsvp-inline-form-panel {
    align-items: center !important;
    padding: 2em !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(5px);
}

.rsvp-inline-form-content {
    width: 100% !important;
    max-width: 480px !important;
    max-height: 90vh !important;
    padding: 2.5em !important;
    background: #fff !important;
    border: 1px solid rgba(185, 148, 147, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.rsvp-popup-header {
    display: block !important;
    margin-bottom: 2em !important;
    text-align: center;
}

.rsvp-popup-header h2 {
    color: #b99493 !important;
    font-size: 1.5em !important;
    font-weight: 600 !important;
}

.rsvp-popup-close {
    position: absolute;
    top: 1em;
    right: 1em;
    width: 32px !important;
    height: 32px !important;
    background: rgba(0, 0, 0, 0.1) !important;
    color: #776d69 !important;
    border-radius: 50%;
    font-family: Arial, sans-serif;
    font-size: 1.35rem !important;
    font-weight: 300;
    line-height: 1;
}

.rsvp-side-tabs {
    gap: 0 !important;
    margin-bottom: 1.5em !important;
    padding: 3px !important;
    background: #fff !important;
    border: 2px solid #e0e0e0;
    border-radius: 8px !important;
}

.rsvp-side-tabs .option-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    color: #8e817c !important;
    border-radius: 5px !important;
    font-weight: 700 !important;
    text-align: center !important;
}

.rsvp-side-tabs .option-btn.selected {
    color: #9b5c5f !important;
    background: #f3e8e5 !important;
    box-shadow: none !important;
}

.rsvp-simple-field {
    display: block !important;
    margin-bottom: 1.5em !important;
}

.rsvp-simple-field label {
    display: block;
    margin-bottom: 0.8em;
    color: #333 !important;
    font-size: 0.95em !important;
    font-weight: 500 !important;
}

.rsvp-simple-field input {
    width: 100%;
    height: auto !important;
    padding: 1em 1.2em !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 0.95em !important;
}

.rsvp-count-notice {
    margin: -0.5em 0 1.5em !important;
    padding: 0.8em 1em !important;
    border-radius: 6px;
    font-size: 0.72em !important;
}

.rsvp-privacy-box {
    text-align: left;
}

.rsvp-privacy-box > strong {
    font-size: 0.9em !important;
}

.rsvp-privacy-box > p,
.rsvp-privacy-box .privacy-check-option {
    font-size: 0.78em !important;
}

.rsvp-popup-submit {
    min-width: 88px !important;
    padding: 0.72em 1.55em !important;
    background: #b99493 !important;
    border-radius: 22px !important;
    font-size: 0.9em !important;
}

@media (max-width: 480px) {
    .rsvp-inline-form-panel {
        padding: 1em !important;
    }

    .rsvp-inline-form-content {
        width: 100% !important;
        max-height: calc(100vh - 2em) !important;
        padding: 2em 1.5em !important;
        border-radius: 16px !important;
    }
}

/* 화면 크기별 공통 반응형 보정 */
@media (max-width: 600px) {
    :root {
        --section-space: clamp(3.75rem, 16vw, 5rem);
    }

    section.letter,
    .couple-section,
    .calendar,
    .gallery,
    .location,
    .account-trapezoid,
    .guestbook-section,
    .rsvp-inline-section,
    .share-header {
        padding-left: var(--page-gutter) !important;
        padding-right: var(--page-gutter) !important;
    }

    .location-reference-header,
    .location-map-card,
    .location-reference-buttons,
    .location-guide-list,
    .couple-profile-section,
    .account-accordion-container,
    .rsvp-inline-intro,
    .rsvp-inline-content,
    .guestbook-list,
    .share-button-container,
    .account-content {
        width: min(100%, var(--block-max-width)) !important;
        max-width: var(--block-max-width) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .location-map-card iframe {
        width: 100% !important;
    }

    .gallery-carousel {
        width: 100%;
        max-width: 100% !important;
    }

    .gallery-lightbox-container {
        width: 100%;
        max-width: 100vw;
    }

    .gallery-lightbox-image {
        max-width: calc(100vw - 1rem);
        max-height: 55dvh !important;
    }

    .form-modal,
    .rsvp-inline-form-panel,
    .password-modal {
        padding: max(0.75rem, env(safe-area-inset-top)) var(--page-gutter)
            max(0.75rem, env(safe-area-inset-bottom)) !important;
    }

    .form-modal-content,
    .rsvp-inline-form-content,
    .password-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 1.5rem) !important;
        overflow-y: auto;
    }
}

@media (max-width: 390px) {
    :root {
        --page-gutter: 0.9rem;
        --section-space: 3.75rem;
    }

    .gallery-description,
    .share-description,
    .guestbook-description {
        white-space: normal !important;
    }

    .location-map-buttons {
        gap: 0.45rem !important;
    }

    .location-map-button {
        min-width: 0 !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
        font-size: 0.78rem !important;
    }

    .account-row,
    .account-info {
        min-width: 0;
    }

    .account-copy-button {
        flex: 0 0 auto;
    }

    .share-button {
        width: 100% !important;
    }

    .share-button-container .share-kakao-button,
    .share-button-container .share-link-button {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 340px) {
    :root {
        font-size: 0.8125rem;
        --page-gutter: 0.75rem;
    }

    .rsvp-inline-form-content,
    .form-modal-content {
        padding: 1.5rem 1rem !important;
    }

    .gallery-carousel-button {
        width: 34px !important;
        height: 34px !important;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .form-modal,
    .rsvp-inline-form-panel,
    .password-modal {
        align-items: flex-start !important;
        overflow-y: auto;
    }

    .gallery-lightbox-image {
        max-height: 68dvh;
    }
}

/* 참고 청첩장과 같은 전역 꽃잎 배경 */
.background-petal-rain {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    contain: strict;
}

.background-petal-rain .petal {
    position: absolute;
    width: 17px;
    height: 23px;
    border-radius: 78% 22% 72% 28%;
    background: linear-gradient(145deg, rgba(226, 177, 181, 0.72), rgba(185, 123, 132, 0.4));
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.7);
    animation-name: weddingPetalFall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    will-change: transform, opacity;
}

.background-petal-rain .petal.rose {
    width: 21px;
    height: 18px;
    background: linear-gradient(145deg, rgba(215, 160, 168, 0.7), rgba(170, 105, 118, 0.38));
}

.background-petal-rain .petal.peony {
    width: 20px;
    height: 26px;
    background: linear-gradient(145deg, rgba(241, 207, 206, 0.76), rgba(203, 151, 158, 0.4));
}

.background-petal-rain .petal.carnation {
    width: 16px;
    height: 21px;
    border-radius: 60% 40% 65% 35%;
    background: linear-gradient(145deg, rgba(232, 190, 184, 0.72), rgba(189, 133, 137, 0.38));
}

/* 꽃잎보다 텍스트와 버튼이 항상 앞에 오도록 합니다. */
body > section:not(.cover) > *,
.footer-section > * {
    position: relative;
    z-index: 2;
}

.cover > .names-kr-box,
.cover > .cover-title-container,
.cover > .cover-scroll-indicator {
    z-index: 2;
}

@keyframes weddingPetalFall {
    0% { transform: translate3d(0, -4vh, 0) rotate(0deg); opacity: 0; }
    8% { opacity: 0.72; }
    52% { transform: translate3d(26px, 52vh, 0) rotate(230deg); }
    100% { transform: translate3d(-22px, 108vh, 0) rotate(520deg); opacity: 0.15; }
}

/* 스크롤 진입 시 차분하게 나타나는 공통 모션 */
.wedding-reveal {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition:
        opacity 0.9s ease var(--reveal-delay, 0ms),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.wedding-reveal-left { transform: translate3d(-24px, 0, 0); }
.wedding-reveal-right { transform: translate3d(24px, 0, 0); }
.wedding-reveal-scale { transform: scale(0.97); }

.wedding-reveal.animate {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    will-change: auto;
}

/* 첫 화면 하단의 두 줄 스크롤 안내 */
.cover-scroll-indicator {
    position: absolute !important;
    left: 50%;
    bottom: clamp(1.1rem, 3.5vh, 2rem);
    z-index: 6 !important;
    display: block !important;
    width: 46px;
    height: 46px;
    transform: translateX(-50%);
    background: rgba(251, 247, 242, 0.78);
    border: 1px solid rgba(155, 92, 95, 0.42);
    border-radius: 50%;
    box-shadow: 0 3px 14px rgba(75, 54, 49, 0.12);
    opacity: 1 !important;
    backdrop-filter: blur(4px);
}

.cover-scroll-indicator span {
    position: absolute;
    left: 50%;
    width: 9px;
    height: 9px;
    border-right: 1.5px solid #9b5c5f;
    border-bottom: 1.5px solid #9b5c5f;
    transform: translateX(-50%) rotate(45deg);
    animation: weddingScrollCue 1.6s ease-in-out infinite;
}

.cover-scroll-indicator span:first-child { top: 10px; }
.cover-scroll-indicator span:last-child { top: 20px; animation-delay: 0.16s; }

@keyframes weddingScrollCue {
    0%, 100% { opacity: 0.28; transform: translate(-50%, -3px) rotate(45deg); }
    50% { opacity: 0.9; transform: translate(-50%, 3px) rotate(45deg); }
}

@media (prefers-reduced-motion: reduce) {
    .background-petal-rain { display: none !important; }
    .wedding-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .cover-scroll-indicator span { animation: none !important; }
}

/* 캘린더 추가 버튼을 사이트의 주요 동작 버튼과 같은 톤으로 맞춥니다. */
.calendar-btn.google-calendar {
    width: auto !important;
    min-width: 190px;
    padding: 0.95em 1.8em !important;
    background: #995f61 !important;
    color: #fff !important;
    border-radius: 28px !important;
    box-shadow: none !important;
    font-family: 'Nanum Myeongjo', serif !important;
    font-size: 0.92rem !important;
    font-weight: 400 !important;
}

.calendar-btn.google-calendar:hover {
    background: #875255 !important;
    box-shadow: none !important;
}

/* 날짜와 저작권을 청첩장 공유 영역에서 분리된 마지막 섹션으로 표시합니다. */
.footer-section {
    padding: 4em 1.5em !important;
    background: #ffffff !important;
    border-top: 0 !important;
}

.footer-content {
    gap: 0.9em !important;
}

.footer-date {
    color: #6f625d !important;
}

.footer-copyright {
    margin-top: 0 !important;
}

.footer-copyright p {
    color: #6f625d !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    opacity: 0.95 !important;
}

.couple-profile-family {
    font-weight: 700 !important;
}

.account-accordion-item,
.account-accordion-item:hover,
.account-accordion-item.active,
.account-accordion-button,
.account-accordion-button:hover,
.account-accordion-content,
.account-details-container,
.account-card,
.account-card:hover {
    background: #f3ece4 !important;
}

/* 계좌 제목은 공유 버튼과 같은 크기와 굵기로 통일 */
.account-accordion-button {
    padding: 1em 1.25em 1em 1.5em !important;
    font-family: 'Nanum Myeongjo', serif !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
}

.account-accordion-item,
.account-accordion-item:hover,
.account-accordion-item.active {
    border-color: transparent !important;
    box-shadow: none !important;
}

.account-accordion-content,
.account-details-container {
    background: #f9f9f9 !important;
}

.account-card,
.account-card:hover {
    background: #ffffff !important;
}

/* 현재 콘텐츠 순서를 기준으로 흰색과 아이보리 배경을 교차합니다. */
section.letter,
.gallery,
.account-trapezoid,
.rsvp-inline-section {
    background-color: #ffffff !important;
}

/* 본문 문단의 letter 클래스가 섹션 여백을 상속하지 않도록 축소 */
section.letter p.letter {
    padding: 1em 0 !important;
    background: transparent !important;
    font-size: calc(1rem - 2px) !important;
}

/* 아이보리 오시는 길 섹션 안의 교통 안내는 흰색 카드로 구분 */
.location-guide-card {
    background: #ffffff !important;
    padding: 1.45em 1.4em !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 12px rgba(75, 54, 49, 0.07) !important;
}

.calendar,
.location,
.guestbook-section,
.share-section {
    background-color: #f3ece4 !important;
}

@media (max-width: 480px) {
    .footer-section {
        padding: 3.5em 1em !important;
    }

    .footer-date {
        font-size: 0.92rem !important;
    }

    .footer-copyright p {
        font-size: 0.78rem !important;
    }
}

@media (max-width: 600px) {
    .share-section {
        padding-left: var(--page-gutter) !important;
        padding-right: var(--page-gutter) !important;
    }

    .gallery-carousel,
    .share-button-container {
        width: min(100%, var(--block-max-width)) !important;
        max-width: var(--block-max-width) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .share-button-container .share-kakao-button,
    .share-button-container .share-link-button {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 팝업 닫기 아이콘을 글꼴 문자 대신 고정된 교차선으로 렌더링합니다. */
.form-modal-close,
.rsvp-popup-close {
    top: 2.5rem !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    font-size: 0 !important;
    transition: background-color 0.2s ease !important;
    transform: none !important;
    outline: none !important;
}

.form-modal-close {
    right: 2.5rem !important;
}

.rsvp-popup-close {
    right: 2.5rem !important;
}

.form-modal-close:hover,
.form-modal-close:active,
.form-modal-close:focus,
.rsvp-popup-close:hover,
.rsvp-popup-close:active,
.rsvp-popup-close:focus {
    background: rgba(185, 148, 147, 0.18) !important;
    transform: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.form-modal-close span {
    display: none !important;
}

.form-modal-close::before,
.form-modal-close::after,
.rsvp-popup-close::before,
.rsvp-popup-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 1.5px;
    background: #776d69;
    border-radius: 2px;
    transform-origin: center;
}

.form-modal-close::before,
.rsvp-popup-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.form-modal-close::after,
.rsvp-popup-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 확인/전달 버튼은 상태가 바뀌어도 크기와 중앙 정렬을 유지합니다. */
.guestbook-popup-submit,
.rsvp-popup-submit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 104px !important;
    min-width: 104px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 1em !important;
    line-height: 1 !important;
    white-space: nowrap;
    box-sizing: border-box !important;
    transform: none !important;
    box-shadow: none !important;
}

#rsvp-modal-form {
    text-align: right;
}

#rsvp-modal-form .rsvp-side-tabs,
#rsvp-modal-form .rsvp-simple-field,
#rsvp-modal-form .rsvp-count-notice,
#rsvp-modal-form .rsvp-privacy-box {
    text-align: left;
}

.guestbook-popup-submit:hover:not(:disabled),
.guestbook-popup-submit:active:not(:disabled),
.rsvp-popup-submit:hover:not(:disabled),
.rsvp-popup-submit:active:not(:disabled) {
    transform: none !important;
    box-shadow: none !important;
}

@media (max-width: 480px) {
    .form-modal-close,
    .rsvp-popup-close {
        top: 1.5rem !important;
    }

    .form-modal-close {
        right: 1.5rem !important;
    }

    .rsvp-popup-close {
        right: 1.5rem !important;
    }
}

/* 태블릿 이하에서는 방명록 폼의 좌우 안쪽 여백(1.5rem)에 맞춥니다. */
@media (min-width: 481px) and (max-width: 768px) {
    .form-modal-close {
        right: 1.5rem !important;
    }
}
