/*
Theme Name: Panchokmool Lite
Theme URI: https://panchokmool.kr/
Description: wp-auto-posting 플러그인 전용 초경량 테마. GeneratePress 부모 의존성 없이 시스템 폰트와 순수 CSS로 동작합니다. Rank Math · WP Rocket · Image Format Converter · Akismet 호환.
Author: 호텔천사
Version: 1.4.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: panchokmool-lite
*/

:root {
    --pcl-primary: #18609C;
    --pcl-primary-dark: #124d84;
    --pcl-text: #222;
    --pcl-muted: #666;
    --pcl-muted-2: #888;
    --pcl-border: #e9e9e9;
    --pcl-bg: #ffffff;
    --pcl-bg-soft: #f8fafc;
    --pcl-radius: 12px;
    --pcl-content-width: 1000px;
    --pcl-shell-width: 1200px;
    --pcl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo",
        "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--pcl-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--pcl-text);
    background: var(--pcl-bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--pcl-primary); text-decoration: none; }
a:hover { color: var(--pcl-primary-dark); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.35; color: var(--pcl-text); }

.pcl-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--pcl-primary);
    color: #fff;
    padding: 10px 16px;
    z-index: 100000;
}
.pcl-skip-link:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.pcl-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--pcl-border);
}
.pcl-header-inner {
    max-width: var(--pcl-shell-width);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.pcl-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pcl-brand a { text-decoration: none; color: var(--pcl-text); }
.pcl-brand img { display: block; max-height: 44px; width: auto; }
.pcl-site-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.pcl-site-desc { display: none; }

.pcl-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.pcl-nav a {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.pcl-nav a:hover,
.pcl-nav .current-menu-item > a {
    background: var(--pcl-primary);
    color: #fff;
}

/* ---------- dropdown (서브 메뉴) ---------- */
.pcl-nav .menu-item-has-children { position: relative; }
.pcl-nav .menu-item-has-children > a::after {
    content: "▾";
    margin-left: 6px;
    font-size: 11px;
    transition: transform 0.15s ease;
}
.pcl-nav li.pcl-open > a::after { transform: rotate(180deg); }

.pcl-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 720px;
    column-count: 4;
    column-gap: 8px;
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--pcl-border);
    border-radius: var(--pcl-radius);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    z-index: 1001;
}
.pcl-nav .sub-menu li { break-inside: avoid; }
.pcl-nav .sub-menu a {
    height: auto;
    min-height: 38px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.pcl-nav li.pcl-open > .sub-menu { display: block; }

@media (min-width: 861px) {
    .pcl-nav .menu-item-has-children:hover > .sub-menu { display: block; }
}

.pcl-nav-toggle {
    display: none;
    border: 1px solid var(--pcl-border);
    background: #fff;
    border-radius: 8px;
    width: 44px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

/* ---------- main shell ---------- */
.pcl-main { min-height: 50vh; }
.pcl-shell {
    max-width: var(--pcl-content-width);
    margin: 0 auto;
    padding: 32px 20px 56px;
}
/* 단일 글은 상단 네비게이션과 동일한 가로폭(--pcl-shell-width)으로 통일 */
.single .pcl-shell { max-width: var(--pcl-shell-width); }

/* ---------- single / page ---------- */
.pcl-entry-header {
    margin: 0 0 28px;
    padding: 28px;
    background: var(--pcl-bg-soft);
    border: 1px solid var(--pcl-border);
    border-radius: var(--pcl-radius);
}
.pcl-entry-title { font-size: 30px; font-weight: 800; margin: 0 0 14px; }
.pcl-entry-meta {
    color: var(--pcl-muted-2);
    font-size: 14px;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--pcl-border);
}
.pcl-entry-meta a { color: var(--pcl-muted); }
.pcl-entry-meta .pcl-meta-sep { margin: 0 6px; }
.pcl-entry-content { font-size: 17px; line-height: 1.85; }
.pcl-entry-content h2 { font-size: 24px; margin: 1.8em 0 0.6em; }
.pcl-entry-content h3 { font-size: 20px; margin: 1.5em 0 0.5em; }
.pcl-entry-content p { margin: 0 0 1.1em; }
.pcl-entry-content img { border-radius: 8px; height: auto; }
.pcl-entry-content ul, .pcl-entry-content ol { padding-left: 1.4em; }
.pcl-entry-content a { text-decoration: underline; }

/* ---------- 작성자 약력 카드 (single 하단 / author 아카이브 상단) ---------- */
.pcl-author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 32px 0;
    padding: 20px;
    background: var(--pcl-bg-soft);
    border: 1px solid var(--pcl-border);
    border-radius: 12px;
}
.pcl-author-avatar {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--pcl-primary);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.pcl-author-info { flex: 1 1 auto; min-width: 0; }
.pcl-author-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.pcl-author-name { font-size: 16px; font-weight: 700; color: var(--pcl-text); }
.pcl-author-title { font-size: 13px; color: var(--pcl-muted); }
.pcl-author-bio { margin: 8px 0 10px; font-size: 14px; line-height: 1.7; color: var(--pcl-muted); }
.pcl-author-more { font-size: 14px; font-weight: 600; color: var(--pcl-primary); text-decoration: none; }
.pcl-author-more:hover { text-decoration: underline; }

