@import url('//fonts.googleapis.com/earlyaccess/nanummyeongjo.css');

/* --- Variables & Base --- */
:root {
    --primary-color: #a68d7a;
    --bg-soft: #faf9f8;
}

body, html {
    width: 100%;
    overflow-x: hidden; /* 가로 스크롤 방지 */
    overflow-y: visible; /* 일반 스크롤 허용 */
    font-family: 'Pretendard Variable', sans-serif;
    background-color: var(--bg-soft);
    letter-spacing: -0.04em;
    position: relative;
    margin: 0;
    padding: 0;
}

.section {
    width: 100%;
    min-height: 80vh; /* 각 섹션의 최소 높이 설정 */
    display: flex;
    align-items: center;
    position: relative;
    padding: 100px 0; /* 상하 여백 추가 */
}

.bg-soft { background-color: var(--bg-soft); }
.bg-white { background-color: #ffffff; }

/* --- Hero --- */
.hero-section { 
    height: 100vh; 
    background-color: #000; 
    padding: 0;
}
.bg-image-container { position: absolute; top:0; left:0; width:100%; height:100%; z-index: 1; }
.bg-image { 
    width: 100%; height: 100%; 
    background: url('https://klaud9ux.github.io/happymarriage/bg.webp') center/cover no-repeat;
    filter: brightness(0.5);
}
.hero-overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.1); z-index: 2; }

/* --- Typography --- */
.display-lg { font-family: 'Pinyon Script', cursive; font-size: clamp(2.25rem, 12vw, 8rem); font-weight: 100; line-height: 1; }
.label-sm { font-family: 'Montserrat'; font-size: 0.8rem; letter-spacing: 8px; font-weight: 300; }
.num-label { 
    font-family: 'Montserrat'; 
    font-size: 0.7rem; 
    letter-spacing: 4px; 
    color: var(--primary-color); 
    display: block; 
    margin-bottom: 1.5rem; 
    text-align: inherit; /* 부모 정렬을 따름 */
}
.text-primary { color: var(--primary-color) !important; }
.text-serif{
    font-family: 'nanummyeongjo', serif !important;
}


