
/* ==================================
   도화신문 기본 스타일
================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f5f2ea;
  color: #111111;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.6;
}

/* ==================================
   헤더
================================== */


header {
  background-color: #ffffff;
  border-bottom: 2px solid #111111;
  padding: 12px 20px;
  text-align: center;
}

header h1 {
  margin: 0;
}

header a {
  display: inline-block;
  text-decoration: none;
}

.site-logo {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
}


/* ==================================
   내비게이션
================================== */

nav {
  background-color: #111111;
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav li {
  margin: 0;
}

nav a {
  display: block;
  padding: 14px 20px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  background-color: #444444;
}

/* ==================================
   메인 콘텐츠
================================== */

main {
  width: 100%;
  max-width: 1200px;
  min-height: 500px;
  margin: 30px auto;
  padding: 30px;
  background-color: #ffffff;
}

main h2 {
  margin-top: 0;
  font-size: 28px;
}

/* ==================================
   푸터
================================== */

footer {
  background-color: #111111;
  color: #ffffff;
  text-align: center;
  padding: 25px 20px;
  font-size: 13px;
}


.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-contact {
  color: #cccccc;
  font-size: 12px;
}

/* ==================================
   모바일 화면
================================== */

@media (max-width: 768px) {
  header {
    padding: 12px 10px;
  }

  header h1 {
    font-size: 30px;
  }

  nav a {
    padding: 10px 12px;
    font-size: 13px;
  }

  main {
    margin: 15px auto;
    padding: 20px 15px;
  }

  main h2 {
    font-size: 24px;
  }
}

/* ==================================
   주요 뉴스 영역
================================== */

.main-news {
  width: 100%;
}

.main-news h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid #111111;
}

/* 기사 카드 배치 */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* 개별 기사 카드 */

.news-card {
  min-width: 0;
  background-color: #ffffff;
  border: 1px solid #dddddd;
  padding: 20px;
  transition: box-shadow 0.2s ease;
}

.news-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 기사 섹션 표시 */

.news-category {
  display: inline-block;
  color: #003b96;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* 기사 제목 */

.news-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: break-word;
}

/* 기사 요약 */

.news-card p {
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.7;
}

/* ==================================
   태블릿 화면
================================== */

@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==================================
   모바일 화면
================================== */

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

  .news-card {
    padding: 16px;
  }

  .news-card h3 {
    font-size: 18px;
  }

  .main-news h2 {
    font-size: 23px;
  }
}

/* ==================================
   기사 카드 링크 디자인
================================== */

.news-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.news-card a:visited {
  color: inherit;
}

.news-card a:hover h3,
.news-card a:focus-visible h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.news-card a:focus-visible {
  outline: 2px solid #003b96;
  outline-offset: 4px;
}

/* 기사 카드 섹션명 */

.news-card .news-category {
  color: #003b96;
}
/* ==================================
   기사 카드 발행일
================================== */

.news-date {
  display: block;
  margin-top: 12px;
  color: #666666;
  font-size: 12px;
  font-weight: 400;
}/* ==================================
   기사 썸네일
================================== */

.news-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  overflow: hidden;
  background-color: #f5f2ea;
}

.news-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 사진 없는 기사 카드 */

.news-card:not(:has(.news-thumbnail)) {
  background-color: #ffffff;
}
/* 메인 화면 대표 기사 */

.featured-article {
  margin-bottom: 32px;
  border: 1px solid #ddd;
  background-color: #fff;
}

.featured-article a {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 20px;
  color: inherit;
  text-decoration: none;
}

.featured-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #f5f2ea;
}

.featured-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-content h3 {
  margin: 12px 0;
  font-size: 28px;
  line-height: 1.4;
}

.featured-content p {
  color: #666;
  line-height: 1.7;
}

.featured-article a:hover h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.featured-article a:focus-visible {
  outline: 2px solid #003b96;
  outline-offset: 4px;
}

/* 모바일에서는 사진과 제목을 세로로 배치 */

@media (max-width: 768px) {
  .featured-article a {
    grid-template-columns: 1fr;
  }

  .featured-content h3 {
    font-size: 23px;
  }
}
/* 사진 없는 대표 기사 */

.featured-article.no-thumbnail a {
  grid-template-columns: 1fr;
}

.featured-article.no-thumbnail .featured-content {
  width: 100%;
}
/* 현재 선택된 섹션 메뉴 */

nav a[aria-current="page"] {
  background-color: #444;
  color: #fff;
  font-weight: 700;
}
/* 최신 기사 목록 */

.latest-news {
  margin-top: 40px;
}

.latest-news h2 {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #222;
}

.latest-news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.latest-news-list li {
  border-bottom: 1px solid #ddd;
}

.latest-news-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 4px;
  color: inherit;
  text-decoration: none;
}

.latest-news-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.latest-news-list time {
  flex-shrink: 0;
  color: #666;
  font-size: 12px;
}

.latest-news-list a:hover .latest-news-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.latest-news-list a:focus-visible {
  outline: 2px solid #003b96;
  outline-offset: 4px;
}

/* 모바일 화면 */

