/* ============================================================================
   gear.css — 러닝 기어 계급도(러닝화·러닝워치) + 허브
   --ro-* 토큰만 사용(다크/라이트 자동 대응). 색상 하드코딩 금지.
   site.css 전역 section{padding} 을 덮어쓰기 위해 .gr-wrap 패딩을 명시한다.
   ============================================================================ */

.gr-wrap {
    max-width: 960px;
    margin-inline: auto;
    /* 전역 section 패딩 무효화 — 좌우 16px 거터 + 상하 여백 명시 */
    padding: clamp(1.5rem, 1rem + 2vw, 3rem) 16px clamp(3rem, 2rem + 4vw, 5rem);
    color: var(--ro-text);
}

/* ── 브레드크럼 ── */
.gr-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: var(--ro-text-sm);
    color: var(--ro-text-muted);
    margin-bottom: 1.25rem;
}
.gr-crumb a { color: var(--ro-text-sub); text-decoration: none; }
.gr-crumb a:hover { color: var(--ro-primary-700); text-decoration: underline; }
.gr-crumb strong { color: var(--ro-text); font-weight: var(--ro-weight-semibold); }
.gr-crumb span { color: var(--ro-text-muted); }

/* ── 히어로 ── */
.gr-hero { margin-bottom: clamp(1.75rem, 1rem + 3vw, 2.75rem); }
.gr-hero__kicker {
    display: inline-block;
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-primary-700);
    background: var(--ro-primary-50);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}
.gr-hero__title {
    font-size: var(--ro-text-3xl);
    font-weight: var(--ro-weight-black);
    line-height: 1.18;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
    color: var(--ro-text);
}
.gr-hero__title em { color: var(--ro-primary-600); font-style: normal; }
.gr-hero__sub {
    font-size: var(--ro-text-lg);
    line-height: 1.6;
    color: var(--ro-text-sub);
    max-width: 44ch;
    margin: 0;
}

/* ── 러닝화/워치 전환 탭 ── */
.gr-switch {
    display: inline-flex;
    gap: 4px;
    margin-top: 1.4rem;
    padding: 4px;
    background: var(--ro-surface-alt);
    border: 1px solid var(--ro-border);
    border-radius: 999px;
}
.gr-switch a {
    padding: 8px 20px;
    border-radius: 999px;
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-text-sub);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.gr-switch a:hover { color: var(--ro-text); }
.gr-switch__on,
.gr-switch a[aria-current="page"] {
    background: var(--ro-primary-cta);
    color: var(--ro-text-on-primary);
}

/* ── 허브 카드(러닝화/워치 입구) ── */
.gr-hub {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.gr-hub__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: clamp(1.25rem, 1rem + 1.5vw, 1.9rem);
    background: var(--ro-surface);
    border: 1px solid var(--ro-border);
    border-radius: 16px;
    box-shadow: var(--ro-shadow-sm);
    text-decoration: none;
    color: var(--ro-text);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.gr-hub__card:hover {
    border-color: var(--ro-primary-300);
    box-shadow: var(--ro-shadow-md);
    transform: translateY(-2px);
}
.gr-hub__kicker { font-size: var(--ro-text-sm); color: var(--ro-text-muted); font-weight: var(--ro-weight-medium); }
.gr-hub__title { font-size: var(--ro-text-2xl); font-weight: var(--ro-weight-bold); }
.gr-hub__desc { font-size: var(--ro-text-base); color: var(--ro-text-sub); }
.gr-hub__go { margin-top: 6px; font-size: var(--ro-text-sm); font-weight: var(--ro-weight-semibold); color: var(--ro-primary-700); }

/* ── 티어(계급) ── */
.gr-tiers { display: flex; flex-direction: column; gap: clamp(1.75rem, 1rem + 3vw, 2.75rem); }
.gr-tier__head { margin-bottom: 1rem; }
.gr-tier__title {
    font-size: var(--ro-text-xl);
    font-weight: var(--ro-weight-bold);
    color: var(--ro-text);
    margin: 0 0 0.3rem;
    padding-left: 12px;
    border-left: 4px solid var(--ro-accent-400);
}
.gr-tier__lead { font-size: var(--ro-text-base); color: var(--ro-text-sub); margin: 0; line-height: 1.55; }

.gr-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.gr-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1.1rem 1.2rem;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border);
    border-radius: 14px;
    box-shadow: var(--ro-shadow-xs);
}
.gr-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gr-card__name { display: flex; flex-direction: column; gap: 2px; }
.gr-card__brand { font-size: var(--ro-text-xs); color: var(--ro-text-muted); font-weight: var(--ro-weight-medium); }
.gr-card__model { font-size: var(--ro-text-lg); font-weight: var(--ro-weight-bold); color: var(--ro-text); line-height: 1.2; }
.gr-card__pick {
    flex: none;
    font-size: var(--ro-text-xs);
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-accent-700);
    background: var(--ro-accent-50);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.gr-card__price {
    align-self: flex-start;
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-primary-700);
    background: var(--ro-primary-50);
    padding: 3px 10px;
    border-radius: 8px;
}
/* 현재 최저가(스크래퍼 데이터가 있을 때만) */
.gr-card__live {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--ro-success-50);
    border: 1px solid var(--ro-success-200);
    text-decoration: none;
    color: var(--ro-success-700);
}
.gr-card__live:hover { text-decoration: underline; }
.gr-card__live-label { font-size: var(--ro-text-xs); color: var(--ro-text-muted); font-weight: var(--ro-weight-medium); }
.gr-card__live strong { font-size: var(--ro-text-base); color: var(--ro-success-700); font-weight: var(--ro-weight-bold); }
.gr-card__mall { font-size: var(--ro-text-xs); color: var(--ro-text-muted); }
.gr-card__live-na { color: var(--ro-text-muted); }

