/* MOIM — 흰 바탕 + 다크그레이 텍스트, 포인트 컬러는 꼭 필요한 곳(선택 상태, 링크 hover)에만 */
:root {
  --white: #ffffff;
  --ink: #212121;
  --ink-2: #6b6b6b;      /* 보조 텍스트 */
  --line: #e6e6e6;
  --tile: #f2f2f2;       /* 사진 로딩 전 자리 */
  --point: #476C6C;      /* 메인 포인트 */
  --point-2: #6BA0A0;    /* 보조 포인트 */
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-heading: var(--font);   /* 관리자 페이지 > 디자인 에서 바뀜 */
  --font-body: var(--font);
  --w-heavy: 900;
  --w-light: 300;
  --logo-h: 28px;
  --gutter: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }
html { overflow-anchor: none; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: var(--w-light);
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--point); outline-offset: 3px; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

/* 강조 = Pretendard Black */
.brand, .label, .service h3, .filters button, .nav a, .lang button, .rates, .k, .card-name, .project-title, .back, .cat-nav a, .page-title, .about-def b {
  font-family: var(--font-heading);
  font-weight: var(--w-heavy);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 28px;
  padding: 18px max(var(--gutter), env(safe-area-inset-right)) 18px max(var(--gutter), env(safe-area-inset-left));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
}
.brand { font-size: 24px; letter-spacing: -.01em; text-transform: lowercase; }
.nav { display: flex; gap: 22px; font-size: 12px; letter-spacing: .06em; }
.nav a:hover, .rates:hover, .contact-list a:hover { color: var(--point); }
.lang { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.lang button { color: var(--ink-2); letter-spacing: .06em; }
.lang button[aria-pressed="true"] { color: var(--point); }

/* ---------- Hero ---------- */
.hero { padding: 8px var(--gutter) 0; }
.hero-figure { margin: 0; background: var(--tile); aspect-ratio: 3 / 2; max-height: 82vh; width: 100%; overflow: hidden; }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; }
.hero-text { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 14px 0 0; font-size: 13px; }
.hero-line { color: var(--ink); }
.hero-sub { color: var(--ink-2); }

/* ---------- Sections ---------- */
#view-home > section:not(.hero) { padding: clamp(72px, 10vw, 140px) var(--gutter) 0; scroll-margin-top: 40px; }
[hidden] { display: none !important; }
.label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Work ---------- */
/* 작업 카드 목록 (메인) */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(12px, 2vw, 28px); margin-top: 28px; }
.project-grid[data-count="1"] { grid-template-columns: 1fr; }
.project-card { display: flex; flex-direction: column; gap: 14px; }
.card-figure { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; background: var(--tile); }
.project-grid[data-count="1"] .card-figure { aspect-ratio: 16 / 9; }
.card-figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, opacity .3s; }
.project-card:hover .card-figure img { transform: scale(1.015); opacity: .94; }
@media (prefers-reduced-motion: reduce) { .card-figure img { transition: none; } .project-card:hover .card-figure img { transform: none; } }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-name { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; }
.project-card:hover .card-name { color: var(--point); }
.card-count { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.card-meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* 작업 상세 */
.project-page { padding: clamp(32px, 5vw, 64px) var(--gutter) 0; }
.back { font-size: 12px; letter-spacing: .08em; color: var(--ink-2); }
.back:hover { color: var(--point); }
.back-bottom { display: inline-block; margin-top: 32px; }
.project-title { font-size: clamp(34px, 6vw, 72px); line-height: 1.1; margin-top: 28px; letter-spacing: -.01em; }
.project-meta { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.filters { display: flex; gap: 20px; flex-wrap: wrap; margin: 28px 0 24px; font-size: 12px; letter-spacing: .08em; }
.filters button { color: #b0b0b0; padding-bottom: 4px; border-bottom: 1px solid transparent; }
.filters button:hover { color: var(--ink); }
.filters button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--point); }

.gallery { columns: 2; column-gap: clamp(12px, 2vw, 28px); }
.gallery .item { break-inside: avoid; margin: 0 0 clamp(12px, 2vw, 28px); cursor: zoom-in; background: var(--tile); }
.gallery .item img { width: 100%; transition: opacity .3s; }
.gallery .item:hover img { opacity: .92; }
.gallery .placeholder { display: grid; place-items: center; color: #b8b8b8; font-size: 11px; letter-spacing: .14em; font-weight: 900; cursor: default; }
.empty-note { font-size: 13px; color: var(--ink-2); margin-top: 8px; column-span: all; }

/* ---------- Services ---------- */
.service-list { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); margin-top: 32px; }
.service { border-top: 1px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.service h3 { font-size: 20px; }
.service p { font-size: 14px; color: var(--ink); }
.service .fine { font-size: 12px; color: var(--point); }
.coverage { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-top: 44px; font-size: 14px; color: var(--ink-2); }
.rates { color: var(--ink); font-size: 13px; letter-spacing: .04em; }

/* ---------- About ---------- */

/* ---------- Contact ---------- */
.contact-lead { margin-top: 20px; font-size: 17px; max-width: 40em; }
.contact-list { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); }
.contact-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.k { font-size: 12px; letter-spacing: .08em; }
.v { overflow-wrap: anywhere; user-select: all; }
.copy { font-size: 12px; color: var(--ink-2); }
.copy:hover { color: var(--point); }
.copy.done { color: var(--point-2); }

/* ---------- Footer ---------- */
.site-footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 120px var(--gutter) 32px; font-size: 11px; color: var(--ink-2); }

