:root {
    /* 색상 팔레트 - 우아한 웨딩 테마 */
    --primary-color: #d4a574;
    --primary-dark: #b8935f;
    --secondary-color: #f5f5f0;
    --accent-color: #8b7355;
    --text-dark: #2c2c2c;
    --text-light: #666;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.2);

    /* 그라데이션 */
    --gradient-primary: linear-gradient(135deg, #d4a574 0%, #b8935f 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nanum Gothic', 'Noto Serif KR', 'Georgia', sans-serif;
    color: var(--text-dark);
    background-color: var(--secondary-color);
    line-height: 1.8;
    overflow-x: hidden;
    word-break: keep-all;
}

/* 헤더 섹션 */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    padding: 4rem 1.5rem;
}

.hero-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 1s ease-out;
}

.hero-greeting {
    font-family: 'Croissant One', cursive;
    font-size: 4.5rem;
    font-weight: 400;
    letter-spacing: 0.05rem;
    margin-bottom: 4rem;
    color: var(--text-light);
    text-align: center;
}

.hero-image-wrapper {
    width: 100%;
    padding: 0 1rem;
}

.hero-image-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 3/4;
    border-radius: 50% 50% 0 0;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow-heavy);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 날짜 애니메이션 섹션 */
.date-reveal-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #9b8d82;
    padding: 4rem 1.5rem;
}

.date-reveal-container {
    width: 100%;
    text-align: center;
    color: var(--white);
}

.date-line {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin: 1rem 0;
}

.date-word {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    height: 7rem;
}

.reveal-char {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 6rem;
    font-weight: 400;
    opacity: 0;
    transform: translateY(100px);
    display: inline-block;
}

/* 섹션 공통 스타일 */
.section {
    padding: 4rem 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 3rem;
    color: var(--accent-color);
    position: relative;
    padding-bottom: 1rem;
    font-family: 'Nanum Gothic', sans-serif;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--primary-color);
}

/* 인사말 섹션 */
.greeting-section {
    background: var(--white);
}

.rings-animation {
    width: 100%;
    max-width: 240px;
    margin: 0 auto 1.5rem;
    padding: 2rem 0;
}

.rings-svg {
    width: 100%;
    height: auto;
}

.ring-left {
    opacity: 0;
    animation: slideInLeft 1s ease-out 0.5s forwards;
}

.ring-right {
    opacity: 0;
    animation: slideInRight 1s ease-out 0.5s forwards;
}

/* 하트들은 처음에 숨김 */
.hearts-burst .heart {
    opacity: 0;
    transform-origin: center;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }

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

    70% {
        transform: translateX(2px);
    }

    100% {
        opacity: 1;
        transform: translateX(-8px);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }

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

    70% {
        transform: translateX(-2px);
    }

    100% {
        opacity: 1;
        transform: translateX(8px);
    }
}

/* 하트 흩뿌리기 애니메이션 */
@keyframes burstHeart1 {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-30px, -40px) scale(1.2) rotate(-30deg);
    }
}

@keyframes burstHeart2 {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(10px, -50px) scale(1) rotate(15deg);
    }
}

@keyframes burstHeart3 {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(20px, 30px) scale(1.1) rotate(20deg);
    }
}

@keyframes burstHeart4 {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(35px, -10px) scale(0.9) rotate(-25deg);
    }
}

@keyframes burstHeart5 {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-15px, -55px) scale(1.3) rotate(40deg);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    70% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.greeting-text {
    text-align: center;
    font-size: 1.0rem;
    line-height: 2;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-family: 'Nanum Gothic', sans-serif;
    word-break: keep-all;
}

.family-info-summary {
    margin: 2rem auto 0;
    width: fit-content;
    /* 텍스트 너비만큼만 차지 */
    display: grid;
    /* 각 칸의 너비를 내용물에 맞춤 */
    grid-template-columns: auto auto auto;
    row-gap: 0.8rem;
    column-gap: 15px;
    /* 성함과 '관계' 사이의 간격 */
    align-items: center;
    font-family: 'Nanum Gothic', sans-serif;
}

