/*
Theme Name: 지원금 한눈에
Description: 대상별 지원금, 검색, 신청 안내를 위한 퓨처셀프 워드프레스 테마.
Version: 1.1.1
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: jiwongeum-hannune
*/

:root {
    color-scheme: light;
    --ink: #152139;
    --muted: #52627c;
    --blue: #2155a2;
    --navy: #14294e;
    --line: #dce4ef;
    --paper: #f1f4f7;
    --white: #fff;
    --shell: 1120px;
    --topic-columns: 2;
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--font); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
img, video { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid #6a85d6; outline-offset: 4px; }
[hidden] { display: none !important; }
.screen-reader-text, .skip-to-content:not(:focus) {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-to-content:focus { position: absolute; top: .5rem; left: .5rem; z-index: 3; padding: .7rem 1rem; background: var(--white); color: var(--navy); }
.shell { width: min(var(--shell), calc(100% - 3rem)); margin-inline: auto; }

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .625rem; flex: none; font-size: 1.125rem; font-weight: 800; letter-spacing: -.055em; }
.brand-image img { display: block; max-width: 180px; max-height: 44px; width: auto; object-fit: contain; }
.brand-mark { position: relative; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); }
.brand-mark::before {
    content: ''; position: absolute; left: 10px; top: 8px; width: 13px; height: 15px;
    border: 1.5px solid #fff; border-radius: 2px;
}
.brand-mark::after {
    content: ''; position: absolute; left: 13px; top: 12px; width: 7px; height: 4px;
    border: solid #fff; border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg);
}
.site-nav { display: flex; gap: clamp(1.2rem, 3.5vw, 2.5rem); align-items: center; font-size: .925rem; font-weight: 650; }
.site-nav a:hover, .footer-links a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: .3em; }
.header-search { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--blue); }
.header-search:hover { background: #edf3ff; }
.search-icon { display: block; position: relative; width: 16px; height: 16px; border: 1.75px solid currentColor; border-radius: 50%; flex: none; }
.search-icon::after { content: ''; position: absolute; width: 6px; height: 1.75px; right: -4px; bottom: -2px; background: currentColor; transform: rotate(47deg); border-radius: 2px; }

.home-main { padding-block: 2.4rem 3rem; }
.hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, 365px); align-items: end;
    gap: 1.2rem 2rem; padding: .75rem 0 1.75rem; border-bottom: 1px solid var(--line);
}
.hero h1 { margin: 0; font-size: clamp(2.18rem, 4.35vw, 3.55rem); font-weight: 800; line-height: 1.17; letter-spacing: -.065em; overflow-wrap: anywhere; }
.hero-main > p { margin: .85rem 0 0; color: var(--muted); font-size: clamp(.925rem, 1.55vw, 1.02rem); letter-spacing: -.024em; }
.hero-search { min-width: 0; }
.site-search {
    max-width: 535px; min-width: 0; min-height: 61px; display: flex; align-items: center; gap: .75rem;
    padding: .375rem .375rem .375rem 1.125rem; border-radius: 13px; border: 1px solid var(--line);
    background: var(--white); color: var(--blue);
}
.site-search:focus-within { outline: 2px solid #829bea; outline-offset: 3px; }
.site-search input { flex: 1; min-width: 0; min-height: 38px; background: transparent; border: 0; outline: 0; color: var(--ink); padding: 0 .2rem; }
.site-search input::placeholder { color: #65738d; }
.site-search button { align-self: stretch; flex: none; min-width: 86px; border: 0; border-radius: 9px; background: var(--blue); color: var(--white); font-weight: 750; }
.site-search button:hover { filter: brightness(.9); }
.site-search button span { margin-left: .25rem; font-weight: 500; }

.home-section { margin-top: clamp(1.9rem, 4vw, 2.75rem); }
.home-section h2, .guide-section h2 { margin: 0 0 1rem; font-size: clamp(1.3rem, 2.4vw, 1.65rem); letter-spacing: -.055em; line-height: 1.35; }
.topic-section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1.2rem; margin-bottom: .9rem; }
.topic-section-header h2 { margin: 0; }
.topic-nav { display: flex; flex-wrap: wrap; gap: .42rem; }
.topic-nav a {
    background: #fff; border: 1px solid var(--line); border-radius: 7px; color: #34445f;
    padding: .26rem .65rem; font-size: .8rem; line-height: 1.55; font-weight: 700;
}
.topic-nav a:hover { border-color: var(--blue); color: var(--blue); }
.topic-grid, .post-grid { display: grid; gap: .95rem; }
.topic-grid { grid-template-columns: repeat(var(--topic-columns), minmax(0, 1fr)); }
.post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-grid > .post-card:only-child { grid-column: 1 / -1; }
.topic-card {
    display: grid; grid-template: "title art" auto "details art" 1fr "action action" auto / minmax(0, 1fr) clamp(88px, 10vw, 126px);
    align-items: start; gap: .65rem .85rem; min-height: 196px; padding: 1.25rem; background: var(--white);
    border: 1px solid var(--line); border-radius: 19px;
    transition: border-color .18s, box-shadow .18s;
}
.topic-card:hover { border-color: #a9bfde; box-shadow: 0 6px 19px #28416615; }
.topic-title { grid-area: title; }
.topic-title h3 { margin: 0 0 .38rem; font-size: clamp(1.12rem, 2.15vw, 1.48rem); line-height: 1.33; letter-spacing: -.05em; }
.topic-title p { margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.55; word-break: keep-all; }
.topic-description { grid-area: details; align-self: end; margin-bottom: .2rem; color: var(--muted); font-size: .81rem; line-height: 1.4; }
.topic-art {
    grid-area: art; display: block; width: 100%; aspect-ratio: 1; border-radius: 14px;
    background: #eef3f8 url('assets/category-art.jpg') no-repeat;
    background-size: 300% 200%;
}
.art-youth { background-position: 0 0; }
.art-work { background-position: 50% 0; }
.art-parenting { background-position: 100% 0; }
.art-business { background-position: 0 100%; }
.art-senior { background-position: 50% 100%; }
.art-welfare { background-position: 100% 100%; }
.topic-cta {
    grid-area: action; display: flex; justify-content: space-between; align-items: center; gap: .6rem;
    padding: .55rem .8rem; min-height: 43px; border-radius: 9px; background: var(--blue); color: var(--white);
    font-size: .91rem; font-weight: 740;
}
.topic-card:hover .topic-cta { filter: brightness(.9); }

.post-card, .empty-note { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 1.15rem 1.25rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: .48rem .65rem; align-items: center; color: var(--muted); font-size: .78rem; }
.post-meta span { color: var(--blue); background: #edf2fd; padding: .05rem .42rem; border-radius: 4px; font-weight: 650; }
.post-card h3 { font-size: 1.08rem; line-height: 1.45; letter-spacing: -.04em; margin: .65rem 0 .42rem; overflow-wrap: anywhere; }
.post-card h3 a:hover, .empty-note a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: .25em; }
.post-card p, .empty-note { color: var(--muted); font-size: .92rem; line-height: 1.65; margin: 0; }
.empty-note p { margin: 0 0 .45rem; }
.empty-note a { color: var(--blue); font-weight: 700; }
.guide-section { margin-top: 2.35rem; display: flex; align-items: center; justify-content: space-between; gap: 1.1rem 1.5rem; padding: 1.4rem 1.5rem; background: #e9effc; border: 1px solid #d7e2f8; border-radius: 16px; }
.guide-section h2 { margin-bottom: .3rem; font-size: 1.22rem; }
.guide-section p { margin: 0; color: var(--muted); font-size: .925rem; }
.guide-links { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.guide-links a { display: inline-flex; gap: .48rem; align-items: center; padding: .55rem .72rem; color: var(--blue); background: var(--white); border: 1px solid #ccdaf6; border-radius: 8px; white-space: nowrap; font-size: .85rem; font-weight: 700; }
.guide-links a:hover { border-color: var(--blue); }

.site-footer { background: var(--white); border-top: 1px solid var(--line); padding-block: 1.65rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; gap: .75rem 2rem; }
.footer-name { font-size: 1rem; letter-spacing: -.04em; font-weight: 800; }
.footer-inner p, .footer-links { color: var(--muted); font-size: .82rem; }
.footer-inner p { margin: .32rem 0 0; }
.footer-links { display: flex; gap: 1.05rem; }

.page-main { min-height: 63vh; padding-block: 2.25rem 3rem; }
.page-intro { margin-bottom: 1.45rem; }
.page-intro h1, .article-header h1 { margin: .65rem 0 1.05rem; font-size: clamp(1.85rem, 4vw, 3rem); line-height: 1.25; letter-spacing: -.065em; overflow-wrap: anywhere; }
.back-link { color: var(--blue); font-size: .9rem; font-weight: 730; }
.back-link:hover { text-decoration: underline; text-underline-offset: .25em; }
.article-surface { max-width: 795px; margin-inline: auto; padding: clamp(1.15rem, 4.8vw, 3.1rem); border: 1px solid var(--line); border-radius: 19px; background: var(--white); }
.article-header { margin-bottom: 1.7rem; border-bottom: 1px solid var(--line); padding-bottom: 1.15rem; }
.article-header time { color: var(--muted); font-size: .88rem; }
.article-content { font-size: 1.035rem; line-height: 1.82; overflow-wrap: anywhere; }
.article-content h2 { margin: 1.85rem 0 .65rem; font-size: clamp(1.25rem, 2.6vw, 1.55rem); line-height: 1.4; letter-spacing: -.04em; }
.article-content h3 { margin: 1.4rem 0 .5rem; font-size: 1.2rem; line-height: 1.45; }
.article-content p, .article-content ul, .article-content ol { margin: 0 0 1rem; }
.article-content ul, .article-content ol { padding-left: 1.4rem; }
.article-content a, .article-comments a { color: var(--blue); text-decoration: underline; text-underline-offset: .22em; }
.article-content iframe { max-width: 100%; }
.article-content table { width: 100%; border-collapse: collapse; }
.article-content td, .article-content th { border: 1px solid var(--line); padding: .52rem; }
.article-content pre, .article-content .wp-block-table { overflow: auto; }
.article-content .benefit-overview, .article-content .benefit-links {
    margin: 1.35rem 0; padding: 1.05rem 1.2rem; background: #eef4fc; border: 1px solid #dbe6f6; border-radius: 13px;
}
.article-content .benefit-overview h2, .article-content .benefit-links h2 { margin-top: 0; }
.article-content .benefit-overview p:last-child, .article-content .benefit-links p:last-child { margin-bottom: 0; }
.benefit-facts { margin: .3rem 0 .6rem; }
.benefit-facts > div { display: grid; grid-template-columns: minmax(78px, 120px) 1fr; gap: .65rem; padding: .4rem 0; }
.benefit-facts > div + div { border-top: 1px solid #dbe6f6; }
.benefit-facts dt { color: var(--navy); font-weight: 750; }
.benefit-facts dd { margin: 0; }
.benefit-checked { color: var(--muted); font-size: .85rem; }
.article-content details {
    margin: 0 0 .7rem; padding: .65rem .85rem; background: var(--white); border: 1px solid var(--line); border-radius: 9px;
}
.article-content summary { cursor: pointer; font-weight: 700; }
.article-content details > p { margin: .5rem 0 0; }
.benefit-link-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.article-content .benefit-button {
    display: inline-flex; align-items: center; min-height: 41px; padding: .4rem .65rem; border-radius: 7px;
    background: var(--blue); color: var(--white); font-size: .9rem; font-weight: 700; text-decoration: none;
}
.article-content .benefit-button:hover { filter: brightness(.9); }
.related-benefits { margin-top: 2.1rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.related-benefits h2 { margin: 0 0 .75rem; color: var(--navy); font-size: 1.25rem; line-height: 1.4; letter-spacing: -.04em; }
.related-benefits ul { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.related-benefits a {
    display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; gap: .7rem;
    padding: .5rem .75rem .5rem .5rem; border: 1px solid var(--line); border-radius: 10px; background: #f8fafd;
}
.related-benefits a:hover { border-color: #a9bfde; }
.related-benefits a:hover .related-benefit-title { color: var(--blue); text-decoration: underline; text-underline-offset: .22em; }
.related-benefit-art { grid-area: auto; position: relative; width: 100%; aspect-ratio: 1; border-radius: 7px; }
.related-benefit-art:not(.topic-art) { background: #e9effc; color: var(--blue); }
.related-benefit-art:not(.topic-art)::before {
    content: ''; position: absolute; inset: 24% 31%; border: 1.5px solid currentColor; border-radius: 3px;
}
.related-benefit-art:not(.topic-art)::after {
    content: ''; position: absolute; inset: 41% 40%; border-block: 1.5px solid currentColor;
}
.related-benefit-category { display: block; margin-bottom: .08rem; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.related-benefit-title { display: block; font-size: 1rem; line-height: 1.4; font-weight: 730; overflow-wrap: anywhere; word-break: keep-all; }
.related-benefit-arrow { color: var(--blue); font-size: 1.05rem; }
.article-comments { margin-top: 1.25rem; }
.article-comments input:not([type='checkbox']), .article-comments textarea { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: .45rem; }
.article-comments input[type='submit'] { padding: .5rem 1rem; color: var(--white); background: var(--blue); border: 0; cursor: pointer; }
.pagination { margin-top: 1.15rem; }
.pagination .page-numbers { display: inline-block; padding: .25rem .55rem; border-radius: 6px; }
.pagination .current, .pagination a:hover { background: #e2eafb; color: var(--blue); }

@media (max-width: 850px) {
    .shell { width: calc(100% - 2rem); }
    .hero { grid-template-columns: minmax(0, 1fr) minmax(220px, .78fr); }
    .topic-grid, .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .guide-section { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
    .header-inner { flex-wrap: wrap; gap: .35rem 1rem; padding-block: .55rem 0; }
    .header-search { margin-left: auto; width: 38px; height: 38px; }
    .site-nav { order: 3; flex: 1 0 100%; min-height: 40px; border-top: 1px solid #edf1f6; justify-content: space-between; gap: .45rem; font-size: .85rem; }
    .home-main, .page-main { padding-top: 1.05rem; }
    .hero { grid-template-columns: 1fr; gap: 1rem; padding: .75rem 0 1.15rem; }
    .hero h1 { font-size: clamp(1.84rem, 7.8vw, 2.66rem); }
    .hero-main > p { margin-top: .65rem; }
    .site-search { min-height: 53px; gap: .55rem; padding-left: .7rem; }
    .site-search input { font-size: .86rem; }
    .site-search button { min-width: 62px; font-size: .88rem; }
    .site-search button span { display: none; }
    .topic-grid { grid-template-columns: 1fr; gap: .65rem; }
    .topic-card { grid-template-columns: minmax(0, 1fr) clamp(80px, 22vw, 105px); gap: .55rem .75rem; padding: .95rem; min-height: 0; border-radius: 15px; }
    .topic-art { border-radius: 11px; }
    .topic-cta { min-height: 41px; }
    .post-grid { grid-template-columns: 1fr; }
    .guide-section { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