/* --- Components --- */
.calendar-card { box-shadow: 0 30px 60px rgba(0,0,0,0.05) !important; margin: 0 auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px 0; font-family: 'Montserrat'; }
.cal-grid div { height: 35px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.cal-grid .active { background: var(--primary-color); color: #fff; border-radius: 50%; width: 32px; height: 32px; margin: 0 auto; }

/* --- Utils --- */
.animate-up { opacity: 0; transform: translateY(30px); animation: fadeInUp 1.2s forwards ease-out; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

.loader-line { width: 40px; height: 1px; background: var(--primary-color); }
.btn-hover {
    transition: all .4s;
}
.btn-hover:hover { background-color: #333 !important; border-color: #333; color: #fff !important; transform: translateY(-2px); }

.scroll-guide {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 0.6rem; letter-spacing: 5px; opacity: 0.6; z-index: 10;
}
.scroll-guide .line { width: 1px; height: 40px; background: white; margin-bottom: 10px; }


/* --- Digital Album--- */
.album-outer-container {
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 0; /* 상하 여백만 주어 다음 섹션과 구분 */
}

.mySwiper {
    width: 100%;
}

.swiper-slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* 와이드한 시네마틱 비율 */
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05); /* 아주 연한 그림자 */
    background: #fff;
}

.swiper-slide {
    background: #f8f8f8; /* 로딩 전 배경색 */
}

/* --- Apple 스타일 플로팅 페이지네이션 --- */
.apple-pagination {
    /* 위치 및 레이아웃 */
    bottom: 20px !important; 
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    display: inline-flex;
    align-items: center;
    padding: 8px 8px; /* 바의 상하좌우 여백 */
    border-radius: 50px; /* 완벽한 타원형 */
    z-index: 10;
    gap: 4px;

    background: rgba(0, 0, 0, 0.25) !important; /* 약간 어두운 반투명 배경 */
    backdrop-filter: blur(15px); /* 배경 블러 효과 */
    -webkit-backdrop-filter: blur(15px);
    border: 0.5px solid rgba(255, 255, 255, 0.1); /* 미세한 테두리 */
}

/* 페이지네이션 점(Bullet) 스타일 */
.apple-pagination .swiper-pagination-bullet {
    width: 8px; /* 점 크기 */
    height: 8px;
    background: rgba(255, 255, 255, 0.4) !important; /* 비활성 점: 반투명 화이트 */
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 활성화된 점 스타일 */
.apple-pagination .swiper-pagination-bullet-active {
    background: #ffffff !important; /* 활성 점: 완전한 화이트 */
    transform: scale(1.1); /* 미세하게 강조 */
}


/* --- 내비게이션: 미니멀 삼각형 커스텀 --- */
.swiper-button-next,
.swiper-button-prev {
    width: 48px !important;
    height: 48px !important;
    color: transparent !important; /* 기본 화살표 폰트 숨기기 */
    transition: all 0.3s ease;
    background: rgba(0,0,0,.25);
    border-radius: 50%;
    opacity: .6;
}

/* 기본 화살표 폰트(>) 제거 */
.swiper-button-next::after,
.swiper-button-prev::after {
    display: none;
}

/* 오른쪽 삼각형 (Next) */
.custom-triangle-next::before {
    content: '';
    display: block;
    width: 15px;
    height: 20px;
    background-color: #ffffff; /* 화이트 삼각형 */
    clip-path: polygon(0% 0%, 100% 50%, 0% 100%); /* 삼각형 모양 생성 */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transform: translateX(2px);
}

/* 왼쪽 삼각형 (Prev) */
.custom-triangle-prev::before {
    content: '';
    display: block;
    width: 15px;
    height: 20px;
    background-color: #ffffff;
    clip-path: polygon(100% 0%, 0% 50%, 100% 100%);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transform: translateX(-2px);
}

/* 호버 효과 */
.swiper-button-next:hover,
.swiper-button-prev:hover {
    opacity: 1;
    transform: scale(1.1); /* 중앙 정렬 유지하며 확대 */
    background: rgba(0,0,0,.4);
}

/* 위치 미세 조정 (1400px 대화면 대응) */
.swiper-button-next { right: 40px !important; }
.swiper-button-prev { left: 40px !important; }


@media (max-width: 767px) {
    .swiper-pagination {
        display: none;
    }
    .swiper-button-next, .swiper-button-prev {
        display: none;
    }
}

/* 방명록 전용 추가 스타일 */
.guestbook-input-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(166, 141, 122, 0.08); /* 프라이머리 컬러 기반 그림자 */
    border: 1px solid rgba(166, 141, 122, 0.1);
}

.form-control-minimal {
    border: none;
    border-bottom: 1px solid #eee;
    background: transparent;
    padding: 10px 5px;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.3s;
}

.form-control-minimal:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.form-control-minimal:focus {
    border-bottom: 2px solid var(--primary-color) !important;
    transform: translateY(-2px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-write {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-write:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
}

/* 개별 댓글 카드 */
.guest-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 15px;
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.page-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background-color: transparent;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 0;
}
.page-item.active .page-link {
    background-color: var(--primary-color) !important; /* 애플스러운 블랙 포인트 */
    color: #fff !important;
}
.page-link:hover {
    background-color: #f5f5f7;
}

/* 팝오버 애니메이션 효과 */
@keyframes popoverUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    70% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popover-card {
    animation: popoverUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: center bottom;
}


.side-account-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-tag {
    font-size: 0.875rem;
    padding: 10px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 500;
}
.card-tag.groom { 
    background: #f0f4f7; 
    color: #607d8b; 
}

.card-tag.bride { 
    background: #f9f2f2; 
    color: #b18585; 
}

.card-body-custom {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 10px;
}

.mini-account-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
    border-bottom: 1px dashed #e9e9e9;
    text-align: center;
}
.mini-account-item.no-border { border-bottom: none; }

.flex-fill { flex: 1 0 0; }
.flex-grow-2 { flex: 2 0 0; }

/* 1. 라벨 디자인 강화 (크기 및 대비 상향) */
.mini-role {
    font-size: 0.8rem; /* 기존 0.6rem에서 상향 */
    color: #888;
    display: block;
    font-weight: 600;
    letter-spacing: 1px;
}
.mini-role.highlight-role {
    color: var(--primary-color);
}

.mini-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
}

.mini-acc-num {
    font-size: 0.85rem;
    color: #555;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0;
}

/* 2. 버튼 호버 애니메이션 (애플 스타일) */
.btn-mini-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.75rem;
    padding: 6px 8px;
    border-radius: 6px;
    color: #444;
    font-weight: 500;
    align-self: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    user-select: none;
}

/* 호버 시: 배경색이 살짝 변하고 위로 뜸 */
@media (hover: hover) {
    .btn-mini-copy:hover {
        background: var(--primary-color);
        color: #fff;
        border-color: var(--primary-color);
        transform: translateY(-3px);
        box-shadow: 0 6px 15px rgba(166, 141, 122, 0.25);
    }
}

.btn-mini-copy:active {
    transform: translateY(-1px) scale(0.96);
    filter: brightness(0.9);
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 모바일 대응 */
@media (max-width: 767px) {
    .mini-role { font-size: 0.75rem; }
    .mini-name { font-size: 1rem !important; }
    .mini-acc-num { font-size: 0.78rem !important; }
}

/* 토스트 메시지 스타일 */
.toast-message {
    position: fixed;
    bottom: 80px; 
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000 !important; 
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    pointer-events: none; 
}

.toast-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 3. 모바일 여백 최적화 */
@media (max-width: 767px) {
    .section { padding: 60px 0 !important; }
    

    .hero-date {
        font-size: 1rem !important;
    }
    .hero-location {
        font-size: 0.875rem !important;
    }

    .signature {
        font-size: 1rem !important;
    }


    /* 앨범 이미지 비율 유지 및 넘침 방지 */
    .swiper-slide img {
        max-width: 100%;
        height: auto;
    }
}


/* 지도 오버레이 */
.map-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20; /* 지도보다 위에 위치 */
    background: rgba(255, 255, 255, 0.1); /* 미세한 불투명도 */
    backdrop-filter: blur(2px); /* 부드러운 블러 효과 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s ease;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none; /* 텍스트가 클릭을 방해하지 않도록 */
}