.gr-card__summary { font-size: var(--ro-text-base); color: var(--ro-text); line-height: 1.55; margin: 0; }
.gr-card__for {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: var(--ro-text-sm);
    color: var(--ro-text-sub);
    margin: 0;
    line-height: 1.5;
}
.gr-card__for-label {
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-text-muted);
}

.gr-disclaimer {
    margin-top: 1.75rem;
    font-size: var(--ro-text-sm);
    color: var(--ro-text-muted);
    line-height: 1.55;
}

/* ── 다음 단계(유입 → 전환 길목) ── */
.gr-next {
    margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
    padding: clamp(1.4rem, 1rem + 2vw, 2.2rem);
    background: var(--ro-surface-alt);
    border: 1px solid var(--ro-border);
    border-radius: 16px;
}
.gr-next__title { font-size: var(--ro-text-xl); font-weight: var(--ro-weight-bold); color: var(--ro-text); margin: 0 0 0.4rem; }
.gr-next__sub { font-size: var(--ro-text-base); color: var(--ro-text-sub); margin: 0 0 1.1rem; line-height: 1.55; }
.gr-next__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.gr-next__links a { font-size: var(--ro-text-base); color: var(--ro-primary-700); text-decoration: none; font-weight: var(--ro-weight-medium); }
.gr-next__links a:hover { text-decoration: underline; }
.gr-next__cta {
    padding: 10px 20px;
    background: var(--ro-primary-cta);
    color: var(--ro-text-on-primary) !important;
    border-radius: 10px;
    font-weight: var(--ro-weight-semibold) !important;
}
.gr-next__cta:hover { background: var(--ro-primary-cta-hover); text-decoration: none !important; }

/* ── 자주 찾는 비교(계급도 하단 내부 링크) ── */
.gr-compares {
    margin-top: clamp(1.75rem, 1rem + 2vw, 2.5rem);
    padding: clamp(1.1rem, 0.8rem + 1.5vw, 1.6rem) clamp(1.1rem, 0.8rem + 1.5vw, 1.6rem);
    background: var(--ro-surface);
    border: 1px solid var(--ro-border);
    border-radius: 14px;
}
.gr-compares__title { font-size: var(--ro-text-lg); font-weight: var(--ro-weight-bold); color: var(--ro-text); margin: 0 0 0.8rem; }
.gr-compares__links { display: flex; flex-wrap: wrap; gap: 8px; }
.gr-compares__links a {
    font-size: var(--ro-text-sm);
    color: var(--ro-text-sub);
    text-decoration: none;
    padding: 6px 12px;
    background: var(--ro-surface-alt);
    border: 1px solid var(--ro-border);
    border-radius: 999px;
    transition: border-color .15s, color .15s;
}
.gr-compares__links a:hover { color: var(--ro-primary-700); border-color: var(--ro-primary-300); }
.gr-compares__links span { color: var(--ro-text-muted); margin: 0 4px; }

