/* 부천YWCA Ghost 테마
   ---------------------------------------------------------------------------
   1.  변수 / 리셋
   2.  레이아웃 (본문 셸, 데스크톱 소개 패널)
   3.  헤더
   4.  캐러셀 공통
   5.  홈 - 주요 소식 배너
   6.  홈 - 사업 바로가기
   7.  홈 - 이 달의 책
   8.  소식 목록 / 페이지네이션
   9.  글 상세 + 본문(.gh-content)
   10. 아카이브 / 오류 화면
   11. 푸터
   --------------------------------------------------------------------------- */

/* 1. 변수 / 리셋
   -------------------------------------------------------------------------- */

:root {
    --accent: var(--ghost-accent-color, #1e40af);
    /* Ghost 관리자에서 고른 폰트가 있으면 그것을, 없으면 Noto Sans KR을 쓴다 */
    --font-stack: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
        "Malgun Gothic", sans-serif;
    --font-body: var(--gh-font-body, var(--font-stack));
    --font-heading: var(--gh-font-heading, var(--font-stack));
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6b7280;
    --line: #d1d5db;
    --line-soft: #e5e7eb;
    --surface: #ffffff;
    --surface-alt: #f3f4f6;
    --column: 32rem;
    --gutter: 1rem;
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: break-word;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

h1,
h2,
h3,
h4,
p,
figure,
dl,
dd {
    margin: 0;
}

h1,
h2,
h3,
h4,
.site-aside-tagline,
.site-brand-title,
.hero-title,
.article-title,
.archive-title,
.error-code {
    font-family: var(--font-heading);
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0;
}

/* 키보드 초점. 사진 위에 놓이는 요소는 파란 테두리가 묻혀서 흰색으로 바꾼다. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hero-link:focus-visible,
.glide__bullet:focus-visible {
    outline-color: #fff;
}

.site-donate:focus-visible {
    outline-offset: 3px;
}

/* 누를 수 있는 곳임을 데스크톱에서 알 수 있게 한다. */
.post-item-title,
.related-title,
.book-title,
.hero-scrim,
.site-donate {
    transition: color 0.15s ease, background 0.15s ease, filter 0.15s ease;
}

.post-item-link:hover .post-item-title,
.related-link:hover .related-title,
.book-link:hover .book-title {
    color: var(--accent);
}

.hero-link:hover .hero-scrim {
    background: linear-gradient(to top, rgb(0 0 0 / 0.75), rgb(0 0 0 / 0.15));
}

.site-donate:hover {
    filter: brightness(0.9);
}

.accent {
    color: var(--accent);
}

.empty {
    padding: 2rem 1rem;
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
}

.empty-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--accent);
    font-weight: 700;
}

/* 2. 레이아웃
   -------------------------------------------------------------------------- */

.site-shell {
    display: flex;
    justify-content: center;
}

.site {
    width: 100%;
    max-width: var(--column);
    min-height: 100vh;
    min-height: 100svh;
    background: var(--surface);
    overflow-x: hidden;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.site-main {
    display: block;
}


/* 데스크톱에서만 보이는 왼쪽 소개 패널 */
.site-aside {
    display: none;
}

@media (min-width: 640px) {
    .site-aside {
        display: flex;
        align-items: center;
        width: 100%;
        max-width: var(--column);
        height: 100vh;
        padding: 0 1.5rem;
    }
}

.site-aside-inner {
    width: 100%;
}

.site-aside-tagline {
    font-size: 2.25rem;
    line-height: 1.25;
    font-weight: 700;
}

.site-aside-tagline-accent {
    color: var(--accent);
}

.site-aside-donate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.site-aside-qr {
    width: 8rem;
    height: 8rem;
    padding: 1.5rem;
    flex: none;
}

.site-aside-donate-body {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}

.site-aside-donate-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.site-aside-donate-link {
    display: inline-block;
    margin-top: 0.25rem;
    color: #2563eb;
    font-weight: 700;
}

/* 3. 헤더
   -------------------------------------------------------------------------- */

/* 원본과 같이 스크롤을 따라 올라간다. `.site`의 overflow-x:hidden이 스크롤 컨테이너를
   만들어 버려서 position:sticky를 걸어도 걸리지 않는다. */
.site-header {
    background: var(--surface);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem;
}

.site-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 2rem;
    color: var(--ink-soft);
}

