/*
 Theme Name:   Astra Child - 연세초록빛치과의원
 Theme URI:    https://chorokbit.com/column/
 Description:  연세초록빛치과의원 워드프레스 칼럼용 Astra 차일드 테마
 Author:       연세초록빛치과의원
 Template:     astra
 Version:      1.0.2
 Text Domain:  astra-child
*/

/* ─── WP Admin Bar 모바일 고정 ─── */
@media screen and (max-width: 600px) {
    #wpadminbar { position: fixed; }
}

/* ─── 헤더 상단 빈공간 완전 제거 ─── */
.ast-above-header-bar, .ast-above-header { display: none; }
.site-header, #ast-desktop-header, .ast-primary-header-bar { margin-top: 0 !important; padding-top: 0 !important; }
#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; }
body { margin-top: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
#ast-scroll-top { display: none !important; }
.site-content { margin-top: 0 !important; }

/* ─── 드롭메뉴 z-index 최상단 (사이트 헤더만) ─── */
#page > header, .hfeed > header { position: relative; z-index: 99999 !important; }
#page > header nav, .hfeed > header nav { position: relative; z-index: 99999 !important; }
#page > header .menu_wrap, .hfeed > header .menu_wrap { position: absolute; z-index: 99999 !important; width: 100%; left: 0; }
.entry-header, article header { z-index: auto !important; }

/* ─── 모바일 햄버거 버튼 ─── */
.mo-menu-btn { display: none; cursor: pointer; padding: 8px; }
.mo-menu-btn span { display: block; width: 22px; height: 2px; background: #333; margin: 5px 0; transition: 0.3s; }

/* ─── 모바일 하단 퀵바 ─── */
.mo-quick-bar { display: none; }

/* ─── PC 퀵메뉴 ─── */
.pc-quick-menu { display: block; }

@media (max-width: 921px) {
    .mo-menu-btn { display: block; }
    .pc-nav-menu, .point_box { display: none !important; }
    #page > header .menu_wrap, .hfeed > header .menu_wrap {
        display: none !important; position: fixed !important; top: 0 !important; right: 0 !important;
        left: auto !important; width: 80% !important; max-width: 320px !important; height: 100vh !important;
        background: #fff !important; z-index: 999999 !important; overflow-y: auto !important;
        transform: translateX(100%); transition: transform 0.3s ease;
    }
    #page > header .menu_wrap.mo-open, .hfeed > header .menu_wrap.mo-open {
        display: block !important; transform: translateX(0);
    }
    .menu_wrap .menu_all {
        all: unset !important;
        display: flex !important; flex-direction: column !important;
        width: 100% !important; padding: 20px 0 !important;
        background: #fff !important;
    }
    .menu_wrap .menu_all ul {
        all: unset !important;
        display: block !important; list-style: none !important;
        padding: 0 !important; margin: 0 0 10px 0 !important;
    }
    .menu_wrap .menu_all ul li {
        all: unset !important; display: block !important;
    }
    .menu_wrap .menu_all ul li a {
        all: unset !important;
        display: block !important; padding: 12px 24px !important;
        font-size: 14px !important; color: #555 !important;
        text-decoration: none !important; cursor: pointer !important;
        border-bottom: 1px solid #f5f5f5 !important;
        font-family: "Pretendard", sans-serif !important;
    }
    .menu_wrap .menu_all ul li:first-child a {
        font-weight: 700 !important; font-size: 15px !important;
        color: #222 !important; background: #f9faf7 !important;
        border-left: 3px solid #9BAB83 !important;
    }
    .menu_wrap .menu_all ul li a:active { background: #f0f0f0 !important; }
    .menu_wrap .menu_all { display: flex; flex-direction: column; padding: 60px 0 20px; }
    .menu_wrap .menu_all ul { display: flex; flex-direction: column; padding: 0; margin: 0; }
    .menu_wrap .menu_all ul li { list-style: none; }
    .menu_wrap .menu_all ul li a { display: block; padding: 12px 20px; font-size: 15px; color: #333; text-decoration: none; border-bottom: 1px solid #f0f0f0; }
    .menu_wrap .menu_all ul li:first-child > a { font-weight: 700; font-size: 16px; background: #f9f9f9; }
    .pc-quick-menu { display: none !important; }
    .mo-quick-bar { display: block; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; border-top: 1px solid #eee; z-index: 9999; }
    .mo-quick-bar ul { display: flex; margin: 0; padding: 0; list-style: none; }
    .mo-quick-bar li { flex: 1; text-align: center; }
    .mo-quick-bar a { display: flex; flex-direction: column; align-items: center; padding: 10px 0; text-decoration: none; color: #333; font-size: 11px; }
    .mo-quick-bar img { margin-bottom: 4px; }
}

/* ─── 컨테이너 ─── */
.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; width: 100% !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: #9BAB83; 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; }
.cat-links a:hover { background: #7A8E68; }

/* ─── 글 제목 ─── */
.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: #9BAB83; }

/* ─── 메타 (날짜/글쓴이) ─── */
.blog-layout-4 header.entry-header,
.ast-article-post header.entry-header { all: unset !important; display: block !important; position: static !important; }
.entry-meta { font-size: 13px; color: #999; margin-bottom: 8px; position: static !important; float: none !important; display: block !important; }
.entry-meta * { position: static !important; float: none !important; }
.entry-meta a { color: #999; text-decoration: none; }
.entry-meta .posted-by .url { text-decoration: none; color: #666; }
.entry-meta .posted-by .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: #9BAB83; color: #fff; border-color: #9BAB83; }
.ast-pagination .page-numbers:hover:not(.current) { background: #f5f5f5; }

/* ─── 싱글 포스트 (글 내부) ─── */
.ast-single-post .site-content { background: transparent; }
.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-meta { font-size: 14px; color: #999; }
.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 #9BAB83; }
.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 #9BAB83; padding: 16px 20px; margin: 1.5em 0; border-radius: 0 8px 8px 0; }
.ast-single-post .entry-content ul, .ast-single-post .entry-content ol { padding-left: 1.5em; margin-bottom: 1.5em; }
.ast-single-post .entry-content li { margin-bottom: 0.5em; line-height: 1.7; }
.ast-single-post .cat-links a { background: #9BAB83; 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; }
.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 .ast-post-nav { font-size: 13px; color: #999; font-weight: 600; white-space: nowrap; }
.ast-single-post .nav-links .ast-post-nav svg { width: 14px; height: 14px; fill: #999; }
.ast-single-post .nav-links a p { margin: 0; font-size: 15px; font-weight: 600; color: #333; line-height: 1.4; }
.ast-single-post .nav-links .nav-next { border-left: 1px solid #eee; }

/* ─── 조회수 ─── */
.post-views { font-size: 13px; color: #999; }

/* ─── 상하단 여백 ─── */
.site-content > .ast-container { padding-top: 0; }
#primary { margin-top: 30px; margin-bottom: 30px; }

/* ─── 푸터 ─── */
footer .footer_info, footer .price_box, footer { max-width: 1440px; margin-left: auto; margin-right: auto; justify-content: flex-start; gap: 50px; }

/* ─── 모바일 ─── */
@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 .entry-content { font-size: 15px; }
    .ast-single-post .entry-content h2 { font-size: 19px; }
    .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; }

    /* 모바일 푸터 */
    footer {
        all: unset !important;
        display: block !important;
        background-color: #5B6645 !important;
        padding: 40px 20px 100px !important;
        font-family: "Pretendard", sans-serif !important;
    }
    footer .footer_info { all: unset !important; display: block !important; }
    footer .footer_info h1 { all: unset !important; display: block !important; margin-bottom: 30px !important; }
    footer .footer_info h1 a { display: inline-block !important; }
    footer .footer_info h1 img { height: 30px !important; width: auto !important; filter: brightness(0) invert(1) !important; }
    footer .footer_info ul { all: unset !important; display: block !important; list-style: none !important; }
    footer .footer_info ul li {
        all: unset !important; display: block !important;
        margin-bottom: 15px !important; font-size: 15px !important;
        font-weight: 400 !important; line-height: 160% !important;
        letter-spacing: -0.5px !important; color: rgba(255,255,255,0.6) !important;
    }
    footer .price_box {
        all: unset !important; display: flex !important;
        align-items: center !important; justify-content: center !important;
        margin-top: 30px !important; border-radius: 100px !important;
        background: #BDA476 !important;
        width: 172px !important; height: 60px !important;
    }
    footer .price_box a {
        font-size: 18px !important; font-weight: 500 !important;
        letter-spacing: -1px !important; color: #fff !important;
        text-decoration: none !important;
    }

    /* 모바일 퀵메뉴 (aside) */
    .pc-quick-menu {
        position: fixed !important; bottom: 16px !important; right: 16px !important;
        z-index: 109 !important; display: block !important;
    }
    .pc-quick-menu .menu_box ul {
        margin-bottom: 20px !important; display: none;
    }
    .pc-quick-menu .menu_box ul li:not(:last-child) { margin-bottom: 22px !important; }
    .pc-quick-menu .menu_box ul li a {
        width: 100% !important; display: flex !important;
        flex-direction: column !important; align-items: center !important; justify-content: center !important;
        text-decoration: none !important;
    }
    .pc-quick-menu .menu_box ul li a img { width: 28px !important; height: 28px !important; }
    .pc-quick-menu .menu_box ul li a p {
        margin-top: 6px !important; font-size: 13px !important; font-weight: 500 !important;
        letter-spacing: -0.5px !important; color: rgba(61,66,67,0.7) !important;
        background-color: rgba(246,244,236,0.85) !important; border-radius: 4px !important;
        padding: 1px 4px !important;
    }
    .pc-quick-menu .menu_box .menu_btn {
        width: 76px !important; height: 76px !important; border-radius: 100% !important;
        display: flex !important; align-items: center !important; justify-content: center !important;
        background: rgba(155,171,131,0.85) !important;
        backdrop-filter: blur(7.27px) !important; -webkit-backdrop-filter: blur(7.27px) !important;
        cursor: pointer !important; padding: 4px !important;
    }
    .pc-quick-menu .menu_box .menu_btn p {
        font-size: 13px !important; font-weight: 400 !important; line-height: 140% !important;
        color: #fff !important; font-family: "Marcellus", serif !important;
        width: 100% !important; height: 100% !important;
        border: 1px solid #fff !important; border-radius: 100% !important;
        display: flex !important; align-items: center !important; justify-content: center !important;
        margin: 0 !important;
    }
    .pc-quick-menu .top_btn {
        display: flex !important; align-items: center !important; justify-content: center !important;
        flex-direction: column !important; width: 60px !important; height: 60px !important;
        cursor: pointer !important; margin: 8px auto 0 !important;
    }
    .pc-quick-menu .top_btn span {
        font-size: 15px !important; font-weight: 400 !important; letter-spacing: 1px !important;
        font-family: "Marcellus", serif !important; display: inline-block !important;
        margin-top: 3px !important; opacity: 0.7 !important;
    }

    /* 하단 퀵바 숨김 (aside 퀵메뉴 사용) */
    .mo-quick-bar { display: none !important; }
}
