@font-face {
    font-family: 'Chosunilbo_myungjo';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/Chosunilbo_myungjo.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'ChosunSg';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunSg.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'JoseonBoldGothic';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunKg.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

/* --- 🎯 1. 전역 스타일 및 초기화 --- */
:root {
    /* JS에서 계산된 실제 뷰포트 높이, 모바일 주소창 문제 해결 */
    --vh: 1vh; 
}

html {
    scroll-behavior: smooth; /* 부드러운 스크롤 효과 */
}

body {
    max-width:700px;
    margin: auto;
    font-family: 'Chosunilbo_myungjo', serif;
    /* 터치 시 회색 배경이 나타나는 현상 제거 (iOS) */
    -webkit-tap-highlight-color: transparent;
}

* {
    box-sizing: border-box; /* 모든 요소의 크기 계산을 쉽게 만듦 */
}

/* ----- 1. 오버레이 시작 화면 ----- */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 700px;
  left:50%;
  transform: translateX(-50%);
  height: calc(var(--vh, 1vh) * 100);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background-color: #41220E;
  color: #FFFFFF;
  padding: 15vh 25px;
  box-sizing: border-box;

  /* 수정된 부분 */
  opacity: 1;
  visibility: visible;
  transition: opacity 1.5s ease-in-out, visibility 0s linear 1.5s;
}
#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
#splash-screen > * {
  text-align: center;
}
#splash-screen .verse {
  font-size: clamp(14px, 4vw, 20px);
  margin-bottom: 0;
}
#splash-screen .names {
  font-size: clamp(24px, 5.8vw, 44px);
  line-height: 1.8;
  font-weight: normal;
  margin-bottom: 0;
}
#splash-screen .details {
  font-size: clamp(16px, 4.8vw, 24px);
  line-height: 1.6;
}

/* ----- 2. 스크롤 콘텐츠 기본 스타일 ----- */
.screen {
  /* --- 수정: 화면 좌우 여백을 vw 단위로 변경하여 유연성 확보 --- */
  padding: 0 6vw;
  height: calc(var(--vh, 1vh) * 100);
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* ----- 두 번째 화면 ----- */
#main-content {
    background-color: #41220E;
    color: #FFFFFF;
    text-align: center;
}
.scripture-body {
    font-size: clamp(16px, 4.2vw, 22px);
    line-height: 1.8;
    margin-bottom: 30px;
    word-break: keep-all;
}
.scripture-reference {
    font-size: clamp(14px, 3.5vw, 18px);
}

/* ----- 세 번째 화면 ----- */
#invitation {
  background-color: #FFFFFF;
  color: #41220E;
  justify-content: flex-start;
  padding-top: 10vh;
  height: auto;
  min-height: calc(var(--vh, 1vh) * 100);
  padding-bottom: 10vh;
}
.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}
.invitation-title {
    width: 100%;
    text-align: center;
    font-size: 20px;
    font-weight: normal;
    line-height: 30px;
    margin-bottom: 50px;
}
.intro-text {
    width: 100%;
    text-align: center;
    font-size: clamp(14px, 3.5vw, 16px);
    line-height: 30px;
    margin-bottom: 80px;
}
.family-info {
    text-align: center;
    margin-bottom: 20px;
}
.family-info p {
    font-size: 15px;
    line-height: 30px;
}
.highlight-name {
    font-size: 18px;
}
.cta-button {
    background-color: #41220E;
    color: #FFFFFF;
    font-family: 'ChosunSg', sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 30px;
    border: none;
    border-radius: 10px;
    padding: 2px 25px;
    margin-bottom: 40px;
    cursor: pointer;
    transition: opacity 0.3s;
}
.cta-button:hover {
    opacity: 0.8;
}
.details-group {
    font-family: 'ChosunSg', sans-serif;
    font-size: 16px;
    line-height: 2; 
    text-align: left;
}
.details-group p {
    font-size: clamp(14px, 3.5vw, 16px);
    white-space: nowrap;
}
.details-group strong {
    font-weight: 700;
    margin-right: 15px;
}
/* ----- 달력 ----- */
.calendar-container {
    width: 100%;
    margin-top: 80px;
}
.date-highlight {
    text-align: center;
    color: #41220E;
    margin-bottom: 20px;
}
.date-highlight .date-large {
    font-size: 30px;
    margin: 0;
}
.date-highlight .date-small {
    font-size: 20px;
    margin: 5px 0 0 0;
}

