/* 기본 스타일 및 가독성 최적화 */
:root {
    --primary-color: #0056b3;
    --text-color: #333;
    --bg-color: #f4f6f8;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --gray-text: #666;
    --light-gray: #999;
}

body {
    font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 레이아웃 구조 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 20px;
}

header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 10px 0 20px;
    color: #111;
}

/* 상단 카테고리 (가로 스크롤 UX) */
.category-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 20px;
    /* position: relative; removed to allow fixed dropdown calculation relative to viewport easily if needed, but keeping flow */
}

.category-nav::-webkit-scrollbar {
    display: none;
}

/* 드롭다운 컨테이너 */
.nav-item-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

/* 카테고리 태그 공통 */
.category-tag {
    background: var(--white);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
    text-decoration: none;
    display: inline-block;
}

.category-tag:hover,
.category-tag.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 86, 179, 0.2);
}

/* 드롭다운 메뉴 스타일 (Fixed로 변경하여 클리핑 방지) */
.dropdown-menu {
    display: none;
    /* JS로 제어 */
    position: fixed;
    /* 뷰포트 기준 배치 */
    background-color: var(--white);
    min-width: 140px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 6px 0;
    z-index: 9999;
    border: 1px solid #eee;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f9ff;
    color: var(--primary-color);
}


/* 게시글 카드 스타일 (정보 계층화) */
.article-card {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.card-meta {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin: 5px 0 10px;
    line-height: 1.4;
    color: #111;
    word-break: keep-all;
}

.card-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--primary-color);
}

.card-date {
    font-size: 13px;
    color: var(--light-gray);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.card-date::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: var(--light-gray);
    border-radius: 50%;
    margin-right: 6px;
}

/* 수익화 문구 디자인 */
.disclaimer {
    font-size: 12px;
    color: #777;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 18px;
    border: 1px solid #eee;
}

/* GEO 최적화 본문 스타일 (리스트형) */
.summary-box {
    background: #f8fbff;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 0 8px 8px 0;
}

.summary-header {
    font-weight: 800;
    color: #1a1a1a;
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-size: 15px;
    color: #444;
}

.summary-list li {
    margin-bottom: 8px;
    padding-left: 10px;
    position: relative;
    line-height: 1.6;
}

.summary-list li:last-child {
    margin-bottom: 0;
}

/* 모바일 최적화 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .card-title {
        font-size: 19px;
    }

    .article-card {
        padding: 20px;
        border-radius: 12px;
    }
}

footer {
    text-align: center;
    padding: 40px 0 20px;
    color: #888;
    font-size: 13px;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* 옵션 버튼 스타일 */
.option-btn {
    flex: 1;
    min-width: 120px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.option-btn:hover {
    background: #f9f9f9;
}

.option-btn.active {
    border: 2px solid #3e6ae1;
    background: #f0f4ff;
}

/* 색상 원형 버튼 */
.color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.active {
    outline: 3px solid #3e6ae1;
    outline-offset: 2px;
}

/* --- 종합 견적 계산기 스타일 --- */
.calculator-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calc-section {
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 12px;
    background-color: #fafafa;
}

.sec-title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.calc-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.calc-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
    outline: none;
    cursor: pointer;
}

.trim-options {
    display: flex;
    gap: 8px;
}

.trim-options .option-btn {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    font-size: 13px;
    line-height: 1.4;
}

.trim-options .option-btn strong {
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}

.checkbox-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    cursor: pointer;
}

.checkbox-group input {
    margin-right: 8px;
}

/* 결과 박스 */
.calc-result-box {
    background: #f8fbfd;
    border: 1px solid #e1f0fa;
    border-radius: 12px;
    padding: 20px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.result-row.discount {
    color: #d32f2f;
    font-weight: 600;
}

.result-row.total {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    align-items: center;
}

.result-row.total .highlight {
    color: var(--primary-color);
    font-size: 24px;
}

.final-note {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    text-align: right;
}

.full-width-btn {
    width: 100%;
    padding: 16px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.full-width-btn:hover {
    background: #333;
}