/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}


:root {
  --input-body1-font-family: "Asta Sans", sans-serif;
  --input-body1-font-weight: 300;
  --input-body1-font-size: 16px;
  --input-body1-line-height: 1.6em;
  --input-button-font-family: "Gowun Dodum", sans-serif;
  --input-button-font-weight: 300;
  
  --background-color: #f5f5f5;
  --color-text: #111111;
  --color-border: #AEB8BD;
  --color-button-link: var(--background-color);
  --color-button-link-hover: #D8DEE2;
  --color-button-closed: #D8DEE2;
  --color-key: #3F8C92;
}

/* 스크롤바 */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.25);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,0,0,0.45);
}

/* ------------------------------- */
/* 전체 */
/* ------------------------------- */

html {
  height: 100%;
  margin: 0;
}

body {
    margin: 0;
    font-family: var(--input-body1-font-family);
    font-size: var(--input-body1-font-size);
    color: var(--color-text);
    height: 100%;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
}

header > h1{
  display: block;
  margin-bottom: 0;
  font-weight: 900;
}

h1 > a:hover {
  font-weight: 900;
  color: var(--color-key)
}

.inquiry-btn {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  text-decoration: none;
  color: var(--color-key);
}

.inquiry-btn:hover {
  font-weight: 500;
  border-color: var(--color-key);
  background-color: var(--color-key);
  color: #fff;
  transition: 0.2s ease;
}

p {
    margin: 1em 0;
    line-height: var(--input-body1-line-height);
}

h1 {
    font-family: var(--input-body1-font-family);
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 50px;
}

h2 {
    font-family: var(--input-body1-font-family);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 45px;
}

h2 > span {
  font-weight: 500;
  font-size: 18px;
  word-break: keep-all;
}

h3 {
    font-family: var(--input-body1-font-family);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
}

a { 
    font-family: var(--input-body1-font-family);
    color: var(--color-text);
    text-decoration: none;
}

a:hover { 
  text-decoration: none;
  font-weight: 700;
}


button {
  border: none;
  color: inherit;
}

section {
  scroll-margin-top: 80px; /* 헤더 높이만큼 */
}

.site-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.6;
}

.footer-title {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 30px;
  padding-bottom: 30px;
  font-weight: 900;
  color: var(--color-text);
}

.footer-note {
  margin-top: 20px;
  font-style: italic;
  opacity: 0.65;
  font-size: 0.8rem;
}

.footer-info {
  opacity: 0.7;
}

footer img {
  height: 1.1em;
  width: auto;  
  vertical-align:text-bottom;
}

/* ------------------------------- */
/* 데스크탑 고정화면 */
/* ------------------------------- */

.container {
  display: flex;
  height: 100%;    
}

.sidebar-desktop {
  display: flex;
  flex-direction: column;
  width: 50%;
  padding: 40px;
  background: var(--background-color);
  border-right: 1px solid var(--color-border);
  box-sizing: border-box;
  overflow-y: auto;
  min-height: 0;
}

/* About 텍스트 박스 */

.textbox {
  display: flex;
  margin-bottom: 20px;
  position: relative;
  flex-direction: column;
  width: auto;
  border-color: var(--color-border);
}

.textbox-row {
  display: flex;
  gap: 20px;
  width: 100%;
  margin-top: 30px;
  flex-direction: column
}

.textbox .text {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  flex: 1;
}

.textbox .label-container {
  display: inline-flex;
  height: 2px;
  align-items: center;
  padding: 0px 10px;
  position: absolute;
  top: 0;
  left: 20px;
  background-color: var(--background-color);
}

.textbox .label-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  font-family: var(--input-body1-font-family);
  font-weight: 700;
  color: var(--color-text);
  font-size: 14px;
}

.textbox .text-btn {
  margin-top: auto;  
  align-self: flex-start;
  margin-bottom: 0;
  font-family: var(--input-button-font-family);
  font-weight: 800;
  background: var(--background-color);
  width: 100%;
  border: 1px solid var(--color-border);
  padding: 12px;
  font-size: 15px;
}

.textbox .text-btn:hover {
  background: var(--color-key);
  transition: 0.2s ease;
  color: #fff;
}


/* 책, 프로젝트 소개 표 */
nav {
  display: flex;
}

table {
  font-family: var(--input-body1-font-family);
  width: 100%;
  margin-top: 1em;
}

table thead {
  border-bottom: 2px solid var(--color-border);
}

