/*
 Theme Name:   Astra Child - 시흥세브란스치과
 Theme URI:    https://shsevdent.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; }

/* ─── 공유 헤더 보정 ─── */
#page { padding-top: 90px !important; }
header nav ul { list-style: none; margin: 0; padding: 0; }
header nav ul li, .menu-wrap .menu-link ul li { list-style: none; }
/* PC 표시 / 모바일 숨김 */
.col-pc-header { z-index: 110 !important; }
.menu-wrap { z-index: 109 !important; }
.col-mo-header { display: none !important; }

/* ─── 모바일 ≤1024px ─── */
@media (max-width: 1024px) {
    .col-pc-header, .menu-wrap { display: none !important; }
    .col-mo-header { display: flex !important; position: fixed; top: 0; left: 0; width: 100%; height: 70px; background: #fff; justify-content: center; align-items: center; z-index: 105; }
    .col-mo-header::after { content: ""; width: 100%; height: 100vh; display: block; position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.5); z-index: 108; opacity: 0; visibility: hidden; transition: all 0.3s; }
    .col-mo-header.on::after { opacity: 1; visibility: visible; }
    .col-mo-header nav { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 16px; z-index: 106; }
    .col-mo-header nav h1 img { height: 30px; width: auto; }
    @keyframes col-pulse { 0%{transform:translate(-50%,-50%) scale(1.1)} 50%{transform:translate(-50%,-50%) scale(1)} 100%{transform:translate(-50%,-50%) scale(1.1)} }
    .col-mo-header .menu_btn { width: 30px; height: 30px; border-radius: 100%; background: var(--main, #002673); display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; z-index: 2; }
    .col-mo-header .menu_btn::before { content: ""; width: 40px; height: 40px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(18,50,116,0.2); border-radius: 100%; z-index: -1; animation: col-pulse 1.5s infinite ease-in-out; }
    .col-mo-header .menu_btn img { width: 16px; filter: brightness(0) invert(1); }
    .col-mo-header .menu-box { position: fixed; top: 0; right: -100%; background: #fff; width: 260px; height: 100vh; padding: 109px 20px 40px; z-index: 109; transition: right 0.4s ease-in-out; overflow-y: auto; }
    .col-mo-header .menu-box.on { right: 0; }
    .col-mo-header .exit-btn { position: absolute; top: 20px; right: 20px; background: var(--main, #002673); border-radius: 100%; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; cursor: pointer; }
    .col-mo-header .exit-btn::before { content: ""; width: 40px; height: 40px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(18,50,116,0.2); border-radius: 100%; z-index: -1; animation: col-pulse 1.5s infinite ease-in-out; }
    .col-mo-header .exit-btn img { transform: rotate(-45deg); width: 14px; filter: brightness(0) invert(1); }
    .col-mo-header .main_menu { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
    .col-mo-header .main_menu > li { position: relative; width: 100%; padding: 10px; }
    .col-mo-header .main_menu > li > a { font-size: 16px; font-weight: 400; line-height: 160%; letter-spacing: -0.48px; display: block; color: #333; text-decoration: none; }
    .col-mo-header .main_menu > li ul { display: none; margin-top: 10px; padding-left: 10px; list-style: none; }
    .col-mo-header .main_menu > li.active > ul { display: block; }
    .col-mo-header .main_menu > li.active > a { font-weight: 700; color: var(--main, #002673); }
    .col-mo-header .main_menu > li ul li:not(:last-child) { margin-bottom: 10px; }
    .col-mo-header .main_menu > li ul li a { font-size: 14px; font-weight: 400; line-height: 160%; letter-spacing: -0.48px; opacity: 0.8; color: #333; text-decoration: none; }
    .col-mo-header .sns-box { margin-top: 50px; border-top: 1px solid #eee; padding-top: 30px; }
    .col-mo-header .sns-box ul { display: flex; gap: 12px; align-items: center; justify-content: center; list-style: none; margin: 0; padding: 0; }
    .col-mo-header .sns-box img { width: 32px; height: 32px; }
    #page { padding-top: 70px !important; }
}

/* ─── 푸터 ─── */
.wp-col-footer { background: #001643; 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: #001643; 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; }
}

/* ─── PC 퀵메뉴 ─── */
.wp-col-quick { position: fixed; bottom: 20px; right: 20px; z-index: 100; }
.wp-col-quick .qm-list { display: none; margin-bottom: 16px; }
.wp-col-quick .qm-list.open { display: block; }
.wp-col-quick .qm-item { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; text-decoration: none; }
.wp-col-quick .qm-item img { width: 28px; height: 28px; }
.wp-col-quick .qm-item span { margin-top: 4px; font-size: 11px; font-weight: 500; color: rgba(61,66,67,0.7); background: rgba(246,244,236,0.85); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.wp-col-quick .qm-toggle { width: 72px; height: 72px; border-radius: 50%; background: rgba(0,22,67,0.85); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); border: none; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; }
.wp-col-quick .qm-toggle-inner { width: 100%; height: 100%; border: 1px solid rgba(255,255,255,0.6); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: "Marcellus", serif; font-size: 12px; color: #fff; line-height: 1.3; text-align: center; }
.wp-col-quick .qm-top { display: flex; flex-direction: column; align-items: center; margin-top: 8px; cursor: pointer; background: none; border: none; opacity: 0.7; }
.wp-col-quick .qm-top span { font-family: "Marcellus", serif; font-size: 13px; margin-top: 2px; }

/* ─── 모바일 하단 (메인 사이트 aside 동일) ─── */
.wp-col-aside { display: none; }
@media (max-width: 1024px) {
    .wp-col-quick { display: none; }
    .wp-col-aside { display: block; position: fixed; bottom: 30px; right: 16px; z-index: 100; }
    .wp-col-aside .call-btn { margin-bottom: 12px; }
    .wp-col-aside .call-btn a { display: flex; width: 50px; height: 50px; border-radius: 50%; background: var(--main, #002673); align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
    .wp-col-aside .call-btn img { width: 24px; filter: brightness(0) invert(1); }
    .wp-col-aside .top-btn { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); border-radius: 50%; cursor: pointer; }
    .wp-col-aside .top-btn img { width: 24px; filter: brightness(0) invert(1); }
}

/* ─── 컨테이너 ─── */
.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: #001643; 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: #001643; }

/* ─── 메타 ─── */
.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: #001643; color: #fff; border-color: #001643; }

/* ─── 싱글 포스트 ─── */
.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 #001643; }
.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 #001643; 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 .ast-post-nav { font-size: 0; line-height: 0; }
.ast-single-post .ast-post-nav .ahfb-svg-iconset { font-size: 16px; line-height: 1; }
.ast-single-post .ast-post-nav svg { width: 16px; height: 16px; }
.ast-single-post .cat-links a { background: #001643; 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; }

/* ─── 사이드바 레이아웃 (sidebar inside #primary) ─── */
#primary { display: flex; gap: 30px; align-items: flex-start; }
#primary > .site-main { 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: #001643; 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: #001643; }

/* 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 #primary { display: block; }

@media (max-width: 992px) {
    #primary { flex-direction: column; }
    #primary > .site-main { width: 100%; }
    .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; }
}