:root {
  --ink: #cccccc;
  --paper: #000000;
  --line: rgba(255, 255, 255, 0.12);
  --muted: #888888;
  --gutter: 10px;
  --lightbox-bg: rgba(0, 0, 0, 0.95);
  --sidebar-w: 220px;
  --max-content-width: 1620px;
  color-scheme: dark; /* 원래 어두운 사이트라고 브라우저에 알림 → 크롬/삼성 인터넷의 '자동 다크/라이트 변환' 방지 */
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

html {
  background: #000000; /* 변수(var)를 못 읽는 브라우저 대비 */
}

body {
  background: #000000; /* 변수(var)를 못 읽는 브라우저 대비 */
  background: var(--paper);
  color: #cccccc;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-container {
  display: flex;
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  min-height: 100vh;
}

/* PC 헤더 */
.site-header {
  position: sticky;
  top: 0;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--paper);
  z-index: 20;
  flex-shrink: 0;
}

.site-header-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  padding: 48px 36px;
  gap: 32px;
}

.site-header .brand {
  display: block;
  width: 100%;
  max-width: 120px;
  text-decoration: none;
}

.site-header .brand img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  margin-left: 13px; /* 메뉴 로고 이 값을 조절해서 이동 정도 조절 */
}

.nav-toggle {
  display: none;
}

.site-header nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  font-size: 20px;
  margin-top: 0;
  margin-left: 18px; /* 메뉴 좌측여백 이 값을 조절해서 이동 정도 조절 */
}

.site-header nav a {
  color: #888888;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity .2s ease, color .2s ease;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: #ffffff;
  opacity: 1;
}

/* contact 아래 인스타그램 아이콘 (두 칸 띄움) */
.site-header nav a#navInstagram {
  display: inline-block;
  margin-top: 2em;
  line-height: 0;
  padding: 0;
  border: 0;
  background: none;
  opacity: 1;
}
#navInstagram img {
  display: block;
  width: 24px;
  height: 24px;
}
/* PC: 아이콘을 about · gallery · contact 글자의 왼쪽 끝 선에 맞춤 */
@media (min-width: 901px) {
  .site-header nav a#navInstagram { align-self: flex-start; margin-left: 0; }
}
#navInstagram:hover img { opacity: .8; }

/* 클릭된 메뉴는 마우스를 떼어도 hover와 같은 색상을 유지 */
.site-header nav a.active {
  font-weight: 400;
}

/* gallery 메뉴 + 소분류 서브메뉴를 감싸는 래퍼 (nav의 다른 항목과 동일한 세로 흐름 유지) */
.nav-item--gallery {
  display: flex;
  flex-direction: column;
}

/* gallery 버튼 글자 아래로 스르륵 나타나는 소분류 메뉴 */
.sub-nav {
  list-style: none;
  margin: 10px 0 0 14px;  /* 마지막 값(-6px)을 조절 — 숫자가 클수록 더 왼쪽 */
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sub-nav li {
  opacity: 0;
  transform: translateY(-6px);
  animation: subNavIn .4s ease forwards;
}

.sub-nav li:nth-child(1) { animation-delay: .05s; }
.sub-nav li:nth-child(2) { animation-delay: .15s; }
.sub-nav li:nth-child(3) { animation-delay: .25s; }

@keyframes subNavIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sub-nav-link {
  display: block;
  font-size: 14px;
  color: #777777;
  text-decoration: none;
  opacity: .8;
  transition: opacity .2s ease, color .2s ease;
}

.sub-nav-link:hover,
.sub-nav-link.active {
  color: #ffffff;
  opacity: 1;
}

/* 모바일 전용 gallery 소분류 버튼 바 (PC에서는 숨김) */
.mobile-sub-nav {
  display: none;
}

/* 현재 페이지 제목은 모바일에서만 표시합니다. */
.mobile-page-title {
  display: none;
}

.page-content {
  flex: 1;
  min-width: 0;
  padding-top: 48px;
}

/* gallery든, 소분류로 연결된 다른 게시판이든 상단 여백이 항상 동일하도록
   콘텐츠 첫 요소 자체의 위쪽 마진은 무시합니다. */
.page-content > *:first-child {
  margin-top: 0;
}

/* 우측 상단 태그 메뉴 */
.tag-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 0 40px 24px;
}