table thead th {
  font-family: inherit;
  padding: 0 0 1em 1em;
  font-weight: 700;
  text-align: center;
}

table thead th:first-child {
  width: 30px;
}

table thead th:nth-child(2) {
  width: 40%;
}

table thead th:nth-child(3) {
  width: 60%;
}

tbody {
  border-bottom: 2px solid var(--color-border);
}

tbody tr {
  border-bottom: 1px solid var(--color-border);
}

tbody tr td {
  padding: 0.75em 0px 0.75em 1em;
  text-align: left;
  padding-left: 1em;
  line-height: 1em;
}

tbody tr td:first-child {
    vertical-align: middle;
    text-align: center;
}

tfoot td {
  padding: 0.35em 0 .35em;
  text-align: left;
  font-size: 1.25em;
}

ul {
  list-style-type: none;
  padding-left: 1.2em;
}

.sidebar-desktop li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  line-height: 1.6;
  gap: 0.5em;
}

.sidebar-desktop li:before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0.1em;
  font-size: 0.9em;
  flex: 0 0 auto;
  line-height: 1.6;
  margin-top: 0.1em; 
}

.li-text {
  flex: 0 1 auto;
  min-width: 0;
}

li > .li-content {
  display: inline;
  display: inline-flex;      /* ← 핵심 */
  flex-wrap: wrap;           /* 줄바꿈 허용 */
  gap: 6px;
  line-height: 1.6;
}

li:last-child {
  margin-bottom: 0;
}

/* 표 내부 버튼 공통 */

button {
  border: none;
  padding: 1.2px 0.65em;
  border-radius: 4px;
  cursor: pointer;
  margin: 0;
  position: relative;
  overflow: hidden;
  transition: var(--background-color) 0.3s ease;
}

button > span {
  font-family: var(--input-button-font-family);
  color: var(--color-text);
  font-weight: 500;
  font-size: 12px;
  transition: opacity 0.2s ease;
}

/* 버튼 링크 */
.btn-link {
  background-color: var(--background-color);
  border: 1px solid var(--color-border);
}

.btn-link:hover {
  background-color: var(--color-button-external-link-click); 
}

.btn-link:hover span {
  opacity: 0;
}

.btn-link:hover::after {
  opacity: 1;
}

.btn-link::after {
  content: "click!";
  font-family: var(--input-button-font-family);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* 버튼 절판 */

.btn-book-closed {
  background-color: var(--color-button-closed); 
  cursor: default;
}

h2 .btn-book-closed {
  background-color: var(--color-key);
}

h2 .btn-book-closed > span {
  color: #fff;
}

/* 버튼 신간 */

.btn-book-new {
  background-color: var(--color-key);
  cursor: default;
  margin-right: 5px;
}

.btn-book-new > span {
  color: #fff;
}

/* ------------------------------- */
/* 모바일 메뉴 (슬라이드) */
/* ------------------------------- */
.sidebar-mobile {
  display: none;
}

/* 햄버거 버튼 */
.menu-btn {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
}

/* ------------------------------- */
/* 오른쪽 콘텐츠 영역 */
/* ------------------------------- */

 
#content {
  width: 50%;
  padding: 40px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
  scrollbar-gutter: stable; 
  min-height: 0;
}

.wrapper {
  min-height: 92dvh;
  display: flex;
  justify-content: center;     
  box-sizing: border-box;  
}

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 30px;
  justify-content: flex-start; /* 🔥 핵심 */
}


/* 한 줄을 3등분 - 책 표지 배열 */

img {
  width: 20px;
  display: inline-block;
  justify-content: center;
}


.image-grid .item {
  flex: 0 1 calc((100% - 60px) / 3);
  display: flex;
  justify-content: center;
}

.image-grid img {
  display: block;
  max-width: 200px; 
  width: 100%;
  object-fit: contain;
}

.image-grid .item.bingo img {
  max-width: 200px;
}

.image-grid .item.demagoguery img {
  max-width: 160px;
}

.image-grid .item.systemsthinking img {
  max-width: 220px;
}

.image-grid .item.data img {
  max-width: 180px;
}

.image-grid .item.unification img {
  max-width: 170px;

}

.image-grid img:hover {
  transform: scale(1.05);
}

@media (max-width: 1200px) {
  .image-grid .item {
    flex: 0 1 calc((100% - 30px) / 2);
  }
}

@media (max-width: 600px) {
  .image-grid .item {
    flex: 0 1 100%;
  }
}