/* --- 수정된 부분 시작 --- */
.calendar {
    /* 기존 스타일 유지 */
    width: 80%;
    max-width: 400px;
    margin: 0 auto;
    border-top: 1px solid #41220E;
    border-bottom: 1px solid #41220E;
    aspect-ratio: 1 / 1; /* 그리드에서는 잘 작동합니다 */

    /* 그리드 컨테이너로 변경 */
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7개의 동일한 너비의 열 생성 */
}

/* 모든 셀 (요일 + 날짜) 공통 스타일 */
.calendar > div {
    text-align: center;
    font-size: clamp(14px, 4vw, 21px);
    
    /* vertical-align: middle; 대신 flex 사용 */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 요일 셀 스타일 */
.calendar .weekday {
    font-weight: normal;
    letter-spacing: 1px;
    padding: 10px 0;
}
/* 날짜 셀 스타일 (특별한 스타일이 없으면 공통 스타일만 적용됨) */


/* --- 수정된 부분 끝 --- */

.calendar .sunday {
    color: #E85C5C;
}

.wedding-day {
    font-weight: bold;
    color: #FFFFFF;
    position: relative;
    z-index: 1;
}
.wedding-day::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5em;
    height: 1.5em;
    background-color: #E74C3C;
    border-radius: 50%;
    z-index: -1;
}

/* ----- 오시는 길 ----- */
.directions-container {
    width: 100%;
    margin-top: 100px;
    text-align: center;
}
.directions-title {
    font-size: 30px;
    font-weight: normal;
    margin-bottom: 15px;
}
.address {
    font-size: 18px;
    color: #32190E;
    margin-bottom: 25px;
}
.map-placeholder {
    aspect-ratio: 1 / 1;
    background-color: #FFFFFF;
}

.address-detail{
    display: flex;
    margin-top: 30px;
    justify-content: space-evenly;
    align-items: center;
}

#sketch{
    background-color: #b1b1b1;
    border-radius: 50%;
    /* --- 수정: 너비를 %로 지정하고 최대 크기를 설정하여 유연하게 조절 --- */
    width: 30%;
    max-width: 120px;
    height: auto; /* --- 추가: 너비에 맞춰 높이가 자동 조절되도록 함 --- */
    aspect-ratio: 1 / 1; /* --- 추가: 1:1 비율 유지 --- */
}

.description {
    font-size: 14px;
    /* --- 수정: line-height를 단위 없이 지정하여 가독성 개선 --- */
    line-height: 1.7;
    font-family: 'ChosunSg', sans-serif;
    margin-bottom: 3px;
    margin-top: 3px;
}

.traffic-container {
    margin-top: 20px;
    text-align: left;
}

.traffic-container > div > p {
    /* --- 수정: line-height를 단위 없이 지정하여 가독성 개선 --- */
    line-height: 1.6;
}


.info {
    font-family: 'ChosunSg', sans-serif;
}

.title{
    font-family: 'JoseonBoldGothic';
    font-size: 15px;
    margin-top: 15px;
    margin-bottom: 3px;
}

.etc {
    margin-top: 50px;
    text-align: center;
    font-size: 15px;
}

.etc > .info {
    margin-bottom: 50px;
}

.footer {
    background-color: #41220E;
    height: auto;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.share {
    color: #FFFFFF;
    font-family: 'JoseonBoldGothic', sans-serif;
    font-size: 15px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
}

.share-button-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    max-width: 500px;
}

.share-btn{
    width: 40px;
    height: 40px;
}

