/* =====================================================================
   맥스구조건축사사무소 — 공개 사이트 스타일
   전부 직접 작성. 외부 테마/프레임워크 코드 없음.
   서체: Pretendard (SIL Open Font License 1.1) — 상업적 사용 가능.
   ===================================================================== */

@font-face {
  font-family: "Pretendard";
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fg:          #1f2328;
  --fg-soft:     #4b5563;
  --muted:       #8b93a1;
  --line:        #e5e7eb;
  --line-strong: #d1d5db;
  --bg:          #ffffff;
  --bg-soft:     #f6f7f8;
  --accent:      #b8863b;
  --accent-dark: #96692a;
  --danger:      #b42318;
  --nav-h:       68px;
  --container:   1140px;
  --radius:      6px;
  --shadow:      0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  word-break: keep-all;      /* 한글 단어 중간에서 줄바꿈되지 않게 */
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--fg); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------ 헤더 / 내비 */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex; align-items: center; gap: 16px;
  height: var(--nav-h);
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  flex-shrink: 0;
}
.nav-brand img { height: 30px; width: auto; }
.nav-brand:hover { text-decoration: none; }

.nav-menu {
  display: flex; align-items: center; gap: 2px;
  flex: 1 1 auto; min-width: 0;
  margin: 0; padding: 0; list-style: none;
  flex-wrap: nowrap; justify-content: center;
  overflow: hidden;          /* 넘치는 항목은 nav.js 가 '•••' 로 접는다 */
}
.nav-menu a {
  display: block; padding: 8px 12px;
  font-size: 15px; font-weight: 600; color: var(--fg-soft);
  border-radius: var(--radius);
  transition: color .12s, background-color .12s;
  white-space: nowrap;
}
.nav-menu a:hover { color: var(--fg); background: var(--bg-soft); text-decoration: none; }
.nav-menu a[aria-current="page"] { color: var(--accent); }

/* 넘친 메뉴를 담는 '•••' 드롭다운 */
.nav-more { position: relative; flex-shrink: 0; }
.nav-more-btn {
  padding: 8px 12px; font: inherit; font-size: 15px; font-weight: 700;
  letter-spacing: .06em; line-height: 1;
  color: var(--fg-soft); background: none;
  border: 0; border-radius: var(--radius); cursor: pointer;
}
.nav-more-btn:hover { color: var(--fg); background: var(--bg-soft); }
.nav-more.is-open .nav-more-btn { color: var(--accent); background: var(--bg-soft); }

.nav-more-list {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 190px; max-height: 70vh; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
}
.nav-more.is-open .nav-more-list { display: block; }
.nav-more-list a { display: block; padding: 9px 12px; white-space: nowrap; }

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 9px; cursor: pointer; color: var(--fg);
}

/* ------------------------------------------------------------ 히어로 */

.hero {
  position: relative;
  min-height: min(72vh, 620px);
  display: flex; align-items: center;
  background: #2c2a26 center/cover no-repeat;
  color: #fff;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.42) 100%);
}
.hero > .container { position: relative; z-index: 1; width: 100%; padding-block: 72px; }

.hero-inner { display: flex; }
.hero[data-align="left"]   .hero-inner { justify-content: flex-start; text-align: left; }
.hero[data-align="center"] .hero-inner { justify-content: center;     text-align: center; }
.hero[data-align="right"]  .hero-inner { justify-content: flex-end;   text-align: right; }

.hero-text { max-width: 620px; }

.hero-title {
  margin: 0 0 20px;
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 800; letter-spacing: .02em; line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.hero-line {
  margin: 0; font-size: clamp(1rem, 2.1vw, 1.25rem); font-weight: 500;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
}
.hero-line + .hero-line { margin-top: 4px; }

/* ------------------------------------------------------------ 페이지 공통 */

main { min-height: 50vh; }

.page-head {
  padding: 56px 0 8px;
}
.page-title {
  margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 700;
  letter-spacing: -.02em;
}
.page-head p { margin: 8px 0 0; color: var(--muted); }

.section { padding: 48px 0 72px; }
.section--tight { padding-top: 24px; }

/* 본문 리치텍스트 */
.prose { font-size: 1.0625rem; color: var(--fg-soft); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--fg); font-weight: 700; letter-spacing: -.02em;
  margin: 2em 0 .6em; line-height: 1.35;
}
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.1rem; }
.prose p { margin: 0 0 1.1em; white-space: pre-line; }
.prose strong { color: var(--fg); font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; white-space: pre-line; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.prose img { margin: 1.5em 0; border-radius: var(--radius); }
.prose blockquote {
  margin: 1.5em 0; padding: .2em 0 .2em 1.2em;
  border-left: 3px solid var(--accent); color: var(--muted);
}
.prose hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 600; color: var(--fg); }

/* 홈의 'Direction of Maxstucture' 처럼 첫 강조 문단을 금색 소제목으로 */
.prose--accent-lead > p:first-child strong {
  display: block; color: var(--accent);
  font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em;
  margin-bottom: .2em;
}