.tag-nav a {
  color: #888888;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity .2s ease, color .2s ease;
}

.tag-nav a:hover,
.tag-nav a.active {
  color: #ffffff;
  opacity: 1;
}

.gallery {
  width: 100%;
  padding: 0 40px 80px;
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
}

.gallery-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  gap: var(--gutter);
}

.gallery figure {
  margin: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
  will-change: opacity;
}

.gallery figure.is-loaded {
  opacity: 1;
}

.gallery figure a {
  display: block;
  overflow: hidden;
  line-height: 0;
  width: 100%;
  text-decoration: none;
}

.gallery figure img,
.gallery figure video {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  object-fit: cover;
}

/* 왼쪽 하단 연락처·사업자 정보 - 사이드바 맨 아래에 붙음 (화면 높이에 맞춰 자동으로 아래 고정) */
.site-header-inner {
  overflow-y: auto;          /* 화면 세로가 아주 작을 때도 잘리지 않고 스크롤 */
  scrollbar-width: none;
}
.site-header-inner::-webkit-scrollbar { display: none; }

.site-info {
  margin-top: auto;          /* 남는 공간을 위쪽으로 밀어 맨 아래에 붙게 함 */
  margin-left: -36px;        /* 사이드바 안쪽 여백을 무시하고 사이드바 전체 폭을 사용 */
  margin-right: -36px;
  display: flex;
  justify-content: center;   /* 글자 덩어리를 사이드바 가운데에 놓음 (줄은 왼쪽 맞춤) */
  padding: 0 12px;
}

.site-info-inner {
  text-align: left;
}

/* PC·모바일 공통 글자 모양 */
.site-info,
.site-footer-mobile {
  font-size: 10.5px;
  line-height: 1.75;
  color: #666666;
}

.site-info p,
.site-footer-mobile p {
  margin: 0;
}

.site-info p + p,
.site-footer-mobile p + p {
  margin-top: 16px;
}

.site-info a,
.site-footer-mobile a {
  color: #999999;
  text-decoration: none;
  transition: color .2s ease;
}

.site-info a:hover,
.site-footer-mobile a:hover {
  color: #ffffff;
}

/* PC: 한 줄씩 끊어서 표시 */
.site-info span {
  display: block;
  white-space: nowrap;
}

/* 모바일용 하단 정보는 PC에서 숨김 */
.site-footer-mobile {
  display: none;
}

