/* 
   예봉중학교 모과나무 이야기 웹사이트 스타일시트
   이 스타일시트는 캔바 사이트 특유의 따뜻하고 부드러운 감성을 재현하기 위해 작성되었습니다.
   모든 설명과 주석은 한국어로만 작성되었습니다.
*/

/* 1. 디자인 시스템 변수 설정 (색상 및 폰트) */
:root {
    /* 기본 배경 색상 (부드러운 미색/크림색) */
    --background-color: #FAF8F2;
    /* 주조색 (밝은 모과 노란색) */
    --primary-color: #FFC83B;
    /* 보조색 (어두운 모과 주황색) */
    --primary-dark: #E09F00;
    /* 강조색 (싱그러운 나뭇잎 초록색) */
    --accent-green: #5D9C59;
    /* 어두운 나뭇잎 초록색 */
    --accent-green-dark: #3F703C;
    /* 주 텍스트 색상 (따뜻한 갈색조 밤색) */
    --text-color: #3E2723;
    /* 보조 텍스트 색상 (연한 밤색) */
    --text-light: #6D4C41;
    /* 카드 및 흰색 영역 배경색 */
    --card-background: #FFFFFF;
    /* 그림자 효과 정의 */
    --box-shadow-soft: 0 10px 30px rgba(62, 39, 35, 0.05);
    --box-shadow-hover: 0 20px 40px rgba(62, 39, 35, 0.1);
    /* 기본 둥근 모서리 크기 */
    --border-radius-large: 24px;
    --border-radius-medium: 16px;
    /* 기본 전환 속도 */
    --transition-speed: 0.3s;
}

/* 2. 기본 초기화 및 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Gowun Dodum', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}

/* 링크 기본 스타일 제거 */
a {
    text-decoration: none;
    color: inherit;
}

/* 이미지 반응형 기본 설정 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 3. 공통 레이아웃 및 섹션 헤더 */
section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

/* 제목 하단에 귀여운 노란색 물결선 모양 밑줄 효과 부여 */
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-header p {
    font-size: 1.15rem;
    color: var(--text-light);
}

/* 4. 상단 탐색창 (네비게이션 바) */
.navigation-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: rgba(250, 248, 242, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.02);
    border-bottom: 1px solid rgba(62, 39, 35, 0.05);
}

.navigation-bar .logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 20px;
    transition: all var(--transition-speed);
}

.nav-menu a:hover {
    color: var(--text-color);
    background-color: rgba(255, 200, 59, 0.15);
}

/* 5. 히어로 섹션 */
.hero-section {
    padding-top: 150px;
    padding-bottom: 100px;
    min-height: 90vh;
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    align-items: center;
    width: 100%;
}

.hero-text-content {
    padding-right: 20px;
}

.badge {
    display: inline-block;
    background-color: rgba(93, 156, 89, 0.1);
    color: var(--accent-green-dark);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 24px;
}

.hero-text-content h1 {
    font-size: 3.5rem;
    line-height: 1.25;
    margin-bottom: 24px;
    color: var(--text-color);
}

.hero-text-content h1 span {
    color: var(--primary-dark);
    position: relative;
    z-index: 1;
}

/* 텍스트 강조 뒤에 노란 동그란 하이라이트 효과 배치 */
.hero-text-content h1 span::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: -5px;
    right: -5px;
    height: 18px;
    background-color: rgba(255, 200, 59, 0.3);
    z-index: -1;
    border-radius: 10px;
}

.hero-text-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

/* 공통 단추 스타일 */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all var(--transition-speed);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--text-color);
    margin-right: 15px;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(224, 159, 0, 0.2);
}

.secondary-btn {
    background-color: var(--card-background);
    color: var(--text-light);
    border: 2px solid rgba(62, 39, 35, 0.1);
}

.secondary-btn:hover {
    background-color: rgba(62, 39, 35, 0.03);
    color: var(--text-color);
    transform: translateY(-3px);
}

