/* 🌟 1. 전체 기본 세팅 및 웹폰트 */
@font-face {
  font-family: "applemyungjo";
  src: url("./apple-myungjo.woff2") format("woff2");
}

* {
  font-family: "applemyungjo", serif;
  box-sizing: border-box; /* 패딩과 테두리가 너비에 포함되도록 설정해 가로스크롤 방지 */
}

body {
  margin: 0;
  padding: 0;
  background-color: #fff;
}

category-title img {
}

.wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* 🌟 3. 왼쪽 사이드바 메뉴 (화면에 완전히 fixed 고정) */
#filter-buttons {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 240px;
  height: auto;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  z-index: 10;
}

/* ALL 버튼 스타일 (상단 전체 차지) */
#filter-buttons > button:first-child {
  grid-column: span 2;
  width: 100%;
  padding: 5px;
  background-color: white;
  font-weight: bold;
  text-align: center;
  border: none;
  cursor: pointer;
}

/* 카테고리 세로 그룹들 */
.category-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* 세로 경계선 처리 (People과 Nature 사이의 선) */
.category-group:not(:last-child) {
}

/* 대제목 (People, Nature) */
.category-title {
  margin: 0;
  padding: 10px;
  font-size: 14px;
  font-weight: normal;
  text-align: center;
  /* background-color: #eeeeee; */
}
.category-title img {
  height: 50px;
  margin: 0 auto;
}

.category-group .filter-btn {
  width: 100%;
  padding: 5px 5px;
  background-color: #fff;
  border: none;

  text-align: center;
  font-size: 13px;
  cursor: pointer;
}
.category-group .filter-btn:last-child {
  border-bottom: none;
}

/* 필터 버튼 호버 및 활성화 상태 */
.filter-btn:hover {
  background-color: #f5f5f5;
}

.filter-btn.active {
  background-color: black !important;
  color: white !important;
  font-weight: bold;
}

/* 🌟 4. 오른쪽 메인 이미지 그리드 (사이드바의fixed 영역을 침범하지 않음) */
#arena-grid {
  flex-grow: 1;
  margin-left: 280px; /* 🔥 fixed 메뉴 너비(240px) + 여백(40px) 만큼 왼쪽 여백을 강제 확보 */
  padding: 20px 20px 20px 0; /* 우측과 상하단에만 패딩 부여 */

  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(180px, 1fr)
  ); /* 화면 크기에 맞게 사진 크기 자동 조절 */
  gap: 25px;
  width: auto;
}

/* 🌟 5. 개별 이미지 블록 카드 설정 */
.block {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
}

.block.hidden {
  display: none !important;
}

.image-container {
  width: 100%;
  aspect-ratio: 1; /* 정사각형 비율 유지 */
  overflow: hidden;
  position: relative;
}

.block img.main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 텍스트 영역 */
.block-info {
  padding: 8px 0 4px 0;
}

.block-title {
  margin: 0;
  font-size: 14px;
  text-align: center;
}

/* 드롭다운 영역 */
.recipe-dropdown {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
}

.block.active .recipe-dropdown {
  max-height: 200px;
  opacity: 1;
  padding-top: 4px;
}

.tag-display-list {
  font-size: 11px;
  color: #777;
  text-align: center;
  line-height: 1.4;
}

.no-recipe {
  font-size: 11px;
  color: #999;
  text-align: center;
  display: block;
}

#footer {
  padding: 10px;
  font-size: 10pt;
}
/* ========================================================
   📱 모바일 / 태블릿 반응형 레이아웃 (화면 폭 768px 이하)
   ======================================================== */
@media screen and (max-width: 768px) {
  /* 1. 레이아웃 방향 세로 전환 */

  category-title {
    height: 45px !important;
  }
  .wrapper {
    flex-direction: column;
  }

  /* 2. 상단 고정 메뉴판 전체 틀 */
  #filter-buttons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow-y: visible;
    border: none;
    border-bottom: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(5px);
    padding: 0;
    z-index: 10;
    border-radius: 0 !important; /* 🌟 모든 메뉴의 라운딩 제거 */
  }

  /* ALL 버튼 모바일 스타일 (상단 슬림 고정 및 직각화) */
  #filter-buttons > button:first-child {
    width: 100%;
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    background-color: #fff;
    border-radius: 0 !important; /* 🌟 각진 사각형 유지 */
  }

  /* 카테고리 그룹 (People / Nature) 각각의 좌우 스크롤 트랙 */
  .category-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 4px 8px 4px 0px;
    border-bottom: 1px solid #eee;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-group::-webkit-scrollbar {
    display: none;
  }

  .category-group:not(:last-child) {
    border-right: none;
  }

  /* 🌟 대제목 (People, Nature SVG 이미지) 왼쪽 완전 고정 및 시각화 보완 */
  .category-title {
    position: sticky;
    left: 0;
    display: flex !important; /* 내부에 이미지가 있으므로 flex 정렬 유지 */
    align-items: center;
    justify-content: center;
    background-color: #fff !important; /* 뒤로 밀리는 버튼 글씨가 비치지 않게 철벽 방어 */
    padding: 0 15px !important; /* 양옆 여백을 확보해 버튼들과 겹침 방지 */
    margin: 0;
    border-bottom: none;
    flex-shrink: 0;
    z-index: 5; /* ⚠️ 중요: 버튼들보다 무조건 위에 오도록 높임 */
    height: 100%;
    min-width: 70px; /* 타이틀 공간 최소 너비 확보 */
  }

  /* 🌟 인라인 스타일을 강제로 이기고 모바일 정사이즈로 고정하는 트릭 */
  .category-title img {
    display: block !important;
    height: 35px !important; /* ⚠️ JS의 max-height 인라인을 완벽히 무력화 */
    max-height: 35px !important;
    width: auto !important;
    margin: 0 auto !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* 🌟 가로 나열되는 필터 버튼들 (직각 디자인 반영) */
  .category-group .filter-btn {
    display: inline-block;
    width: auto;
    height: 35px;
    flex-shrink: 0;
    padding: 6px 12px;
    margin-right: 6px;
    font-size: 12px;
    border: 0px solid #eee;
    background-color: #fff;
    text-align: center;
    border-radius: 0 !important; /* 🌟 둥근 모서리 완전 제거 */
  }

  .category-group .filter-btn:last-child {
    margin-right: 0;
  }

  /* 3. 오른쪽 메인 이미지 그리드 영역 모바일 여백 조정 */
  #arena-grid {
    margin-left: 0;
    margin-top: 135px; /* 메뉴판 디자인 두께 변화에 맞춰 미세 조정 */
    padding: 15px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  /* 개별 이미지 블록 내부 텍스트 */
  .block-title {
    font-size: 12px;
  }

  .tag-display-list {
    font-size: 10px;
  }
}