@media (max-width: 600px) {
  .latest-news-list a {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
/* 모바일 상단 메뉴: 한 줄 유지 및 가로 스크롤 */

@media (max-width: 768px) {
  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  nav ul {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
  }

  nav li {
    flex-shrink: 0;
  }

  nav a {
    white-space: nowrap;
  }
}
/* ========================================
   기사 상세 페이지
======================================== */

.article-detail {
  max-width: 800px;
  margin: 60px auto 100px;
  padding: 0 20px;
}

/* 기사 상단 */

.article-header {
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid #ddd;
}

/* 기사 섹션명 */

.article-category {
  margin-bottom: 18px;
  color: #003b96;
  font-size: 15px;
  font-weight: 700;
}

/* 기사 제목 */

.article-header h1 {
  margin: 0 0 20px;
  color: #111;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.4;
  word-break: keep-all;
}

/* 기사 부제 */

.article-subtitle {
  margin: 0 0 24px;
  color: #555;
  font-size: 20px;
  line-height: 1.6;
  word-break: keep-all;
}

/* 작성일 및 수정일 */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: #666;
  font-size: 13px;
  line-height: 1.6;
}

/* 모바일 화면 */

@media (max-width: 768px) {
  .article-detail {
    margin: 35px auto 70px;
    padding: 0 16px;
  }

  .article-header h1 {
    font-size: 28px;
  }

  .article-subtitle {
    font-size: 17px;
  }

  .article-category {
    font-size: 14px;
  }

  .article-meta {
    font-size: 12px;
  }
}
/* ========================================
   기사 본문 디자인
======================================== */

/* 본문 전체 */

.article-body {
  color: #222;
  font-size: 18px;
  line-height: 1.9;
  overflow-wrap: break-word;
}

/* 본문 문단 */

.article-body p {
  margin: 0 0 24px;
  word-break: keep-all;
}

/* 본문 소제목 */

.article-body h2 {
  margin: 48px 0 20px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.5;
  color: #111;
  word-break: keep-all;
}

.article-body h3 {
  margin: 36px 0 16px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  color: #222;
  word-break: keep-all;
}

/* 본문 인용문 */

.article-body blockquote {
  margin: 36px 0;
  padding: 18px 24px;
  border-left: 4px solid #003b96;
  background-color: #f5f2ea;
  color: #444;
  font-size: 18px;
  line-height: 1.8;
}

.article-body blockquote p {
  margin-bottom: 0;
}

/* 본문 강조 */

.article-body strong {
  font-weight: 700;
}

/* 모바일 화면 */

@media (max-width: 768px) {
  .article-body {
    font-size: 16px;
    line-height: 1.85;
  }

  .article-body p {
    margin-bottom: 20px;
  }

  .article-body h2 {
    margin-top: 36px;
    font-size: 22px;
  }

  .article-body h3 {
    margin-top: 28px;
    font-size: 19px;
  }

  .article-body blockquote {
    padding: 16px 18px;
    font-size: 16px;
  }
}
/* ========================================
   기사 이미지 및 사진 설명문
======================================== */

/* 기사 대표 이미지 */

.article-detail > .article-image {
  margin: 0 0 36px;
}

/* 기사 본문 이미지 */

.article-body figure {
  margin: 36px 0;
}

/* 이미지 공통 */

.article-detail > .article-image img,
.article-body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* 사진 설명문 */

.article-detail figcaption {
  margin-top: 10px;
  color: #666;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  word-break: keep-all;
}

/* 모바일 화면 */

@media (max-width: 768px) {
  .article-detail > .article-image {
    margin-bottom: 28px;
  }

  .article-body figure {
    margin: 28px 0;
  }

  .article-detail figcaption {
    font-size: 12px;
  }
}
/* ========================================
   기사 하단 관련 기사 및 목록 이동
======================================== */

.article-bottom {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #ddd;
}

/* 관련 기사 */

.related-articles {
  margin-bottom: 36px;
}

.related-articles h2 {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 700;
  color: #111;
}

.related-articles ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-articles li {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.related-articles a {
  color: #222;
  text-decoration: none;
  line-height: 1.6;
}

.related-articles a:hover {
  color: #003b96;
  text-decoration: underline;
}

/* 목록으로 돌아가기 */

.article-navigation {
  margin-top: 30px;
  text-align: center;
}

.article-navigation a {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid #ccc;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.article-navigation a:hover {
  background-color: #f5f2ea;
}

/* 모바일 */

@media (max-width: 768px) {
  .article-bottom {
    margin-top: 40px;
  }

  .related-articles h2 {
    font-size: 20px;
  }

  .article-navigation a {
    padding: 10px 20px;
    font-size: 13px;
  }
}
/* 기사 본문 이미지 반응형 처리 */
.article-body img {
  max-width: 100%;
  height: auto;
}
/* 화면에는 숨기되 스크린리더에는 제공 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* 섹션 페이지 제목 스타일 */
main h1:not(.visually-hidden):not(.article-header h1) {
  margin-top: 0;
  font-size: 28px;
}

@media (max-width: 768px) {
  main h1:not(.visually-hidden):not(.article-header h1) {
    font-size: 24px;
  }
}

/* ========================================
   404 오류 페이지
======================================== */

.error-page {
  max-width: 700px;
  margin: 80px auto;
  padding: 40px 20px;
  text-align: center;
}

.error-page h1 {
  margin: 0 0 20px;
  color: #003b96;
  font-size: 96px;
  font-weight: 800;
  line-height: 1.2;
}

.error-page h2 {
  margin: 0 0 24px;
  color: #111111;
  font-size: 28px;
  font-weight: 700;
}

.error-page p {
  margin: 0 0 28px;
  color: #555555;
  font-size: 16px;
  line-height: 1.8;
}

.error-page a {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid #111111;
  background-color: #111111;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.error-page a:hover {
  background-color: #444444;
}

.error-page a:focus-visible {
  outline: 3px solid #003b96;
  outline-offset: 4px;
}

/* 404 페이지 모바일 화면 */

@media (max-width: 768px) {
  .error-page {
    margin: 40px auto;
    padding: 30px 15px;
  }

  .error-page h1 {
    font-size: 64px;
  }

  .error-page h2 {
    font-size: 22px;
  }

  .error-page p {
    font-size: 15px;
  }
}
