* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Pretendard', sans-serif;
  background: linear-gradient(to bottom, #dbeeff, #ffffff);
  overflow-x: hidden;
}


  /* 최상단 글 */
  .top-header{
  text-align: center;
  margin-left: 50px;
  }
  .top-header h1 {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(90deg, #4facfe, #00f2fe); /* 푸른 계열 그라데이션 */
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  /* top-gallery */
  .top-gallery{
    display: flex;
    justify-content: center;
    align-items: flex-start;  /* ✅ 세로 시작점에 맞춤 */
    gap: 40px;
    margin-top: 20px;
  }
  /* 컨텐츠 섹션 */
  .content-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 40px;
  }
  
  .diary-container {
    position: relative; /* ✅ sidebar 위치 고정시킬 기반 */
    display: flex;
  flex-direction: row; /* ✅ 가로로 배치 */
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
  }
  /* bgm */
  .bgm-toggle {
    font-size: 14px;
    cursor: pointer;
    color: #333;
    
  }
  .bgm-control{
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 25px; /* 위에서부터 얼마나 떨어트릴지 */
  }


  
  .diary-content {
    margin-top: 40px;
  }
  
  .diary-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
  }
  .volume-control {
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .volume-control input[type="range"] {
    flex-grow: 1;
  }
  /* 하단 */
  .footer {
    text-align: center;
    margin-top:100px;
    padding: 20px 0;
    font-size: 14px;
    color: #777;
  }
  
  .footer-heart {
    font-size: 24px;
    margin-bottom: 10px;
  }
  
  .footer-info a {
    color: #777;
    text-decoration: none;
  }
  .footer-info a:hover {
    text-decoration: underline;
  }
  /* 메인 다이어리 css */
  .main-container {
    display: flex;
    background: #e3f2fd;
    padding: 20px;
    height: 100vh;
  }
  .main-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    gap: 20px;
  }
  
  .sidebar {
    position: absolute; /* ✅ 따로 띄움 */
  top: 55px; /* ✅ 상단 여백 조정 (필요시 조정) */
  left: 30px; /* ✅ 왼쪽 여백 조정 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 150px;
  min-width: 60px;
  }
  
  .profile-box {
    width: 80px;
  height: 60px;          /* ✅ 높이 늘림 */
  background: white;
  border: 1px solid #ccc;
  text-align: center;
  line-height: 60px;     /* ✅ 가운데 정렬 맞춤 */
  font-size: 16px;       /* ✅ 글씨 약간 키움 */
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s;
  }
  
  
  
  /* 이미지 */
  .image-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    width: 100%;
  }
  .image-box {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    width: 45%;
    min-width: 300px;
    max-width: 450px;
  }
  
  .image-box img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .image-box.left {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .image-box.right {
    width: 500px;   /* ✅ 가로 고정 */
  display: flex;
  flex-direction: column;
  align-items: center;
  }
  
#slide-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ✅ 비율 유지하며 꽉 채움 */
}
  
  .comment-box {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ccc;
  }
  
  .bottom-box {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 95%;
    max-width: 700px;
    margin: 0 auto;
  }
  .guestbook-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
  }
  
  .guestbook {
    background: white;
    border: 1px solid #999;
    height: 200px;
    padding: 10px;
  }

  /* 이미지 반응형 */
  .gallery-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
  }

  /* 코멘트 & 댓글 */
  .comment-box {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ccc;
  }
  
  .comment-form {
    display: flex;
    margin-top: 10px;
    gap: 8px;
  }
  
  .comment-form input {
    flex-grow: 1;
    padding: 6px;
    font-size: 14px;
  }
  
  .comment-form button {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
  }
  
  #comment-list {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
  }
  /* 방명록 */
  .guestbook-box {
    width: 100%;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
  }
  
  .guestbook-form {
    display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  }
  
  .guestbook-form textarea {
    flex-grow: 1;
  resize: none;
  font-size: 14px;
  padding: 6px;
  height: 40px;
    white-space: pre-wrap; /* ✅ 줄바꿈 적용됨 */
  }
  
  .guestbook-form button {
    width: 60px;
  height: 40px;
  font-size: 14px;
    cursor: pointer;
  }

  .guestbook-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
  }
  .guestbook-item span {
    white-space: pre-wrap;
  }
  
  #guestbook-list {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    max-height: 150px; /* ✅ 5개 정도만 보이게 제한 */
    overflow-y: auto;  /* ✅ 세로 스크롤 생성 */
    padding-right: 4px; /* 스크롤 오른쪽 여백 */
  }
  /* 슬라이드 컨트롤 */
  .slide-container {
    width: 100%;         /* 부모 width에 맞춰서 */
    height: 100%;        /* 필요하면 높이 고정 가능 */
    display: flex;
    flex-direction: column; /* ✅ 세로 방향 정렬 */
    align-items: center;
    justify-content: space-between;
  }
  
  .slide-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px; /* 버튼과 이미지 사이 여백 */
  }
  .slide-controls-outside button {
    padding: 6px 12px;
    font-size: 16px;
    background-color: #a1c7e0;
    border: 2px solid #444;
    border-radius: 16px;
    cursor: pointer;
  }
  .slide-controls{
    display: flex;
  justify-content: center;
  gap: 10px;

  }
  .slide-wrapper {
    width: 100%;
  height: 400px; /* ✅ 높이 고정 */
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  }
  /* 관리자용 텍스트칸 */
  .left-text-display{
    white-space: pre-wrap; /* ✅ 줄바꿈(\n), 공백 유지 */
  }
.left-text-edit {
  width: 90%;
  margin-top: 10px;
  font-size: 14px;
}

.left-text-edit {
  width: 90%;
  height: 60px;
  font-size: 14px;
  resize: vertical; /* 필요 시만 늘림 */
  max-height: 120px;
}

.left-text-save {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
}
/* 이미지 버튼 */
.image-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
}

.image-button img {
  width: 40px;
  height: 40px;
}

.image-button span {
  font-size: 14px;
  margin-top: 4px;
}
.bottom-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}
@media (max-width: 768px) {
  .diary-container {
    padding-left: 20px; /* ✅ 왼쪽에 20px 공간 추가 */
    padding-right: 20px;
  }

  .content-section {
    margin-left: 10px; /* ✅ 컨텐츠만 살짝 더 밀기 */
    width: 100%;
  }

  .image-row {
    display: flex;
    flex-direction: column;
    align-items: center;  /* ✅ 세로로 가운데 */
    justify-content: center; /* ✅ 가로로도 가운데 */
    width: 100%;
    gap: 20px;
    margin-top: 20px;
  }

  .image-box.left,
  .image-box.right {
    max-width: 360px; /* ✅ 왼쪽/오른쪽 박스 최대 크기 제한 */
  width: 90%; /* ✅ 화면 기준으로 90% */
  margin: 0 auto; /* ✅ 자동 좌우 여백: 진짜로 가운데 */
  }

  #slide-image {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .bottom-box {
    width: 90%;
    margin: 0 auto;
  }

  .bgm-control {
    justify-content: center; /* BGM은 가운데 정렬 */
    margin: 10px 0;
  }
}
