/* 모퉁이 카페 — design-system.md의 규칙만 쓴다 (전자책 4-2).
   색·글씨 크기·간격·모서리는 바로 아래 :root에 이름으로 한 번만 적고, 나머지 줄은 그 이름만 부른다.
   새 값이 필요하면 먼저 design-system.md에 적는다. */
@font-face { font-family: "GmarketSans"; font-weight: 400; font-display: swap; src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff") format("woff"); }
@font-face { font-family: "GmarketSans"; font-weight: 600 700; font-display: swap; src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff") format("woff"); }

:root {
  /* 색: 다섯 가지 역할 */
  --main: #000000;   /* 메인: 가장 중요한 버튼의 바탕에만 */
  --bg: #ffffff;     /* 배경 */
  --text: #181818;   /* 글자 */
  --sub: #767676;    /* 보조(진한 단계): 흐린 글씨 */
  --line: #dfe0e2;   /* 보조(연한 단계): 테두리, 구분선, 빈 사진 자리 */
  --warn: #d92c20;   /* 경고: 오류 안내 */
  /* 글씨: 다섯 단계 (크기/줄 높이) */
  --t-title: 28px/36px;
  --t-subtitle: 18px/24px;
  --t-body: 16px/24px;
  --t-note: 14px/24px;
  --t-small: 12px/16px;
  --font: "GmarketSans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  /* 간격: 8의 배수만 */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s6: 48px;
  --s8: 64px;
  --s11: 88px;
  /* 모서리: 하나 */
  --radius: 8px;
  /* 화면에 따라 바뀌는 값 */
  --container: 1280px;
  --gutter: var(--s3);
  --section-gap: var(--s11);
  --header: 72px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--t-body) var(--font); word-break: keep-all; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
/* 입력 칸·버튼은 브라우저가 따로 글씨체를 정하므로 본문 글씨체를 물려받게 한다 */
input, select, textarea, button { font-family: inherit; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- 헤더: 로고 + 네비게이션 ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header); }
.logo { font: 600 var(--t-subtitle) var(--font); }
.nav { display: flex; gap: var(--s4); }
.nav a, .nav-button { font: 600 var(--t-body) var(--font); text-transform: uppercase; color: var(--text); border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"], .nav-button:hover { border-bottom-color: var(--text); }
/* 로그아웃은 버튼이지만 네비게이션 글자와 같은 모양으로 보인다 */
.nav-button { border-width: 0 0 2px; background: transparent; padding: 0; cursor: pointer; }
.nav [hidden] { display: none; }
/* 키보드로 옮겨 왔을 때: 글자 색 2px 테두리를 바깥에 2px 띄운다 */
.nav a:focus-visible, .nav-button:focus-visible, .btn:focus-visible, .menu-toggle:focus-visible, .text-link:focus-visible,
.field input:focus-visible, .field select:focus-visible, .table input:focus-visible, .table select:focus-visible {
  outline: 2px solid var(--text); outline-offset: 2px;
}
.menu-toggle { display: none; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: var(--s1) auto; }

/* ---------- 제목과 구역 ---------- */
.section-title { margin: 0; font: 600 var(--t-title) var(--font); }
.section-sub { margin: var(--s1) 0 0; color: var(--sub); }
.section { padding-top: var(--section-gap); }
.section:last-of-type { padding-bottom: var(--section-gap); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s4); }
.text-link { font-weight: 600; border-bottom: 2px solid var(--text); white-space: nowrap; }

/* ---------- 버튼 ---------- */
/* 메인 버튼: 그 화면에서 가장 중요한 행동 하나에만 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 var(--s3);
  border: 0; border-radius: var(--radius); background: var(--main); color: var(--bg);
  font: 600 var(--t-body) var(--font); cursor: pointer;
}
/* 선 버튼: 덜 중요한 행동 */
.btn--line { background: var(--bg); color: var(--text); border: 1px solid var(--sub); }
/* 작은 버튼: 표 안에서만 */
.btn--small { height: 40px; padding: 0 var(--s2); font: 600 var(--t-note) var(--font); }
/* 보내는 중에는 버튼을 잠근다 (전자책 6-3 연타 방지) */
.btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- 사진 ---------- */
/* 사진이 없는 자리: 연한 보조 색 바탕에 글자 */
.photo {
  background: var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  color: var(--sub); font: 400 var(--t-note) var(--font); text-align: center; padding: var(--s2);
}
/* 사진이 들어간 자리: 칸을 가득 채우고 넘치는 부분은 잘라 보여준다 */
.photo--filled { position: relative; padding: 0; overflow: hidden; }
.photo--filled img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.photo--hero { aspect-ratio: 16 / 7; }
.photo--card { aspect-ratio: 411 / 274; }
.photo--map { aspect-ratio: 16 / 9; }

/* ---------- 홈 ---------- */
.hero { padding-top: var(--s6); }
.hero-copy { margin-top: var(--s4); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.hero-copy p { margin: var(--s1) 0 0; color: var(--sub); }

/* ---------- 카드 (메뉴): 테두리·바탕·그림자 없음 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); list-style: none; margin: 0; padding: 0; }
/* 홈 인기 메뉴만: 큰 칸 하나 + 작은 칸 둘 */
.cards--bento { grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; }
.cards--bento li { display: flex; flex-direction: column; }
.cards--bento li:first-child { grid-row: 1 / span 2; }
.cards--bento li:first-child .photo--card { aspect-ratio: auto; flex: 1; min-height: 240px; }
.card-name { margin: var(--s2) 0 0; font-weight: 600; }
.card-meta { margin: 0; color: var(--sub); font: 400 var(--t-note) var(--font); }
.card-price { margin: var(--s1) 0 0; font: 600 var(--t-subtitle) var(--font); }

.info { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin: 0; }
.info div { border-top: 1px solid var(--line); padding-top: var(--s2); }
.info dt { color: var(--sub); font: 400 var(--t-note) var(--font); }
.info dd { margin: var(--s1) 0 0; font-weight: 600; }

/* ---------- 메뉴 ---------- */
.menu-group + .menu-group { margin-top: var(--s8); }
.menu-group h2 { margin: 0 0 var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); font: 600 var(--t-subtitle) var(--font); }

/* ---------- 입력 칸 ---------- */
.form { max-width: 520px; }
.field { margin-bottom: var(--s3); }
.field label { display: block; margin-bottom: var(--s1); font: 400 var(--t-note) var(--font); }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: 400 var(--t-body) var(--font);
}
.form .btn { width: 100%; }
/* 입력 오류 안내: 경고 색 */
.form-error { margin: var(--s1) 0 0; color: var(--warn); font: 400 var(--t-note) var(--font); }
.form-error[hidden] { display: none; }
.field.has-error input { border-color: var(--warn); }
/* 동의 체크 칸 (기능정의서 22번): 줄 전체를 눌러도 체크된다 */
.field--check label { display: flex; align-items: center; gap: var(--s1); margin-bottom: 0; min-height: 48px; cursor: pointer; }
.field--check input { width: 24px; height: 24px; padding: 0; flex: none; accent-color: var(--text); }
.field--check.has-error label { color: var(--warn); }
.consent-note { margin: 0; color: var(--sub); font: 400 var(--t-small) var(--font); }
.consent-note a { border-bottom: 1px solid var(--sub); }
/* 봇 차단용 함정 칸 (기능정의서 21번): 사람 눈에 보이지 않게 화면 밖으로 보낸다 */
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-alt { margin: var(--s3) 0 0; color: var(--sub); font: 400 var(--t-note) var(--font); }