.site-search:hover {
    color: var(--accent);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding-top: 0.25rem;
}

.site-brand-logo {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.site-brand-title {
    font-size: 1.125rem;
    line-height: 1.4;
}

.site-donate {
    display: inline-flex;
    align-items: center;
    flex: none;
    border-radius: 9999px;
    background: var(--accent);
    color: #fff;
    padding: 0.6875rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1;
}

/* 4. 캐러셀
   슬라이드 폭·간격·순환은 Glide(assets/js/glide.min.js)가 맡고, 여기서는 원본의
   px-4 여백만 다시 준다. 불릿 모양과 위치는 glide.min.css의 기본 테마 그대로다.
   -------------------------------------------------------------------------- */

.hero-slide,
.book {
    padding: 0 var(--gutter);
}

/* 점 크기는 Glide 기본값 9px 그대로 두고 눌리는 범위만 24px로 넓힌다.
   WCAG 2.2 SC 2.5.8은 24px 미만 대상끼리 겹치지 않을 것도 요구하므로 간격도 함께 벌린다. */
.glide__bullet {
    position: relative;
    margin: 0 0.5em;
}

.glide__bullet::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
}

/* 5. 홈 - 주요 소식 배너
   -------------------------------------------------------------------------- */

.hero-link {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.hero-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: top;
}

.hero-image-empty {
    display: block;
    background: var(--surface-alt);
}

.hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(0 0 0 / 0.6), transparent);
}

.hero-body {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 3rem;
    padding: 1rem;
    color: #fff;
}

.hero-title {
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 700;
}

.hero-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 6. 홈 - 사업 바로가기
   -------------------------------------------------------------------------- */

/* 왼쪽에 정사각 아이콘, 오른쪽에 가운데 정렬 제목(두 줄까지). 이 배치는 가로 폭을
   먹어서 3열로는 제목 칸이 50px대로 줄어든다. 그래서 2열로 둔다. */
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.shortcut:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.shortcut-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border-radius: var(--radius);
    object-fit: cover;
}

.shortcut-icon-empty {
    display: block;
    background: var(--surface-alt);
}

.shortcut-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.35;
}

/* 7. 홈 - 이 달의 책
   -------------------------------------------------------------------------- */

.section-title {
    padding: 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    font-weight: 700;
}

/* 소식 구역에만 붙는 검색 진입점. 목록과 페이지네이션 아래, 게시판이 검색창을 두는 자리다. */
.section-tools {
    display: flex;
    justify-content: center;
    padding: 0 1rem 1.5rem;
}

.section-search {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: none;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 9999px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--ink-soft);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.section-search:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.books {
    padding: 1rem 0;
}

.book {
    text-align: center;
}

.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    object-position: top;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.book-cover-empty {
    display: block;
    background: var(--surface-alt);
}

.book-title {
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
}

.book-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--muted);
}

/* 8. 소식 목록 / 페이지네이션
   -------------------------------------------------------------------------- */

.post-item-link {
    display: block;
    padding: 1rem;
}

.post-item-thumb {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.post-item-thumb-empty {
    display: block;
    background: var(--surface-alt);
}

.post-item-body {
    padding: 1rem 1rem 0;
}

.post-item-title {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 700;
}

.post-item-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
}

.post-item-date {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted);
}

/* 게시판형. 번호에 배경을 깔지 않고 현재 쪽만 색과 밑줄로 구분한다. */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.pagination-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    color: var(--ink-soft);
}

.pagination-step.is-disabled {
    color: var(--line);
    pointer-events: none;
}

