/* ============================================================
   밥집여행 — 스타일
   색·간격은 아래 :root 변수만 바꾸면 전체가 따라옵니다.

   편집 원칙
   · 그림자 대신 실선 한 겹      · 모서리는 거의 직각(2px)
   · 색 채운 배지 대신 자간 넓힌 글자로 분류를 표시
   · 본문은 상자에 가두지 않고 여백으로 구분
   ============================================================ */

:root {
  --paper:    #f7f5f1;   /* 배경 (따뜻한 아이보리) */
  --paper-2:  #fffefc;
  --ink:      #16130f;   /* 제목·본문 */
  --ink-2:    #4a443c;   /* 보조 */
  --ink-3:    #8d8479;   /* 라벨·날짜 */
  --line:     #ded7cb;   /* 실선 */
  --line-2:   #ebe5db;   /* 더 옅은 실선 */
  --accent:   #8c3d21;   /* 여행 */
  --accent-2: #2d5a4a;   /* 밥집 */

  --topbar-h:  74px;
  --sidebar-w: 268px;
  --measure:   66ch;     /* 본문 한 줄 길이 */

  --sans: 'Pretendard', 'Apple SD Gothic Neo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'AppleMyungjo', 'Nanum Myeongjo', 'Apple SD Gothic Neo', Georgia, serif;

  /* 자간 넓힌 작은 라벨 — 사이트 전체에서 반복 사용 */
  --label-size: 11px;
  --label-track: .19em;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
dl, dd, dt { margin: 0; }

/* 공통 라벨 */
.kicker,
.postlist__label,
.section__title,
.pager__dir,
.rating__label,
.lightbox__count {
  font-size: var(--label-size);
  font-weight: 600;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}

/* ─────────── 상단 헤더 ─────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: rgba(247, 245, 241, .9);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  height: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand__name {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .04em;
}
.brand__rule { width: 22px; height: 1px; background: var(--line); }
.brand__tag {
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--ink-3);
}

.topnav { display: flex; gap: 26px; }

.topnav__item {
  position: relative;
  padding: 4px 0;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--ink-3);
  transition: color .18s;
}
.topnav__item::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s cubic-bezier(.2,.7,.3,1);
}
.topnav__item:hover { color: var(--ink); }
.topnav__item.is-active { color: var(--ink); }
.topnav__item.is-active::after { transform: scaleX(1); }

.topbar__side {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.search {
  width: 150px;
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: .02em;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, width .25s cubic-bezier(.2,.7,.3,1);
}
.search::placeholder { color: var(--ink-3); }
.search:focus { border-color: var(--ink); width: 196px; }
.search::-webkit-search-cancel-button { -webkit-appearance: none; }

.menu-toggle {
  display: none;
  width: 26px;
  height: 20px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.menu-toggle span { display: block; height: 1px; background: var(--ink); }

/* ─────────── 레이아웃 ─────────── */

.layout {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 34px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ─────────── 좌측 사이드바 ─────────── */

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  padding-top: 44px;
}

.sidebar__scroll {
  height: 100%;
  overflow-y: auto;
  padding-right: 10px;
  padding-bottom: 40px;
  scrollbar-width: thin;
}

.postlist__group + .postlist__group { margin-top: 44px; }

.postlist__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  color: var(--ink-2);
}
.postlist__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.postlist__count {
  font-weight: 400;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--ink-3);
}

.post-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 0 16px 12px;
  border-bottom: 1px solid var(--line-2);
  transition: padding-left .22s cubic-bezier(.2,.7,.3,1);
}
.post-item::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 1px;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .25s cubic-bezier(.2,.7,.3,1);
}
.post-item:hover { padding-left: 16px; }
.post-item.is-active { padding-left: 16px; }
.post-item.is-active::before { transform: scaleY(1); }

.post-item__thumb {
  width: 44px;
  height: 52px;
  object-fit: cover;
  background: var(--line-2);
  filter: saturate(.86);
  transition: filter .25s;
}
.post-item:hover .post-item__thumb,
.post-item.is-active .post-item__thumb { filter: none; }

.post-item__body { min-width: 0; padding-top: 1px; }

.post-item__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: .01em;
  color: var(--ink-2);
  transition: color .18s;
}
.post-item:hover .post-item__title,
.post-item.is-active .post-item__title { color: var(--ink); }

