@font-face {
  font-family: 'Font';
  src: url('font/온글잎 박다현체.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  font-family: 'Font', sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: #FDF8F0;
}

#page {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px dashed #D4B896;
  flex-shrink: 0;
}

main {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #C8956C #F3E9DC;
}

main::-webkit-scrollbar {
  width: 6px;
}

main::-webkit-scrollbar-track {
  background: #F3E9DC;
  border-radius: 10px;
}

main::-webkit-scrollbar-thumb {
  background-color: #C8956C;
  border-radius: 10px;
}

h1 {
  font-size: 3.6rem;
  text-align: center;
  color: #5C3D1E;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1rem;
  color: #A07850;
  margin-bottom: 28px;
}

/* 작성하기 버튼 */
#writeBtn {
  background-color: #C8956C;
  color: #FDF8F0;
  border: none;
  border-radius: 24px;
  padding: 12px 36px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 90, 43, 0.2);
  transition: background-color 0.2s, transform 0.1s;
}

#writeBtn:hover {
  background-color: #A8714A;
  transform: translateY(-1px);
}

/* 카드 그리드 */
#guestbookContainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  overflow-x: hidden;
}

.card {
  background-color: #FFFBF2;
  border: 1px solid #E8D8C0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 2px 4px 10px rgba(139, 90, 43, 0.08);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 4px 8px 18px rgba(139, 90, 43, 0.15);
}

.card h3 {
  font-size: 1.2rem;
  color: #5C3D1E;
  margin-bottom: 8px;
  border-bottom: 1px dashed #E8D8C0;
  padding-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card p {
  font-size: 0.95rem;
  color: #7A5C3A;
  margin-bottom: 4px;
  line-height: 1.5;
  word-break: break-all;
}

.card-content {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  min-height: 0;
  flex-shrink: 1;
}

.card-writer {
  font-size: 0.8rem;
  color: #B8956A;
  text-align: right;
  margin-top: auto;
  padding-top: 12px;
}

.card-created {
  font-size: 0.8rem;
  color: #B8956A;
  text-align: right;
  margin-top: 4px;
}

.deleteBtn {
  background: none;
  border: 1px solid #D4A87A;
  border-radius: 8px;
  color: #A07850;
  font-size: 0.75rem;
  padding: 3px 10px;
  cursor: pointer;
  position: absolute;
  top: 14px;
  right: 14px;
  transition: background-color 0.15s, color 0.15s;
}

.deleteBtn:hover {
  background-color: #C8956C;
  color: #FDF8F0;
  border-color: #C8956C;
}

/* 작성 모달 */
#modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(92, 61, 30, 0.35);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

#modal.open {
  display: flex;
}

#writeGuestBook {
  background-color: #FFFBF2;
  border: 1px solid #E8D8C0;
  border-radius: 16px;
  padding: 36px 40px;
  width: 440px;
  position: relative;
  box-shadow: 0 8px 32px rgba(92, 61, 30, 0.2);
}

#writeGuestBook h2 {
  font-size: 1.6rem;
  color: #5C3D1E;
  text-align: center;
  margin-bottom: 24px;
}

#closeModal {
  background: none;
  border: none;
  font-size: 1.4rem;
  position: absolute;
  top: 12px;
  right: 16px;
  cursor: pointer;
  color: #A07850;
}

#closeModal:hover {
  color: #5C3D1E;
}

#guestbookForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#guestbookForm input,
#guestbookForm textarea {
  padding: 10px 14px;
  border: 1px solid #D4B896;
  border-radius: 10px;
  font-size: 1rem;
  background-color: #FDF8F0;
  color: #5C3D1E;
  outline: none;
  transition: border-color 0.2s;
}

#guestbookForm input:focus,
#guestbookForm textarea:focus {
  border-color: #C8956C;
}

#guestbookForm textarea {
  height: 100px;
  resize: none;
}

#submitBtn {
  background-color: #C8956C;
  color: #FDF8F0;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 4px;
  transition: background-color 0.2s;
}

#submitBtn:hover {
  background-color: #A8714A;
}

/* 단일 조회 모달 */
#detailModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(92, 61, 30, 0.35);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

#detailModal.open {
  display: flex;
}

#detailContent {
  background-color: #FFFBF2;
  border: 1px solid #E8D8C0;
  border-radius: 16px;
  padding: 36px 40px;
  width: 440px;
  position: relative;
  box-shadow: 0 8px 32px rgba(92, 61, 30, 0.2);
}

#detailTitle {
  font-size: 1.6rem;
  color: #5C3D1E;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #D4B896;
}

#detailWriter {
  font-size: 1rem;
  color: #A07850;
  margin-bottom: 12px;
}

#detailBody {
  font-size: 1.05rem;
  color: #5C3D1E;
  line-height: 1.8;
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 40vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #C8956C #F3E9DC;
}

#detailBody::-webkit-scrollbar {
  width: 6px;
}

#detailBody::-webkit-scrollbar-track {
  background: #F3E9DC;
  border-radius: 10px;
}

#detailBody::-webkit-scrollbar-thumb {
  background-color: #C8956C;
  border-radius: 10px;
}

#detailCreated {
  font-size: 0.85rem;
  color: #B8956A;
  text-align: right;
}

#closeDetailModal {
  background: none;
  border: none;
  font-size: 1.4rem;
  position: absolute;
  top: 12px;
  right: 16px;
  cursor: pointer;
  color: #A07850;
}

#closeDetailModal:hover {
  color: #5C3D1E;
}

.paw {
  position: fixed;
  pointer-events: none;
  font-size: 1.3rem;
  transform: translate(-50%, -50%) rotate(var(--rotation));
  animation: paw-fade 3s ease forwards;
  z-index: 0;
}

@keyframes paw-fade {
  0%   { opacity: 0.4; }
  65%  { opacity: 0.2; }
  100% { opacity: 0; }
}

/* 알림 모달 */
#alertModal,
#promptModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(92, 61, 30, 0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

#alertModal.open,
#promptModal.open {
  display: flex;
}

#alertContent,
#promptContent {
  background-color: #FFFBF2;
  border: 1px solid #E8D8C0;
  border-radius: 16px;
  padding: 32px 36px;
  width: 320px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(92, 61, 30, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#alertMessage,
#promptContent p {
  font-size: 1.1rem;
  color: #5C3D1E;
  line-height: 1.6;
}

#alertOkBtn {
  background-color: #C8956C;
  color: #FDF8F0;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

#alertOkBtn:hover {
  background-color: #A8714A;
}

#promptInput {
  padding: 10px 14px;
  border: 1px solid #D4B896;
  border-radius: 10px;
  font-size: 1rem;
  background-color: #FDF8F0;
  color: #5C3D1E;
  outline: none;
  text-align: center;
  letter-spacing: 2px;
}

#promptInput:focus {
  border-color: #C8956C;
}

.prompt-buttons {
  display: flex;
  gap: 10px;
}

#promptCancelBtn,
#promptOkBtn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

#promptCancelBtn {
  background-color: #E8D8C0;
  color: #7A5C3A;
}

#promptCancelBtn:hover {
  background-color: #D4B896;
}

#promptOkBtn {
  background-color: #C8956C;
  color: #FDF8F0;
}

#promptOkBtn:hover {
  background-color: #A8714A;
}

