/* 디자인 설정: 아래 색상 변수를 수정하면 사이트 전체에 반영됩니다. */
:root {
  --paper: #fafaf8;
  --ink: #292a25;
  --line: #deded6;
  --sub: #73756a;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    12px "Courier New",
    monospace;
}
button,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover,
button:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid #677147;
  outline-offset: 4px;
}
header {
  height: 130px;
  padding: 30px 4%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
nav {
  display: flex;
  gap: 22px;
}
nav:last-child {
  justify-content: flex-end;
}
.logo {
  font:
    48px Georgia,
    serif;
  letter-spacing: -4px;
  text-align: center;
}
.logo small {
  display: block;
  font:
    9px "Courier New",
    monospace;
  letter-spacing: 3px;
  margin-top: 8px;
}
.intro {
  margin: 24px 4% 45px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--sub);
  font-size: 10px;
}
.intro p {
  font:
    italic 18px Georgia,
    serif;
  color: var(--ink);
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px 5%;
  padding: 0 8% 110px;
}
.product {
  padding: 0;
  text-align: center;
  width: 100%;
}
.photo {
  overflow: hidden;
  background: #e6e6e1;
  aspect-ratio: 1/1.08;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.product:hover img {
  transform: scale(1.035);
}
.product small {
  display: block;
  font-size: 9px;
  color: var(--sub);
  letter-spacing: 1px;
  margin: 22px 0 9px;
}
.product h2 {
  font:
    12px "Courier New",
    monospace;
  margin: 0 0 9px;
}
.product p {
  font-size: 10px;
  color: var(--sub);
  margin: 0;
}
.studio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eeeee7;
  margin: 0 4%;
}
.studio img {
  width: 100%;
  height: 560px;
  object-fit: cover;
}
.studio > div {
  padding: 12%;
  align-self: center;
}
small {
  font-size: 10px;
}
h1 {
  font:
    normal clamp(30px, 4vw, 56px) / 1.12 Georgia,
    serif;
  letter-spacing: -1px;
  margin: 30px 0;
}
.studio p {
  line-height: 1.9;
  color: var(--sub);
  max-width: 300px;
}
.studio a {
  display: inline-block;
  margin-top: 30px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 5px;
}
#ordering {
  padding: 100px 8%;
}
h2 {
  font:
    normal 32px Georgia,
    serif;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
  margin-top: 50px;
}
.steps article {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.steps p {
  line-height: 1.9;
  color: var(--sub);
}
footer {
  border-top: 1px solid var(--line);
  margin: 0 4%;
  padding: 45px 0;
  display: flex;
  gap: 6%;
  align-items: center;
  line-height: 1.8;
}
footer b {
  font:
    40px Georgia,
    serif;
  letter-spacing: -3px;
}
footer small {
  margin-left: auto;
  font-size: 9px;
  color: var(--sub);
}
dialog {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 45px;
  max-width: 900px;
  width: calc(100% - 40px);
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #20221d80;
  backdrop-filter: blur(4px);
}
.close {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 28px;
}
#detailBody {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
#detailBody img {
  width: 100%;
  height: 470px;
  object-fit: cover;
}
#detailBody h2 {
  margin-top: 40px;
}
.description {
  line-height: 1.9;
  color: var(--sub);
}
label {
  display: block;
  margin-top: 22px;
  font-size: 10px;
}
select {
  display: block;
  width: 100%;
  padding: 12px 8px;
  border: 1px solid var(--line);
  background: transparent;
  margin-top: 8px;
}
.solid {
  display: block;
  width: 100%;
  padding: 16px;
  background: #353b29;
  color: white;
  margin: 24px 0 12px;
  text-decoration: none !important;
}
.muted {
  font-size: 10px;
  line-height: 1.8;
  color: var(--sub);
}
.selected {
  display: flex;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.selected img {
  width: 65px;
  height: 75px;
  object-fit: cover;
}
.selected div {
  flex: 1;
  line-height: 1.9;
}
.contact {
  display: block;
  margin: 20px 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
textarea {
  width: 100%;
  height: 180px;
  background: white;
  border: 1px solid var(--line);
  padding: 15px;
  line-height: 1.7;
}
#copy {
  padding: 12px;
  border: 1px solid var(--line);
  margin-top: 10px;
}
@media (min-width: 1450px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 0 4% 120px;
    gap: 30px;
  }
} /* 휴대폰 화면의 메뉴, 상품 열, 상세 창 배치 */
@media (max-width: 650px) {
  header {
    height: 110px;
    padding: 20px 5%;
    grid-template-columns: 1fr auto;
  }
  header .logo {
    grid-column: 1;
    grid-row: 1;
    text-align: left;
    font-size: 40px;
  }
  header nav:first-child {
    grid-column: 1/3;
    grid-row: 2;
    margin-top: 20px;
    gap: 20px;
  }
  header nav:last-child {
    grid-column: 2;
    grid-row: 1;
    gap: 10px;
    font-size: 10px;
  }
  .intro {
    margin-top: 35px;
    font-size: 8px;
    gap: 15px;
  }
  .intro p {
    font-size: 13px;
  }
  .intro span:last-child {
    display: none;
  }
  .grid {
    padding: 0 5% 60px;
    gap: 40px 16px;
  }
  .product h2 {
    font-size: 11px;
  }
  .studio {
    grid-template-columns: 1fr;
  }
  .studio img {
    height: 370px;
  }
  .studio > div {
    padding: 45px 25px;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #ordering {
    padding: 55px 7%;
  }
  footer {
    flex-wrap: wrap;
    gap: 25px;
  }
  footer small {
    width: 100%;
    margin: 0;
  }
  #detailBody {
    grid-template-columns: 1fr;
    gap: 0;
  }
  #detailBody img {
    height: 300px;
  }
  dialog {
    padding: 30px 22px;
  }
  h2 {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .photo img {
    transition: none;
  }
}

