@charset "utf-8";

/*
 * 블로그 상세 (ai/blog_detail.html) 전용 스타일
 *
 * 팔레트는 common.css의 기업 팔레트를 따른다.
 *   메인   #004da8 / hover #003b82
 *   본문   #121212 (헤딩) / #333 (본문) / #636569 (보조)
 *   경계   #d3d3d3 / #ebebeb
 *   배경   #f5f5f5 / #f8f8f9 / #f5faff (라이트 블루 틴트)
 * 사각 요소 라운딩은 10px로 통일한다.
 */

/* ─── 메타 / 태그 ───────────────────────────────── */

.bbs-view__meta {
    margin-bottom: 0;
    padding-bottom: 30px;
    border-bottom: 1px solid #ebebeb;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 25px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #ebebeb;
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 14px;
    color: #636569;
    font-weight: 500;
    transition: all 0.2s;
}

.blog-tag:hover {
    background: #ebebeb;
    color: #004da8;
}

/* ─── 마크다운 본문 ─────────────────────────────── */

.markdown-content {
    line-height: 1.8;
    font-size: 17px;
    color: #333;
    word-break: keep-all;
    margin-top: 10px;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin-top: 2.2em;
    margin-bottom: 1em;
    font-weight: 700;
    line-height: 1.4;
    color: #121212;
    letter-spacing: -0.02em;
}

/* 교정 프롬프트가 본문 H1을 금지하므로 관리자 직접 작성분에만 적용된다 */
.markdown-content h1 { font-size: 2.2em; margin-top: 0.5em; }

.markdown-content h2 {
    font-size: 1.7em;
    border-bottom: 2px solid #ebebeb;
    padding-bottom: 0.5em;
    margin-top: 2.5em;
}

.markdown-content h3 { font-size: 1.4em; }
.markdown-content h4 { font-size: 1.2em; }

/*
 * "TL;DR" 헤딩만 시각적으로 감춘다(요약 본문은 그대로 노출).
 * ponytail: color:#fff + font-size:0 은 키워드 스터핑 시그니처라 sr-only로 대체.
 * toc 슬러그가 ASCII만 남기므로 한글 "요약" 헤딩은 매칭되지 않고 그대로 보인다.
 * 라벨을 항상 감추려면 CSS가 아니라 생성 프롬프트에서 표기를 고정해야 한다.
 */
.markdown-content #tldr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.markdown-content p {
    margin-bottom: 1.6em;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1.6em;
    padding-left: 1.5em;
}

.markdown-content li {
    margin-bottom: 0.6em;
}

.markdown-content blockquote {
    border-left: 4px solid #004da8;
    padding: 1.2em 1.5em;
    margin: 2.5em 0;
    background: #f5faff;
    border-radius: 0 10px 10px 0;
}

.markdown-content code {
    background: #f5f5f5;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 0.9em;
    color: #121212;
}

/*
 * 건강 콘텐츠에는 코드 블록이 없다. pre는 AI가 실수로 펜스를 뱉거나
 * 중첩 리스트 들여쓰기가 코드로 파싱될 때만 나오므로, 다크 코드 블록이 아니라
 * 본문 톤의 정보 박스로 렌더링한다.
 */
.markdown-content pre {
    background: #f8f8f9;
    color: #333;
    border: 1px solid #d3d3d3;
    padding: 1.5em;
    border-radius: 10px;
    margin: 2.5em 0;
    font-family: inherit;
    font-size: inherit;
    white-space: pre-wrap;
    word-break: keep-all;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #ebebeb;
    margin: 3.5em 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2.5em 0;
    border: 1px solid #d3d3d3;
    border-radius: 10px;
    overflow: hidden;
}

.markdown-content th,
.markdown-content td {
    border-bottom: 1px solid #d3d3d3;
    border-right: 1px solid #d3d3d3;
    padding: 14px;
}

.markdown-content th:last-child,
.markdown-content td:last-child {
    border-right: none;
}

.markdown-content tr:last-child td {
    border-bottom: none;
}

.markdown-content th {
    background: #f5f5f5;
    font-weight: 600;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2.5em 0;
    display: block;
}

.markdown-content a {
    color: #004da8;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(0, 77, 168, 0.3);
}

.markdown-content a:hover {
    color: #003b82;
    text-decoration-color: #003b82;
}

/* ─── 추천 제품 ─────────────────────────────────── */

.recommended-section {
    margin-top: 80px;
    padding-top: 50px;
    border-top: 1px solid #ebebeb;
}

.recommended-section__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #121212;
}

.product-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid #d3d3d3;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.07);
    transform: translateY(-5px);
    border-color: #004da8;
}

.product-card__image {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f8f8f9;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-card__image img {
    transform: scale(1.08);
}

.product-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__category {
    font-size: 11px;
    color: #004da8;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.product-card__name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #121212;
    line-height: 1.4;
}

.product-card__desc {
    font-size: 13.5px;
    color: #636569;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

.product-card__prices {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid #ebebeb;
}

.product-card__price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card__price-label {
    font-size: 11px;
    color: #636569;
}

.product-card__price-value {
    font-size: 14px;
    font-weight: 700;
    color: #121212;
}

.product-card__price-value--highlight {
    color: #004da8;
    font-size: 16px;
}

.product-card__instruction {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f5faff;
    border-radius: 8px;
    font-size: 12px;
    color: #004da8;
    line-height: 1.5;
    font-weight: 500;
}

/* ─── 반응형 ────────────────────────────────────── */

@media screen and (max-width: 1025px) {
    .product-cards { grid-template-columns: repeat(2, 1fr); }
}

/* 769px은 common.css가 .bbs-view__content 좌우 패딩을 0으로 떨어뜨리는 지점 */
@media screen and (max-width: 769px) {
    /*
     * 좌우 패딩이 0이라 컨테이너가 뷰포트 폭이 되고, word-break:keep-all 때문에
     * 셀이 줄바꿈되지 않아 표가 화면을 넘친다. table의 overflow:hidden이
     * 스크롤 대신 잘라내므로 가로 스크롤로 바꾼다.
     */
    .markdown-content table {
        display: block;
        width: max-content;
        max-width: 100%;
        overflow-x: auto;
    }
}

@media screen and (max-width: 600px) {
    .product-cards { grid-template-columns: 1fr; }
}
