/* EF Dark Theme Color Palette */
/*
:root {
  --bg-color: #282c34;
  --text-color: #abb2bf;
  --accent-color: #61afef;
  --secondary-accent-color: #c678dd;
  --subtle-text-color: #5c6370;
  --code-bg-color: #3a4049;
  --border-color: #4b5263;
}
*/

/* EF Dark Theme Color Palette - WCAG AAA Compliant */
:root {
  --bg-color: #282c34;
  --text-color: #e3eaf2; /* AAA 기준 충족 */
  --accent-color: #82c8ff; /* AAA 기준 충족 */
  --secondary-accent-color: #c678dd; /* 텍스트가 아닌 강조 요소에 사용 */
  --subtle-text-color: #a0b3c7; /* AA 기준 충족 (보조 텍스트용) */
  --code-bg-color: #3a4049;
  --border-color: #4b5263;
}

/* Global Resets & Typography */
body {
  font-family: "Noto Sans KR", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  font-size: 17px;
  margin: 0;
  padding: 0;
}

/* Main Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.site-header {
  margin-bottom: 60px;
}

.site-header a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 2rem;
  font-weight: bold;
}

/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--accent-color);
  margin-top: 2em;
  margin-bottom: 0.8em;
  font-weight: 600;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }

/* Post List (Homepage) */
/* Post List (Homepage & List pages) */
.post-list-container {
  list-style: none;
  padding: 0;
}

.post-list-item {
  background-color: var(--code-bg-color); 
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 25px 30px;
  margin-bottom: 30px;
  transition: border-color 0.2s ease-in-out;
}

.post-list-item:hover {
  border-color: var(--accent-color); 
}

.post-list-item h2 {
  margin: 0 0 5px 0;
  padding: 0;
  border: none;
  font-size: 1.6rem;
}

.post-list-item h2 a {
  color: var(--accent-color);
}

.post-list-meta {
  color: var(--subtle-text-color);
  font-size: 0.9em;
  margin-bottom: 20px;
}

.post-summary p {
  margin: 0;
  color: var(--text-color);
}

.post-footer {
  margin-top: 20px;
  text-align: right;
}

.read-more {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
}

/* Single Post */
.post-title {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.post-meta {
  color: var(--subtle-text-color);
  margin-bottom: 40px;
}

.post-content {
  margin-top: 2rem;
}

.post-content h2 {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

/* Code Blocks */
pre {
  background-color: var(--code-bg-color);
  padding: 1.2em;
  border-radius: 8px;
  overflow-x: auto;
}

code {
  font-family: "Fira Code", "Consolas", monospace;
  font-size: 0.9em;
}

:not(pre) > code {
  background-color: var(--code-bg-color);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

/* Footer */
.site-footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--subtle-text-color);
  font-size: 0.85em;
}
/* Header & Navigation */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
}

.site-header a {
  color: var(--accent-color);
  text-decoration: none;
}

.site-branding a {
  font-size: 1.5rem; /*           ణ  ۰       */
  font-weight: bold;
}

.site-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.site-navigation li {
  margin-left: 25px;
}

.site-navigation a {
  color: var(--text-color);
  font-size: 1rem;
}

.site-navigation a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* Footer */
.site-footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--subtle-text-color);
  font-size: 0.85em;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: var(--subtle-text-color);
    text-decoration: none;
    margin-left: 15px;
}

.social-links a:hover {
    color: var(--text-color);
    text-decoration: underline;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  font-size: 0.9em;
}

.pagination a {
  color: var(--text-color);
  text-decoration: none;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.pagination a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Terms Page (e.g., /tags/) */
.page-title {
  text-align: center;
  margin-bottom: 2em;
}

.terms-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  list-style: none;
  padding: 0;
}

.term-item {
  display: inline-block;
  background-color: var(--code-bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.term-item:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--bg-color);
}

.term-count {
  margin-left: 8px;
  background-color: var(--border-color);
  color: var(--text-color);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.8em;
}