.pcl-author-posts { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--pcl-border); }
.pcl-author-posts-head { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--pcl-text); }
.pcl-author-posts ul { list-style: none; margin: 0 0 10px; padding: 0; }
.pcl-author-posts li { position: relative; margin: 0; padding: 4px 0; font-size: 14px; line-height: 1.6; border-bottom: 1px dashed var(--pcl-border); }
.pcl-author-posts li:last-child { border-bottom: 0; }
.pcl-author-posts li::before { content: "\203A"; position: absolute; left: 1px; top: 4px; color: var(--pcl-primary); font-weight: 700; }
.pcl-author-posts li a { color: var(--pcl-muted); text-decoration: none; display: block; padding-left: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcl-author-posts li a:hover { color: var(--pcl-primary); }

.pcl-entry-cats { margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--pcl-primary); }
.pcl-post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; }
.pcl-post-nav a {
    display: block;
    max-width: 48%;
    padding: 12px 16px;
    border: 1px solid var(--pcl-border);
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
}
.pcl-post-nav a:hover { border-color: var(--pcl-primary); }

/* ---------- single post + sidebar layout ---------- */
.single .pcl-post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.pcl-post-main { min-width: 0; }
.pcl-post-sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 24px; }
.pcl-side-box { border: 1px solid var(--pcl-border); border-radius: 12px; padding: 18px; }
.pcl-side-title { margin: 0 0 14px; font-size: 16px; font-weight: 800; }
.pcl-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pcl-side-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; }
.pcl-side-thumb { display: block; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: var(--pcl-bg-alt, #f4f4f4); }
.pcl-side-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcl-side-item-title {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pcl-side-item-title:hover { color: var(--pcl-primary); }
.pcl-side-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pcl-side-cats li { border-bottom: 1px dashed var(--pcl-border); }
.pcl-side-cats li:last-child { border-bottom: 0; }
.pcl-side-cats a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 2px;
    font-size: 14px;
    text-decoration: none;
}
.pcl-side-cats a:hover { color: var(--pcl-primary); }
.pcl-side-cat-count { color: var(--pcl-muted); font-size: 13px; }

/* ---------- archive / blog list ---------- */
.pcl-archive-title { font-size: 26px; font-weight: 800; margin: 0 0 24px; }
.pcl-list { display: grid; gap: 22px; }
.pcl-list-item {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--pcl-border);
}
.pcl-list-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--pcl-bg-soft); }
.pcl-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pcl-list-title { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.pcl-list-title a { color: var(--pcl-text); text-decoration: none; }
.pcl-list-title a:hover { color: var(--pcl-primary); }
.pcl-list-excerpt { color: var(--pcl-muted); font-size: 14px; margin: 0 0 8px; }
.pcl-list-meta { color: var(--pcl-muted-2); font-size: 13px; }

/* ---------- thumbnail placeholder (대표 이미지 없을 때) ---------- */
.pcl-thumb-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, #eef6fc 0%, #dbeafe 100%);
    color: var(--pcl-primary);
    font-weight: 800;
    font-size: 15px;
    text-align: center;
    padding: 10px;
}

