/* Phototaxis overlay — 기본은 숨김, 시작 시에만 보이게 */
#overlay{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9990;        /* 검색바가 더 위여도 OK (header search z-index가 더 크면 그대로 유지) */
  pointer-events: none; /* 클릭은 통과 (끄기/켜기는 문서 리스너에서 처리) */
  display: none;        /* ✅ 기본 숨김 */
}

/* ===========================
   Global Styles (Front/styles.css)
   =========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Poppins', sans-serif;
  color: #333;
  line-height: 1.5;
  background: #fff;
}


/* ===========================
   ✨ Header Search (moved from styles.css)
   =========================== */
#search-bar {
  position: fixed;
  top: var(--header-h, 56px);   /* ✅ 헤더 높이와 동기화 */
  left: 0;
  width: 100%;
  background-color: #fff;
  z-index: 10050;               /* ✅ 오버레이(예: 9999)보다 위 */
  padding: 15px 20px 5px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  margin-bottom: 36px;
}

#search-bar.hidden { display: none; }

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

#search-input {
  width: 100%;
  padding: 10px 36px 10px 10px;
  font-size: 0.8rem;
  border: 0.8px solid #ccc;
  border-radius: 2px;
  height: 32px;
  box-sizing: border-box;
}
#search-input:focus {
  outline: 1px solid #ccc;
  outline-offset: 0;
  border-color: #ccc;
}

.clear-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #999;
  cursor: pointer;
  display: none;
  line-height: 1;
}

#search-results {
  width: 100%;
  background-color: rgba(255,255,255,0.95);
  z-index: 10040;
  padding: 10px 5px 10px;
  margin-top: 17px;
  margin-bottom: 10px;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(1, 130px);
  gap: 8px;
}

.search-results-images {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 40px;
  max-height: 410px;
  overflow-y: auto;
  padding: 3px;
}

.recommend-item {
  padding: 6px 8px;
  font-size: 0.6rem;
  line-height: 0.3;
  border-radius: 4px;
  text-align: left;
  color: #999;
  font-weight: 500;
  cursor: pointer;
}
.recommend-item:hover {
  background-color: transparent;
  color: #000;
}
.recommend-item.highlighted {
  background-color: #fff;
  color: #000;
}

.search-card {
  background-color: transparent;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  transition: none;
  padding: 16px 0 10px 0;
}
.search-card:hover { background-color: transparent; }

.search-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0;
}

.card-title {
  text-align: left;
  font-size: 0.6rem;
  color: #999;
  margin-top: 6px;
}
.search-card:hover .card-title,
.search-card.highlighted .card-title { color: #000; }


/* ===========================
   ✨ Section Styles (compact)
   =========================== */
section {
  padding: 24px 20px;     /* 여백 확 줄임 */
  min-height: auto;       /* 강제 100vh 제거 → 하얀 공백 방지 */
  border-bottom: 0;       /* 섹션 사이 라인 제거 */
}

/* 첫 섹션은 고정 헤더만큼만 여유 줌 */
section:first-of-type {
  padding-top: calc(var(--header-h, 56px) + 12px);
}

/* 모바일에서 더 타이트하게 */
@media (max-width: 900px) {
  section { padding: 16px 12px; }
  section:first-of-type { padding-top: calc(var(--header-h, 56px) + 8px); }
}


/* ===========================
   ✨ Section 1
   =========================== */

#section1 {
  background-image: url('/Front/Profile.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 80px 20px 20px 40px;
  min-height: 100vh;
  color: #000;
}

#section1 h2 {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 1px;
  letter-spacing: 0.02em;
}

#section1 .subtitle {
  font-size: 0.6rem;
  color: rgba(0, 0, 0, 0.6);
  margin-top: -2px;
  line-height: 1.0;
}

/* 바코드 블록 */
#section1 .code-stamp {
  position: absolute;
  left: 60px;      /* h2/subtitle의 padding-left와 동일 */
  bottom: 27px;    /* 섹션 하단 padding 값과 동일 */
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
  pointer-events: auto;
  user-select: none;
}

/* 바코드 이미지 */
#section1 .code-stamp img {
  width: 250px;   /* 원하는 픽셀 값 */
  height: auto;
  mix-blend-mode: multiply;   /* 배경과 섞이게 */
  image-rendering: pixelated;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
#section1 .code-stamp:hover img {
  opacity: 1;
}

@media (max-width: 600px) {
  #section1 .code-caption { display: none; }
}


/* ===========================
   ✨ Contact Section
   =========================== */