.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------------ 갤러리 */

.gallery {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  list-style: none; margin: 0; padding: 0;
}
.gallery figure {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-soft);
}
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: #fff;
}
.gallery figcaption {
  padding: 10px 12px; font-size: .875rem; color: var(--muted);
  border-top: 1px solid var(--line); background: #fff;
}

/* ------------------------------------------------------------ 게시판 */

.board-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.board-count { color: var(--muted); font-size: .9375rem; }

.board {
  width: 100%; border-collapse: collapse;
  border-top: 2px solid var(--fg);
  font-size: .9375rem;
}
.board th, .board td {
  padding: 14px 12px; border-bottom: 1px solid var(--line);
  text-align: center; white-space: nowrap;
}
.board th { font-weight: 600; color: var(--fg-soft); background: var(--bg-soft); }
.board td.subject { text-align: left; white-space: normal; }
.board td.subject a { font-weight: 500; }
.board td.subject a:hover { color: var(--accent-dark); }
.board tbody tr:hover { background: var(--bg-soft); }
.board .empty { padding: 64px 12px; color: var(--muted); }

.badge-notice {
  display: inline-block; margin-right: 8px; padding: 1px 8px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  color: var(--accent-dark); background: rgba(184, 134, 59, .12);
  border-radius: 999px; vertical-align: 2px;
}

/* 글 보기 */
.post-head { border-top: 2px solid var(--fg); padding: 24px 4px 16px; border-bottom: 1px solid var(--line); }
.post-title { margin: 0 0 10px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .875rem; }
.post-body { padding: 32px 4px 40px; border-bottom: 1px solid var(--line); }
.post-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 24px; flex-wrap: wrap; }

/* ------------------------------------------------------------ 버튼 / 폼 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; font: inherit; font-size: .9375rem; font-weight: 600;
  color: var(--fg); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer; transition: background-color .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--danger { color: var(--danger); border-color: #f2c9c5; background: #fff; }
.btn--danger:hover { background: #fdf3f2; }
.btn--sm { padding: 6px 12px; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: 18px; }
.field > label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9375rem; }
.field .hint { margin-top: 6px; font-size: .8125rem; color: var(--muted); }

.input, .textarea, .select {
  width: 100%; padding: 10px 12px; font: inherit; font-size: .9375rem;
  color: var(--fg); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.input:focus, .textarea:focus, .select:focus, [contenteditable]:focus {
  outline: 2px solid rgba(184, 134, 59, .35); outline-offset: 1px;
  border-color: var(--accent);
}
.textarea { min-height: 160px; resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: .9375rem; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.form-narrow { max-width: 420px; }

.alert {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px;
  font-size: .9375rem; border: 1px solid;
}
.alert--error   { color: var(--danger); background: #fef3f2; border-color: #fecdca; }
.alert--success { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.alert--info    { color: #175cd3; background: #eff8ff; border-color: #b2ddff; }

/* ------------------------------------------------------------ 관리자 바 */

.admin-bar {
  position: sticky; top: var(--nav-h); z-index: 90;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 20px;
  background: #1f2328; color: #fff; font-size: .875rem;
}
.admin-bar a { color: #fff; font-weight: 600; }
.admin-bar .spacer { margin-left: auto; }
.admin-bar .chip {
  padding: 3px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
}
.admin-bar .chip:hover { background: rgba(255,255,255,.12); text-decoration: none; }

/* ------------------------------------------------------------ 푸터 */

.site-footer {
  margin-top: 80px; padding: 40px 0;
  background: var(--bg-soft); border-top: 1px solid var(--line);
  text-align: center; font-size: .875rem; color: var(--fg-soft);
}
.site-footer strong { display: block; margin-bottom: 8px; color: var(--fg); font-size: .9375rem; }
.site-footer p { margin: 3px 0; }
.site-footer .legal { margin-top: 18px; color: var(--muted); font-size: .8125rem; }

/* ------------------------------------------------------------ 반응형 */

@media (max-width: 960px) {
  .nav-menu { gap: 0; }
  .nav-menu a { padding: 8px 9px; font-size: 14px; }
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px; margin: 0;
    overflow: visible;              /* 모바일에서는 접지 않고 전부 펼친다 */
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav-more { display: none; }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { padding: 12px 14px; font-size: 15px; }
  .nav-brand { margin-right: auto; }

  .hero { min-height: 58vh; }
  .hero-inner { justify-content: flex-start !important; text-align: left !important; }

  .board th:nth-child(1), .board td:nth-child(1),
  .board th:nth-child(5), .board td:nth-child(5) { display: none; }
  .board th, .board td { padding: 12px 8px; }

  .page-head { padding-top: 36px; }
  .section { padding: 32px 0 56px; }
}

@media print {
  .site-header, .admin-bar, .site-footer, .board-toolbar, .post-nav { display: none; }
}