/* 히어로 우측 이미지 둥실둥실 애니메이션 */
.hero-image-content {
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-image-content img {
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-soft);
    border: 8px solid var(--card-background);
    max-width: 85%;
}

.floating-animation {
    animation: floatEffect 5s ease-in-out infinite;
}

@keyframes floatEffect {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* 6. 모과나무 소개 섹션 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.info-card, .info-cardHighlight {
    background-color: var(--card-background);
    border-radius: var(--border-radius-large);
    padding: 40px 30px;
    box-shadow: var(--box-shadow-soft);
    transition: all var(--transition-speed);
    border: 1px solid rgba(62, 39, 35, 0.03);
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-hover);
}

/* 돋보이게 만들고 싶은 교훈 카드의 스타일 */
.info-cardHighlight {
    background-color: rgba(255, 200, 59, 0.08);
    border: 2px dashed rgba(255, 200, 59, 0.5);
}

.info-cardHighlight:hover {
    transform: translateY(-8px);
    background-color: rgba(255, 200, 59, 0.12);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 24px;
}

.info-card h3, .info-cardHighlight h3 {
    font-size: 1.35rem;
    margin-bottom: 16px;
    color: var(--text-color);
}

.info-card p, .info-cardHighlight p {
    font-size: 1rem;
    color: var(--text-light);
}

/* 7. 캐릭터 소개 섹션 */
.character-section {
    background-color: rgba(255, 200, 59, 0.05);
    border-radius: 40px;
    padding: 80px 40px;
    max-width: 1160px;
}

.character-container {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 50px;
    align-items: center;
}

.character-image {
    display: flex;
    justify-content: center;
}

.character-avatar {
    border-radius: 50%;
    border: 10px solid var(--card-background);
    box-shadow: var(--box-shadow-soft);
    max-width: 80%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.character-profile {
    padding-left: 20px;
}

.profile-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 16px;
}

.character-profile h3 {
    font-size: 2.2rem;
    margin-bottom: 24px;
    color: var(--text-color);
}

.profile-details {
    list-style: none;
    margin-bottom: 30px;
}

.profile-details li {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-light);
}

.profile-details strong {
    color: var(--text-color);
    display: inline-block;
    width: 90px;
}

.character-quote {
    background-color: var(--card-background);
    border-left: 5px solid var(--primary-color);
    padding: 20px 24px;
    border-radius: 0 var(--border-radius-medium) var(--border-radius-medium) 0;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-color);
    box-shadow: var(--box-shadow-soft);
}

/* 8. 모과이 이야기 섹션 */
.story-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

/* 중앙을 가르는 세로선 효과 */
.story-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 40px;
    width: 4px;
    background-color: rgba(255, 200, 59, 0.3);
    border-radius: 2px;
}

.story-block {
    position: relative;
    margin-bottom: 60px;
    padding-left: 80px;
}

.story-block:last-child {
    margin-bottom: 0;
}

.story-number {
    position: absolute;
    left: 20px;
    top: 5px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(255, 200, 59, 0.3);
    z-index: 2;
}

.story-content {
    background-color: var(--card-background);
    border-radius: var(--border-radius-medium);
    padding: 30px;
    box-shadow: var(--box-shadow-soft);
    border: 1px solid rgba(62, 39, 35, 0.02);
}

.story-content h3 {
    font-size: 1.35rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.story-content p {
    font-size: 1.05rem;
    color: var(--text-light);
}

/* 9. 참여형 방명록 섹션 */
.guestbook-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 60px;
}

.input-form-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-large);
    padding: 40px;
    box-shadow: var(--box-shadow-soft);
    border: 1px solid rgba(62, 39, 35, 0.03);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--border-radius-medium);
    border: 2px solid rgba(62, 39, 35, 0.1);
    background-color: #FAFAFA;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    transition: all var(--transition-speed);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    background-color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 200, 59, 0.2);
}

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