.term-item:hover .term-count {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* 404 Not Found Page */
.not-found {
  text-align: center;
  margin: 100px 0;
}

.not-found h1 {
  font-size: 6rem;
  margin: 0;
  color: var(--subtle-text-color);
}

.not-found h2 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-color);
    border: none; /*      h2   Ÿ          ̵  */
}

.not-found a {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
}

.not-found a:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    text-decoration: none;
}

/* Table of Contents (TOC) */
.toc-container {
    background-color: var(--code-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 2em; /* 본문과의 간격 */
}

/* 목차 제목 스타일 */
.toc-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--subtle-text-color);
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase; /* 대문자로 변경 */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* 목차 내용 리스트 스타일 */
.toc-content ul {
    list-style: none; /* 기본 list-style 제거 */
    padding-left: 0;
    margin: 0;
    counter-reset: toc-counter; /* 번호를 위한 카운터 초기화 */
}

.toc-content li {
    margin-bottom: 10px;
}

/* 번호 생성 및 스타일 */
.toc-content li a::before {
    counter-increment: toc-counter; /* 카운터 1씩 증가 */
    content: counter(toc-counter) ". "; /* "1. ", "2. " 형태로 내용 추가 */
    color: var(--subtle-text-color);
    font-weight: 600;
}

/* 하위 목록 스타일 (들여쓰기 및 번호 형식) */
.toc-content ul ul {
    margin-top: 10px;
    padding-left: 20px; /* 들여쓰기 */
    counter-reset: toc-sub-counter;
}

.toc-content ul ul li a::before {
    counter-increment: toc-sub-counter;
    content: counter(toc-counter) "." counter(toc-sub-counter) ". "; /* "1.1. ", "1.2. " 형태 */
}

/* 링크 스타일 */
.toc-content a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.toc-content a:hover {
    color: var(--accent-color);
}

/* Gallery Styles */
.gallery-container {
    margin: 2em 0;
}

/* 1. Grid Type Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* 2. Vertical Type Gallery */
.gallery-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Common styles for gallery items */
.gallery-item {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--code-bg-color);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease-in-out;
}

.gallery-item:hover img {
    transform: scale(1.05); /* Hover effect */
}

/* Caption styles */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(40, 44, 52, 0.8);
    color: var(--text-color);
    font-size: 0.8em;
    padding: 8px;
    text-align: center;
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0); /* Show caption on hover */
}

