/*
 Theme Name:   Astra Child - 첫번째치과의원
 Theme URI:    https://yourfirstdent.com/column/
 Description:  첫번째치과의원 워드프레스 칼럼용 차일드 테마 (자체완결형)
 Author:       첫번째치과의원
 Template:     astra
 Version:      2.0.0
 Text Domain:  astra-child
*/

/* ─── WP Admin Bar ─── */
@media screen and (max-width: 600px) { #wpadminbar { position: fixed; } }
#ast-scroll-top { display: none !important; }

/* ─── 글로벌 리셋 ─── */
body { margin: 0 !important; padding: 0 !important; font-family: "Pretendard", -apple-system, sans-serif; }
#page { margin-top: 0 !important; padding-top: 0 !important; }
#page > *:first-child { margin-top: 0 !important; }
.wp-site-blocks > *:first-child { margin-block-start: 0 !important; }
.site-content { margin-top: 0 !important; }
/* ─── Astra 기본 헤더/푸터 숨기기 ─── */
#masthead, .site-header, .main-header-bar, .ast-above-header-bar, .ast-above-header,
.ast-mobile-header-wrap, .ast-main-header-bar-alignment { display: none !important; }
.site-footer, .ast-small-footer, .site-below-footer-wrap, .ast-footer-copyright,
.ast-footer-overlay, .site-below-footer-col-1, #colophon,
footer.entry-footer { display: none !important; }

/* ─── PC 헤더 (메인 사이트 header.css 동일) ─── */
.col-pc-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 110; background: #fff; border-bottom: 1px solid #eee; height: 70px; display: flex; align-items: center; justify-content: center; }
.col-pc-header .hd_wrap { max-width: 1440px; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.col-pc-header h1 img { height: 36px; width: auto; }
.col-pc-header ul { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; align-items: center; }
.col-pc-header ul li a { font-size: 15px; font-weight: 500; color: #333; text-decoration: none; transition: color 0.2s; letter-spacing: -0.3px; white-space: nowrap; }
.col-pc-header ul li a:hover, .col-pc-header ul li.active a { color: #20508d; font-weight: 700; }
.col-pc-header ul li:last-child a { background: #20508d; color: #fff !important; padding: 8px 18px; border-radius: 6px; font-weight: 600; }
.col-pc-header ul li:last-child a:hover { opacity: 0.85; }
#page { padding-top: 70px !important; }

/* ─── 모바일 헤더 (메인 사이트 m_header.css 동일) ─── */
.col-mo-header { display: none !important; }
@media (max-width: 768px) {
    .col-pc-header { display: none !important; }
    .col-mo-header { display: flex !important; width: 100%; box-sizing: border-box; background: #929292; box-shadow: 0 3px 6px rgba(0,0,0,0.16); padding: 0 20px; height: 60px; position: fixed; left: 0; top: 0; z-index: 101; transition: all 0.2s; align-items: center; overflow: visible; }
    .col-mo-header .hd_wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; overflow: visible; }
    .col-mo-header h1 img { filter: grayscale(1) brightness(10); height: 28px; width: auto; }
    #page { padding-top: 60px !important; }
    /* 햄버거 SVG 메뉴 */
    .col-mo-header .menu { position: relative; z-index: 102; flex-shrink: 0; }
    .col-mo-header .menu label { display: block; cursor: pointer; width: 50px; height: 50px; position: relative; overflow: visible; }
    .col-mo-header .menu input { display: none; }
    .col-mo-header .menu circle { fill-opacity: 0; }
    .col-mo-header .menu svg { width: 100%; height: 100%; }
    .col-mo-header .menu path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; --length: 24; --offset: -38; stroke-dasharray: var(--length) var(--total-length); stroke-dashoffset: var(--offset); transition: all 0.8s cubic-bezier(0.645,0.045,0.355,1); }
    .col-mo-header .menu--3 .line--1, .col-mo-header .menu--3 .line--3 { --total-length: 126.38; }
    .col-mo-header .menu--3 .line--2 { --total-length: 80; }
    .col-mo-header .menu--3 input:checked + svg .line--1, .col-mo-header .menu--3 input:checked + svg .line--3 { --offset: -109.177; }
    .col-mo-header .back input:checked + svg .line--1, .col-mo-header .back input:checked + svg .line--3 { --length: 8.602; }
    /* 전체화면 네비게이션 */
    .col-mo-header .m_nav { position: fixed; right: -100vw; top: 0; width: 100vw; height: 100%; background: #fff; transition: all 0.5s; z-index: -1; margin-top: 60px; display: flex; flex-direction: column; justify-content: center; list-style: none; margin-left: 0; padding: 0; }
    .col-mo-header .m_nav.active { right: 0; }
    .col-mo-header .m_nav > li > a { display: block; text-align: center; font-size: 28px; font-weight: 700; line-height: 56px; color: #333; text-decoration: none; }
    .col-mo-header .m_nav > li > a:hover { color: #20508d; }
    .col-mo-header .m_nav > img { position: absolute; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); z-index: -1; filter: opacity(0.08); width: 80%; animation: col-m-logo 30s infinite linear; }
    @keyframes col-m-logo { 0% { transform: translateX(-50%) translateY(-50%) rotateY(0deg); } 100% { transform: translateX(-50%) translateY(-50%) rotateY(360deg); } }
}

/* ─── 푸터 ─── */
.wp-col-footer { background: #002d67; padding: 40px 20px; }
.wp-col-footer .ft-inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: flex-start; justify-content: flex-start; gap: 50px; }
.wp-col-footer .ft-logo img { height: 30px; width: auto; filter: brightness(0) invert(1); margin-bottom: 20px; }
.wp-col-footer .ft-info p { font-size: 14px; color: rgba(255,255,255,0.6); line-height: 1.8; margin: 0; }
.wp-col-footer .ft-price { margin-top: 20px; }
.wp-col-footer .ft-price a { display: inline-flex; align-items: center; justify-content: center; background: #20508d; color: #fff; text-decoration: none; padding: 12px 28px; border-radius: 100px; font-size: 15px; font-weight: 500; }
@media (max-width: 768px) {
    .wp-col-footer { padding: 30px 20px 100px; }
    .wp-col-footer .ft-inner { flex-direction: column; gap: 20px; }
    .wp-col-footer .ft-info p { font-size: 13px; }
}

/* ─── 퀵메뉴 (메인 사이트 aside.quick_menu 동일) ─── */
.wp-col-quick { position: fixed; bottom: 42px; right: 20px; z-index: 99; display: flex; flex-direction: column; gap: 10px; }
.wp-col-quick a { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; backdrop-filter: blur(19px); -webkit-backdrop-filter: blur(19px); background: rgba(0,0,0,0.3); box-shadow: 0 3px 6px rgba(0,0,0,0.16); transition: transform 0.2s; }
.wp-col-quick a:hover { transform: scale(1.1); }
.wp-col-quick img { width: 56px; height: 56px; }
@media (max-width: 768px) {
    .wp-col-quick { bottom: 20px; right: 12px; gap: 8px; }
    .wp-col-quick a { width: 48px; height: 48px; }
    .wp-col-quick img { width: 48px; height: 48px; }
}

/* ─── 컨테이너 ─── */
.ast-container { max-width: 1200px; margin: 0 auto; }
.ast-separate-container .ast-article-post { background: #fff; border: 1px solid #eee; border-radius: 12px; overflow: hidden; transition: box-shadow 0.3s ease, transform 0.2s ease; }
.ast-separate-container .ast-article-post:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }

/* ─── 그리드 ─── */
.ast-row { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 24px !important; }
.ast-row .ast-grid-common-col { margin-bottom: 0 !important; }
@media (max-width: 921px) { .ast-row { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 544px) { .ast-row { grid-template-columns: 1fr !important; } }

/* ─── 썸네일 ─── */
.post-thumb img { width: 100%; height: 200px; object-fit: cover; border-radius: 12px 12px 0 0; }
.ast-no-thumb .post-thumb { display: none; }

/* ─── 카테고리 뱃지 ─── */
.cat-links { margin-top: 16px; display: block; }
.cat-links a { background: #20508d; color: #fff !important; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-decoration: none; display: inline-block; }

/* ─── 글 제목 ─── */
.blog .entry-title { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 12px 0 8px; }
.blog .entry-title a { color: #222; text-decoration: none; }
.blog .entry-title a:hover { color: #20508d; }

/* ─── 메타 ─── */
.blog-layout-4 header.entry-header, .ast-article-post header.entry-header { all: unset !important; display: block !important; }
.entry-meta { font-size: 13px; color: #999; margin-bottom: 8px; }
.entry-meta a { color: #999; text-decoration: none; }
.entry-meta .author-name { font-weight: 600; color: #444; }

/* ─── 발췌 ─── */
.ast-excerpt-container { font-size: 14px; color: #666; line-height: 1.6; }
.ast-excerpt-container p { margin: 0; }
.blog-layout-4 .post-content { padding: 20px; }

/* ─── 페이지네이션 ─── */
.ast-pagination { text-align: center; margin: 40px 0; }
.ast-pagination .page-numbers { display: inline-block; padding: 8px 14px; margin: 0 4px; border-radius: 8px; font-size: 14px; color: #666; text-decoration: none; border: 1px solid #ddd; }
.ast-pagination .page-numbers.current { background: #20508d; color: #fff; border-color: #20508d; }

/* ─── 싱글 포스트 ─── */
.ast-single-post .ast-article-single { background: #fff; border-radius: 12px; padding: 40px; max-width: 860px; margin: 30px auto; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.ast-single-post .entry-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.ast-single-post .entry-title { font-size: 28px; font-weight: 800; line-height: 1.4; margin-bottom: 12px; color: #222; }
.ast-single-post .entry-content { font-size: 16px; line-height: 1.9; color: #333; }
.ast-single-post .entry-content p { margin-bottom: 1.5em; }
.ast-single-post .entry-content img { border-radius: 8px; max-width: 100%; height: auto; }
.ast-single-post .entry-content h2 { font-size: 22px; font-weight: 700; margin: 2em 0 0.8em; padding-left: 14px; border-left: 4px solid #20508d; }
.ast-single-post .entry-content h3 { font-size: 18px; font-weight: 700; margin: 1.5em 0 0.6em; color: #444; }
.ast-single-post .entry-content blockquote { background: #f7f8f6; border-left: 4px solid #20508d; padding: 16px 20px; margin: 1.5em 0; border-radius: 0 8px 8px 0; }
.ast-single-post .navigation.post-navigation { max-width: 860px; margin: 0 auto 30px; background: #fff; border-radius: 12px; padding: 0; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.ast-single-post .nav-links { display: flex; }
.ast-single-post .nav-links > div { flex: 1; }
.ast-single-post .nav-links a { display: flex; align-items: center; gap: 12px; padding: 20px 24px; text-decoration: none; color: #333; transition: background 0.2s; }
.ast-single-post .nav-links a:hover { background: #f7f8f6; }
.ast-single-post .nav-links .nav-next { border-left: 1px solid #eee; }
.ast-single-post .nav-links a p { margin: 0; font-size: 15px; font-weight: 600; }
.ast-single-post .cat-links a { background: #20508d; color: #fff !important; padding: 4px 12px; border-radius: 20px; font-size: 12px; }

#primary { margin-top: 30px; margin-bottom: 30px; }
.site-content > .ast-container { padding-top: 0; }

/* ─── 사이드바 레이아웃 ─── */
.site-content > .ast-container { display: flex; gap: 30px; align-items: flex-start; }
.site-content > .ast-container > #primary { flex: 1; min-width: 0; }
.wp-col-sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.wp-col-sidebar::-webkit-scrollbar { width: 0; }
.wp-col-sidebar *, .wp-col-sidebar *::before, .wp-col-sidebar *::after { box-sizing: border-box; }
.wp-col-sidebar .sb-widget { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); padding: 24px; margin-bottom: 20px; overflow: hidden; }
.wp-col-sidebar .sb-title { font-size: 16px; font-weight: 700; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 8px; }
.wp-col-sidebar .sb-title .sb-icon { font-size: 18px; }

/* 진료 예약 위젯 */
.wp-col-sidebar .sb-phone { display: block; width: 100%; padding: 14px; background: #20508d; color: #fff; text-align: center; border-radius: 100px; font-size: 18px; font-weight: 700; text-decoration: none; letter-spacing: 0.5px; margin-bottom: 12px; box-sizing: border-box; }
.wp-col-sidebar .sb-phone:hover { opacity: 0.9; }
.wp-col-sidebar .sb-cta { font-size: 13px; color: #888; text-align: center; margin-bottom: 16px; }
.wp-col-sidebar .sb-hours { width: 100%; }
.wp-col-sidebar .sb-hours .sb-hour-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid #f5f5f5; }
.wp-col-sidebar .sb-hours .sb-hour-row:last-child { border-bottom: none; }
.wp-col-sidebar .sb-hours .sb-day { font-weight: 600; color: #333; }
.wp-col-sidebar .sb-hours .sb-time { color: #555; }

/* 의료진 위젯 */
.wp-col-sidebar .sb-doctor { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.wp-col-sidebar .sb-doctor:first-of-type { padding-top: 0; }
.wp-col-sidebar .sb-doctor-icon { width: 40px; height: 40px; background: #f0f0f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.wp-col-sidebar .sb-doctor-name { font-size: 15px; font-weight: 600; color: #222; }
.wp-col-sidebar .sb-doctor-spec { font-size: 13px; color: #888; margin-top: 2px; }

/* 오시는 길 위젯 */
.wp-col-sidebar .sb-location-item { padding: 8px 0; font-size: 14px; color: #444; line-height: 1.6; }
.wp-col-sidebar .sb-location-label { font-weight: 600; color: #333; margin-right: 4px; }
.wp-col-sidebar .sb-location-highlight { font-weight: 700; color: #20508d; }

/* FAQ 위젯 */
.wp-col-sidebar .sb-faq-item { padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.wp-col-sidebar .sb-faq-item:last-child { border-bottom: none; }
.wp-col-sidebar .sb-faq-q { font-size: 14px; font-weight: 600; color: #222; margin-bottom: 6px; }
.wp-col-sidebar .sb-faq-a { font-size: 13px; color: #666; line-height: 1.6; }

/* 싱글 포스트에서 사이드바 숨김 */
.ast-single-post .wp-col-sidebar { display: none; }
.ast-single-post .site-content > .ast-container { display: block; }

@media (max-width: 992px) {
    .site-content > .ast-container { flex-direction: column; }
    .wp-col-sidebar { width: 100%; position: static; max-height: none; }
}
@media (max-width: 768px) {
    .ast-container { padding: 0 16px; }
    .blog .entry-title { font-size: 16px; }
    .ast-single-post .ast-article-single { padding: 20px; margin: 16px; }
    .ast-single-post .entry-title { font-size: 22px; }
    .ast-single-post .nav-links { flex-direction: column; }
    .ast-single-post .nav-links .nav-next { border-left: none; border-top: 1px solid #eee; }
    #primary { margin-bottom: 80px; }
}