.family-info-summary .parents {
    text-align: right;
    /* 부모님 성함은 오른쪽으로 붙임 */
    white-space: nowrap;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.family-info-summary .separator-dot {
    margin: 0 0.2rem;
    color: #ccc;
    font-size: 0.8rem;
}

.family-info-summary .relation {
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
    min-width: 50px;
    /* '의 아들/딸' 공간 확보 */
}

.family-info-summary .name {
    text-align: left;
    /* 자녀 성함은 왼쪽으로 붙임 */
    white-space: nowrap;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-dark);
    letter-spacing: 0.05rem;
}

/* 캘린더 섹션 */
.calendar-section {
    background: var(--white);
}

.calendar-wrapper {
    max-width: 500px;
    margin: 0 auto 3rem;
}

.calendar-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calendar-date-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.calendar-date-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
}

.calendar-container {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
}

.calendar {
    width: 100%;
    border-collapse: collapse;
}

.calendar thead th {
    padding: 0.8rem 0.5rem;
    font-weight: 500;
    color: var(--accent-color);
    font-size: 0.95rem;
}

.calendar thead th:first-child {
    color: #e74c3c;
    /* 일요일 빨간색 */
}

.calendar thead th:last-child {
    color: #3498db;
    /* 토요일 파란색 */
}

.calendar tbody td {
    padding: 0.8rem 0.5rem;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.95rem;
    position: relative;
}

.calendar tbody td.sunday {
    color: #e74c3c;
}

.calendar tbody td.saturday {
    color: #3498db;
}

.calendar tbody td.other-month {
    color: #ccc;
}

.calendar tbody td.wedding-day {
    background: var(--gradient-primary);
    color: var(--white);
    font-weight: 700;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(212, 165, 116, 0.6);
    }
}

/* 카운트다운 섹션 */
.countdown-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.countdown-value {
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.3s ease;
}

.countdown-value:hover {
    transform: translateY(-4px);
}

.countdown-separator {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 1.5rem;
}

.countdown-message {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-dark);
    line-height: 1.8;
}

.highlight-days {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
}

/* 오시는 길 섹션 */
.location-section {
    background: var(--white);
}

.section-subtitle {
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-light);
    margin-top: -2rem;
    margin-bottom: 2rem;
}

.location-info {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--secondary-color);
    border-radius: 12px;
}

.location-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
}

.location-address {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.location-tel a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.location-tel a:hover {
    color: var(--primary-dark);
}

/* 지도 */
.map-wrapper {
    margin: 2rem 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow);
}

#map {
    border-radius: 16px;
}

/* 지도 버튼 */
.map-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.map-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: var(--white);
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: var(--accent-color);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.map-btn:hover {
    background: var(--secondary-color);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 165, 116, 0.2);
}

.map-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.calendar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--white);
    color: var(--accent-color);
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.calendar-btn:hover {
    background: var(--secondary-color);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 165, 116, 0.2);
}

.calendar-btn .map-logo {
    width: 20px;
    height: 20px;
}

/* 교통 정보 */
.transport-info {
    margin-top: 3rem;
}