/* 레이어가 사라지는 애니메이션 */
.map-overlay-layer.hide {
    opacity: 0;
    visibility: hidden;
}

/* PC 환경 (992px 이상) 설정 */
@media (min-width: 992px) {
    .map-overlay-layer {
        display: none !important; /* PC에서는 오버레이 강제 숨김 */
    }
    
    #kakao-map {
        cursor: grab; /* PC에서 지도임을 알 수 있게 커서 변경 */
    }
}

/* 기존 .music-controller:hover .volume-slider-container 삭제 후 추가 */

.volume-toggle-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(166, 141, 122, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.volume-slider-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 8px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(166, 141, 122, 0.2);
    position: absolute;
    bottom: 24px; /* 버튼 위로 띄움 */
    left: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
}

/* active 상태일 때 노출 */
.volume-slider-container.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 세로형 슬라이더 설정 */
#volume-range {
    writing-mode: bt-lr; /* IE 대응 */
    appearance: slider-vertical; /* 크롬, 사파리 대응 */
    width: 4px;
    height: 80px;
    cursor: pointer;
    accent-color: var(--primary-color); /* 메인 컬러 적용 */
}

/* 음악 재생 버튼 기본 디자인 */
.music-player-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(166, 141, 122, 0.2);
    padding: 8px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

#volume-range {
    /* 기존 appearance: slider-vertical 삭제 */
    writing-mode: vertical-lr; 
    direction: rtl; 
    width: 8px;
    height: 80px;
    cursor: pointer;
}

.music-text { font-size: 0.65rem; font-family: 'Montserrat'; font-weight: 600; color: var(--primary-color); letter-spacing: 1px; }
.music-bars { display: flex; align-items: flex-end; gap: 2px; width: 12px; height: 12px; }
.bar { width: 2px; background: var(--primary-color); height: 30%; transition: height 0.3s; }
.playing .bar { animation: sound-wave 1s ease-in-out infinite alternate; }
@keyframes sound-wave { 0% { height: 30%; } 100% { height: 100%; } }

/* 벚꽃 캔버스: 본문 요소들 위에서 흩날림 */
#cherry-blossom-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* [중요] 모든 글자와 사진보다 위로 배치 */
    z-index: 100; 
    
    /* [필수] 캔버스가 위에 있어도 아래 버튼들을 클릭할 수 있게 함 */
    pointer-events: none; 
}

/* 음악 컨트롤러와 토스트 메시지는 벚꽃보다도 위에 있어야 함 */

.music-controller {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 999999 !important; /* 최상단 레이어 보장 */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.music-controller, 
.toast-message {
    z-index: 10000 !important;
}

/* 비디오 섹션 스타일 */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 비율 유지 */
    height: 0;
    overflow: hidden;
    border-radius: 12px; /* 모서리 둥글게 */
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 갤러리 모달 전체 배경 */
.gallery-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #000000 !important; /* 완전 검정 */
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.gallery-modal.show {
    opacity: 1;
    visibility: visible;
}

/* 이미지 감싸는 영역 (여백 클릭 시 닫기 용이하게) */
.modal-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 확대된 이미지 스타일 */
#modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border-radius: 4px;
    animation: zoomIn 0.3s ease-out; /* 등장 애니메이션 */
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 닫기 버튼 */
.modal-close-btn {
    position: absolute;
    top: 20px; right: 25px;
    background: none; border: none;
    color: #fff; font-size: 40px; font-weight: 200;
    z-index: 1000001; cursor: pointer;
}

/* --- 모바일 레이아웃 최적화 --- */
@media (max-width: 767px) {
    /* 1. 볼륨 조절 버튼(스피커) 숨기기 */
    .volume-toggle-btn {
        display: none !important;
    }

    /* 2. 볼륨 조절 패널(슬라이더) 숨기기 */
    .volume-slider-container {
        display: none !important;
    }

    /* 3. 재생 버튼 위치 및 정렬 보정 */
    .music-controller {
        right: 15px; /* 모바일 여백 최적화 */
        bottom: 20px;
        align-items: flex-end; /* 오른쪽 정렬로 변경 */
    }

    .controller-buttons-group {
        gap: 0; /* 버튼이 하나뿐이므로 간격 제거 */
    }

    .music-player-btn {
        height: 38px; /* 모바일에서 살짝 더 슬림하게 */
        padding: 0 12px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(5px);
    }
    
    .music-text {
        font-size: 0.6rem; /* 텍스트 크기 미세 조정 */
    }
}