/* ---------- 모바일 스타일 수정 ---------- */
@media (max-width: 900px) {
  .site-container {
    flex-direction: column;
  }

  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    min-width: 100%;
    height: 90px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    z-index: 100;
  }

  .site-header-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    gap: 0;
    position: relative;
  }

  /* 모바일 로고 좌측 배치 */
  .site-header .brand {
    max-width: 70px;
    z-index: 102;
    margin: 0;
  }

  /* 3줄 햄버거 버튼 강제 노출 및 우측 정렬 */
  .nav-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 102;
    margin: 0;
    position: relative;
    top: 0px;     /* +는 아래로, -는 위로 */
    right: 15px;   /* +는 왼쪽으로, -는 오른쪽으로 */
  }



  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #888888;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
  }

  /* 메뉴 열림 상태 - ✕ 버튼 */
  .site-header.is-open .nav-toggle span {
    background-color: #aaaaaa;
  }

  .site-header.is-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.is-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }





  /* 풀스크린 메뉴 오버레이 */
  .site-header nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
	margin: 0; /* ← 이 줄 추가: PC용 margin-left: 18px가 모바일에 새어 들어오는 걸 막음 */
    background: #000000;
    flex-direction: column;
    
	
    align-items: center;
    justify-content: flex-start;   /* 가운데 → 위에서부터 시작 */
    gap: 32px;
    padding: 0;            /* 첫 숫자가 화면 맨 위에서 about까지 거리 */





    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    z-index: 101;
  }

  .site-header nav.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-header nav a {
    font-size: 32px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #888888;
    text-decoration: none;
    opacity: 0.9;
  }

  .site-header nav a:hover,
  .site-header nav a.active {
    color: #ffffff;
  }

  /* 모바일 풀스크린 메뉴에서는 gallery 아래 세로 gap이 이미 있으므로 서브메뉴 여백을 살짝 줄임 */
  .nav-item--gallery {
    align-items: center;
  }

  .sub-nav {
    margin-top: 18px;
    align-items: center;
    gap: 16px;
  }

  .sub-nav-link {
    font-size: 20px;
    color: #888888;
  }

  /* 모바일에서는 햄버거 메뉴 안 서브메뉴 대신, 헤더 바로 아래 버튼 바를 사용합니다 */
  .nav-item--gallery .sub-nav {
    display: none;
  }

  /* gallery 헤더 바로 아래에 버튼 형태로 노출되는 소분류 바 */
  .mobile-sub-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 14px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-sub-nav-link {
    opacity: 0;
    transform: translateY(-6px);
    animation: subNavIn .4s ease forwards;

    display: inline-block;
    font-size: 13px;
    color: #aaaaaa;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: opacity .2s ease, color .2s ease, border-color .2s ease;
  }

  .mobile-sub-nav-link:nth-child(1) { animation-delay: .05s; }
  .mobile-sub-nav-link:nth-child(2) { animation-delay: .15s; }
  .mobile-sub-nav-link:nth-child(3) { animation-delay: .25s; }
  .mobile-sub-nav-link:nth-child(4) { animation-delay: .35s; }

  .mobile-sub-nav-link:hover,
  .mobile-sub-nav-link.active {
    color: #ffffff;
    border-color: #ffffff;
  }

  /* 모바일: 기존 위치 그대로 상단 바 중앙에 현재 페이지 표시 */
  .mobile-page-title {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 102;
  }

  .page-content {
    width: 100%;
    padding-top: 12px;
  }

  /* 태그 버튼 헤더 아래 우측 정렬 */
  .tag-nav {
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 20px 16px;
  }
}

@media (max-width: 640px) {
  .gallery {
    padding: 0 12px 60px;
  }
  :root {
    --gutter: 5px;
  }
}

/* 라이트박스 */
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--lightbox-bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox.open {
  display: flex;
}

.lightbox img,
.lightbox video {
  max-width: 88vw;
  max-height: 84vh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  opacity: 0.75;
  z-index: 1010;
}

.lightbox-close { top: 22px; right: 28px; font-size: 28px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); font-size: 34px; padding: 10px 14px; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #ffffff; opacity: 0.6; font-size: 12px; }

/* 모바일: 사이드바 정보는 숨기고, 페이지 맨 아래에 가운데 정렬로 표시 */
@media (max-width: 900px) {
  .site-header-inner {
    overflow: visible;
  }

  .site-info {
    display: none;
  }

  /* 본문이 화면 높이만큼 늘어나지 않게 해서, 내용(예: about 사진) 바로 아래에 하단 정보가 붙도록 함 */
  .page-content {
    flex: 0 0 auto;
  }

  .site-footer-mobile {
    display: block;
    width: 100%;
    padding: 36px 20px 48px;
    border-top: 1px solid var(--line);
    text-align: center;
  }

  .site-footer-mobile .site-info-contact span {
    display: block;
  }

  /* 사업자 정보는 원래 문장대로 3줄로 이어서 표시 */
  .site-footer-mobile .site-info-company span {
    display: inline;
  }
  .site-footer-mobile .site-info-company span:nth-child(1)::after,
  .site-footer-mobile .site-info-company span:nth-child(3)::after,
  .site-footer-mobile .site-info-company span:nth-child(5)::after {
    content: " ";
  }
  .site-footer-mobile .site-info-company span:nth-child(3)::before,
  .site-footer-mobile .site-info-company span:nth-child(5)::before {
    content: "\A";
    white-space: pre;
  }
}


/* 모바일 메뉴 위치 고정: gallery 페이지 등에서 다른 CSS가 덮어써도 유지 */
@media (max-width: 900px) {
  .site-header #siteNav {
    justify-content: flex-start !important;
    padding: 200px 0 0 !important;   /* ← 이제 여기 숫자로 위치 조절 */
  }
}

/* 모바일 햄버거 메뉴 속 인스타그램 아이콘 크기 */
@media (max-width: 900px) {
  #navInstagram img { width: 24px; height: 24px; }
}
