body {
  background-color: #353535;
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 페이지네이션 스타일 */
.pagination-container {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-btn,
.pagination-number {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  color: #666;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.pagination-btn:hover:not(:disabled),
.pagination-number:hover {
  background: #f5f5f5;
  border-color: #4d77ff;
}

.pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.pagination-number.active {
  background: #4d77ff;
  color: white;
  border-color: #4d77ff;
}

/* 로딩/오류/빈 상태 스타일 */
.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4d77ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.empty-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.retry-btn {
  padding: 10px 20px;
  background: #4d77ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 16px;
}

.retry-btn:hover {
  background: #3d67ef;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .titleWrap {
    flex-direction: column;
    padding: 12px;
  }

  .titleWrap .thumbnail {
    flex-basis: auto;
    width: 100%;
    height: 200px;
    margin-bottom: 12px;
  }

  .titleWrap .textContents {
    flex-basis: auto;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 4px;
  }

  .pagination-btn,
  .pagination-number {
    padding: 6px 10px;
    font-size: 13px;
  }
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  background-color: white;
  min-height: 100vh;
}

.containerWrap {
  width: 100%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}
.headers {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 20px 0;
}

.headers .logo {
  width: 200px;
}

.headers .logo img {
  width: 100%;
  height: auto;
}

.backArrow {
  display: none;
}

.Menubar {
  display: flex;
  font-size: 20px;
  gap: 9px;
  align-items: center;
}

.Menubar li {
  width: 97px;
  cursor: pointer;
  position: relative;
  padding-bottom: 5px;
  text-align: center;
}

.Menubar li::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background-color: #3366e6;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.Menubar li:hover::after {
  width: 70%;
}

.Menubar li:hover {
  color: #353535;
}
.topicContainer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 40px;
}

.topicContainer h1 {
  color: #000;
  font-family: Pretendard;
  font-size: 22px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  margin-bottom: 12px;
}

.sectionEventBanner {
  width: 100%;
}

.sectionEventBannerWrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.Banner {
  padding: 20px 23px;
  width: 100%;
  border-radius: 16px;
}