.pagination-pages {
    padding: 0 0.75rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.pagination-nums {
    display: inline-flex;
    align-items: center;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 2rem;
    padding: 0 0.125rem;
    font-size: 0.875rem;
    line-height: 1;
    color: var(--ink-soft);
}

.pagination-num:hover {
    color: var(--accent);
}

.pagination-num.is-current {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* 9. 글 상세 + 본문
   -------------------------------------------------------------------------- */

.article {
    padding: 0 1rem 1rem;
}

.article-header {
    padding-top: 0.5rem;
}

.article-kicker {
    color: var(--ink-soft);
    font-size: 0.875rem;
}

/* 36px은 데스크톱 폭을 전제한 크기라 343px 칸에서는 긴 제목이 네 줄까지 갔다.
   28px로 낮춰 아카이브 제목과 단계를 맞춘다. */
.article-title {
    margin: 0.5rem 0;
    font-size: 1.75rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.article-byline {
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--muted);
    display: flex;
    gap: 0.5rem;
}

.article-figure {
    margin: 1.5rem 0;
}

.article-figure img {
    width: 100%;
    border-radius: var(--radius);
}

.article-figure figcaption {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

.gh-content {
    padding: 1rem 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ink);
}

.gh-content > * {
    margin: 0 0 1.25rem;
}

.gh-content > :last-child {
    margin-bottom: 0;
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4 {
    margin: 2rem 0 0.75rem;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.gh-content h1 {
    font-size: 1.5rem;
}

.gh-content h2 {
    font-size: 1.25rem;
}

.gh-content h3 {
    font-size: 1.125rem;
}

.gh-content h4 {
    font-size: 1rem;
}

.gh-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gh-content ul,
.gh-content ol {
    padding-left: 1.25rem;
}

.gh-content ul {
    list-style: disc;
}

.gh-content ol {
    list-style: decimal;
}

.gh-content li {
    margin-bottom: 0.5rem;
}

.gh-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    color: var(--ink-soft);
}

.gh-content hr {
    border: 0;
    border-top: 1px solid var(--line);
}

.gh-content img,
.gh-content video,
.gh-content iframe {
    max-width: 100%;
    height: auto;
}

.gh-content figure img {
    border-radius: var(--radius);
}

.gh-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--muted);
    text-align: center;
}

.gh-content pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: var(--radius);
    background: #1f2937;
    color: #f9fafb;
    font-size: 0.875rem;
    line-height: 1.6;
}

.gh-content :not(pre) > code {
    padding: 0.125rem 0.3125rem;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    font-size: 0.9em;
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.gh-content th,
.gh-content td {
    border: 1px solid var(--line-soft);
    padding: 0.5rem;
    text-align: left;
}

/* 코이닉 카드 폭 — 좁은 한 칼럼 레이아웃에 맞춰 좌우 여백만 걷어낸다 */
.gh-content .kg-width-wide,
.gh-content .kg-width-full {
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    width: calc(100% + var(--gutter) * 2);
    max-width: none;
}

.gh-content .kg-width-full img {
    border-radius: 0;
}

.gh-content .kg-card + .kg-card {
    margin-top: 1.25rem;
}

/* 관련 글 */
.related-item + .related-item {
    border-top: 1px solid var(--line-soft);
}

.related-link {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.related-thumb {
    width: 5rem;
    height: 5rem;
    flex: none;
    object-fit: cover;
    border-radius: var(--radius);
}

.related-thumb-empty {
    display: block;
    background: var(--surface-alt);
}

.related-body {
    min-width: 0;
    padding: 0.25rem 0;
}

.related-title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
}

/* 10. 아카이브 / 오류 화면
   -------------------------------------------------------------------------- */

.archive-header {
    padding: 1.5rem 1rem 0.5rem;
}

.archive-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.archive-title {
    font-size: 1.75rem;
    line-height: 1.3;
    font-weight: 700;
}

.archive-description {
    margin-top: 0.5rem;
    color: var(--ink-soft);
}

.archive-count {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.error {
    padding: 4rem 1rem 2rem;
    text-align: center;
}

.error-code {
    font-size: 3rem;
    line-height: 1;
    font-weight: 700;
    color: var(--accent);
}

.error-title {
    margin-top: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.error-message {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.error-link {
    display: inline-block;
    margin-top: 1.5rem;
    border-radius: 9999px;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 11. 푸터
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: 1rem;
}

.site-footer-org {
    padding: 1rem;
}

.site-footer-org-name {
    font-size: 1rem;
}

.site-footer-meta {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.site-footer-meta-row {
    display: flex;
    gap: 0.5rem;
}

.site-footer-meta dt {
    color: var(--muted);
    flex: none;
}

.site-footer-meta dd {
    color: var(--ink-soft);
}

/* 폭을 25%로 통일해 줄을 가지런히 맞춘다. 높이를 대신 맞춰 보면 세로로 긴 국세청 로고만
   폭이 좁아져 오히려 들쭉날쭉해 보인다. 밀림 방지는 img의 width/height 속성이 맡는다. */
.site-partners {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    padding: 1rem;
}

.site-partners a {
    width: 25%;
}

.site-copyright {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted);
}
