/* ===== KINN Ghost Theme — style.css ===== */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
main { width: 100%; }

/* {{navigation}} 헬퍼 출력 <ul class="nav"> 글로벌 리셋 */
ul.nav { list-style: none; margin: 0; padding: 0; }

:root {
  --black: #111;
  --dark: #1a1a1a;
  --gray-900: #222;
  --gray-800: #333;
  --gray-700: #444;
  --gray-600: #666;
  --gray-500: #888;
  --gray-400: #aaa;
  --gray-300: #ccc;
  --gray-200: #e5e5e5;
  --gray-100: #f2f2f2;
  --white: #fff;
  --max-width: 1200px;
  --header-height: 64px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  height: var(--header-height);
  width: 100%;
}
/* fixed 헤더만큼 본문 여백 확보 */
body { padding-top: var(--header-height); }

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.site-logo img {
  height: 36px;
  width: auto;
}

.site-nav { display: flex; align-items: center; gap: 28px; }

/* {{navigation}} 헬퍼 출력: <ul class="nav"><li><a> */
.site-nav .nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav .nav li a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: color 0.2s;
  letter-spacing: -0.01em;
}
.site-nav .nav li a:hover { color: var(--black); }
.site-nav .nav li.nav-current a { color: var(--black); font-weight: 700; }

.nav-support {
  background: var(--black);
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: 4px;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  transition: background 0.2s;
}
.nav-support:hover { background: var(--gray-800); }

/* Secondary nav: 데스크톱에서 숨김 */
.mobile-secondary-nav { display: none; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
  flex-shrink: 0;
  z-index: 110;
}
.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--black);
  position: absolute;
  left: 6px;
  transition: all 0.3s;
}
.mobile-menu-toggle span:nth-child(1) { top: 9px; }
.mobile-menu-toggle span:nth-child(2) { top: 15px; }
.mobile-menu-toggle span:nth-child(3) { top: 21px; }

.mobile-menu-toggle.is-active span:nth-child(1) { top: 15px; transform: rotate(45deg); }
.mobile-menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.is-active span:nth-child(3) { top: 15px; transform: rotate(-45deg); }

/* --- Hero --- */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 80px 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content { max-width: 520px; }

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--gray-600);
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 20px;
  color: var(--gray-400);
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero h1 a { color: inherit; }
.hero h1 a:hover { text-decoration: underline; }

.hero p {
  font-size: 1.05rem;
  color: var(--gray-400);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-image {
  aspect-ratio: 16/10;
  border-radius: 4px;
  overflow: hidden;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Section Common --- */
.section { padding: 64px 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--black);
  padding-bottom: 12px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-more {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.section-more:hover { color: var(--black); }
.section-more::after { content: '\2192'; }

.section--alt { background: var(--gray-100); }

/* --- Card --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.card-image {
    display: block;
    width: 100%;
  aspect-ratio: 16/9;
  background: var(--gray-200);
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body { padding: 20px; }

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: inherit; }
.card-title a:hover { text-decoration: underline; }

.card-excerpt {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-meta {
  font-size: 0.78rem;
  color: var(--gray-500);
  display: flex;
  gap: 12px;
}

/* --- News/Announcements (소식) --- */
.news-list { display: flex; flex-direction: column; }

.news-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-200);
  transition: background 0.15s;
}
.news-item:first-child { border-top: 1px solid var(--gray-200); }
.news-item:hover { background: var(--gray-100); margin: 0 -12px; padding: 20px 12px; }

.news-date {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-title-wrap { min-width: 0; }

.news-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.news-title a { color: inherit; }
.news-item:hover .news-title a { text-decoration: underline; }

.news-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.news-badge--notice { background: var(--black); color: var(--white); }

/* --- CTA Banner --- */
.cta-banner {
  padding: 64px 0;
  text-align: center;
  border-top: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
}

.cta-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta-desc {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-btn {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 14px 40px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.2s;
}
.cta-btn:hover { background: var(--gray-800); }

/* --- Member Logo Grid --- */
.member-logo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.member-logo-item {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: opacity 0.2s;
}
.member-logo-item img { max-height: 48px; max-width: 100%; width: auto; object-fit: contain; }
.member-logo-item:hover { opacity: 0.7; }

.member-section-desc {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--gray-500);
}
.member-section-desc a { color: var(--black); font-weight: 600; border-bottom: 1px solid var(--gray-400); }
.member-section-desc a:hover { border-color: var(--black); }

/* --- Footer --- */
.site-footer {
  background: var(--black);
  color: var(--gray-400);
  padding: 48px 0 32px;
  width: 100%;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .site-logo { color: var(--white); margin-bottom: 12px; }

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--gray-500);
  max-width: 320px;
}

/* {{navigation}} 헬퍼 출력: <ul class="nav"><li><a> */
.footer-nav .nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav .nav li a {
  display: block;
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer-nav .nav li a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--gray-600);
}

.footer-legal a { margin-left: 20px; color: var(--gray-600); transition: color 0.2s; }
.footer-legal a:hover { color: var(--gray-400); }

/* --- Single Post --- */
.post-full {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.post-full-header { margin-bottom: 32px; }

.post-full-tag {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ghost-accent-color);
  margin-bottom: 12px;
}
.post-full-tag a { color: inherit; }
.post-full-tag a:hover { color: var(--black); }

.post-full-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.post-full-meta {
  font-size: 0.88rem;
  color: var(--gray-500);
  display: flex;
  gap: 16px;
  justify-content: end;
}

.post-full-image {
  margin-bottom: 32px;
  border-radius: 4px;
  overflow: hidden;
}
.post-full-image img { width: 100%; }