/* ── 비교 페이지 ── */
.gr-cmp__h1 { font-size: var(--ro-text-2xl); }
.gr-cmp__vs { color: var(--ro-text-muted); font-weight: var(--ro-weight-medium); margin: 0 6px; }
.gr-cmp { overflow-x: auto; margin-top: 0.5rem; }
.gr-cmp__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 420px;
}
.gr-cmp__table th,
.gr-cmp__table td {
    padding: 0.85rem 0.9rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--ro-border);
    font-size: var(--ro-text-base);
    color: var(--ro-text);
    line-height: 1.5;
}
.gr-cmp__table thead th {
    background: var(--ro-surface-alt);
    border-bottom: 2px solid var(--ro-border);
    vertical-align: bottom;
}
.gr-cmp__table thead th:first-child { background: transparent; }
.gr-cmp__table tbody th[scope="row"] {
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-text-muted);
    white-space: nowrap;
    width: 1%;
}
.gr-cmp__table thead th:first-child,
.gr-cmp__table tbody tr:last-child th,
.gr-cmp__table tbody tr:last-child td { border-bottom: none; }
.gr-cmp__corner { font-size: var(--ro-text-sm); color: var(--ro-text-muted); font-weight: var(--ro-weight-semibold); }
.gr-cmp__brand { display: block; font-size: var(--ro-text-xs); color: var(--ro-text-muted); font-weight: var(--ro-weight-medium); }
.gr-cmp__model { display: block; font-size: var(--ro-text-lg); font-weight: var(--ro-weight-bold); color: var(--ro-text); line-height: 1.2; margin-bottom: 4px; }

.gr-cmp__verdict {
    margin-top: 1.75rem;
    padding: clamp(1.25rem, 1rem + 1.5vw, 1.8rem);
    background: var(--ro-primary-50);
    border: 1px solid var(--ro-border);
    border-radius: 16px;
}
.gr-cmp__verdict-title { font-size: var(--ro-text-xl); font-weight: var(--ro-weight-bold); color: var(--ro-text); margin: 0 0 0.75rem; }
.gr-cmp__verdict-list { margin: 0 0 0.75rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.gr-cmp__verdict-list li { font-size: var(--ro-text-base); color: var(--ro-text); line-height: 1.55; }
.gr-cmp__verdict-list strong { color: var(--ro-primary-700); }
.gr-cmp__verdict .gr-disclaimer { margin-top: 0.75rem; }

/* ── 가격 알림 버튼 ── */
.gr-alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 7px 12px;
    font-size: var(--ro-text-sm);
    font-weight: var(--ro-weight-semibold);
    color: var(--ro-primary-700);
    background: var(--ro-primary-50);
    border: 1px solid var(--ro-primary-200);
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.gr-alert-btn:hover { background: var(--ro-primary-100); border-color: var(--ro-primary-300); }
.gr-alert-btn svg { flex: none; }
.gr-alert-btn.is-on {
    color: var(--ro-success-700);
    background: var(--ro-success-50);
    border-color: var(--ro-success-200);
    cursor: default;
}
.gr-alert-btn[disabled] { opacity: .9; }

/* 내 가격 알림 목록 */
.gr-alerts-list { display: flex; flex-direction: column; gap: 10px; margin-top: 1rem; }
.gr-alert-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 1rem 1.2rem;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border);
    border-radius: 12px;
}
.gr-alert-row__name { font-size: var(--ro-text-base); font-weight: var(--ro-weight-semibold); color: var(--ro-text); }
.gr-alert-row__meta { font-size: var(--ro-text-sm); color: var(--ro-text-muted); margin-top: 2px; }
.gr-alert-row__off {
    flex: none; padding: 6px 14px; font-size: var(--ro-text-sm);
    color: var(--ro-text-sub); background: var(--ro-surface-alt);
    border: 1px solid var(--ro-border); border-radius: 999px; cursor: pointer;
}
.gr-alert-row__off:hover { color: var(--ro-danger-600); border-color: var(--ro-danger-300); }

/* ── 다크모드 링크 보정 ──────────────────────────────────────────────────
   앵커(<a>)는 다크에서 진한 파랑(#2960CC)으로 남아 어두운 배경 대비가 모자랐다.
   이 코드베이스 관례대로(site.css 의 html[data-theme="dark"] … a 선례) 섹션별로
   밝은 파랑을 명시한다. 두 다크 블록은 항상 같이 고친다(tokens.css 규칙). */
html[data-theme="dark"] .gr-crumb a,
html[data-theme="dark"] .gr-next__links a,
html[data-theme="dark"] .gr-compares__links a { color: #8AB3FF; }
html[data-theme="dark"] .gr-next__links a:hover,
html[data-theme="dark"] .gr-compares__links a:hover { color: #B7D1FF; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .gr-crumb a,
    html:not([data-theme="light"]) .gr-next__links a,
    html:not([data-theme="light"]) .gr-compares__links a { color: #8AB3FF; }
    html:not([data-theme="light"]) .gr-next__links a:hover,
    html:not([data-theme="light"]) .gr-compares__links a:hover { color: #B7D1FF; }
}

/* ── 반응형 ── */
@media (min-width: 640px) {
    .gr-grid { grid-template-columns: 1fr 1fr; }
    .gr-hub { grid-template-columns: 1fr 1fr; }
    .gr-cmp__h1 { font-size: var(--ro-text-3xl); }
}