/* ---------- Lightbox ---------- */
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: var(--ink); display: grid; place-items: center; padding: 56px 64px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 112px); width: auto; height: auto; object-fit: contain; }
.lightbox button { position: absolute; color: var(--white); font-size: 22px; width: 48px; height: 48px; opacity: .7; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 8px; font-size: 30px !important; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #9a9a9a; font-size: 12px; letter-spacing: .1em; }
body.lb-open { overflow: hidden; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .site-header { grid-template-columns: 1fr auto; gap: 12px 20px; }
  .nav { grid-column: 1 / -1; order: 3; gap: 18px; }
  .gallery { columns: 1; }
  .service-list { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 20px; }
  .about-body, .contact-lead { font-size: 16px; }
  .contact-list li { grid-template-columns: 1fr auto; }
  .contact-list .k { grid-column: 1 / -1; }
  .lightbox { padding: 56px 8px; }
  .lb-prev, .lb-next { top: auto !important; bottom: 4px; transform: none !important; }
}

@media (max-width: 760px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-grid[data-count="1"] .card-figure { aspect-ratio: 3 / 2; }
}
.load-error { padding: 16px var(--gutter); background: #fff3f0; color: #a33; font-weight: 900; }

/* 카드 사진은 흑백 (흑백 보정본이 아니어도 흑백으로 보이게) */
.card-figure img { filter: grayscale(1); }

/* 작업 화면: 카테고리 카드 */
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(12px, 2vw, 28px); margin-top: clamp(32px, 4vw, 56px); }
.category-grid[data-count="1"] { grid-template-columns: 1fr; }
.category-grid .card-name { text-transform: uppercase; letter-spacing: .02em; }
.category-title { text-transform: uppercase; }
.project-page .gallery { margin-top: clamp(28px, 4vw, 48px); }

/* 카테고리 화면 아래: 이전 / 다음 카테고리 */
.cat-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; letter-spacing: .06em; }
.cat-nav a { color: var(--ink-2); text-transform: uppercase; }
.cat-nav a:hover { color: var(--point); }
.cat-nav .next { margin-left: auto; text-align: right; }

@media (max-width: 760px) { .category-grid { grid-template-columns: 1fr; } }

/* ---------- 독립 페이지 (서비스 · 소개 · 문의) ---------- */
.page { padding: clamp(32px, 5vw, 64px) var(--gutter) 0; }
.page-title { font-size: clamp(34px, 6vw, 72px); line-height: 1.1; letter-spacing: -.01em; margin-bottom: clamp(28px, 4vw, 56px); }
.page .service-list { margin-top: 0; }
.page .contact-lead { margin-top: 0; }

/* 지금 보고 있는 메뉴 */
.nav a[aria-current="page"] { color: var(--point); }

/* 소개: 프로필 사진 + 글 */
.about-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.about-layout.no-photo { grid-template-columns: minmax(0, 1fr); }
.profile { margin: 0; background: var(--tile); aspect-ratio: 4 / 5; overflow: hidden; }
.profile img { width: 100%; height: 100%; object-fit: cover; }
.about-body { display: flex; flex-direction: column; gap: 16px; font-size: 17px; line-height: 1.85; max-width: 52em; text-wrap: pretty; }
.about-def { font-size: clamp(19px, 2vw, 22px); line-height: 1.6; padding-bottom: 20px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }


@media (max-width: 760px) {
  .about-layout { grid-template-columns: minmax(0, 1fr); }
  .profile { max-width: 420px; }
  .about-body { font-size: 16px; }
}
.about-body p { white-space: pre-line; }

/* site.yaml 글 안의 // : 휴대폰에서만 줄바꿈 */
.m-br { display: none; }
@media (max-width: 760px) { .m-br { display: inline; } }

/* 문의: 링크가 있는 연락처 표시 */
.contact-list a.v { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.contact-list a.v:hover { text-decoration-color: var(--point); }
.copy.open { white-space: nowrap; }

/* 문의: 연락처 이름(EMAIL, INSTAGRAM, WHATSAPP)은 영문 대문자로 */
.contact-list .k { text-transform: uppercase; }

/* 로고 이미지 (관리자 페이지에서 올림) */
.brand.has-logo { display: inline-flex; align-items: center; }
.brand.has-logo img { height: var(--logo-h); width: auto; max-width: 60vw; display: block; }
