/* 공통 스타일 */
html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 가로 스크롤 방지 */
  overflow-y: auto;   /* 필요할 때만 세로 스크롤 */
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #3B4551; 
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 첫 페이지(header) 스타일 */
header {
  position: relative; 
  background-color: #ffffff; /* 목록 페이지와 맞춤 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 10px 50px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: left;
  font-size: 0.8em;
  color: #3B4551; /* 첫 페이지 제목/설명 색상 */
}

.header-top h1 {
  font-size: 1.5em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

header .header-top {
  width: 100%;
  display: flex;
  justify-content: space-between; /* 왼쪽과 오른쪽 완전 분리 */
  align-items: center;            /* 수직 중앙 정렬 */
  margin-bottom: 15px;            /* 밑에 p와 간격 */
}

header h1 {
  display: flex;
  align-items: center;  /* 이미지와 텍스트 수직 가운데 정렬 */
  gap: 10px;            /* 이미지와 텍스트 사이 간격 */
  margin: 0;
  font-size: 1.5em;
  color: #3B4551;
}

header p {
  margin-top: 5px;
  font-size: 1.2em;
  line-height: 1.5;
  max-width: 600px;
  color: #3B4551;
}

.logo-inline {
  width: 50px;  /* 로고 크기 조절 */
  height: auto;
  display: block;
}

/* 공통 top-right 버튼 스타일 */
.top-right-buttons {
  display: flex;
  gap: 10px;
}

.top-right-buttons a {
  text-decoration: none;
  color: #fff;
  background-color: #8d613d; /* 목록 페이지 버튼색 기준 */
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 0.8em;
  transition: background-color 0.3s ease;
}


.top-right-buttons a:hover {
  background-color: #472910;
}

/* 첫 페이지 main */
main {
  flex: 1;
  background-color: #3B4551; /* 첫 페이지 짙은 파란색 */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 50px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

/* 카드 컨테이너 - 첫 페이지 */
.card-container {
  display: grid;
  grid-template-columns: repeat(2, 300px);
  grid-template-rows: repeat(2, auto);
  gap: 30px 50px;
  justify-content: center;
  width: 100%;
  max-width: 700px;
  font-size: 0.8em;
  margin-bottom: 30px;
  padding-top: 30px; /* 위쪽 여백 */
  padding-bottom: 30px; /* 아래쪽 여백 */
}

/* 카드 - 첫 페이지 */
.card {
  background-color: #FFFFFF;
  border-radius: 15px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  padding: 30px 25px;
  text-align: center;
  color: #5B4B58;
  transition: transform 0.3s ease;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.icon {
  font-size: 3.5em;
  margin-bottom: 20px;
  color: #49607A;
}

.card h2 {
  margin: 0 0 15px 0;
  font-size: 1.8em;
  color: #5B4B58;
}

.card p {
  font-size: 1em;
  color: #7D6E83;
  line-height: 1.4;
}

/* footer 스타일 */
footer {
  flex-shrink: 0;
  width: 100%;
  background-color: #CDD2D9;
  color: #4F5E6E;
  text-align: center;
  padding: 15px 20px;
  font-size: 0.9em;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
  z-index: 1000;
}

footer a {
  color: #49607A;
  margin-left: 5px;
}

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

a:hover {
  text-decoration: none;
}

/* 목록 페이지 스타일 별도 클래스들 */

/* 목록 페이지 상단 헤더 (div.header) */
.header {
  min-height: 50px;
  padding: 10px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff; /* 목록 페이지 header 배경 */
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: relative;
}

.site-title {
  font-size: 1.0em;
  font-weight: bold;
  white-space: nowrap; /* 줄바꿈 방지 */
  text-overflow: ellipsis; /* ... 처리 */
  max-width: 300px; 
}

/* 목록 페이지 컨테이너 */
.container {
  max-width: 1200px;
  width: 80%;
  margin: 40px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* 목록 페이지 제목 */
h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 1.0em;
  display: block;
  align-items: center;
  gap: 12px;
}

/* 목록 글 목록 줄 */
.article-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 25px;
  margin-bottom: 15px;
  background-color: #fafafa;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
  font-size: 0.8em;
}

.article-title {
  font-size: 1.1em;
  color: #333;
  flex: 1;
}

/* 목록 버튼 그룹 */
.buttons {
  display: flex;
  gap: 10px;
}

.buttons a {
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 0.9em;
  color: #fff;
  background-color: #93a1af; /* 목록 버튼 공통색 */
  transition: background-color 0.3s ease;
}

.buttons a:hover {
  background-color: #7a8999;
}

/* 추가 스타일: center-content, bio, construction, 이미지, 버튼 재정의 */

.center-content {
  display: flex;
  flex-direction: column;        /* 이미지와 텍스트 가로 배치 */
  align-items: flex-start;    /* 위쪽 정렬 */
  gap: 20px;                  /* 이미지와 텍스트 사이 간격 */
  text-align: left;           /* 텍스트 왼쪽 정렬 */
  padding: 20px;              /* 내부 여백 */
  color: #eee;                /* 텍스트 색 */
}

.center-content img {
  width: 150px;               /* 이미지 고정 크기 */
  height: auto;
  border-radius: 10px;
  margin: 0;                  /* 마진 초기화 */
  flex-shrink: 0;             /* 이미지 축소 방지 */
}

.bio {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8em;
  text-align: left;
  color: #eee;
  margin-bottom: 80px;
  line-height: 2.0;
}

.center-content > div.bio {
  flex: 1;                    /* 텍스트 영역 가변 넓이 */
  line-height: 1.6;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9em;
}

.center-content h1 {
  font-size: 1.2em;
  margin: 0 0 10px 0;
  color: #eee;
  text-align: left;
}

.contact-content {
  max-width: 900px;           /* 최대 넓이 넉넉하게 */
  width: 100%;
  margin: 0 auto;             /* 좌우 자동 마진으로 가운데 정렬 */
  padding: 40px 50px !important; /* 기존 인라인 패딩 덮어쓰기 */
  background-color: #ffffff;
  border-radius: 12px;
  box-sizing: border-box;
  align-items: center;
}

.contact-content form {
  width: 100%;      /* 부모 너비 100% */
}

.contact-content form input,
.contact-content form textarea {
  width: 100%;      /* 입력창들도 꽉 채우기 */
  box-sizing: border-box; /* 패딩 포함해서 넓이 계산 */
}

.contact-main {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  background-color: #3B4551;
}

.text {
  font-family: 'Poppins', sans-serif;
  font-size: 1em;
  text-align: justify;
  color: #eee;
  line-height: 2;
  padding: 0 5%; /* 좌우 넉넉한 여백 */
  margin-bottom: 80px;
}

.text img {
  width: 30%;
  max-width: 300px;
  text-align: center;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 60px auto 40px auto; /* 위아래 여백 증가 */
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  width: 40px;
  height: 40px;
}

.main-image {
  width: 100%;
  max-width: 700px;
  margin: 20px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
}

h1 i {
  color: #444;
}

.book-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* 화면 높이 전체 */
}

.book-page .container {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 15px;
}

.book-page h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.2em;
  color: #333;
}