.post-full-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-800);
}
.post-full-content h2 { font-size: 1.5rem; font-weight: 700; margin: 40px 0 16px; color: var(--black); }
.post-full-content h3 { font-size: 1.2rem; font-weight: 700; margin: 32px 0 12px; color: var(--black); }
.post-full-content p { margin-bottom: 20px; }
.post-full-content a { color: var(--black); border-bottom: 1px solid var(--gray-400); }
.post-full-content a:hover { border-color: var(--black); }
.post-full-content blockquote {
  border-left: 3px solid var(--black);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--gray-600);
  font-style: italic;
}
.post-full-content img { border-radius: 4px; margin: 24px 0; }
.post-full-content figure { margin: 24px 0; }
.post-full-content figcaption { font-size: 0.85rem; color: var(--gray-500); margin-top: 8px; text-align: center; }

/* Ghost editor content cards (Koenig) */
.kg-cta-card {
    margin: 20px 0;
}
.kg-cta-card .kg-cta-content-inner {
    gap: 0;
}

.kg-width-wide {
  margin-left: -80px;
  margin-right: -80px;
  max-width: calc(100% + 160px);
}
.kg-width-full {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  max-width: 100vw;
  width: 100vw;
}
.kg-width-wide img,
.kg-width-full img {
  width: 100%;
}
.kg-image-card { margin: 24px 0; }
/* .kg-image-card img { border-radius: 4px; } */
.kg-embed-card { 
    margin: 24px 0; 
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 임베드 iframe(YouTube, Vimeo 등)을 부모 너비에 꽉 채우고 16:9 유지 */
.kg-embed-card iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}
.kg-gallery-card { margin: 24px 0; }
.kg-gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
.kg-bookmark-card { margin: 24px 0; }
.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.kg-bookmark-content { padding: 16px; flex: 1; }
.kg-bookmark-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.kg-bookmark-description { font-size: 0.85rem; color: var(--gray-600); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.78rem; color: var(--gray-500); }
.kg-bookmark-icon { width: 16px; height: 16px; }
.kg-bookmark-thumbnail { width: 200px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* --- Tag Archive --- */
.tag-header {
  padding: 48px 0;
  border-bottom: 2px solid var(--black);
}
.tag-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tag-header p {
  font-size: 1rem;
  color: var(--gray-600);
  margin-top: 8px;
}

.tag-feed {
  padding: 48px 0;
}

/* --- Page --- */
.page-full {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-full-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.page-full-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-800);
}
.page-full-content h2 { font-size: 1.5rem; font-weight: 700; margin: 40px 0 16px; color: var(--black); }
.page-full-content p { margin-bottom: 20px; }

/* --- Members Directory (page-members.hbs) --- */
.page-members { max-width: 860px; }
.page-members .page-full-content { margin-bottom: 48px; }

.members-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--black);
  margin-bottom: 0;
  margin-top: 48px;
}
.members-section-title:first-of-type { margin-top: 0; }

.members-directory {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 48px;
}
/* 회원사가 없는 빈 섹션 숨김 */
.members-directory:empty { display: none; }
.members-directory:empty + .members-section-title { display: none; }
.members-section-title + .members-directory:empty { display: none; }

.member-profile {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  align-items: start;
  padding: 40px 0;
  border-bottom: 1px solid var(--gray-200);
}
.member-profile:first-child { border-top: 1px solid var(--gray-200); }

.member-profile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  background: var(--gray-100);
  border-radius: 4px;
  padding: 16px;
}
.member-profile-logo img {
  max-height: 60px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}
.member-profile-logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-600);
  text-align: center;
}

.member-profile-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--black);
}

.member-profile-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--gray-700);
  margin-bottom: 16px;
}

.member-profile-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  border: 1px solid var(--gray-300);
  padding: 8px 20px;
  border-radius: 4px;
  transition: all 0.2s;
}
.member-profile-link:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 40px 0;
  font-size: 0.9rem;
  color: var(--gray-500);
}
.pagination a {
  color: var(--black);
  font-weight: 600;
  padding: 8px 20px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  transition: all 0.2s;
}
.pagination a:hover { background: var(--black); color: var(--white); border-color: var(--black); }

/* --- Mobile --- */
@media (max-width: 768px) {
  .mobile-menu-toggle { display: block; }

  .site-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 24px 40px;
    gap: 0;
    z-index: 105;
  }
  .site-nav.is-open { display: flex; }
  .site-nav .nav {
    flex-direction: column;
    gap: 0;
    align-items: center;
    width: 100%;
    max-width: 320px;
  }
  .site-nav .nav li a {
    padding: 16px 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: block;
    text-align: center;
    color: var(--black);
  }
  .site-nav .nav li.nav-current a { font-weight: 800; }
  .site-nav .nav-support {
    margin-top: 24px;
    text-align: center;
    padding: 14px 40px;
    font-size: 1rem !important;
  }
  /* 모바일 secondary navigation */
  .site-nav .mobile-secondary-nav {
    display: block;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    width: 100%;
    max-width: 320px;
  }
  .site-nav .mobile-secondary-nav .nav {
    flex-direction: column;
    gap: 0;
    align-items: center;
  }
  .site-nav .mobile-secondary-nav .nav li a {
    padding: 12px 0;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--gray-600);
  }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { display: none; }
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 48px 0; }

  .card-grid { grid-template-columns: 1fr 1fr; }

  .member-logo-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .member-logo-item { height: 56px; }
  .member-logo-item img { max-height: 36px; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .news-item { grid-template-columns: 1fr auto; }
  .news-date { display: none; }

  .post-full-title { font-size: 1.6rem; }
  .page-full-title { font-size: 1.6rem; }

  .member-profile {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 32px 0;
  }
  .member-profile-logo { height: 80px; max-width: 200px; }
}

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