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

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

/* ─── 글로벌 리셋 ─── */
body { margin: 0 !important; padding: 0 !important; font-family: "Pretendard", -apple-system, sans-serif; background-color: #f9fafb !important; }
#page { margin-top: 0 !important; padding-top: 92px !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 기본 요소 전부 제거 ─── */
.ast-above-header-bar, .ast-above-header,
#ast-mobile-header, .ast-mobile-header-wrap,
.ast-main-header-wrap, .main-header-bar-wrap,
.ast-primary-header-bar, .site-primary-header-wrap,
#masthead, .site-header,
.ast-small-footer, .site-below-footer-wrap, .ast-footer-copyright, .ast-small-footer-wrap,
.site-footer .ast-builder-layout-element { display: none !important; }
.site-footer { padding: 0 !important; margin: 0 !important; }

/* ─── 헤더 오버라이드 (메인사이트 header.css의 bare header 선택자 충돌 방지) ─── */
header:not(.header) { position: static !important; top: auto !important; left: auto !important; width: auto !important; height: auto !important; z-index: auto !important; transform: none !important; background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; backface-visibility: visible !important; transition: none !important; }
.wp-mo-menu-bar { display: none; }
.wp-mo-menu-box { display: none; }
@media (max-width: 921px) {
    header.header { height: 72px !important; backdrop-filter: blur(20px) !important; -webkit-backdrop-filter: blur(20px) !important; }
    header.header nav { padding: 0 30px; height: 100%; }
    header.header .menu_bar { display: none; }
    header.header .wp-mo-menu-bar { display: block; cursor: pointer; }
    header.header .logo_box { display: flex; align-items: center; }
    header.header .logo_in { display: flex; align-items: center; }
    header.header .logo_in svg { width: 150px; height: auto; display: block; }
    #page { padding-top: 72px !important; }
    .wp-mo-menu-box { background-color: #001A54; position: fixed; top: 0; right: 0; z-index: 9999; border-radius: 0 0 0 40px; overflow: hidden; padding: 0; }
    .wp-mo-menu-box.open { display: block; }
    .wp-mo-menu-box * { color: #fff; }
    .wp-mo-exit { padding: 14px 20px; display: flex; justify-content: flex-end; cursor: pointer; }
    .wp-mo-exit svg { width: 27px; height: 27px; }
    .wp-mo-menu-box ul { padding: 28px 40px; list-style: none; margin: 0; display: flex; flex-direction: column; gap: 10px; }
    .wp-mo-menu-box ul li a { padding: 10px; display: flex; align-items: center; font-size: 16px; font-weight: 400; line-height: 160%; letter-spacing: -0.48px; text-decoration: none; width: max-content; }
    .wp-mo-menu-box ul li.menu-active a { background-color: #fff; color: #001A54; font-weight: 700; border-radius: 500px; }
}

/* ─── 푸터 오버라이드 (메인사이트 footer.css 로드됨) ─── */
footer.footer { background: #001A54; }
footer.footer .top-box { display: none; }
footer.footer .map-box { display: none; }

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

/* ─── 3열 그리드 ─── */
.ast-row { display: grid !important; grid-template-columns: repeat(3, 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: #001A54; 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: #001A54; }

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

/* ─── 싱글 포스트 ─── */
/* ─── 싱글 포스트 본문 ─── */
.ast-single-post .ast-article-single { background: #fff; border-radius: 16px; padding: 48px 52px; max-width: 860px; margin: 0 auto 30px; box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
.ast-single-post .entry-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 2px solid #f0f0f0; text-align: center; }
.ast-single-post .entry-title { font-size: 32px; font-weight: 800; line-height: 1.35; margin-bottom: 16px; color: #111; letter-spacing: -0.5px; }
.ast-single-post .entry-meta { margin-top: 12px; font-size: 14px; color: #888; }
.ast-single-post .cat-links { margin-bottom: 16px; }
.ast-single-post .entry-content { font-size: 17px; line-height: 1.95; color: #333; }
.ast-single-post .entry-content p { margin-bottom: 1.6em; }
.ast-single-post .entry-content img { border-radius: 10px; max-width: 100%; height: auto; margin: 1em 0; }
.ast-single-post .entry-content h2 { font-size: 24px; font-weight: 700; margin: 2.2em 0 0.8em; padding-left: 16px; border-left: 4px solid #001A54; color: #111; }
.ast-single-post .entry-content h3 { font-size: 19px; font-weight: 700; margin: 1.8em 0 0.6em; color: #333; }
.ast-single-post .entry-content blockquote { background: #f4f6fa; border-left: 4px solid #001A54; padding: 20px 24px; margin: 1.8em 0; border-radius: 0 10px 10px 0; font-size: 16px; color: #444; }
.ast-single-post .cat-links a { background: #001A54; color: #fff !important; padding: 4px 12px; border-radius: 20px; font-size: 12px; }

/* ─── 네비게이션 ─── */
.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; min-width: 0; }
.ast-single-post .nav-links a { display: flex; align-items: center; gap: 14px; padding: 24px 28px; text-decoration: none; color: #222; transition: background 0.2s; }
.ast-single-post .nav-links a:hover { background: #f0f2f5; }
.ast-single-post .nav-links a span.nav-subtitle { display: none !important; }
.ast-single-post .nav-links a span.nav-title,
.ast-single-post .nav-links a p { margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ast-single-post .nav-links .nav-previous a::before { content: "←"; font-size: 20px; color: #001A54; flex-shrink: 0; }
.ast-single-post .nav-links .nav-next a::after { content: "→"; font-size: 20px; color: #001A54; flex-shrink: 0; }
.ast-single-post .nav-links .nav-previous .ast-left-arrow,
.ast-single-post .nav-links .nav-next .ast-right-arrow,
.ast-single-post .nav-links .ast-post-nav { display: none !important; }
.ast-single-post .nav-links .nav-next { border-left: 1px solid #eee; text-align: right; }
.ast-single-post .nav-links .nav-next a { justify-content: flex-end; }

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

@media (max-width: 768px) {
    .ast-container { padding: 0 16px; }
    .blog .entry-title { font-size: 16px; }
    .ast-single-post .ast-article-single { padding: 24px 20px; margin: 16px; border-radius: 12px; }
    .ast-single-post .entry-title { font-size: 24px; }
    .ast-single-post .entry-content { font-size: 16px; }
    .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; }
}