/*
 Theme Name:   Astra Child - 서울릴리브치과
 Theme URI:    https://seoulrelieve.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; }
.ast-above-header-bar, .ast-above-header { display: none; }

/* ─── 사이트 헤더 ─── */
.wp-col-header { background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,0.08); position: relative; z-index: 99999; }
.wp-col-header nav { display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 40px; }
.wp-col-header .hd-logo img { height: auto; width: auto; display: block; }
.wp-col-header .hd-logo-text { font-size: 20px; font-weight: 700; color: #333; text-decoration: none; letter-spacing: -0.03em; white-space: nowrap; }
.wp-col-header .hd-menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.wp-col-header .hd-menu a {
    font-size: 15px; font-weight: 500; color: #555; text-decoration: none;
    transition: color 0.2s, background 0.2s;
    display: inline-block; text-align: center; padding: 10px 20px;
    letter-spacing: -0.03em; border-radius: 8px; line-height: 1.4;
}
.wp-col-header .hd-menu a:hover { color: #4A90D9; background: #eef4fb; }
.wp-col-header .hd-menu .hd-cta a {
    color: #fff; font-weight: 600; background: #4A90D9;
    border-radius: 100px; padding: 10px 24px;
}
.wp-col-header .hd-menu .hd-cta a:hover { background: #3a7bc8; color: #fff; }
.wp-col-header .mo-toggle { display: none; cursor: pointer; padding: 8px; background: none; border: none; }
.wp-col-header .mo-toggle span { display: block; width: 22px; height: 2px; background: #555; margin: 5px 0; transition: all 0.2s; border-radius: 2px; }
.wp-col-header .mo-overlay { display: none; }

/* ─── 태블릿 헤더 ─── */
@media (max-width: 1600px) {
    .wp-col-header nav { height: 60px; padding: 0 20px; }
    .wp-col-header .hd-logo img { width: 65%; }
    .wp-col-header .hd-menu a { font-size: 13px; padding: 8px 14px; }
    .wp-col-header .hd-menu .hd-cta a { padding: 8px 18px; }
}

/* ─── 닫기 버튼·모바일전용 (PC에서 숨김) ─── */
.wp-col-header .mo-close-wrap { display: none; }
.wp-col-header .mo-contact { display: none; }

/* ─── 모바일 헤더 ─── */
@media (max-width: 768px) {
    .wp-col-header .hd-menu {
        display: flex !important;
        position: fixed; top: 0; right: 0;
        width: 80%; max-width: 320px; height: 100vh;
        background: #fff; flex-direction: column; gap: 0;
        padding: 0; z-index: 999999;
        box-shadow: -4px 0 24px rgba(0,0,0,0.15);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
        overflow-y: auto;
        visibility: hidden;
    }
    .wp-col-header .hd-menu.open { transform: translateX(0); visibility: visible; }

    .wp-col-header .hd-menu li { list-style: none; width: 100%; }
    .wp-col-header .hd-menu a {
        display: block; width: 100%; padding: 16px 28px; font-size: 15px; font-weight: 500;
        color: #333; text-decoration: none; letter-spacing: -0.03em;
        border-bottom: 1px solid #f5f5f5; transition: background 0.15s;
        border-radius: 0; text-align: left; box-sizing: border-box;
    }
    .wp-col-header .hd-menu a:active { background: #f7f7f7; }

    .wp-col-header .mo-close-wrap {
        display: flex; align-items: center; justify-content: space-between;
        padding: 0; border-bottom: 1px solid #eee; margin-bottom: 0;
    }
    .wp-col-header .mo-logo { display: block; }
    .wp-col-header .mo-logo img { height: 26px; width: auto; display: block; }
    .wp-col-header .mo-close {
        background: none; border: none; color: #999; cursor: pointer;
        padding: 4px; display: flex; align-items: center; justify-content: center;
        width: 36px; height: 36px; border-radius: 50%; transition: background 0.15s;
        font-size: 20px; line-height: 1;
    }
    .wp-col-header .mo-close:active { background: #f0f0f0; }

    .wp-col-header .hd-menu .hd-cta { margin-top: auto; padding: 20px 24px 8px; border-bottom: none; max-width: 200px; }
    .wp-col-header .hd-menu .hd-cta a {
        display: block; text-align: center; padding: 16px 24px;
        background: #4A90D9; color: #fff; border-radius: 12px; font-weight: 700;
        font-size: 16px; border-bottom: none; letter-spacing: -0.02em;
        box-shadow: 0 4px 12px rgba(74,144,217,0.25); width: 100%; box-sizing: border-box;
    }
    .wp-col-header .hd-menu .hd-cta a:active { background: #3a7bc8; box-shadow: 0 2px 8px rgba(74,144,217,0.2); }

    .wp-col-header .mo-contact { display: block; padding: 10px 24px 32px; }
    .wp-col-header .mo-contact a {
        display: flex; align-items: center; justify-content: center; gap: 8px;
        padding: 14px 24px; border: 1.5px solid #ddd; border-radius: 12px;
        color: #555; font-size: 15px; font-weight: 500; text-decoration: none;
        background: transparent; width: 100%; box-sizing: border-box;
    }
    .wp-col-header .mo-contact a:active { background: #f7f7f7; border-color: #ccc; }
    .wp-col-header .mo-contact svg { flex-shrink: 0; }

    .wp-col-header .mo-toggle { display: block; position: relative; z-index: 1000000; }

    .wp-col-header .mo-overlay {
        display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.4); z-index: 999998;
        opacity: 0; transition: opacity 0.3s ease;
    }
    .wp-col-header .mo-overlay.open { display: block; opacity: 1; }
}

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

/* ─── 컨테이너 ─── */
.ast-container { max-width: 1200px; margin: 0 auto; }
.ast-separate-container .ast-article-post,
.ast-plain-container .ast-article-post { background: #fff; border: 1px solid #eee; border-radius: 12px; transition: box-shadow 0.3s ease, transform 0.2s ease; }
.ast-separate-container .ast-article-post:hover,
.ast-plain-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; width: auto !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: #4A90D9; 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: #4A90D9; }

/* ─── 메타 ─── */
.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; margin-top: 12px; }
.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: #4A90D9; color: #fff; border-color: #4A90D9; }

/* ─── 싱글 포스트 ─── */
.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 #4A90D9; }
.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 #4A90D9; padding: 16px 20px; margin: 1.5em 0; border-radius: 0 8px 8px 0; }
/* prev/next 네비게이션 */
.ast-single-post .navigation.post-navigation { max-width: 860px; margin: 0 auto 40px; padding: 0; background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible; }
.ast-single-post .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
.ast-single-post .nav-links > div { position: relative; }
.ast-single-post .nav-links .nav-previous { border-right: 1px solid #f0f0f0; }
.ast-single-post .nav-links a {
    display: flex; flex-direction: column; gap: 8px;
    padding: 28px 28px; text-decoration: none; color: #555;
    transition: background 0.2s; min-height: 100px; justify-content: center;
}
.ast-single-post .nav-links a:hover { background: #f8fafd; }
.ast-single-post .nav-links .nav-next a { align-items: flex-end; text-align: right; }
.ast-single-post .nav-links .ast-post-nav {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: #aaa; letter-spacing: 0.5px; text-transform: none;
}
.ast-single-post .nav-links .nav-previous .ast-post-nav::before { content: '←'; font-size: 16px; color: #4A90D9; }
.ast-single-post .nav-links .nav-next .ast-post-nav::after { content: '→'; font-size: 16px; color: #4A90D9; }
.ast-single-post .nav-links .nav-next .ast-post-nav { justify-content: flex-end; }
.ast-single-post .nav-links .ast-post-nav svg { display: none; }
.ast-single-post .nav-links a p {
    margin: 0; font-size: 15px; font-weight: 600; color: #222; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ast-single-post .nav-links a:hover p { color: #4A90D9; }
.ast-single-post .nav-links a:hover .ast-post-nav { color: #4A90D9; }
.ast-single-post .cat-links a { background: #4A90D9; color: #fff !important; padding: 4px 12px; border-radius: 20px; font-size: 12px; }

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

/* ─── Astra 기본 푸터 숨김 ─── */
footer#colophon, .site-footer { display: none !important; }

/* ─── Astra 컨테이너 오버라이드 ─── */
.ast-separate-container #primary, .ast-plain-container #primary { background: transparent; border: none; padding: 0; }
.ast-separate-container .ast-article-post { background: #fff; }
.ast-two-container #secondary, #secondary { display: none !important; }
.ast-two-container #primary { width: 100% !important; float: none !important; }
#primary { flex: 1; min-width: 0; }
body.blog .site-content > .ast-container,
body.single .site-content > .ast-container { max-width: 1200px; margin: 0 auto; }
.ast-mobile-header-wrap { display: none !important; }

/* ─── 모바일 ─── */
@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 .navigation.post-navigation { margin: 0 16px 30px; }
    .ast-single-post .nav-links { grid-template-columns: 1fr; }
    .ast-single-post .nav-links .nav-previous { border-right: none; border-bottom: 1px solid #f0f0f0; }
    .ast-single-post .nav-links a { padding: 20px; min-height: auto; }
    .ast-single-post .nav-links .nav-next a { align-items: flex-start; text-align: left; }
    .ast-single-post .nav-links .nav-next .ast-post-nav { justify-content: flex-start; }
    #primary { margin-bottom: 30px; }
    .ast-row { grid-template-columns: 1fr !important; gap: 16px !important; }
    .wp-col-header { position: sticky; top: 0; z-index: 999999; background: #fff; }
    .wp-col-header nav { padding: 12px 16px; }
    .wp-col-header .hd-logo img { height: 30px; }
}

/* ─── 사이드바 ─── */
.wp-col-sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 90px; }
.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-icon { font-size: 18px; }
.wp-col-sidebar .sb-phone { display: block; width: 100%; padding: 14px; background: #4A90D9; 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-of-type { 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-hour-note { font-size: 12px; color: #999; margin-top: 8px; line-height: 1.5; }
.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: #eef4fb; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 20px; }
.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; line-height: 1.4; }
.wp-col-sidebar .sb-popular { list-style: none; margin: 0; padding: 0; }
.wp-col-sidebar .sb-popular li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.wp-col-sidebar .sb-popular li:last-child { border-bottom: none; }
.wp-col-sidebar .sb-rank { font-size: 14px; font-weight: 800; color: #4A90D9; min-width: 20px; }
.wp-col-sidebar .sb-popular a { font-size: 14px; color: #333; text-decoration: none; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wp-col-sidebar .sb-popular a:hover { color: #4A90D9; }
.wp-col-sidebar .sb-location-item { padding: 6px 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-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; }
body.blog .site-content > .ast-container,
body.single .site-content > .ast-container { display: flex; gap: 30px; align-items: flex-start; }
@media (max-width: 960px) {
    .wp-col-sidebar { width: 100%; position: static; }
    body.blog .site-content > .ast-container,
    body.single .site-content > .ast-container { flex-direction: column; }
}
