/* === 초기화 및 공통 설정 === */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Segoe UI', sans-serif;
  background-color: #ffca00;
  color: #333;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* === 레이아웃 컨테이너 === */
.container {
  flex: 1;
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* === 네비게이션 (데스크탑) === */
.navigation {
  width: 280px;
  min-width: 280px;
  padding: 40px 20px;
  background-color: #ffca00;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container > .navigation { flex-shrink: 0; }

.logo { width: 120px; height: auto; }

.logo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* === 메뉴 버튼 === */
.nav-buttons { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.nav-buttons a {
  padding: 10px 20px;
  background-color: white;
  border: 2px solid #333;
  border-radius: 10px;
  color: #333;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 2px 2px 0 #333;
  transition: 0.2s ease;
}
.nav-buttons a:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 #333; }

/* === 소셜 아이콘 === */
.social-icons { display: flex; gap: 12px; justify-content: center; }
.social-icons img { width: 48px; height: 48px; }

/* === 메인 콘텐츠 === */
.main-content { flex-grow: 1; padding: 40px; background-color: #ffca00; overflow-y: auto; }

.headline-message {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: #333;
}

.portfolio-section { background-color: #ffca00; padding: 2rem; overflow-y: auto; height: 100%; }

.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.portfolio-card {
  position: relative;
  background-color: #fff;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 1rem;
  min-height: 300px;
  transition: transform 0.3s ease;
}
.portfolio-card:hover { transform: scale(1.02); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

.card-overlay {
  position: absolute; inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease; border-radius: 10px;
}
.portfolio-card:hover .card-overlay { opacity: 1; }

.card-cta {
  background-color: white; color: #333;
  padding: 0.5rem 1rem; border-radius: 5px; font-weight: bold; text-decoration: none; box-shadow: 2px 2px 0 #333;
}

.card-content { z-index: 1; }
.card-content h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; }
.card-content p { font-size: 1rem; line-height: 1.6; color: #333; margin-bottom: 1rem; }

.tags { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  display: inline-block; font-size: 0.9rem; font-weight: 600; color: #333;
  background-color: #fff; border: 2px solid #333; border-radius: 20px; padding: 0.25rem 0.6rem;
}

.tag-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; justify-content: center; }
.filter-btn {
  font-size: 1.1rem; background-color: #fff; border: 2px solid #333; color: #333;
  font-weight: 700; padding: 0.5rem 1rem; border-radius: 20px; cursor: pointer; transition: background-color 0.3s ease;
}
.filter-btn:hover, .filter-btn.active { background-color: #333; color: #fff; }

.profile-image-wrapper { text-align: center; margin-bottom: 1rem; }
.profile-image { width: 50%; max-width: 180px; height: auto; border-radius: 50%; object-fit: cover; }

.about-section { display: flex; flex-direction: column; gap: 2rem; padding: 2rem; background-color: #ffca00; }
.about-block {
  background-color: #fff; border: 2px solid #ccc; border-radius: 10px; padding: 2rem; min-height: 360px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
  color: #333;
}
.about-block:hover { transform: scale(1.01); box-shadow: 0 6px 14px rgba(0,0,0,0.15); }
.dark-block { background-color: #333; color: #fff; border: 2px solid #333; }
.about-block h2 { margin-top: 0; font-size: 1.8rem; }
.about-block p { font-size: 1.2rem; line-height: 1.6; }

.br-desktop { display: inline; }

.accordion { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.accordion-toggle {
  background-color: #333; color: #fff; padding: 0.75rem 1rem; font-size: 1rem; font-weight: bold;
  border: none; border-radius: 6px; cursor: pointer; text-align: left;
}
.accordion-content {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background-color: #333;
  padding: 0 1rem; border: 1px solid #ccc; border-radius: 6px;
}
.accordion-toggle.active + .accordion-content { max-height: 1000px; padding: 1rem; }

.contact-section { padding: 2rem; background-color: #ffca00; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem; }
.contact-links { display: flex; justify-content: center; gap: 2rem; font-weight: bold; font-size: 1rem; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.contact-form label { font-weight: bold; margin-bottom: 0.25rem; }
.contact-form input, .contact-form textarea { padding: 0.75rem; border-radius: 6px; border: 1px solid #ccc; font-size: 1rem; }
.contact-form button {
  padding: 0.75rem; background-color: #333; color: #fff; border: none; border-radius: 6px; font-weight: bold; font-size: 1rem; cursor: pointer;
  transition: background-color 0.3s ease;
}
.contact-form button:hover { background-color: #555; }

.about-block blockquote { font-style: italic; margin: 1rem 0; padding-left: 1rem; border-left: 4px solid #fff; color: #eee; }
.about-block .recommender { text-align: right; font-weight: 500; color: #ccc; margin-top: 0.5rem; }

.body { margin: 0; font-family: 'Segoe UI', sans-serif; background-color: #f5f5f5; line-height: 1.6; }

.project-detail { max-width: 900px; margin: 2rem auto 2rem; padding: 1rem; }

.section { margin-bottom: 2rem; background-color: #333; padding: 2rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.project-detail section { margin-bottom: 2rem; background-color: white; padding: 2rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* 프로젝트 이미지 */
.hero-image img { width: 100%; height: auto; border-radius: 12px; }

/* ====== 상단 뷰어 + 하단 썸네일 레이아웃 ====== */
/* ===== 상단 뷰어 ===== */
.gallery{ display:flex; flex-direction:column; gap:1rem; }

.viewer{
  position: relative;
  width: 100%;
  height: clamp(320px, 60vh, 720px); /* 처음에 항상 박스 안에 맞춰 보여지게 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;        /* 원본이 커도 넘치지 않도록 */
  background: #fff;        /* 필요시 배경색 */
  border-radius: 12px;     /* 선택 */
}

.viewer img,
.viewer video,
#mainViewerHost > * {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* 긴 변 기준 비율 유지 */
  transition: transform .25s ease;
  cursor: zoom-in;
}


/* 확대 상태 */
.viewer img.zoomed{
  transform: scale(2.5);      /* 필요 시 배율 조정 */
  cursor: zoom-out;
}


.thumbs-wrap{ position:relative; }
.thumb-strip{ display:flex; gap:.75rem; overflow-x:auto; scroll-behavior:smooth; padding:.5rem 3rem .5rem .5rem; }
.thumb{
  height:96px; width:auto; border-radius:8px; border:2px solid #ddd; flex:0 0 auto; object-fit:cover; cursor:pointer;
  transition:transform .2s, border-color .2s, box-shadow .2s; background:#fff;
}
.thumb:hover{ transform:none; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.thumb.active{ border-color:#333; }

.thumbs-wrap .slide-btn{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  background-color:#ffca00; color:#333; border:2px solid #333; border-radius:50%; width:2.5rem; height:2.5rem; font-size:1.5rem; cursor:pointer;
}
.thumbs-wrap .slide-btn.prev{ left:.25rem; }
.thumbs-wrap .slide-btn.next{ right:.25rem; }

/* === Footer === */
.footer { background-color: #333; color: #fff; text-align: center; padding: 0.5rem 0.5rem; font-size: 0.9rem; }
.footer a { color: #fff; text-decoration: underline; }

/* === 디스플레이 제어 === */
.desktop-only { display: flex; }
.mobile-only { display: none; }

/* === 반응형 (모바일) === */
@media (max-width: 768px) {
  .container { flex-direction: column; }
  .navigation { width: 100%; padding: 1rem 0.5rem; align-items: center; }
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
  .top-bar { width: 100%; display: flex; justify-content: center; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
  .top-bar .logo { max-width: 100px; height: auto; }
  .nav-buttons { width: 100%; display: flex; flex-wrap: nowrap; flex-direction: row; justify-content: center; gap: 1rem; margin-bottom: 0.3rem; text-align: center; }
  .nav-buttons a { flex: 1 1 auto; max-width: 100px; min-width: 70px; padding: 0.5rem 0.5rem; font-size: 0.85rem; white-space: nowrap; }
  .social-icons img { width: 36px; height: 36px; }
  .main-content { padding: 0.2rem; }
  .portfolio-grid { grid-template-columns: repeat(1, 1fr); }
  .portfolio-card { min-height: 200px; }
  .about-section { padding: 1rem; gap: 1.5rem; }
  .about-block { min-height: 500px; padding: 1.5rem; }
  .viewer{ height:42vh; min-height:260px; }
  .thumb{ height:72px; }
}
