/* ============================================================
   FILE: public/assets/css/search.css
   ── 배치 정보 ──────────────────────────────────────────────
     서버: 웹서버 (macOS, 172.20.200.10)
     경로: /Users/lajeong/Documents/Site/public/assets/css/search.css
     접근: 가능 — /assets/css/search.css
   ── 역할 ──────────────────────────────────────────────────
     search.php 전용 스타일.
     관리자 게시물 인라인 상세 뷰 (saf-*) 2컬럼 레이아웃,
     관련 게시글·다운로드 링크 스타일 정의.
   ============================================================ */

/* ── 전체 래퍼 ─────────────────────────────────────────────── */
.saf-wrap {
    margin-bottom: 2rem;
}

/* ── 2컬럼 메인 레이아웃 ─────────────────────────────────── */
.saf-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 1.25rem;
}

/* ── 왼쪽: 이미지 + 본문 ─────────────────────────────────── */
.saf-image {
    margin: 0 0 1.25rem;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}

.saf-image img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.saf-content {
    padding: 0;
}

.saf-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.6rem;
    color: var(--color-text, #111);
}

.saf-summary {
    font-size: 0.97rem;
    color: var(--color-text-muted, #555);
    line-height: 1.65;
    margin: 0 0 1rem;
}

.saf-body {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-text, #222);
    margin-bottom: 1rem;

    /* 본문 길이 제한: 최대 6줄 표시 후 페이드 */
    max-height: 11em;
    overflow: hidden;
    position: relative;
}

.saf-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--color-bg, #fff)
    );
}

[data-theme="light"] .saf-body::after {
    background: linear-gradient(to bottom, transparent, #fff);
}

.saf-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--color-text-muted, #888);
    margin-top: 0.5rem;
}

/* ── 오른쪽: PDF + YouTube ───────────────────────────────── */
.saf-right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* PDF 섹션 */
.saf-pdf {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saf-pdf-preview {
    position: relative;
    min-height: 160px;
    background: var(--color-bg-card, #f5f5f5);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 12px;
    overflow: hidden;
}

.saf-pdf-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.saf-pdf-loading-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted, #888);
}

.saf-pdf-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

/* YouTube 섹션 */
.saf-youtube .youtube-embed-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.saf-youtube .youtube-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── 구분선 ──────────────────────────────────────────────── */
.saf-divider {
    border: none;
    border-top: 1px solid var(--color-border, #e0e0e0);
    margin: 2rem 0 1.5rem;
}

/* ── 관련 콘텐츠 섹션 ────────────────────────────────────── */
.saf-related {
    margin-bottom: 1.5rem;
}

.saf-related-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted, #555);
    margin: 0 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border, #eee);
}

.saf-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.saf-related-item {
    border-bottom: 1px solid var(--color-border-light, #f0f0f0);
}

.saf-related-item:last-child {
    border-bottom: none;
}

.saf-related-link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.75rem;
    padding: 0.6rem 0.25rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    border-radius: 6px;
}

.saf-related-link:hover {
    background: var(--color-bg-hover, rgba(0,0,0,0.03));
    color: var(--color-primary, #333);
}

.saf-related-board {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary, #4285F4);
    background: var(--color-primary-light, rgba(66,133,244,0.1));
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.saf-related-item-title {
    font-size: 0.9rem;
    color: var(--color-text, #222);
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

.saf-related-meta {
    font-size: 0.78rem;
    color: var(--color-text-muted, #999);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── 추가 솔루션 그리드 ──────────────────────────────────── */
.saf-more-admin {
    margin-top: 0.5rem;
}

.saf-more-admin .search-admin-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    margin-top: 0.75rem;
}

/* ── 반응형 ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .saf-main {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .saf-image img {
        max-height: 240px;
    }

    .saf-title {
        font-size: 1.15rem;
    }

    .saf-pdf-preview {
        aspect-ratio: 16 / 7;
    }

    .saf-related-link {
        flex-direction: column;
        gap: 0.2rem;
    }

    .saf-related-meta {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .saf-image img {
        max-height: 200px;
    }

    .saf-body {
        max-height: 8em;
    }
}