.book-page .article-row {
  display: block !important;  /* flex 대신 block으로 변경 */
  background-color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  margin-bottom: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.book-page .article-row:hover {
  background-color: #f9f9f9;
}

.book-page .article-title {
  font-weight: 600;
  font-size: 1.1em;
  width: 100%;
  color: #333;
  /* display: block; /* 기본 블록 요소라 필요없음 */
}

.book-page .article-detail {
  display: none;
  margin-top: 12px;
  margin-bottom: 32px;
  font-size: 0.95em;
  line-height: 1.5;
  color: #555;
  width: 100%;
  padding-bottom: 16px;
  padding-right: 8px;   /* 스크롤 때문에 오른쪽 여백 */
  background-color: #fafafa;
  border-left: 3px solid #ccc;
  border-radius: 4px;
}

/* 버튼 영역 숨김 */
.book-page .buttons {
  display: none !important;
}

.book-page main {
  flex-grow: 1; /* 남은 공간 다 차지 */
}

.shortcut-title {
  text-align: center;
  margin-top: 30px;
  font-size: 1.1em;
  color: #333;
}

.institution-links {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* 아이콘과 텍스트가 위쪽 정렬되도록 */
  gap: 80px; /* 아이콘 사이 간격 넓힘 */
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.institution-links a {
  display: flex;
  flex-direction: column; /* 세로 정렬 */
  align-items: center;
  text-decoration: none;
  color: #333;
}

.institution-links img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.2s ease;
  margin-bottom: 8px;
}

.institution-links a:hover img {
  transform: scale(1.05);
}

.link-label {
  font-size: 0.9em;
  color: #333;
  text-align: center;
}

.content-with-image {
  display: flex;
  align-items: flex-start; 
  gap: 20px; 

  background-color: #ffffff; /* 원하는 배경색 넣기 (예: 연한 회색) */
  padding: 20px 20px;    /* 위쪽 20px, 왼쪽 20px 여백, 아래·오른쪽 0 */
  border-radius: 8px;        /* 모서리 둥글게 (선택사항) */

  margin: 20px; 
}

.content-with-image img {
  width: 150px; /* 이미지 크기 조절 */
  border-radius: 10px;
  flex-shrink: 0; /* 이미지 크기 줄어들지 않게 */
  align-self: flex-start; /* 이미지는 컨테이너 상단에 고정 */
  margin-top: 2.5em; /* h1 높이 정도 여백 줘서 p 상단 맞춤 */
}

.content-with-image .text {
  flex: 1; /* 텍스트 영역 넓게 차지 */
  color: #333; /* 글자색 */
  font-size: 1em;
  line-height: 1.5;
}

.content-with-image .text h1 {
  text-align: left;
  margin-top: 2em; /* 원하는 만큼 위 여백 조절 */
}

/* 뒤로가기 버튼 */
.back-button-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 50px;
  margin-bottom: 20px;
}