#contact {
  background-color: white;
  padding: 90px 40px 22px 40px;
  min-height: 20vh;
  text-align: left;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.8;
  letter-spacing: 0.03em;
}

#contact h2 {
  font-size: 0.6rem;
  margin-bottom: 10px;
}

#contact p,
#contact a {
  font-size: 0.6rem;
  color: rgba(0, 0, 0, 0.7);
  text-decoration: none;
  margin: 0;
  padding: 0;
}

#contact a:hover {
  color: #000;
}

#contact .contact-columns {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 140px;
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 40px;
}

#contact .contact-left,
#contact .contact-right {
  flex: none;
  min-width: auto;
  padding: 0;
  margin: 0;
}

#contact .contact-left > *,
#contact .contact-right > * {
  margin: 0;
  padding: 0;
}

#contact .contact-left h2,
#contact .contact-right h2 {
  margin-bottom: 16px;
}

#contact .contact-right p,
#contact .contact-right a,
#contact .subscribe-btn {
  font-size: 0.6rem;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.8;
  letter-spacing: 0.03em;
  text-decoration: none;
}

#contact .contact-right a:hover {
  color: #000;
}

#contact .subscribe-btn {
  background-color: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.7);
}

#contact .subscribe-btn:hover {
  color: #000;
  background-color: transparent;
  text-decoration: none;
  font-weight: normal; /* ✅ 굵기 고정 (600 ➝ normal) */
}


#contact .contact-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 80px;
  padding-top: 50px;
  border-top: none;
  font-size: 0.55rem;
  color: #999;
}

#contact .last-touched {
  margin: 0;
  font-weight: normal;
  font-size: 0.55rem;
  color: #999;
}

#contact .last-touched a {
  font-size: 0.55rem;
  font-weight: normal;
  color: #999;
  text-decoration: none;
}


#contact .last-touched a:hover {
  color: rgba(0, 0, 0, 0.7);
}

#contact .copyright {
  margin: 0;
  font-size: 0.55rem;
  color: #999;
}

/* contact 마지막 줄 아래 여백만 최소화 */
#contact{
  padding-bottom: 16px;            /* 22px → 6px (원하면 0~10px로 조절) */
  min-height: 0 !important;       /* 20vh 최소높이 효과 제거 */
}
#contact .contact-footer,
#contact .copyright{ margin-bottom: 0; padding-bottom: 0; }
#contact :where(.contact-columns, .contact-footer, .copyright) :last-child{ margin-bottom: 0; }


/* ===========================
   ✨ Popup Newsletter Styles
   =========================== */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 999;
  justify-content: center;
  align-items: center;
}

.popup-box {
  background: #fff;
  border: 1px solid #999;
  padding: 20px;
  width: 300px;
  font-family: system-ui, sans-serif;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

.popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
}

.newsletter-title {
  font-size: 1.1rem;
  letter-spacing: -0.5px;  /* 🎯 자간 좁게 */
  margin-bottom: 8px;
  color: rgba(0, 0, 0, 0.9);
}

.newsletter-subtext {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.6);
  margin: 3px 0 4px 0;  /* 위/오른/아래/왼 */
}

#newsletter-email {
  width: 100%;
  padding: 5.7px;
  margin: -4px 0 20px;
  font-size: 0.8rem;
}

.popup-buttons {
  display: flex;
  justify-content: space-between;
}

.popup-buttons button {
  padding: 4.5px 14px;
  font-size: 0.7rem;
  cursor: pointer;
}


/* 히스토리 스와이프 방지: 가로 오버스크롤/제스처 막기 */
html, body{
  overscroll-behavior-x: none;  /* Chrome/Edge/Firefox */
  touch-action: pan-y;          /* 세로만 스크롤 허용 */
}

/* Section1: 작은 화면일 때 텍스트/바코드 숨김 */
@media (max-width: 900px) {
  #section1 h2,
  #section1 .subtitle,
  #section1 .code-stamp {
    display: none !important;
  }
}

/* Contact: 모바일에서 세로 스택 (<=900px) */
@media (max-width: 900px) {
  /* 본문 두 칼럼 → 세로 쌓기 */
  #contact .contact-columns{
    display: flex;            /* inline-flex → flex */
    flex-direction: column;   /* 세로 정렬 */
    gap: 48px;
    align-items: stretch;
  }
  #contact .contact-left,
  #contact .contact-right{
    width: 100%;
  }

  /* 푸터 두 줄도 위/아래로 */
  #contact .contact-footer{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }
  #contact .last-touched,
  #contact .copyright{
    width: 100%;
    text-align: left;      /* 필요하면 center로 변경 가능 */
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