/* ---------- pagination ---------- */
.pcl-pagination { margin-top: 36px; display: flex; justify-content: center; }
.pcl-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pcl-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; height: 42px; padding: 0 14px;
    border-radius: 10px; border: 1px solid #ddd; background: #fff;
    color: #333; text-decoration: none; font-weight: 600;
}
.pcl-pagination .page-numbers.current,
.pcl-pagination .page-numbers:hover { background: var(--pcl-primary); border-color: var(--pcl-primary); color: #fff; }

/* ---------- buttons ---------- */
.pcl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 46px; padding: 0 22px; border-radius: 10px;
    background: var(--pcl-primary); color: #fff; font-weight: 700;
    text-decoration: none; border: 0; cursor: pointer;
}
.pcl-btn:hover { background: var(--pcl-primary-dark); color: #fff; text-decoration: none; }

/* ---------- 404 / empty ---------- */
.pcl-empty { text-align: center; padding: 70px 20px; color: var(--pcl-muted); }
.pcl-empty h1 { font-size: 64px; margin: 0 0 10px; color: var(--pcl-primary); }

/* ---------- footer (브랜드 + 카테고리 + 주문안내 + 저작권) ---------- */
.pcl-footer { border-top: 1px solid var(--pcl-border); background: var(--pcl-bg-soft); }
.pcl-foot-grid {
    max-width: var(--pcl-shell-width); margin: 0 auto; padding: 42px 20px 30px;
    display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px;
}
.pcl-foot-brand-logo { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 20px; font-weight: 800; color: var(--pcl-text); }
.pcl-foot-brand-logo img { max-height: 40px; width: auto; }
.pcl-foot-brand-logo .pcl-ic { width: 22px; height: 22px; color: var(--pcl-primary); }
.pcl-foot-tagline { margin: 0 0 16px; color: var(--pcl-muted); font-size: 14px; line-height: 1.7; }
.pcl-foot-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pcl-foot-badges span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: #fff; border: 1px solid var(--pcl-border); border-radius: 999px; font-size: 13px; color: #374151; }
.pcl-foot-badges .pcl-ic { width: 15px; height: 15px; color: var(--pcl-primary); }
.pcl-foot-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 10px; background: var(--pcl-primary); color: #fff; font-weight: 700; text-decoration: none; }
.pcl-foot-btn:hover { background: var(--pcl-primary-dark); color: #fff; text-decoration: none; }
.pcl-foot-btn .pcl-ic { width: 18px; height: 18px; }
.pcl-foot-col h3 { margin: 0 0 14px; font-size: 16px; font-weight: 800; color: var(--pcl-text); }
.pcl-foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.pcl-foot-col a { display: inline-flex; align-items: center; gap: 6px; color: var(--pcl-muted); font-size: 14px; text-decoration: none; }
.pcl-foot-col a:hover { color: var(--pcl-primary); }
.pcl-foot-col a .pcl-ic { width: 14px; height: 14px; color: var(--pcl-muted-2); }

.pcl-foot-company { border-top: 1px solid var(--pcl-border); background: var(--pcl-bg-soft); }
.pcl-foot-company-inner { max-width: var(--pcl-shell-width); margin: 0 auto; padding: 16px 20px; }
.pcl-foot-company-info { margin: 0; color: var(--pcl-muted); font-size: 13px; line-height: 1.8; word-break: keep-all; text-align: center; }
.pcl-foot-company-info a { color: var(--pcl-muted); text-decoration: none; }
.pcl-foot-company-info a:hover { color: var(--pcl-primary); }
.pcl-foot-company-info .pcl-foot-sep { color: var(--pcl-muted-2); margin: 0 2px; }

.pcl-footer-bottom { border-top: 1px solid var(--pcl-border); }
.pcl-footer-bottom-inner {
    max-width: var(--pcl-shell-width); margin: 0 auto; padding: 18px 20px;
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; text-align: center;
    color: var(--pcl-muted); font-size: 13px;
}
.pcl-footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.pcl-footer-nav a { color: var(--pcl-muted); }
.pcl-ic { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }

/* ---------- 하단 고정 CTA 바 (테마 기능 — 닫기 없이 항상 표시) ----------
   설정: 메인 홈 설정 → 하단 CTA 바. 출력: functions.php pcl_render_cta_bar(). */
.pcl-cta-bar {
    position: fixed; left: 0; right: 0; bottom: 0; width: 100%; z-index: 9999;
    background: #1f2937; color: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.18);
    display: flex; align-items: center; justify-content: center;
    padding: 12px 16px; box-sizing: border-box;
}
.pcl-cta-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 1100px; width: 100%; }
.pcl-cta-text { font-size: 16px; font-weight: 600; line-height: 1.4; }
.pcl-cta-btn {
    display: inline-block; background: var(--pcl-primary); color: #fff;
    font-size: 15px; font-weight: 700; text-decoration: none;
    padding: 10px 22px; border-radius: 8px; white-space: nowrap; transition: background .15s;
}
.pcl-cta-btn:hover { background: var(--pcl-primary-dark); color: #fff; text-decoration: none; }
@media (max-width: 576px) {
    .pcl-cta-bar { padding: 10px 12px; }
    .pcl-cta-inner { gap: 10px; }
    .pcl-cta-text { display: none; }
    .pcl-cta-btn { font-size: 14px; padding: 8px 16px; }
}
/* 고정 CTA 바가 켜진 페이지는 본문 하단에 여백을 주어 푸터가 바에 가리지 않게 함
   (body 클래스 pcl-has-cta = functions.php pcl_cta_bar_active() 조건과 동일) */
body.pcl-has-cta { padding-bottom: 80px; }
@media (max-width: 576px) { body.pcl-has-cta { padding-bottom: 64px; } }

/* 플러그인 AEO의 홈 "최종 업데이트" 표기 숨김
   — 동일 정보를 테마 푸터(.pcl-footer-updated)에 통합했으므로 중복 제거.
   플러그인이 인라인 style="display:flex"로 출력해 !important 로 덮어씀. */
.wpap-aeo-updated { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .single .pcl-post-layout { grid-template-columns: 1fr; gap: 28px; }
    .pcl-post-sidebar { position: static; }
}

@media (max-width: 860px) {
    .pcl-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .pcl-nav {
        display: none;
        position: absolute; left: 0; right: 0; top: 100%;
        background: #fff; border-bottom: 1px solid var(--pcl-border);
        padding: 10px 16px 16px;
    }
    .pcl-nav.is-open { display: block; }
    .pcl-nav ul { flex-direction: column; gap: 4px; }
    .pcl-nav a { height: 44px; width: 100%; border-radius: 8px; }
    .pcl-header-inner { position: relative; }

    /* 모바일 서브메뉴: 아코디언 (1열) */
    .pcl-nav .sub-menu {
        position: static;
        display: none;
        width: auto;
        min-width: 0;
        column-count: 1;
        margin: 2px 0 6px 12px;
        padding: 0 0 0 8px;
        border: 0;
        border-left: 2px solid var(--pcl-border);
        border-radius: 0;
        box-shadow: none;
    }
    .pcl-nav li.pcl-open > .sub-menu { display: block; }

    .pcl-list-item { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
    .pcl-entry-header { padding: 18px 20px; margin-bottom: 22px; }
    .pcl-entry-title { font-size: 25px; }
    .pcl-entry-content { font-size: 16px; }

    /* 모바일: 브랜드는 전체폭, 카테고리/주문안내는 2열 (좁은 화면 포함 항상 2열) */
    .pcl-foot-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
    .pcl-foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
    .pcl-list-item { grid-template-columns: 1fr; }
    .pcl-list-thumb { aspect-ratio: 16 / 9; }
}