.post-item__meta {
  display: block;
  font-size: 11px;
  letter-spacing: .09em;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-item__sep { margin: 0 6px; opacity: .5; }

.sidebar__foot {
  margin: 34px 0 0;
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--ink-3);
}

.postlist__empty {
  padding: 40px 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(22,19,15,.42);
}
.scrim[hidden] { display: none; }

/* ─────────── 히어로 ─────────── */

.main { padding: 44px 0 90px; min-width: 0; }

.hero__frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #221e1a;
  animation: slowzoom 14s ease-out both;
}
@keyframes slowzoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}

.hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(14,12,10,.94) 0%,
    rgba(14,12,10,.78) 30%,
    rgba(14,12,10,.42) 58%,
    rgba(14,12,10,.12) 100%
  );
}

.hero__body {
  position: relative;
  width: 100%;
  padding: 0 52px 46px;
  color: #fff;
}

.kicker {
  margin: 0 0 20px;
  color: rgba(255,255,255,.72);
}
.kicker::before {
  content: '';
  display: inline-block;
  width: 26px;
  height: 1px;
  margin-right: 12px;
  vertical-align: 4px;
  background: var(--accent);
}
.kicker--food::before { background: var(--accent-2); }

.hero__title {
  max-width: 17ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 58px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.005em;
}

.hero__sub {
  max-width: 46ch;
  margin: 18px 0 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(255,255,255,.74);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 46px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.22);
}
.hero__meta dt {
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.5);
  margin-bottom: 5px;
}
.hero__meta dd {
  font-size: 14px;
  letter-spacing: .02em;
  color: rgba(255,255,255,.92);
}
.hero__meta div { padding: 2px 0; }

/* ─────────── 본문 공통 ─────────── */

.content { max-width: 1020px; }

.section { margin-top: 88px; }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 34px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section__title { margin: 0; color: var(--ink); }

.section__hint {
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-3);
}

/* ─────────── 갤러리 (비대칭 편집 그리드) ─────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: start;
  gap: 44px 30px;
}

/* 6장 단위로 넓게 → 7:5 → 5:7 → 넓게 반복 */
.photo { grid-column: span 12; }
.photo:nth-child(6n + 2) { grid-column: span 7; }
.photo:nth-child(6n + 3) { grid-column: span 5; }
.photo:nth-child(6n + 4) { grid-column: span 5; }
.photo:nth-child(6n + 5) { grid-column: span 7; }

.photo {
  margin: 0;
  text-align: left;
  cursor: zoom-in;
}

.photo__frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-2);
}
.photo:nth-child(6n + 1) .photo__frame,
.photo:nth-child(6n + 6) .photo__frame { aspect-ratio: 16 / 9; }
.photo:nth-child(6n + 2) .photo__frame,
.photo:nth-child(6n + 5) .photo__frame { aspect-ratio: 3 / 2; }
.photo:nth-child(6n + 3) .photo__frame,
.photo:nth-child(6n + 4) .photo__frame { aspect-ratio: 4 / 5; }

.photo__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s cubic-bezier(.16,.84,.28,1);
}
.photo:hover .photo__frame img { transform: scale(1.035); }

/* 캡션은 사진 위에 겹치지 않고 아래에 인쇄물처럼 */
.photo figcaption {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding-right: 8px;
}
.photo__num {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--ink-3);
  padding-top: 3px;
}
.photo__cap {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ─────────── 소감 ─────────── */

.section--note { margin-top: 96px; }

.note { max-width: var(--measure); }

.note p {
  margin: 0 0 26px;
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--ink-2);
  word-break: keep-all;
}
.note p:last-child { margin-bottom: 0; }

/* 첫 문단은 조금 크게 — 도입부처럼 */
.note p:first-child {
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink);
}

.note__quote {
  max-width: 26ch;
  margin: 56px auto !important;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 22px !important;
  line-height: 1.6 !important;
  text-align: center;
  letter-spacing: .01em;
  color: var(--ink) !important;
}