.submit-btn {
    width: 100%;
    background-color: var(--accent-green);
    color: #FFFFFF;
    border: none;
    padding: 16px;
    border-radius: var(--border-radius-medium);
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(93, 156, 89, 0.2);
    transition: all var(--transition-speed);
}

.submit-btn:hover {
    background-color: var(--accent-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(63, 112, 60, 0.3);
}

/* 인터랙티브 모과나무 가상 뷰어 영역 */
.tree-visualizer {
    background-color: var(--card-background);
    border-radius: var(--border-radius-large);
    padding: 30px;
    box-shadow: var(--box-shadow-soft);
    border: 1px solid rgba(62, 39, 35, 0.03);
    text-align: center;
}

.visualizer-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-color);
}

.tree-graphic-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px auto;
    border-radius: var(--border-radius-medium);
    overflow: hidden;
}

.interactive-tree-img {
    width: 100%;
    border-radius: var(--border-radius-medium);
    /* 살짝 흐릿하거나 배경처럼 작동하게 명도 낮추기 */
    filter: brightness(0.95);
}

/* 나무 겉에 열매를 띄우기 위한 겹침 레이어 */
.fruits-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* 열매 요소들만 직접 클릭할 수 있도록 전체 레이어는 통과 */
}

/* 동적으로 추가되는 모과 열매 아이콘 */
.quince-fruit {
    position: absolute;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%; /* 울퉁불퉁 모과 과실 모양 표현 */
    box-shadow: 0 4px 8px rgba(224, 159, 0, 0.4);
    cursor: pointer;
    pointer-events: auto; /* 마우스 감지 활성화 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    animation: bounceFruit 2s ease-in-out infinite alternate;
    transition: all var(--transition-speed);
}

/* 잎사귀 모양 데코 추가 */
.quince-fruit::before {
    content: '🍃';
    position: absolute;
    top: -8px;
    right: -4px;
    font-size: 0.8rem;
}

.quince-fruit:hover {
    transform: scale(1.3) rotate(15deg);
    background-color: #FFA41B;
    z-index: 100;
}

@keyframes bounceFruit {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.interactive-tip {
    font-size: 0.9rem;
    color: var(--accent-green-dark);
    font-weight: bold;
}

/* 하단에 메시지를 모아서 보여주는 그리드 영역 */
.messages-list-wrapper {
    margin-top: 60px;
}

.messages-list-wrapper h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center;
}

.messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 응원 카드 스타일 */
.message-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-medium);
    padding: 24px;
    box-shadow: var(--box-shadow-soft);
    border-top: 4px solid var(--primary-color);
    transition: all var(--transition-speed);
}

.message-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-name {
    font-weight: bold;
    color: var(--text-color);
    font-size: 1.1rem;
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-light);
    word-break: break-all;
}

/* 10. 푸터 */
.main-footer {
    background-color: var(--text-color);
    color: #FFFFFF;
    text-align: center;
    padding: 50px 20px;
    margin-top: 100px;
    border-top: 5px solid var(--primary-color);
}

.main-footer p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    opacity: 0.85;
}

.main-footer p:first-child {
    font-weight: bold;
    font-size: 1.1rem;
    opacity: 1;
}

/* 11. 반응형 스타일 정의 (모바일 화면 대응) */
@media (max-width: 900px) {
    section {
        padding: 60px 20px;
    }
    
    .navigation-bar {
        padding: 0 20px;
    }
    
    .nav-menu {
        display: none; /* 단순화를 위해 모바일에서는 네비게이션 감춤 */
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .hero-text-content {
        padding-right: 0;
    }
    
    .hero-text-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .primary-btn {
        margin-right: 0;
    }
    
    .character-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .character-profile {
        padding-left: 0;
    }
    
    .profile-details li strong {
        width: 100% ;
        display: block;
        margin-bottom: 4px;
    }
    
    .story-timeline::before {
        left: 20px;
    }
    
    .story-block {
        padding-left: 50px;
    }
    
    .story-number {
        left: 0px;
    }
    
    .guestbook-container {
        grid-template-columns: 1fr;
    }
}