/* ------------------------------- */
/* about */
/* ------------------------------- */

.about-intro {
  margin-bottom: 20px;
  padding-bottom: 50px;
  border-bottom: 1px solid var(--color-border); 
  text-align: left;
}

.core-values {
  margin: 50px 0;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
  text-align: center;
  background-color: var(--background-color);
}

.core-item h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.core-item p {
  font-size: 16px;
  opacity: 0.75;
  max-width: 320px;
  margin: 0 auto;
  word-break: keep-all;
}

.core-work .title{
  font-size: 18px;
  font-weight: 700;
}

.core-work .desc{
  font-size: 16px;
  font-weight: 500;
}

@media (min-width: 768px) {
  .core-values {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

/* Timeline Grid */

.about-history {
  margin: 50px 0 30px 0;
  padding: 50px 0;
  /* border-top: 1px solid var(--color-border);  */
  border-bottom: 1px solid var(--color-border); 
  text-align: left;
}
 
.timeline-about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start; /* 핵심 */
}

@media (min-width: 768px) {
  .timeline-about {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 카드 기본 */

.timeline-card {
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  padding: 0;
  transition: all 0.3s ease;
}

/* 접힌 상태 */

.timeline-head {
  list-style: none;
  cursor: pointer;
  padding: 30px 30px;
}

.timeline-head::-webkit-details-marker {
  display: none;
}

.timeline-head h3,
.timeline-head div {
  margin: 0;
}

.timeline-body {
  padding: 0 20px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.25s ease;
  word-break: keep-all;
}

/* 열린 상태 */

.timeline-card[open] {
  display: flex;
  flex-direction: column;
}

.timeline-card[open] .timeline-body {
  padding: 16px 30px 30px;
  max-height: 500px;
  opacity: 0.85;
  flex: 1;
  overflow-y: auto;
}

.timeline-body {
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Chrome, Safari */
.timeline-body::-webkit-scrollbar {
  width: 6px;
}

.timeline-body::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-body::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 10px;
}

/* 타이포 */

.timeline-year {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: 12px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.timeline-body .emphasis{
  font-weight: 600;
    color: var(--color-key);
}

.timeline-body a{
  font-weight: 600;
    color: var(--color-key);
}

i {
  font-style: oblique;
}
/* ------------------------------- */
/* 개별 책 페이지 */
/* ------------------------------- */

.book-page {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.book-grid {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 30px;   
  align-items: flex-start;
}

.box {
  border: 0;
  box-sizing: border-box;
}

.box1 {
  flex: 0 0 calc((100% - 50px) * 1/4);   
}

.box2 {
  flex: 0 0 calc((100% - 50px) * 3/4);  

}

.book-grid img {
  display: block;
  width: 100%;
  object-fit: contain;
  margin-bottom: 20px;
}

/* 책 메타정보 및 소개  */
.book-meta {
  margin-bottom: 40px;
}

.book-meta p {
  font-weight:500;
}

.intro-head{
  font-family: var(--input-button-font-family);
  font-size: 14px;
  cursor: default;
}

.intro-content {
  font-family: var(--input-body1-font-family);
  font-weight: 600;
  font-size: 17px;
  padding-bottom: 25px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  word-break: keep-all;
}

/* 하단 탭 */
.tab-buttons {
  display: flex;
  gap: 20px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.tab-content {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-height: 300px;
  padding: 30px;
}

.tab-btn {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--color-border);
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 999px;
  transition: 
    border-color 0.2s ease,
    font-weight 0.2s ease,
    color-key 0.2s ease;
}

.tab-btn:hover {
  border-color: var(--color-key);
  color: var(--color-key);
  font-weight: 800;
}

.tab-btn.active {
  border-color: var(--color-key);
  color: var(--color-key);
  font-weight: 800;
}

/* 탭 - 관련자료 */

.tab-link {
  display: inline-block;
  background-color: var(--background-color);
  margin-top: 10px;
  margin-right: 20px;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid var(--color-border);
  padding: 10px;
  font-weight: 600;
}

.tab-link:hover {
  border-color: var(--color-key);
  color: var(--color-key);
  text-decoration: none;
}


/* 탭 - 타임라인 */

.timeline {
    width: 100%;
    font-size: 16px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 200px 80px 1fr;
    column-gap: 16px;
    padding: 6px 3px;
}

.timeline dt {
    font-weight: 500;
    margin-bottom: 13px;
    line-height: 1.2em;
}

.timeline dd {
    margin-bottom: 13px;
    line-height: 1.2em;
}

.timeline a {
    text-decoration: none;
    color: inherit;
}

.timeline a:hover {
    text-decoration: underline;
    color: var(--color-key);
}

.errata {
    width: 100%;
    font-size: 16px;
} 

.errata-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    column-gap: 16px;
    padding: 6px 3px;
}

.errata dt{
  position: relative;
  padding-left: 1.2em; 
  font-weight: 600;
  margin-bottom: 13px;
  line-height: 1.2em;
}

.errata dt:before {
  content: "•";
  position: absolute;
  left: 0;
}

.errata dd {
  font-weight: 400;
}


@media (max-width: 640px) {
    .timeline-item {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .timeline .type {
        display: none;
    }

    .timeline .date {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .timeline .desc {
        font-size: 16px;
        margin-bottom: 16px;
        word-break: keep-all;
        line-height: 1.2em;
    }

    .errata-item {
    grid-template-columns: 1fr;
    row-gap: 8px;
    }

    .errata dd {
      margin-bottom: 1em;
    }

}

/* 탭 - 책 소개 */

h3.about {
  margin-top: 30px;
  border-top: 1px solid var(--color-border);
  padding-top: 30px;
}

.tab-about p {
  word-break: keep-all;
}

p.intro-title {
  font-size: 16px;
  font-weight: 600;
}

p.emphasis {
  font-weight: 700;
}

p.emphasis > span {
  font-size: 14px;
  font-weight: 500;
}

p.cite {
  margin-left: 30px;
  padding-left: 10px;
  padding-right: 30px;  
  border-left: 2px solid var(--color-key);
  color: var(--color-key);
  font-weight: 600;
}

/* 탭 - 프로그램 */

.tab-program p {
  word-break: keep-all;
}


/* ---- 모바일: 1열 ---- */

@media (max-width: 768px) {
  .box1, .box2 {
    flex: 0 0 100%;
  }
}


/* ------------------------------- */
/* 모바일 전용 스타일 */
/* ------------------------------- */

@media (max-width: 1200px) {

  h2 {
    margin-right: 50px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--color-border);
    word-break: keep-all;
  }
  
  h2 > span {
    padding-top: 16px;
    font-size: 16px;
    display: block;
    word-break: keep-all;
  }

  /* 데스크탑 메뉴 숨기기 */
  .sidebar-desktop {
    display: none;
  }

  .textbox-row {
    flex-wrap: wrap;
  }

  .textbox {
    flex: 1 0 100%;
  }

  /* 콘텐츠는 전체 너비 */
  #content {
    width: 100%;
    padding: 30px;
  }

  /* 햄버거 버튼 보이기 */
  .menu-btn {
    display: block;
  }

  /* 모바일 메뉴 보이기 */
  .sidebar-mobile {
    display: flex;
    flex-direction: column;

    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100vh;
    background: #fafafa;
    padding: 40px 30px;
    box-sizing: border-box;
    border-right: 1px solid #ebebeb;
    transition: left 0.3s ease;
    z-index: 1500;
    overflow-y: auto;
  }

  .sidebar-mobile.open {
    left: 0;
  }

  /* 메뉴 스타일 */

  .mobile-menu {
    list-style: none; 
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;

  }

  .mobile-menu li {
    margin-bottom: 18px;
  }

  .mobile-menu a{
    text-decoration: none;
    color: var(--color-key);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.02em;
    display: block;
    transition: color 0.2s ease;
  }

  .mobile-menu a:hover {
    color: var(--color-key) 
  }

  .has-sub > span {
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    font-weight: 700;
    margin-bottom: 18px;
    display: block;
  }

  .sub-menu {
    list-style: none;
    padding-left: 16px;  
  }

  .sub-menu li {
   margin-bottom: 10px;
  }

  .sub-menu a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
  }

  .sub-menu a:hover {
    color: var(--color-key);
  }

  .mobile-menu a {
    display: inline-block;
    position: relative;
  }

  .mobile-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 1px;
    background: var(--color-key);
    transition: width 0.2s ease;
  }

  .mobile-menu a:hover::after {
    width: 100%;
  }
  .menu-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 0.8rem;
    opacity: 0.6;
  }

  .menu-footer p {
    margin: 0;
    word-break: break-all;
  }

  .menu-footer p span {
    font-weight: 900;
  }
}