.transport-item {
    background: var(--secondary-color);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

.transport-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.transport-content {
    color: var(--text-dark);
    line-height: 1.8;
    /* letter-spacing: -0.02em; */
    word-break: keep-all;
}

.transport-content p {
    margin: 0.5rem 0;
}

/* 지하철 노선 색상 */
.line-2 {
    color: #00a84d;
}

.line-3 {
    color: #ef7c1c;
}

.line-7 {
    color: #747f00;
}

/* 버스 색상 */
.bus-blue {
    color: #0d347f;
}

.bus-green {
    color: #3b9f37;
}

/* 갤러리 섹션 */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px var(--shadow-heavy);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* 방명록 섹션 */
.guestbook-section {
    background: var(--white);
    padding: 4rem 1.5rem;
}

.guestbook-form {
    max-width: 600px;
    margin: 0 auto 3rem;
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-heavy);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 방명록 메시지 목록 */
.messages-container {
    max-width: 600px;
    margin: 0 auto;
}

.message-card {
    background: var(--white);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    animation: fadeInUp 0.5s ease-out;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.message-author {
    font-weight: 600;
    color: var(--accent-color);
}

.message-date {
    font-size: 0.85rem;
    color: #999;
}

.message-content {
    color: var(--text-dark);
    line-height: 1.6;
    white-space: pre-wrap;
}

.delete-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: #e74c3c;
}

/* 푸터 */
.footer {
    background: var(--secondary-color);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 혼주 및 가족 섹션 (New) */
.family-section {
    background-color: #f2efee;
    padding: 4rem 0.5rem;
    /* Minimized side padding */
    text-align: center;
    color: rgb(17, 17, 17);
}

.family-wrapper {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.family-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    /* Increased to create clear space between blocks */
    font-family: 'Nanum Gothic', sans-serif;
    flex-wrap: wrap;
    /* Allow wrapping when truly needed */
    line-height: 1.5;
    word-break: keep-all;
}

.parents-names {
    font-weight: 500;
    letter-spacing: 0.05rem;
    display: flex;
    align-items: center;
}

.separator-dot {
    margin: 0 0.5rem;
    font-weight: 400;
}

.flower-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.25rem;
}

.relation-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0.7;
}

.couple-name-block {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.couple-name-en {
    font-size: 0.6rem;
    margin-top: 0.1rem;
    font-weight: 400;
}

/* Responsive adjustments for phones */
@media (max-width: 450px) {
    .family-group {
        font-size: 12.5px;
        /* Slightly reduced to compensate for larger gaps */
        gap: 0.35rem;
        /* Noticeable space between '아들' and '정승재' */
        flex-wrap: wrap;
        justify-content: center;
    }

    .family-section {
        padding: 3rem 0.3rem;
        /* Minimal padding for maximum content space */
    }

    .separator-dot {
        margin: 0 0.2rem;
    }
}

/* 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* 반응형 디자인 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-greeting {
        font-size: 2.8rem;
        margin-bottom: 2rem;
    }

    .hero-image-container {
        max-width: 100%;
    }

    .date-line {
        gap: 1.5rem;
    }

    .date-word {
        height: 4rem;
    }

    .reveal-char {
        font-size: 3.5rem;
    }

    .section {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    .guestbook-form {
        padding: 1.5rem;
    }

    .calendar-date-title {
        font-size: 1.4rem;
    }

    .calendar-date-subtitle {
        font-size: 1rem;
    }

    .calendar-container {
        padding: 1rem;
    }

    .calendar thead th,
    .calendar tbody td {
        padding: 0.5rem 0.2rem;
        font-size: 0.85rem;
    }

    .calendar tbody td.wedding-day {
        width: 35px;
        height: 35px;
        line-height: 35px;
    }

    .countdown {
        gap: 0.5rem;
    }

    .countdown-value {
        font-size: 1.5rem;
        padding: 0.8rem 1rem;
        min-width: 60px;
    }

    .countdown-separator {
        font-size: 1.5rem;
        margin-top: 1rem;
    }

    .countdown-message {
        font-size: 1rem;
    }

    .highlight-days {
        font-size: 1.2rem;
    }

    .map-buttons {
        flex-direction: column;
    }

    .map-btn {
        width: 100%;
    }

    .transport-item {
        padding: 1rem;
    }

    .transport-title {
        font-size: 1.1rem;
    }

    .transport-content {
        font-size: 0.9rem;
        letter-spacing: normal;
    }
}

/* 로딩 스피너 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 알림 메시지 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    animation: fadeInUp 0.3s ease-out;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}