/* v7/post/search.css - v7 검색 결과 페이지 스타일 (컴팩트 + 가독성) */

/* 검색 페이지 컨테이너 */
.v7-search-page {
    padding: 0;
}

/* ===== 검색 인라인 폼 ===== */
.v7-search-inline-form {
    margin: 0.5rem 0 0.25rem;
}

.v7-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.v7-search-input-wrap:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.v7-search-input-wrap i {
    color: #94a3b8;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.v7-search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.9rem;
    background: transparent;
    color: #0f172a;
    min-width: 0;
    padding: 0.2rem 0;
}

.v7-search-input-wrap input::placeholder {
    color: #94a3b8;
}

.v7-search-input-wrap button {
    border: none;
    background: #2563eb;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.v7-search-input-wrap button:hover {
    background: #1d4ed8;
}

/* ===== 검색어 없을 때 안내 ===== */
.v7-search-empty-guide {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    color: #64748b;
}

.v7-search-empty-guide > i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #cbd5e1;
}

.v7-search-empty-guide > p {
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
    color: #64748b;
}

.v7-search-suggestions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.v7-search-suggestions > span {
    color: #94a3b8;
    font-size: 0.75rem;
}

.v7-search-suggestions > a {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    font-size: 0.8rem;
}

.v7-search-suggestions > a:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ===== 에러 ===== */
.v7-search-error {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #dc2626;
}

.v7-search-error > i {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
    display: block;
}

/* ===== Google CSE (구글 맞춤 검색) 섹션 ===== */
.v7-search-cse-section {
    margin-top: 0;
}

/* Google CSE 위젯 스타일 — 인라인 검색 폼이 있으므로 CSE 내부 검색창 숨김 */
.v7-search-cse-section .gsc-control-cse {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    font-family: inherit !important;
}

/* CSE 내부 검색 입력창 완전 숨김 (인라인 폼과 중복 방지) */
.v7-search-cse-section .gsc-search-box {
    display: none !important;
}

/* CSE 상단 정보 영역 — 컴팩트하게 */
.v7-search-cse-section .gsc-above-wrapper-area {
    border: none !important;
    padding: 0.25rem 0 !important;
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
}

/* CSE 결과 영역 간격 정리 */
.v7-search-cse-section .gsc-results-wrapper-overlay,
.v7-search-cse-section .gsc-results-wrapper-nooverlay {
    padding: 0 !important;
}

/* CSE 개별 결과 항목 — 가독성 좋은 간격 */
.v7-search-cse-section .gsc-webResult.gsc-result {
    padding: 0.625rem 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.v7-search-cse-section .gsc-webResult.gsc-result:last-child {
    border-bottom: none !important;
}

/* CSE 결과 제목 */
.v7-search-cse-section .gsc-result .gs-title {
    text-decoration: none !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.4 !important;
}

.v7-search-cse-section .gsc-result .gs-title a {
    color: #1e40af !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
}

.v7-search-cse-section .gsc-result .gs-title a:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

/* 제목 내 키워드 bold — 폰트 사이즈 동일, 굵기만 굵게 */
.v7-search-cse-section .gsc-result .gs-title b,
.v7-search-cse-section .gsc-result .gs-title strong {
    font-weight: 700 !important;
    font-size: inherit !important;
    color: inherit !important;
}

/* CSE 결과 본문(스니펫) — 가독성 */
.v7-search-cse-section .gsc-result .gs-snippet {
    color: #334155 !important;
    line-height: 1.6 !important;
    font-size: 0.9rem !important;
    margin-top: 0.125rem !important;
}

/* 스니펫 내 키워드 bold — 폰트 사이즈 동일, 굵기만 굵게 */
.v7-search-cse-section .gsc-result .gs-snippet b,
.v7-search-cse-section .gsc-result .gs-snippet strong {
    font-weight: 700 !important;
    font-size: inherit !important;
    color: #0f172a !important;
}

/* CSE 결과 URL 표시 — 부드러운 녹색 */
.v7-search-cse-section .gsc-result .gs-visibleUrl {
    color: #16a34a !important;
    font-size: 0.8125rem !important;
}

/* CSE 페이지네이션 */
.v7-search-cse-section .gsc-cursor-box {
    text-align: center !important;
    margin: 0.75rem 0 !important;
}

.v7-search-cse-section .gsc-cursor-page {
    color: #2563eb !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0 0.125rem !important;
    border-radius: 4px !important;
}

.v7-search-cse-section .gsc-cursor-current-page {
    background: #2563eb !important;
    color: #fff !important;
    font-weight: 600 !important;
}

/* CSE 썸네일 이미지 크기 조절 — 가로 넓게 */
.v7-search-cse-section .gs-image-box {
    width: 120px !important;
}

.v7-search-cse-section .gs-image-box img {
    max-width: 120px !important;
    height: auto !important;
    border-radius: 4px !important;
    object-fit: cover !important;
}

/* ===== 다크모드 대응 ===== */
@media (prefers-color-scheme: dark) {
    .v7-search-input-wrap {
        background: #1e293b;
        border-color: #475569;
    }

    .v7-search-input-wrap:focus-within {
        border-color: #3b82f6;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }

    .v7-search-input-wrap input {
        color: #f1f5f9;
    }

    .v7-search-empty-guide > i {
        color: #475569;
    }

    .v7-search-suggestions > a {
        background: #1e293b;
        color: #cbd5e1;
    }

    .v7-search-suggestions > a:hover {
        background: #1e3a5f;
        color: #93c5fd;
    }

    .v7-search-cse-section .gsc-control-cse {
        background: transparent !important;
    }

    .v7-search-cse-section .gsc-webResult.gsc-result {
        border-bottom-color: #334155 !important;
    }

    .v7-search-cse-section .gsc-result .gs-title a {
        color: #60a5fa !important;
    }

    .v7-search-cse-section .gsc-result .gs-title b,
    .v7-search-cse-section .gsc-result .gs-title strong {
        color: inherit !important;
    }

    .v7-search-cse-section .gsc-result .gs-snippet {
        color: #94a3b8 !important;
    }

    .v7-search-cse-section .gsc-result .gs-snippet b,
    .v7-search-cse-section .gsc-result .gs-snippet strong {
        color: #cbd5e1 !important;
    }

    .v7-search-cse-section .gsc-result .gs-visibleUrl {
        color: #4ade80 !important;
    }
}

/* ===== 반응형 (모바일) ===== */
@media (max-width: 768px) {
    .v7-search-input-wrap {
        padding: 0.35rem 0.6rem;
    }

    .v7-search-input-wrap button {
        width: 26px;
        height: 26px;
    }
}