.custom-dropdown-container {
    position: relative;
    /* --- 수정: 너비를 %로 지정하고 최대 크기 설정 --- */
    width: 80%;
    max-width: 250px; 
    font-family: 'Pretendard', sans-serif;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

.dropdown-button {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 41px;
    padding: 0 20px;
    background-color: #a09086;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.custom-dropdown-container.open .dropdown-button {
    background-color: #41220E;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-button .arrow {
    position: absolute;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
    transition: transform 0.3s;
}

.custom-dropdown-container.open .dropdown-button {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.custom-dropdown-container.open .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    background-color: white;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: none;
}

.custom-dropdown-container.open .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 12px 20px;
    font-size: 15px;
    color: #41220E;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-menu li:hover {
    background-color: #f5f5f5;
}

/* 모달 배경 (반투명 오버레이) */
.modal {
    display: none; /* JS로 'flex'로 변경됨 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%; /* calc(var(--vh) * 100) 대신 사용해도 무방 */
    background-color: rgba(0, 0, 0, 0.7);
    
    /* 자식 요소를 중앙 정렬하기 위해 flex 컨테이너로 만듦 */
    justify-content: center;
    align-items: center;
}


.contact-card {
    /* 기존 스타일 대부분 유지 */
    position: relative;
    background-color: #41220E;
    color: #EAE0D6;
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%; /* 화면 너비의 90% 사용 */
    max-height: 90vh; /* 화면 높이의 90%를 넘지 않도록 */
    overflow-y: auto; /* 내용이 길면 카드 안에서 스크롤 */
    text-align: center;
    font-family: 'Chosunilbo_myungjo';
}

/* 닫기 버튼 */
.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    color: #EAE0D6;
}
.close-btn:hover {
    color: #fff;
}

/* 카드 내부 스타일 */
.modal-header {
    margin-bottom: 30px;
}
.small-title {
    font-size: 14px;
    letter-spacing: 2px;
}
.medium-title {
    font-size: 22px;
}
.family-container {
    margin-bottom: 30px;
    text-align: left;
}
hr {
    border: 0;
    height: 1px;
    background-color: #6a4a35;
    margin-bottom: 15px;
}
.side {
    font-size: 18px;
    margin-bottom: 10px;
}
.person {
    display: grid;

    /* 🎯 3개의 열(column)을 다시 정의합니다. */
    grid-template-columns: minmax(80px, auto) 1fr auto;

    align-items: center;
    gap: 15px; 
    margin-bottom: 15px;
    font-size: 16px;
}
.person span:first-child {
    width: auto; /* 고정 너비 제거 */
    color: white;
    white-space: nowrap; /* 글자가 두 줄로 나뉘는 것을 방지 */
}
.person span:nth-child(2) {
    width: auto;
    /* 이름이 깨지는 것을 방지 */
    word-break: keep-all;
    line-height: 1.4;
}
.icons {
    margin-left: 0; /* 기존 auto 속성 제거 */
    display: flex; /* 아이콘들을 가로로 나란히 배치 */
    gap: 15px; /* 아이콘 사이 간격 */
}
.icons a {
    margin-left: 0; /* 개별 아이콘의 margin 제거 */
}
.icons img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

.cta-button, .dropdown-button {
    min-height: 44px; /* 터치 영역 최소 높이 권장사항 */
    -webkit-appearance: none; /* iOS 기본 버튼 스타일 제거 */
    -moz-appearance: none;
    appearance: none;
}

/* --- 추가: 화면이 작은 기기를 위한 미디어 쿼리 --- */
@media (max-width: 380px) {
    .intro-text,
    .calendar-container {
        /* 상하 여백을 줄여 작은 화면에서 더 많은 정보가 보이도록 함 */
        margin-bottom: 50px;
        margin-top: 50px;
    }

    .address-detail {
        /* 약도와 설명이 너무 좁아지면 세로로 쌓이도록 변경 */
        flex-direction: column;
        gap: 20px; /* 이미지와 텍스트 사이 간격 */
    }

    #sketch {
        width: 100px; /* 세로 배치 시 이미지 크기 고정 */
    }
}