.rating {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 44px;
}
.rating__label { color: var(--ink-3); }
.rating__score {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
}
.rating__of { font-size: 11.5px; letter-spacing: .1em; color: var(--ink-3); }
.rating__meter { display: flex; gap: 5px; margin-left: 4px; }
.rating__tick {
  width: 26px;
  height: 2px;
  background: var(--line);
}
.rating__tick.is-on { background: var(--accent); }
.rating__tick.is-half {
  background: linear-gradient(to right, var(--accent) 50%, var(--line) 50%);
}

/* ─────────── 이전 / 다음 글 ─────────── */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

/* 이전/다음 글이 없을 때 채워지는 빈 칸 */
.pager > div { background: var(--paper); }

.pager__btn {
  background: var(--paper);
  padding: 30px 26px;
  text-align: left;
  transition: background .25s;
}
.pager__btn:hover { background: var(--paper-2); }
.pager__btn--next { text-align: right; }

.pager__dir { display: block; margin-bottom: 10px; color: var(--ink-3); }
.pager__name {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
}

/* ─────────── 라이트박스 ─────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(12,10,9,.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 74px 96px;
}
.lightbox[hidden] { display: none; }

.lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.lightbox__figure img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox__figure figcaption {
  display: flex;
  align-items: baseline;
  gap: 16px;
  max-width: 62ch;
}
.lightbox__count { color: rgba(255,255,255,.42); flex-shrink: 0; }
.lightbox__cap {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,.76);
}

.lightbox__close {
  position: absolute;
  top: 30px; right: 34px;
  font-size: var(--label-size);
  font-weight: 600;
  letter-spacing: var(--label-track);
  color: rgba(255,255,255,.6);
  transition: color .18s;
}
.lightbox__close:hover { color: #fff; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px; height: 54px;
  display: grid; place-items: center;
  font-size: 30px;
  line-height: 1;
  color: rgba(255,255,255,.45);
  transition: color .18s;
}
.lightbox__nav:hover { color: #fff; }
.lightbox__nav--prev { left: 22px; }
.lightbox__nav--next { right: 22px; }

/* ─────────── 푸터 ─────────── */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 46px 34px 60px;
  text-align: center;
}
.footer p { margin: 0; }
.footer p:first-child {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .06em;
  color: var(--ink-2);
}
.footer__sub {
  margin-top: 8px !important;
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--ink-3);
}

/* ─────────── 전환 효과 ─────────── */

.fade-in { animation: fade .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ─────────── 반응형 ─────────── */

@media (max-width: 1100px) {
  .layout { gap: 40px; }
  .hero__frame { min-height: 460px; }
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .topbar__inner { padding: 0 20px; gap: 26px; }
  .topnav { gap: 18px; }
  .search { width: 116px; }
  .search:focus { width: 140px; }

  .layout { grid-template-columns: 1fr; padding: 0 20px; }

  .sidebar {
    position: fixed;
    z-index: 45;
    top: var(--topbar-h);
    left: 0;
    width: 300px;
    height: calc(100vh - var(--topbar-h));
    background: var(--paper);
    border-right: 1px solid var(--line);
    padding: 26px 20px 0;
    transform: translateX(-102%);
    transition: transform .3s cubic-bezier(.2,.7,.3,1);
  }
  .sidebar.is-open { transform: none; }

  .main { padding: 26px 0 70px; }
  .hero__frame { min-height: 400px; }
  .hero__body { padding: 0 26px 32px; }
  .hero__meta { gap: 0 30px; }

  .section { margin-top: 62px; }
  .gallery { gap: 34px 20px; }

  .lightbox { padding: 70px 18px; }
  .lightbox__nav { width: 44px; height: 44px; }
}

@media (max-width: 620px) {
  .brand__rule, .brand__tag { display: none; }
  .search { display: none; }

  /* 좁은 화면에서는 한 장씩 */
  .photo,
  .photo:nth-child(6n + 2),
  .photo:nth-child(6n + 3),
  .photo:nth-child(6n + 4),
  .photo:nth-child(6n + 5) { grid-column: span 12; }
  .photo:nth-child(n) .photo__frame { aspect-ratio: 4 / 3; }

  .hero__title { max-width: none; }
  .note__quote { max-width: none; font-size: 19px !important; }
  .pager { grid-template-columns: 1fr; }
  .pager__btn--next { text-align: left; }
  .pager__btn { padding: 24px 18px; }
}
