@import url("./reset.css");

@font-face {
  font-family: 'MaruBuri-Regular';
  src: url(../assets/MaruBuri-Regular.otf);
  font-weight: normal;
}

@font-face {
  font-family: 'MaruBuri-Bold';
  src: url(../assets/MaruBuri-Bold.otf);
  font-weight: normal;
}

body {
  margin: 0;
  height: 100%;
  font-family: 'Maruburi-Regular', sans-serif;
  background-color: #ebebeb;
  color: #474035;
}

.container {
  display: flex;
}

.navigation {
  position: fixed;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 7em;
  height: 100vh;
  overflow-y: auto;
}

a {
  text-decoration: none;
  color: inherit;
  font-family: 'Maruburi-Bold';
  font-size: 2em;
}

.menu {
  position: relative;
  transition: color 1s ease;
  height: 11em;
}

.menu a {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.content {
  flex: 1;
  text-align: center;
  margin: 6em 12em 2em 15em;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

header h1 {
  font-size: 3em;
  color: #474035;
}

.divider {
  background-color: #474035;
  width: 2px;
  height: 6em;
  margin: 2.5em 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 13.5em);
  justify-content: center;
  gap: 0.5em;
  padding: 2em 0 4em;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item:nth-child(3) {
  grid-row: span 2;
}

.location {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.infos {
  padding: 0.8em 0;
}

.info {
  font-family: "MaruBuri-Regular";
  font-size: 1.2em;
  padding: 0.2em 0;
}

.map {
  display: flex;
  justify-content: center;
  gap: 0.5em;
  width: 46em;
  margin: 1.5em auto 2em auto;
}

.map-item {
  flex: 1;
  min-width: 0;
}

.map-item img {
  width: 100%;
  height: auto;
  display: block;
}

.contact {
  padding: 5em 0 8em 0;
}

footer {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9em;
  text-align: center;
  color: #000;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  background-color: #474035;
  height: 42vh;
  width: 1.8em;
}

.menu:hover {
  background-color: #474035;
  color: #ebebeb;
}

.menu.selected {
  background-color: #474035;
  color: #ebebeb;
}



/* 태블릿 및 작은 화면용 (1024px 이하) */
@media (max-width: 1024px) {
  .content {
    margin: 4em 5em 2em 10em; /* 오른쪽/왼쪽 여백 축소 */
  }
  
  .gallery {
    grid-template-columns: repeat(3, 1fr); /* 고정 em 대신 비율로 변경 */
    max-width: 800px;
    margin: 0 auto;
  }
}

/* 모바일용 (768px 이하) */
@media (max-width: 768px) {
  /* 1. 네비게이션을 하단 바로 변경 */
  .navigation {
    position: fixed;
    flex-direction: row; /* 가로 나열 */
    justify-content: space-around;
    width: 100%;
    height: 4em;
    bottom: 0;
    left: 0;
    background-color: #ebebeb;
    border-top: 1px solid #474035;
    z-index: 1000;
  }

  .menu {
    height: 100%;
    flex: 1;
    border-bottom: none;
  }

  .menu a {
    transform: none; /* 회전 해제 */
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.2em; /* 폰트 크기 축소 */
  }

  /* 2. 컨텐츠 영역 조정 */
  .content {
    margin: 2em 1em 6em 1em; /* 네비게이션 공간 확보를 위해 아래쪽 여백 증가 */
  }

  header {
    margin-top: 5em;
  }

  header h1 {
    font-size: 2em;
  }

  .divider {
    height: 3em;
    margin: 1.5em 0;
  }

  /* 3. 갤러리 2열로 변경 */
  .gallery {
    grid-template-columns: repeat(1, 1fr);
  }

  .gallery-item {
    max-height: 30em;
  }

  .gallery-item:nth-child(3) {
    grid-row: span 1; /* 모바일에서는 밸런스를 위해 확장 해제 추천 */
  }

  /* 4. 지도를 세로로 배치하거나 크기 조정 */
  .map {
    flex-direction: column;
    align-items: center;
    max-width: 20em;
  }

  .map-item {
    width: 100%;
  }

  /* 5. 기타 요소 변경 */
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    background-color: #474035;
    width: 42vw;
    height: 1em;
  }
}

/* 초소형 스마트폰용 (480px 이하) */
@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr; /* 1열 배치 */
  }
  
  .info {
    font-size: 1em;
  }
}