:root {
  --cream: #fdf8f0;
  --ink: #1f2937;
  --muted: #6b7280;
  --orange: #f0a000;
  --orange-deep: #c27803;
  --line: #efe6d8;
  --card: #fff;
  --blue: #1d4ed8;
  --shadow: 0 14px 34px rgba(120, 90, 40, .10);
  --radius: 16px;
  --max: 1100px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  letter-spacing: -0.03em;
  line-height: 1.6;
  font-weight: 400;
}
/* type.css 가 굵기·자간 기본. 버튼 등 잔여 보정 */
.btn { font-weight: 500; }
a { color: inherit; text-decoration: none; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.wide { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* 메인 홈과 동일한 헤더 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253,248,240,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 18px; color: #b45309;
}
.brand img,
.brand .site-logo {
  height: 34px;
  width: auto;
  max-width: min(220px, 52vw);
  display: block;
  object-fit: contain;
}
.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.nav a, .nav button {
  border: 0; background: transparent; cursor: pointer; font: inherit;
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}
.nav a:hover, .nav button:hover { background: #fff; color: var(--orange-deep); }
.nav a.is-active { background: #fff; color: var(--orange-deep); }
.nav .primary {
  background: var(--orange); color: #fff !important;
}
.nav .primary:hover { filter: brightness(1.05); }

/* 햄버거 토글 (PC 숨김 · 메인과 동일) */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: #92400e;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.topbar.is-nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.topbar.is-nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.topbar.is-nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 공지 페이지 모바일: 햄버거 메뉴 */
@media (max-width: 820px) {
  .topbar-inner {
    min-height: 56px;
    flex-wrap: wrap;
    gap: 0;
    position: relative;
  }
  .brand .site-logo {
    height: 30px;
    max-width: min(180px, 58vw);
  }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    margin: 8px 0 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    max-width: none;
    overflow: visible;
  }
  .topbar.is-nav-open .nav { display: flex; }
  .nav a, .nav button {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    white-space: normal;
  }
  .nav a:active,
  .nav a:hover,
  .nav button:hover {
    background: #fff7ea;
    color: var(--orange-deep);
  }
}
@media (max-width: 520px) {
  .list {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero h1 { font-size: clamp(22px, 6vw, 30px); }
}

.hero { padding: 36px 0 10px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.03em; }
.hero p { margin: 10px 0 0; color: var(--muted); font-weight: 400; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 18px 0 8px;
}
.toolbar input, .toolbar select {
  height: 44px; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; font: inherit; background: #fff;
}
.toolbar input { flex: 1; min-width: 200px; }

/* 카드형 그리드 목록 */
.list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 16px 0 60px;
}
.list:has(.empty) {
  grid-template-columns: 1fr;
}
.item {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  min-height: 100%;
}
.item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(120, 90, 40, .14);
}
.item .cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #f3efe6, #ebe3d4);
  overflow: hidden;
  flex: 0 0 auto;
}
.item .cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .35s ease;
}
.item:hover .cover img { transform: scale(1.04); }
.item .cover-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 100%;
  color: #b0a08a;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.03em;
}
.item .pin-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
}
.item .body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}
.item .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #a07840;
  font-size: 12px;
  font-weight: 500;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff4d6;
  color: #b45309;
  font-size: 11px;
  font-weight: 500;
}
.item h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.03em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.item .summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
}
.item .meta-foot {
  margin-top: auto;
  padding-top: 6px;
  color: #b8955c;
  font-size: 12px;
  font-weight: 500;
}
.empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* detail */
.article { padding: 28px 0 70px; }
.article-head { margin-bottom: 22px; }
.article-head h1 {
  margin: 0; font-size: clamp(26px, 4vw, 36px); line-height: 1.25; letter-spacing: -0.03em;
}
.article-meta {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px;
  color: #a07840; font-size: 13px; font-weight: 500;
}
.article-cover {
  margin: 18px 0 24px; border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); background: #f3efe6;
  aspect-ratio: 16 / 9;
}
.article-cover img { width: 100%; height: 100%; display: block; object-fit: contain; }
.content-block { margin: 0 0 22px; }
.content-block.html,
.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: #1f2937;
}
.content-block.html p,
.article-body p { margin: 0 0 14px; }
.content-block.html h2, .content-block.html h3,
.article-body h2, .article-body h3 { margin: 22px 0 10px; letter-spacing: -0.03em; }
.content-block.html a,
.article-body a { color: var(--blue); text-decoration: underline; }
.content-block.html ul, .content-block.html ol,
.article-body ul, .article-body ol { padding-left: 1.2em; }

/* Inline images in body — width % applies to image only (no right white gap) */
.article-body img,
.content-block.html img,
.post-image-wrap img {
  max-width: 100%;
  height: auto !important;
  display: block;
  margin: 12px 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: transparent;
}
.post-image-wrap {
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: left; /* image sits left; no empty right box from centered full frame */
  background: transparent;
}
/* caption = same size/color as body text */
.post-caption,
.article-body .post-caption,
.image-block .caption {
  margin: 0 0 14px !important;
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: #1f2937 !important;
  text-align: left !important;
  font-weight: 400 !important;
}

/* legacy image-block (if any) */
.image-block {
  margin: 0 0 22px;
  text-align: left;
  background: transparent;
}
.image-block .frame {
  display: block;
  width: auto !important;
  max-width: 100%;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
.image-block img {
  display: block;
  height: auto;
  margin: 12px 0;
}
.back-row { margin: 28px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: 14px; cursor: pointer;
}
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-danger { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.btn-ghost { background: #fff; }

.footer {
  margin-top: 20px; padding: 28px 0 40px; background: #2a2118; color: #e7dccb;
}
.footer p { margin: 0 0 6px; font-size: 13px; color: #d6c7b0; }

@media (max-width: 960px) {
  .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 560px) {
  .list { grid-template-columns: 1fr; gap: 14px; }
  .item h2 { min-height: 0; font-size: 16px; }
}