.Banner:nth-child(1) {
  background: linear-gradient(to right, #8e35ff 0%, #ffa0b7 100%);
}

.Banner:nth-child(2) {
  background: linear-gradient(to right, #338ce7 0%, #66cad0 100%);
}

.Banner {
  width: 50%;
  display: flex;
  flex-direction: column;
}

.Banner span {
  padding: 2px 11px;
  color: white;
  font-size: 12px;
  background-color: rgba(0, 0, 0, 0.5);
  width: fit-content;
  border-radius: 20px;
  margin-bottom: 20px;
}

.BannerContents h3 {
  font-size: 20px;
  color: white;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 80%;
}

.BannerContents p {
  font-size: 14px;
  font-weight: normal;
  color: white;
}

.filterBtn {
  width: 100%;
  margin-top: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.filterBtn ul li.active {
  background-color: #007bff;
  color: white;
}

.filterBtn ul {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filterBtn ul li {
  padding: 10px 14px;
  border-radius: 30px;
  border: 1px solid #9c9c9c;
  color: #9c9c9c;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #9c9c9c;
  font-family: Inter;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.filterBtn select {
  border-radius: 8px;
  background-color: #f1f1f1;
  color: #232323;
  margin-left: 10px;
  cursor: pointer;
}

/* api , 글쓰기 목록 */
.posts-grid,
#postsList {
  width: 100%;
}

#postsList {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-item {
  width: 100%;
  border-radius: 10px;
  background: #fafafa;
  padding: 40px 20px;
  cursor: pointer;
}

.post-item:hover {
  border: 1px solid #0644e5;
}

.post-header {
  width: 100%;
}

.titleWrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.titleWrap h3 {
  color: #232323;
  font-family: Inter;
  font-size: 2px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

.titleWrap .thumbnail {
  flex-basis: 20%;
  aspect-ratio: 1.1 / 1; /* 정사각형 비율 설정 */
  border-radius: 15px;
  overflow: hidden; /* 이미지가 컨테이너를 벗어나지 않도록 설정 */
}

.titleWrap .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 이미지가 컨테이너를 꽉 채우도록 설정 */
}

.textContents {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px; /* 모든 요소 사이의 간격을 15px로 통일 */
  flex-basis: 70%;
}
.nickName {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nickName p {
  color: #232323;
  text-align: center;
  font-family: Inter;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.textContents .date {
  color: #666;
  font-size: 14px;
}

.textContents h3 {
  font-size: 20px; /* 제목 크기 수정 (기존 2px에서 변경) */
  color: #232323;
  font-weight: 600;
  margin: 0; /* 기본 마진 제거 */
}

.textContents .excerpt {
  color: #666;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 2줄로 제한 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis; /* 말줄임표 처리 */
}

/* 썸네일이 없는 게시글 스타일 */
.titleWrap.no-thumbnail .textContents {
  flex-basis: 100%; /* 전체 너비 사용 */
}

.titleWrap {
  cursor: pointer;
  transition: background-color 0.3s ease;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.titleWrap:hover {
  background-color: #f8f9fa;
}

.boardSearchWrapper {
  width: 26%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.boardSearchContainer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.boardSortSelect {
  /* 기본 스타일 */
  padding: 12px 20px;
  padding-right: 40px; /* 화살표 아이콘을 위한 여백 */
  border-radius: 8px;
  background-color: #f1f1f1;
  color: #232323;
  cursor: pointer;
  border: none;

  /* 기본 화살표 제거 */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* 커스텀 화살표 추가 */
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%23232323' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* 포커스 상태 */
.boardSortSelect:focus {
  outline: none;
}

/* Firefox에서 화살표 제거 */
.boardSortSelect::-ms-expand {
  display: none;
}

/* 옵션 스타일링 */
.boardSortSelect option {
  background-color: white;
  color: #232323;
  padding: 12px;
}

.boardSearchBox {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-radius: 8px;
  overflow: hidden;
  width: 40px;
  transition: all 0.3s ease;
}

.boardSearchBox.active {
  width: 100%;
  background-color: #f1f1f1;
}

.boardSearchInput {
  width: 0;
  padding: 12px 14px;
  border: none;
  background: transparent;
  outline: none;
  transition: all 0.1s ease;
  opacity: 0;
  order: 1;
  color: #232323;
}

.boardSearchBox.active .boardSearchInput {
  width: calc(100% - 44px);
  opacity: 1;
}

.boardSearchBox.active + .boardSortSelect {
  display: none;
}

.boardSearchInput::placeholder {
  font-size: 14px;
}

.boardSearchIcon {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  order: 2;
  min-width: 44px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pagination__button,
.pagination__number {
  padding: 10px 20px;
  background: white;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  gap: 10px;
}
.pagination__number {
  box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.25);
}

.pagination__number.active {
  border-radius: 4px;
  background: #1a5cff;
  color: white;
}

.pagination__button:nth-child(1) {
  margin-right: 10px;
}
.pagination__button:last-child {
  margin-left: 10px;
}

.pagination__button:disabled {
  color: #9ca3af;
}

.pagination__ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  color: #374151;
  font-size: 14px;
}

@media (max-width: 768px) {
  .pagination {
    gap: 10px;
  }

  .pagination__button,
  .pagination__number {
    padding: 8px 14px;
    font-size: 12px;
  }

  .pagination__button:nth-child(1) {
    margin-right: 2px;
  }
  .pagination__button:last-child {
    margin-left: 2px;
  }
}

/* 초기 로딩 화면 스타일 */
.initial-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 2rem;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem auto;
}

.loading-content p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 페이드인 효과 */
.posts-content {
  transition: opacity 0.3s ease-in-out;
}

/* 에러 메시지 스타일 */
.error-message {
  text-align: center;
  padding: 2rem;
  color: #e74c3c;
  background-color: #fdf2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin: 1rem 0;
}

.no-posts {
  text-align: center;
  padding: 3rem 2rem;
  color: #666;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 1rem 0;
}

/* 페이지네이션 버튼 비활성화 스타일 */
.pagination__button:disabled,
.pagination__number:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 모바일 반응형 개선 */
@media (max-width: 768px) {
  .initial-loading {
    min-height: 200px;
    padding: 1rem;
  }

  .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 2px;
  }

  .error-message,
  .no-posts {
    padding: 1.5rem 1rem;
    font-size: 14px;
  }
}