.back-button {
  background-color: #8d613d;
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  display: inline-block;
}

.back-button:hover {
  background-color: #6e482a;
}














/* 📱 모바일 대응 스타일 (max-width: 768px 이하 기기용) */
@media (max-width: 768px) {

  /* 헤더 요소들 세로 정렬 */
  header {
    padding: 20px;
    font-size: 0.9em;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .top-right-buttons {
    flex-wrap: wrap;
    gap: 8px;
  }


  /* 카드 레이아웃을 한 줄씩 세로로 */
  .card-container {
    grid-template-columns: 1fr; /* 한 줄 카드 */
    gap: 20px;
    padding: 10px 5px;
    box-sizing: border-box;
  }

  .card {
    padding: 12px 10px;
    font-size: 0.95em;
  }

  .card h2 {
    font-size: 1.4em;
  }

  .card p {
    font-size: 0.9em;
  }

  .main {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
  }

  /* 이미지 반응형 */
  .logo-inline {
    width: 40px;
  }

  .center-content img,
  .text img {
    width: 60%;
  }

  /* 텍스트 패딩 줄이기 */
  .text {
    padding: 0 0%;
  }

  /* 푸터 글자 크기 줄이기 */
  footer {
    font-size: 0.8em;
    padding: 10px 15px;
  }

 .header {
    flex-direction: row;        /* 가로 정렬 유지 */
    justify-content: space-between; /* 좌우 끝으로 배치 */
    align-items: center;
    padding: 10px 20px;
  }

  .top-right-buttons {
    display: flex;
    flex-direction: row;   /* 버튼 가로 배열 유지 */
    gap: 10px;
    flex-wrap: nowrap;    /* 한 줄에 다 나오게 */
  }

  .top-right-buttons a {
    flex: 1 1 auto;        /* 버튼이 적당히 공간 나눠 가짐 */
    min-width: 100px;      /* 버튼 최소 너비 설정 (조절 가능) */
    text-align: center;
    padding: 10px 5px;
    box-sizing: border-box;
  }

  .site-title {
    flex: 1 1 auto;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
  }

.container {
  width: calc(100% - 20px); /* 좌우 10px씩 여백 확보 */
  margin: 10px auto;
  padding: 10px 10px;
  box-sizing: border-box;
}

  .text {
    padding: 0 2%; /* 더 좁은 좌우 여백 */
  }

  .article-row {
    width: 98%;          /* 추가: 최대 너비로 확장 */
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 20px auto;
    padding: 0 5px; 
    box-sizing: border-box; /* 패딩 포함해서 정확한 넓이 계산 */
  }

  .article-title {
    width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 1em;
    padding: 0;
  }
  
  .center-content {
    padding: 0 5%;
    box-sizing: border-box;
  }

  .buttons {
    width: 100%;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
  }

  .buttons a {
    flex: 1;
    min-width: 0;
    padding: 10px;
    text-align: center;
  }

  .bio {
    text-align: left;
    display: block;
    padding: 0 1%;
  }

  .contact-main {
    display: flex;
    justify-content: center; /* 가로 중앙 정렬 */
    padding: 10px 15px;
  }
  
  .contact-content {
    width: 100%;
    max-width: 400px; /* 최대 너비 제한 */
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  #contact-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

 .content-with-image {
    flex-direction: column;   /* 이미지-텍스트 세로 배치 */
    align-items: center;
    padding: 15px 20px 5px 20px;
    margin-bottom: 10px;
    gap: 15px;
  }

  .content-with-image img {
    width: 100%;      /* 이미지 너비 100% */
    max-width: 150px;
    height: auto;
    align-self: center;
    border-radius: 8px;
  }

  .content-with-image .text {
    width: 100%;
    font-size: 0.95em;
    padding: 0;
    text-align: justify;    
  }

  .content-with-image h1 {
    font-size: 1.3em;
    margin-bottom: 0.5em;
  }

  .content-with-image p {
    font-size: 0.9em;
    line-height: 2;
    word-break: keep-all;       /* 단어 단위 줄바꿈 (한국어에 적합) */
    hyphens: none;         
  }

  .content-with-image .text h1 {
    text-align: center;  /* h1 텍스트도 중앙 정렬 */
  }

  .institution-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 10px;
  box-sizing: border-box;
}

.institution-links a {
  width: calc(50% - 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* 세로 중앙 정렬 */
  text-align: center;
  box-sizing: border-box;
  padding: 10px 0; /* 위아래 여백 조절 */
  height: 150px;   /* 고정 높이 설정 (필요에 따라 조절) */
}


.institution-links img {
  width: 80px;
  height: 80px;
  object-fit: contain; /* 이미지 비율 유지하면서 공간 채우기 */
  border-radius: 6px;
}

.institution-links .link-label {
  margin-top: 5px;
  font-size: 0.9em;
}

}