/* Single Image Figure Shortcode */
.shortcode-figure {
    margin: 2.5em auto; /* 상하 여백 */
    padding: 0;
    background-color: var(--code-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /*
    max-width: 100%; /* 이미지가 부모 요소를 넘어가지 않도록 함 */
}

.shortcode-figure img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

.shortcode-figure figcaption {
    padding: 12px 20px; /* 상하 여백을 15px -> 12px로 줄여 이미지와의 간격 축소 */
    font-size: 0.85em;  /* 글자 크기를 0.9em -> 0.85em으로 축소 */
    color: var(--subtle-text-color);
    text-align: center;
    line-height: 1.6;
}

.shortcode-figure figcaption p {
    margin: 0;
}

/* Position options */
.shortcode-figure.position-center {
    display: block;
}

.shortcode-figure.position-left {
    float: left;
    margin-right: 2em;
    max-width: 50%; /* 좌우 배치 시 이미지 크기 조절 */
}

.shortcode-figure.position-right {
    float: right;
    margin-left: 2em;
    max-width: 50%; /* 좌우 배치 시 이미지 크기 조절 */
}

/* Clearfix for floated figures */
.post-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Blockquote Styles */
blockquote {
    margin: 2em 0;
    padding: 15px 25px;
    background-color: var(--code-bg-color);
    border-left: 5px solid var(--accent-color); /*
    border-radius: 0 8px 8px 0; /* 왼쪽 테두리를 제외한 모서리를 둥글게 */
    color: var(--text-color);
}

blockquote p {
    margin: 0;
    font-style: italic; /* 인용문 텍스트를 이탤릭체로 */
    font-size: 1.05em; /* 텍스트를 약간 크게 */
}

blockquote footer {
    margin-top: 15px;
    font-style: normal;
    font-size: 0.9em;
    text-align: right;
    color: var(--subtle-text-color);
}

blockquote footer::before {
    content: "— ";
}

/* Tag Cloud on Homepage */
.tag-cloud {
    background-color: var(--code-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px 30px;
    margin-bottom: 50px;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--subtle-text-color);
    text-align: left;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    padding: 0;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px; /* 상하 간격은 10px, 좌우 간격은 20px로 조정 */
}

.tag-item {
    /* 기존 배경, 테두리, 패딩 속성 모두 제거 */
    background-color: transparent;
    border: none;
    padding: 0;

    /* 텍스트 링크 스타일 적용 */
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: var(--border-color); /* 밑줄 색상을 은은하게 */
    font-size: 1em; /* 폰트 크기를 본문과 맞춤 */
    transition: all 0.2s ease;
}

.tag-item:hover {
    /* 호버 시 배경색 변경 대신 텍스트와 밑줄 색상 변경 */
    color: var(--accent-color);
    text-decoration-color: var(--accent-color);
}

.tag-item span {
    font-size: 0.9em;
    color: var(--subtle-text-color);
    margin-left: 4px;
}

/* 호버 시 카운트 숫자 색상은 변경하지 않음 */
.tag-item:hover span {
    color: var(--subtle-text-color);
}

/* ==========================================================================
   Responsive Styles (for screens 768px or less)
   ========================================================================== */
@media screen and (max-width: 768px) {

    /* --- 기본 레이아웃 및 폰트 --- */
    body {
        font-size: 16px; /* 모바일에서 기본 폰트 크기 살짝 줄임 */
    }

    .container {
        padding: 25px 15px; /* 좌우 여백을 줄여 콘텐츠 영역 확보 */
    }

    h1, .post-title {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* --- 헤더 및 푸터 --- */
    .site-header {
        flex-direction: column; /* 로고와 메뉴를 세로로 쌓음 */
        align-items: flex-start;
        margin-bottom: 40px;
    }
    
    .site-navigation {
        margin-top: 20px;
    }

    .site-navigation li {
        margin-left: 0;
        margin-right: 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
    }

    /* --- Figure 쇼트코드 (좌우 정렬 해제) --- */
    .shortcode-figure.position-left,
    .shortcode-figure.position-right {
        float: none;
        max-width: 100%; /* 너비를 100%로 되돌림 */
        margin: 2em auto;
    }

    /* --- 포스트 목록 --- */
    .post-list-item {
        padding: 20px;
    }
    
    /* --- 페이지네이션 --- */
    .pagination a {
        padding: 6px 12px;
    }
}
/* Taxonomy Page Header (e.g., /tags/hugo/) */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 0;
}

.taxonomy-description {
    margin-top: 15px;
    font-size: 1.1em;
    color: var(--subtle-text-color);
}

/* Gallery Album List Styles */
.gallery-album-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.album-card {
    display: block;
    text-decoration: none;
    background-color: var(--code-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.album-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.album-cover {
    width: 100%;
    aspect-ratio: 1 / 1; /* 이미지 비율을 1:1 정사각형으로 강제 */
    object-fit: cover;
    display: block;
}

.album-info {
    padding: 20px;
}

.album-title {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: var(--text-color);
    border: none;
    padding: 0;
}

.album-summary {
    margin: 0 0 15px 0;
    font-size: 0.95em;
    color: var(--subtle-text-color);
}

.album-meta {
    font-size: 0.85em;
    color: var(--subtle-text-color);
}

.album-slug {
    font-family: "Fira Code", "Consolas", monospace; /* 코드 폰트 적용 */
    font-size: 0.8em;
    color: var(--subtle-text-color);
    background-color: var(--bg-color); /* 테마 배경색과 유사하게 처리 */
    padding: 2px 6px;
    border-radius: 4px;
    margin: -5px 0 15px 0;
    display: inline-block; /* 내용만큼만 너비를 차지하도록 */
}