/* shop 드롭다운과 카테고리 필터 메뉴 */
.shop-menu {
  position: relative;
}
.shop-menu summary {
  cursor: pointer;
  list-style: none;
}
.shop-menu summary::-webkit-details-marker {
  display: none;
}
.shop-links {
  position: absolute;
  z-index: 5;
  top: 24px;
  left: -14px;
  min-width: 130px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.shop-links a {
  display: block;
  padding: 9px 0;
}
.category-nav {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 0 5% 14px;
}
.category-nav a {
  padding: 8px 2px;
  border-bottom: 1px solid transparent;
}
.category-nav a[aria-current],
.shop-links a[aria-current] {
  color: var(--ink);
  font-weight: bold;
}
.category-nav a[aria-current] {
  border-bottom-color: var(--ink);
}
.shop-count {
  text-align: center;
  color: var(--sub);
  font-size: 10px;
  margin: 0 0 30px;
}
.empty-category {
  grid-column: 1/-1;
  text-align: center;
  min-height: 180px;
  padding-top: 60px;
  line-height: 2;
  color: var(--sub);
}
.empty-category a {
  display: block;
  text-decoration: underline;
}

/* 메인은 앞으로 사진과 글을 추가할 빈 공간입니다. */
#home {
  min-height: calc(100dvh - 130px);
}
.category-nav {
  margin-top: 35px;
}
@media (max-width: 650px) {
  #home {
    min-height: calc(100dvh - 110px);
  }
}

/* 로고: 이미지 대신 글자로 표시합니다. 크기와 자간은 여기서 조절하세요. */
header .logo {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1;
}
@media (max-width: 650px) {
  header .logo {
    font-size: 25px;
  }
}

/* 페이지 분리 및 상품 상세 갤러리 */
.content-page {
  min-height: calc(100dvh - 130px);
  padding-top: 35px;
}
.gallery {
  min-width: 0;
}
.gallery-frame {
  position: relative;
  touch-action: pan-y;
}
#detailBody .gallery-frame img {
  object-fit: contain;
  background: #eeeee7;
  width: 100%;
  height: 470px;
}
.gallery-arrow {
  position: absolute;
  top: 45%;
  background: #fafaf8e8;
  font-size: 28px;
  padding: 8px 12px;
}
.gallery-arrow[hidden] {
  display: none;
}
.prev {
  left: 8px;
}
.next {
  right: 8px;
}
#gallery-position {
  text-align: center;
  font-size: 10px;
  color: var(--sub);
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow: auto;
}
.gallery-thumbs button {
  padding: 3px;
  border: 1px solid transparent;
}
.gallery-thumbs button[aria-pressed="true"] {
  border-color: var(--ink);
}
#detailBody .gallery-thumbs img {
  width: 55px;
  height: 65px;
  object-fit: cover;
}
.gallery:focus-visible {
  outline: 1px solid var(--ink);
}
@media (max-width: 650px) {
  #detailBody .gallery-frame img {
    height: 300px;
  }
  .content-page {
    min-height: calc(100dvh - 110px);
  }
}

/* 회원 화면: 입력값은 Firebase 인증 서비스로만 전송합니다. */
#auth-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: transparent;
  font: inherit;
  margin: 8px 0 12px;
}
#toggle-auth,
#reset-password,
#refresh-account,
#sign-out {
  padding: 10px 0;
  display: block;
}
#auth-status {
  line-height: 1.8;
  color: var(--sub);
}

/* 관리자 링크와 계정 정보: 인증된 관리자에게만 편집 링크를 표시합니다. */
[hidden] {
  display: none !important;
}
.admin-entry {
  text-align: right;
  margin: 0 5% 20px;
}
.admin-entry a,
#manage-products {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 12px 16px;
}
.account-id {
  margin: 20px 0;
  color: var(--sub);
}
.account-id summary {
  cursor: pointer;
}
.account-id code {
  font-size: 10px;
  overflow-wrap: anywhere;
}
