/* 건강 글 페이지(health/<주소>/)와 건강 페이지(/health/).
 * 설계: docs/superpowers/specs/2026-11-07-supplement-research-blog-design.md
 * 값은 승인된 3차 시안(docs/superpowers/specs/2026-11-07-supplement-research-blog/mock/health.css)이다.
 * 계산기 카드(.home-health-card)와 글 카드(.health-post-card)는 다른 페이지도 써서 base.css에 있다. */

/* ---------- 공통 ---------- */
.health-main {
    padding: 32px 0 64px;
}

/* 글 위의 꼬리표 '건강 · 영양제 이야기'. 누르면 /health/로 간다. */
.health-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--health-wash);
    color: var(--health-ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

.health-tag:hover {
    text-decoration: underline;
}

/* ---------- 글 페이지: 본문은 읽기 좋은 720px 한 열, 상품 줄은 화면 폭을 다 쓴다 ---------- */
.health-post {
    max-width: 720px;
    margin: 0 auto;
}

.health-post-head {
    margin-bottom: 24px;
}

.health-post-title {
    margin: 12px 0 8px;
    font-size: 32px;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.health-post-date {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.health-summary {
    margin: 0 0 32px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--health-wash);
}

.health-summary h2 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--health-ink);
}

.health-summary ul {
    margin: 0;
    padding-left: 20px;
}

.health-summary li {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-primary);
    word-break: keep-all;
}

.health-summary li + li {
    margin-top: 6px;
}

.health-body {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-primary);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.health-body h2 {
    margin: 40px 0 12px;
    font-size: 22px;
    line-height: 1.4;
}

.health-body h3 {
    margin: 28px 0 8px;
    font-size: 18px;
    line-height: 1.45;
}

.health-body p {
    margin: 0 0 16px;
}

.health-body ul,
.health-body ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.health-body li + li {
    margin-top: 4px;
}

.health-body a {
    color: var(--health-ink);
}

/* 근거 번호 [n]: 참고 문헌의 그 줄로 가는 위첨자 링크. */
.health-cite {
    font-size: 0.72em;
    line-height: 0;
    vertical-align: super;
}

.health-cite a {
    color: var(--health-ink);
    font-weight: 600;
    text-decoration: none;
}

.health-cite a:hover {
    text-decoration: underline;
}

/* 표: 좁은 화면에서는 표 안에서만 옆으로 넘긴다(페이지는 넘치지 않는다). */
.health-table {
    margin: 8px 0 20px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.health-table table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
}

.health-table th,
.health-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.health-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.health-table tr:last-child td {
    border-bottom: 0;
}

.health-refs {
    margin: 40px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.health-refs h2 {
    margin: 0 0 12px;
    font-size: 17px;
}

.health-refs ol {
    margin: 0;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 근거 번호로 왔을 때 고정 머리에 가리지 않게. */
.health-refs li {
    scroll-margin-top: 96px;
}

.health-refs li + li {
    margin-top: 8px;
}

.health-refs a {
    color: var(--health-ink);
    overflow-wrap: anywhere;
}

.health-refs li:target {
    border-radius: 6px;
    background: var(--health-wash);
}

/* ---------- 이 글에 나온 상품: 상품 군마다 한 줄(사용자 결정 12) ---------- */
.health-products {
    margin: 56px 0 0;
}

.health-products > h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.4;
}

.health-row {
    margin-top: 20px;
}

.health-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
    margin-bottom: 10px;
}

.health-row-head h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
    word-break: keep-all;
}

/* ‹ › 단추. 서버는 숨긴 채 그리고, 줄이 넘칠 때 js/health_rows.js가 보인다. */
.health-row-nav {
    display: flex;
    flex: none;
    gap: 8px;
}

.health-row-nav[hidden] {
    display: none;
}

.health-row-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.health-row-nav button:hover:not(:disabled) {
    border-color: var(--health-ink);
    color: var(--health-ink);
}

.health-row-nav button:disabled {
    opacity: 0.35;
    cursor: default;
}

/* PC는 다섯 장이 보이고 나머지는 넘긴다. 위아래 여백은 카드를 올리는 호버(4px)와 그림자 자리다. */
.health-cards {
    display: flex;
    gap: 16px;
    margin: 0 -4px;
    padding: 4px 4px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px;
    scrollbar-width: none;
}

.health-cards::-webkit-scrollbar {
    display: none;
}

.health-cards > .product-card {
    display: flex;
    flex: 0 0 calc((100% - 64px) / 5);
    flex-direction: column;
    scroll-snap-align: start;
}

/* 카드의 바닥 줄(재고·관심상품)을 카드 바닥에 붙인다. 가격 내림 격자(.products-grid)의 규칙과 같다(base.css). */
.health-cards > .product-card > .product-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.health-cards > .product-card > .product-content > .product-footer {
    margin-top: auto;
}

.health-cards > .product-card > .product-content > .price-group + .unit-price-summary,
.health-cards > .product-card > .product-content > .price-group + .list-price-drop-meta {
    margin-top: 0;
}

.health-cards .product-image {
    height: 170px;
}

/* ---------- 건강 페이지(/health/) ---------- */
.health-hub {
    max-width: 720px;
    margin: 0 auto;
}

.health-hub-title {
    margin: 0 0 20px;
    font-size: 28px;
    line-height: 1.3;
    color: var(--text-primary);
}

.health-hub-section {
    margin-top: 32px;
}

.health-hub-section h2 {
    margin: 0 0 12px;
    font-size: 17px;
    line-height: 1.4;
}

/* ---------- 폭 ---------- */
@media (max-width: 1024px) and (min-width: 769px) {
    .health-cards > .product-card {
        flex-basis: calc((100% - 48px) / 4);
    }
}

@media (max-width: 768px) {
    .health-main {
        padding: 20px 0 40px;
    }

    .health-post-title {
        font-size: 25px;
        line-height: 1.35;
    }

    .health-summary {
        padding: 16px 16px 16px 14px;
    }

    .health-body {
        font-size: 16px;
        line-height: 1.75;
    }

    .health-body h2 {
        margin-top: 32px;
        font-size: 20px;
    }

    .health-products {
        margin-top: 44px;
    }

    .health-products > h2 {
        font-size: 20px;
    }

    .health-row-nav {
        display: none;
    }

    /* 휴대폰은 홈 줄처럼 화면 끝까지 닿는 가로 줄이다. 맞춤 위치는 본문 여백 16px다. */
    .health-cards {
        gap: 10px;
        margin: 0 -16px;
        padding: 4px 16px 8px;
        scroll-padding-inline: 16px;
    }

    .health-cards > .product-card {
        flex: 0 0 160px;
    }

    .health-cards .product-image {
        height: 120px;
    }

    .health-hub-title {
        font-size: 24px;
    }
}