/* ---------- 안내 상자 ---------- */
.notice { margin: var(--s2) 0 0; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--radius); font: 400 var(--t-note) var(--font); }
.notice[hidden] { display: none; }

/* ---------- 개인정보처리방침 본문 ---------- */
.policy h2 { margin: var(--s4) 0 var(--s2); font: 600 var(--t-subtitle) var(--font); }
.policy ul { margin: 0; padding-left: var(--s3); }
.policy li, .policy > p { font: 400 var(--t-note) var(--font); }

/* ---------- 표: 마이페이지·관리자페이지 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font: 400 var(--t-note) var(--font); }
.table th { text-align: left; color: var(--sub); font-weight: 400; padding: var(--s1) var(--s2) var(--s1) 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* 관리자 예약 표는 칸이 많아서 좁은 화면에서는 표 안에서 옆으로 밀어 본다. 칸이 찌그러지지 않게 최소 폭을 둔다 */
#admin-reservations { min-width: 880px; }
#my-reservations { min-width: 560px; }
/* 띄어쓰기 없이 길게 적은 글은 이름·요청사항 칸 안에서만 줄을 바꾼다. 시간·전화번호는 한 줄로 둔다 */
#admin-reservations td:nth-child(3), #admin-reservations td:nth-child(6), #my-reservations td:nth-child(4) { overflow-wrap: anywhere; }
#admin-reservations td:nth-child(2), #admin-reservations td:nth-child(4), #admin-reservations td:nth-child(5), #my-reservations td:nth-child(2), #my-reservations td:nth-child(3) { white-space: nowrap; }
.table td.strong { font-weight: 600; white-space: nowrap; }
.table .is-cancelled td { color: var(--sub); }
.table input, .table select { height: 40px; padding: 0 var(--s1); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); font: 400 var(--t-note) var(--font); }
.table input.price { width: 112px; }
.saved { margin-left: var(--s1); color: var(--sub); }

/* ---------- 오시는 길 ---------- */
.location { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s6); align-items: start; }
.location .info { grid-template-columns: 1fr; }

/* ---------- 푸터 ---------- */
.site-footer { margin-top: var(--section-gap); border-top: 1px solid var(--line); padding: var(--s4) 0 var(--s6); color: var(--sub); font: 400 var(--t-small) var(--font); }
.site-footer p { margin: 0 0 var(--s1); }
.site-footer .practice { color: var(--text); font-weight: 600; margin-bottom: var(--s2); }
.site-footer a { border-bottom: 1px solid var(--sub); }

/* ---------- 폰 화면 ---------- */
@media (max-width: 760px) {
  :root { --gutter: var(--s2); --section-gap: var(--s6); --header: 64px; --t-title: 24px/32px; }
  .menu-toggle { display: block; }
  .site-header { position: relative; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header); z-index: 10;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: var(--s1) var(--gutter) var(--s2);
  }
  .nav.is-open { display: flex; }
  .nav a, .nav-button { padding: var(--s2) 0; border-bottom: 0; text-align: left; }
  .nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }
  .photo--hero { aspect-ratio: 4 / 3; }
  .cards { grid-template-columns: 1fr; gap: var(--s4); }
  .cards--bento { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; gap: var(--s3) var(--s2); }
  .cards--bento li:first-child { grid-row: auto; grid-column: 1 / -1; }
  .cards--bento li:first-child .photo--card { aspect-ratio: 16 / 10; flex: none; min-height: 0; }
  .cards--menu { grid-template-columns: repeat(2, 1fr); gap: var(--s3) var(--s2); }
  .info { grid-template-columns: 1fr; gap: var(--s2); }
  .location { grid-template-columns: 1fr; gap: var(--s3); }
  .section-head { flex-direction: column; align-items: flex-start; }
}
