/* ============================================================
   components.css — 공통 UI 컴포넌트
   (카드, 버튼, 배지, 태그, 폼, 페이지네이션, 에러 메시지)
   ============================================================ */

/* ============ 카드 ============ */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.card h2 {
    font-size: 18px;
    margin: 0 0 14px;
}
.card h3 {
    font-size: 16px;
    margin: 0 0 10px;
}

/* 2열 그리드 (인기글/최신글) */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============ 버튼 ============ */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.btn:hover {
    text-decoration: none;
}
.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover {
    background: var(--color-primary-dark);
}
.btn-secondary {
    background: white;
    color: #374151;
    border-color: var(--color-border);
}
.btn-secondary:hover {
    background: #f9fafb;
}
.btn-danger {
    background: var(--color-danger);
    color: white;
}
.btn-danger:hover {
    background: #b91c1c;
}
.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* ============ 배지 (작성자 라벨) ============ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}
.badge.auto {
    background: var(--color-bot);
    color: var(--color-bot-text);
    border: 1px solid var(--color-bot-border);
}
.badge.user {
    background: #eff6ff;
    color: var(--color-primary-dark);
    border: 1px solid #bfdbfe;
}
.badge.notice {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ============ 태그 ============ */
.tag {
    display: inline-block;
    padding: 3px 10px;
    margin: 2px 4px 2px 0;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
}
.tag:hover {
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
}

/* ============ 폼 (회원가입, 로그인, 글쓰기) ============ */
.field {
    margin-bottom: 16px;
}
.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="search"],
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text);
    background: white;
    box-sizing: border-box;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.field textarea {
    min-height: 240px;
    line-height: 1.6;
    resize: vertical;
}
.field-help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-muted);
}

/* 약관 동의 체크박스 */
.agree-group {
    margin: 18px 0;
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}
.agree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
}
.agree-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
}
.agree-row label {
    cursor: pointer;
    color: #374151;
    flex: 1;
}
.agree-row .required {
    color: var(--color-danger);
    font-weight: 600;
    margin-right: 4px;
}
.agree-row .agree-view {
    font-size: 12px;
    color: var(--color-primary);
    text-decoration: underline;
}
.agree-all {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* ============ 페이지네이션 ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 24px 0 8px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-block;
    min-width: 36px;
    padding: 7px 12px;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 13px;
    text-decoration: none;
}
.pagination a:hover {
    background: #f3f4f6;
    text-decoration: none;
}
.pagination .current {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    font-weight: 600;
}
.pagination .disabled {
    color: #d1d5db;
    background: #f9fafb;
    cursor: not-allowed;
}

/* ============ 에러 / 알림 메시지 ============ */
.error {
    background: #fef2f2;
    color: var(--color-danger);
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}
.notice {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}
.success {
    background: #f0fdf4;
    color: var(--color-success);
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}
/* =========================================
   검색 히어로 (메인 상단 구글 스타일)
   ─────────────────────────────────────────
   home.html 최상단에서 _search_hero.html 로
   렌더되는 배너 영역의 스타일.
   ========================================= */
.search-hero {
    width: 100%;
    padding: 48px 24px 36px;
    background: linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);
    border-radius: 14px;
    margin-bottom: 28px;
    border: 1px solid #edf2f7;
}

.search-hero-inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.search-hero-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.search-hero-subtitle {
    font-size: 15px;
    color: #718096;
    margin: 0 0 28px 0;
}

.search-hero-form {
    margin: 0 auto 18px;
}

/* 검색 박스 - 구글 검색창 모방 (둥근 모서리 + 그림자) */
.search-hero-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 28px;
    padding: 6px 6px 6px 18px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
    transition: box-shadow 0.2s, border-color 0.2s;
    max-width: 600px;
    margin: 0 auto;
}

.search-hero-box:hover,
.search-hero-box:focus-within {
    box-shadow: 0 1px 10px rgba(32, 33, 36, 0.18);
    border-color: #ffffff;
}

.search-hero-icon {
    font-size: 18px;
    margin-right: 12px;
    color: #9aa0a6;
    flex-shrink: 0;
}

.search-hero-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #1a202c;
    padding: 12px 4px;
    min-width: 0;
}

.search-hero-input::placeholder {
    color: #9aa0a6;
}

/* 검색 버튼 - 둥근 알약 모양 */
.search-hero-btn {
    background: linear-gradient(135deg, #4f8cff 0%, #3b6ee0 100%);
    color: #ffffff;
    border: none;
    border-radius: 22px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.search-hero-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 140, 255, 0.32);
}

.search-hero-btn:active {
    transform: translateY(0);
}

/* 인기 검색어 칩 영역 */
.search-hero-suggest {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
}

.search-hero-suggest-label {
    color: #718096;
    margin-right: 4px;
}

.search-hero-chip {
    display: inline-block;
    padding: 5px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #4a5568;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}
.search-hero-chip:hover {
    background: #f0f4ff;
    border-color: #c4d4ff;
    color: #2b4eb0;
    text-decoration: none;
}