/* =========================================================
   choeis.com 디자인 파일
   색과 글씨체는 맨 위 :root 에서 한 번에 바꿀 수 있습니다.
   ========================================================= */
:root {
  --paper: #fdfdfb;      /* 바탕 */
  --ink: #1a1a18;        /* 글자 */
  --ink-soft: #4a4a44;   /* 보조 글자 (날짜, 부제) */
  --line: #e2e1db;       /* 가는 선 */
  --accent: #e0874a;     /* 선택된 메뉴 색 */
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --wide: 1240px;        /* 페이지 최대 너비 */
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
html { overflow-x: hidden; }   /* 옛 사파리용: 화면이 옆으로 밀리지 않게 */
@supports (overflow-x: clip) { html { overflow-x: visible; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-x: clip;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 18px 32px;
}

/* ---------- 머리 (스노우캣식 한 줄) ---------- */
/* 야구공의 가운데가 가로줄과 같은 높이에 오도록 배치합니다.
   1줄: (빈칸) | 메뉴 버튼   2줄: 야구공 | 가로줄   3줄: (빈칸) | 메뉴 */
.site-head {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 2px auto;
  column-gap: 12px;
  align-items: center;
}
.head-top { grid-column: 2; grid-row: 1; display: flex; justify-content: flex-end; margin-bottom: 4px; }
.logo { grid-column: 1; grid-row: 2; align-self: center; margin-block: -17px; }
.logo img { width: 36px; height: 36px; display: block; transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.logo:hover img { transform: rotate(-25deg); }
.menu-btn { background: none; border: 0; padding: 6px 2px; cursor: pointer; display: grid; gap: 4px; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
.head-line { grid-column: 2; grid-row: 2; height: 2px; background: var(--ink); border-radius: 2px; }
.top-nav { grid-column: 2; grid-row: 3; margin-top: 8px; }
.top-nav { display: flex; justify-content: space-between; gap: 8px; }
.top-nav a { font-weight: 700; font-size: clamp(14px, 3.6vw, 17px); letter-spacing: .05em; padding: 2px 0; transition: color .2s; }
.top-nav a:hover, .top-nav a[aria-current="page"] { color: var(--accent); }

/* ---------- 표지 ---------- */
.cover { margin: 32px auto 0; max-width: 1100px; }
.cover-art { position: relative; }
.cover-art > img { display: block; width: 100%; height: auto; }
.spots { position: absolute; inset: 0; width: 100%; height: 100%; }
.spot { cursor: pointer; outline: none; }
.spot rect { fill: transparent; stroke: transparent; stroke-width: 3; transition: stroke .2s, fill .2s; }
.spot:hover rect, .spot:focus-visible rect { fill: rgba(255, 255, 255, .12); stroke: rgba(255, 255, 255, .85); stroke-dasharray: 8 7; }
.spot-tag {
  position: absolute; transform: translate(-50%, -120%);
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  background: var(--ink); color: #fff; padding: 2px 10px; border-radius: 999px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s, transform .25s;
}
.spot-tag.on { opacity: 1; transform: translate(-50%, -150%); }

/* ---------- 메뉴 제목과 분류 탭 ---------- */
.section { margin-top: 34px; }
.sec-title { text-align: center; font-weight: 800; font-size: clamp(38px, 10vw, 66px); line-height: 1.05; margin: 0; letter-spacing: -.02em; }
/* 분류가 많아 한 줄에 다 안 들어가면 옆으로 밀어서 봅니다 (PC·휴대폰 모두 한 줄) */
.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; gap: 8px clamp(16px, 2.4vw, 26px); margin: 26px 0 36px; padding: 0; list-style: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.scrolls { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
.tabs.scrolls.at-end { -webkit-mask-image: linear-gradient(to left, #000 85%, transparent); mask-image: linear-gradient(to left, #000 85%, transparent); }
.tabs li { flex: none; }
.tabs li:first-child { margin-left: auto; }
.tabs li:last-child { margin-right: auto; }
.tabs button { font-weight: 600; font-size: clamp(15px, 1.4vw, 17px); letter-spacing: -.01em; color: var(--ink); background: none; border: 0; border-bottom: 3px solid transparent; padding: 2px 0 6px; cursor: pointer; }
.tabs button[aria-pressed="true"] { font-weight: 700; color: var(--accent); border-color: var(--accent); }

/* ---------- 글 카드 (디에디트식) ---------- */
/* 카드는 PC·휴대폰 모두 같은 모양이고, 한 줄에 놓이는 개수만 화면 폭에 따라 2개 → 4개로 바뀝니다. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 4vw, 50px) clamp(14px, 2.4vw, 30px); }
.card { display: grid; grid-template-columns: 1fr; align-content: start; min-width: 0; }
.pic { position: relative; overflow: hidden; aspect-ratio: 4 / 5; }
.pic svg, .pic img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
/* 글 카드 (사진 없는 글) : 줄 노트 위에 본문 첫머리 */
.pic-text {
  --lh: 1.85em;
  background-color: #f8f5ee;
  background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 1px), rgba(26, 26, 24, .09) calc(var(--lh) - 1px));
  background-size: 100% var(--lh);
  background-position: 0 clamp(40px, 5vw, 60px);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: clamp(13px, 1.25vw, 16px);
}
.pic-text .q { position: absolute; left: clamp(10px, 1.4vw, 18px); top: clamp(2px, .6vw, 8px); font-size: clamp(36px, 4vw, 54px); font-weight: 800; line-height: 1; color: var(--accent); }
.pic-text .excerpt {
  position: absolute; left: clamp(12px, 1.6vw, 20px); right: clamp(12px, 1.6vw, 20px); top: clamp(40px, 5vw, 60px);
  margin: 0; line-height: var(--lh); color: var(--ink); letter-spacing: -.01em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; line-clamp: 7; overflow: hidden;
}
.pic-text .pic-label { color: var(--ink); text-shadow: none; }
@media (max-width: 699px) { .pic-text .excerpt { -webkit-line-clamp: 4; line-clamp: 4; } }
/* 페이지 번호 */
.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 48px 0 0; }
.pager button { font: inherit; font-size: 15px; font-weight: 600; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 999px; border: 0; background: none; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.pager button:hover:not(:disabled):not([aria-current]) { background: #efede6; }
.pager button[aria-current="page"] { background: var(--ink); color: var(--paper); }
.pager button:disabled { color: #c4c3bc; cursor: default; }
.pager button[aria-label] { font-size: 22px; line-height: 1; }
.pic-label { position: absolute; left: clamp(10px, 1.2vw, 14px); bottom: clamp(8px, 1vw, 10px); font-weight: 800; font-size: clamp(13px, 1.3vw, 16px); letter-spacing: .03em; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.meta { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; min-width: 0; }
.meta > a { grid-column: 1 / -1; margin-top: clamp(12px, 1.6vw, 18px); }
.card h2 { font-weight: 700; font-size: clamp(17px, 2.1vw, 25px); line-height: 1.42; margin: 0; letter-spacing: -.03em; text-wrap: balance; }
/* 카드 줄 맞춤: 제목·부제는 최대 2줄, 넘치면 … 으로 줄이고, 짧아도 2줄 높이를 차지해서 날짜 줄이 나란히 맞습니다 */
.card h2, .card .dek { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.card h2 { min-height: calc(2em * 1.42); text-wrap: initial; }
.card .dek { min-height: calc(2em * 1.6); }
.card a:hover h2 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.dek { font-size: clamp(14px, 1.2vw, 15px); color: var(--ink-soft); margin: 8px 0 0; line-height: 1.6; }
.card .dek { grid-column: 1; }
time { display: block; font-weight: 500; font-size: clamp(13px, 1.1vw, 14px); color: var(--ink-soft); margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.card time { grid-column: 1; }
.kicker { font-weight: 700; font-size: 13px; letter-spacing: .02em; margin: 0 0 6px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-soft); }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- 글 보기 ---------- */
.article { margin-top: 22px; }
@media (max-width: 1272px) { .bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); } }
.hero { aspect-ratio: auto; height: min(56.25vw, 520px); }
.hero .pic-label { display: none; }
.band { background: #f3efe6; padding-block: clamp(30px, 4vw, 48px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.band-in { max-width: 900px; margin: 0 auto; }
.band h1 { font-weight: 800; font-size: clamp(28px, 7.4vw, 44px); line-height: 1.4; margin: 8px 0 0; letter-spacing: -.03em; text-wrap: balance; }
.band h1 span { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 7px; }
.band .dek { font-weight: 600; font-size: 18px; color: var(--ink); margin-top: 16px; }
.band .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 16px; }
.body { max-width: 680px; margin: 38px auto 0; }
.body p { font-size: 17px; line-height: 1.9; margin: 0 0 1.3em; letter-spacing: -.015em; }
.body figure { margin: 28px 0; }
.body figure img { width: 100%; display: block; }
/* 본문 속 영상·유튜브·파일·링크 */
.body video { width: 100%; display: block; background: #000; border-radius: 4px; }
.embed-box { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #111; border-radius: 4px; overflow: hidden; }
.embed-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.body figcaption { margin-top: 8px; font-size: 13px; text-align: right; }
.body figcaption a { color: var(--ink-soft); }
.body figcaption a:hover { color: var(--accent); }
.in-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.file-card, .link-card { display: grid; align-items: center; gap: 4px 14px; margin: 24px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .2s; }
.file-card:hover, .link-card:hover { border-color: var(--accent); }
.file-card { grid-template-columns: auto minmax(0, 1fr) auto; }
.fc-icon { width: 44px; height: 52px; border-radius: 6px; background: #f3efe6; display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--ink-soft); }
.fc-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.fc-go, .lc-go { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.link-card { grid-template-columns: minmax(0, 1fr) auto; }
.lc-host { grid-column: 1; font-weight: 700; font-size: 15px; }
.lc-url { grid-column: 1; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-go { grid-column: 2; grid-row: 1 / 3; font-size: 18px; }
/* 글 아래: 같은 카테고리 다른 글 */
.more-posts { margin-top: 64px; padding-top: 34px; border-top: 2px solid var(--ink); }
.more-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 26px; }
.more-head h2 { margin: 0; font-size: clamp(19px, 2vw, 22px); font-weight: 800; letter-spacing: -.01em; }
.more-head a { font-size: 14px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.more-head a:hover { color: var(--accent); }
.back { display: inline-block; margin-top: 24px; font-weight: 700; font-size: 15px; }
.back:hover { color: var(--accent); }

/* ---------- 프로필 ---------- */
.profile-body { max-width: 760px; margin: 0 auto; }
.intro { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(14px, 2.4vw, 20px); align-items: start; }
.intro-logo { width: 34px; height: 34px; margin-top: -1px; }   /* 홈 버튼·명함 공과 같은 크기 */
.intro-text p { font-size: 17px; line-height: 1.85; margin: 0 0 .8em; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 22px 0 0; font-size: 15px; border-top: 1px solid var(--line); padding-top: 18px; }
.facts dt { font-weight: 700; }
.facts dd { color: var(--ink-soft); }
.facts dd { margin: 0; min-width: 0; }

.namecard {
  max-width: 440px; margin: 0 auto; aspect-ratio: 9 / 5.4;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(40, 35, 25, .08);
  padding: clamp(18px, 5vw, 28px); display: grid; grid-template-rows: auto auto 1fr; position: relative;
}
.nc-logo { position: absolute; right: clamp(14px, 4vw, 22px); top: clamp(14px, 4vw, 20px); width: clamp(28px, 8vw, 34px); height: auto; aspect-ratio: 1; }
.nc-name { margin: 0; font-size: clamp(20px, 5.6vw, 24px); font-weight: 800; letter-spacing: -.02em; }
.nc-name small { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-left: 4px; letter-spacing: .04em; }
.nc-role { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.nc-rows { align-self: end; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: clamp(12px, 3.4vw, 14px); line-height: 1.6; }
.nc-rows dt { font-weight: 700; letter-spacing: .02em; }
.nc-rows dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- 전체 메뉴 (디에디트식) ---------- */
/* 메뉴는 화면 오른쪽에서 반쯤 밀려 나오는 패널입니다. 패널 너비는 --panel 로 조절합니다. */
.overlay { --panel: clamp(300px, 50vw, 620px); position: fixed; inset: 0; z-index: 20; background: rgba(26, 26, 24, 0); transition: background .3s; }
.overlay.open { background: rgba(26, 26, 24, .38); }
.overlay > .wrap {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--panel); max-width: 100%; margin: 0;
  background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
  padding-top: calc(22px + env(safe-area-inset-top, 0px)); padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  padding-left: clamp(20px, 3vw, 40px); padding-right: calc(clamp(20px, 3vw, 40px) + env(safe-area-inset-right, 0px));
  box-shadow: -12px 0 40px rgba(26, 26, 24, .12);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.overlay.open > .wrap { transform: translateX(0); }
html.menu-open { overflow: hidden; }
.ov-top { display: flex; justify-content: space-between; align-items: center; }
.ov-top .name { font-weight: 800; font-size: 22px; letter-spacing: -.01em; }
.close-btn { background: none; border: 0; cursor: pointer; font-size: 34px; line-height: 1; padding: 0 4px; color: var(--ink); }
.ov-list { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ov-list > li > button { font-weight: 800; font-size: clamp(30px, 3.4vw, 42px); background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--ink); text-align: left; letter-spacing: -.01em; }
.ov-list > li.open > button { color: var(--accent); }
.ov-list ul { list-style: none; margin: 6px 0 16px 24px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ov-list ul a { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.ov-list ul a:hover { color: var(--accent); }

/* ---------- 검색 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search-form svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search-form { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 26px auto 0; border-bottom: 3px solid var(--ink); padding-bottom: 8px; }
.search-form svg { flex: none; width: 24px; height: 24px; }
.search-form input { flex: 1; min-width: 0; font: inherit; font-size: clamp(17px, 2vw, 20px); font-weight: 500; border: 0; background: transparent; color: var(--ink); padding: 6px 0; outline: none; }
.search-form input::placeholder { color: #9a9a92; }
.search-form input::-webkit-search-cancel-button { cursor: pointer; }
.search-form button[type="submit"] { flex: none; font: inherit; font-size: 14px; font-weight: 700; background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 6px 16px; cursor: pointer; }
.search-form button[type="submit"]:hover { background: var(--accent); }
.result-count { text-align: center; color: var(--ink-soft); margin: 22px 0 34px; font-size: 15px; }
.result-count b { color: var(--ink); }
mark { background: #fde3c8; color: inherit; border-radius: 3px; padding: 0 2px; }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.taglist a { font-size: 14px; font-weight: 500; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; transition: border-color .2s, color .2s; }
.taglist a:hover { border-color: var(--accent); color: var(--accent); }
.tag-box { max-width: 760px; margin: 56px auto 0; padding-top: 24px; border-top: 1px solid var(--line); }
.tag-title { font-weight: 700; font-size: 15px; margin: 0 0 14px; }
.tag-box .taglist { justify-content: flex-start; }
.article-tags { margin-top: 8px; }
.ov-search { margin-top: 26px; }
.ov-search .search-form { max-width: none; margin: 0; }
.ov-search .quick { margin-top: 16px; }

/* ---------- 관리자에게만 보이는 것 ---------- */
.owner-edit { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 20px; font-size: 14px; font-weight: 700; padding: 8px 16px; border: 1.5px dashed var(--accent); color: var(--accent); border-radius: 999px; }
.owner-edit small { font-weight: 500; color: var(--ink-soft); }
.owner-edit:hover { background: #fff3e8; }
.profile-owner { text-align: center; margin-top: 28px; }
.owner-link { color: var(--accent); font-weight: 600; }
.site-foot { user-select: none; -webkit-user-select: none; }

/* ---------- 맨 위로 버튼 ---------- */
.to-top {
  position: fixed; z-index: 15;
  right: calc(max(16px, env(safe-area-inset-right, 0px)) + 4px);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 14px rgba(30, 25, 20, .12);
  transition: background .2s, color .2s, transform .2s;
}
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.to-top:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

.site-foot { margin-top: 48px; text-align: center; font-size: 13px; color: var(--ink-soft); letter-spacing: .02em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
