/* member/css/share.css - 선교회 홈 "공유" (share.html) - 버튼·창은 section.css 의 sc-* 를 같이 쓴다 */

.share-gate {
    display: grid; justify-items: center; gap: 14px; padding: 48px 20px; text-align: center;
    border-radius: 16px; background: #fff; border: 1px solid var(--line);
}
.share-gate[hidden], #share-body[hidden] { display: none; }
.share-gate p { margin: 0; font-size: 16px; font-weight: 700; color: var(--brand-900); }
.share-gate .sc-btn[hidden] { display: none; }

.share-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-toolbar input[type="search"] {
    flex: 1; min-width: 200px; min-height: 46px; padding: 10px 16px;
    border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 15px; background: #fff;
}
.share-toolbar input[type="search"]:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
.share-count { margin: 14px 2px 8px; font-size: 13.5px; font-weight: 700; color: var(--ink-muted); }

.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.share-empty { padding: 40px 16px; text-align: center; color: var(--ink-muted); border-radius: 14px; background: #fff; border: 1px dashed var(--line); }
.share-item {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start;
    padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
}
.share-icon, .share-thumb {
    width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
    font-size: 26px; font-weight: 900; color: var(--brand-600); background: var(--brand-50);
}
.share-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share-icon-music { background: #fdf2e9; color: #c2410c; }
.share-icon-sermon { background: #eef2ff; color: #4338ca; }
.share-icon-video { background: #fdecec; color: #d64545; }
.share-icon-doc { background: #ecfdf5; color: #047857; }
.share-text { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.share-title { font-size: 16px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.share-desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.share-meta { font-size: 12.5px; color: var(--ink-muted); overflow-wrap: anywhere; }
.share-text audio { width: 100%; max-width: 420px; margin-top: 4px; }
.share-text video { width: 100%; max-width: 480px; margin-top: 4px; border-radius: 10px; background: #000; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 220px; }
.share-actions .sc-btn { padding: 8px 14px; font-size: 13.5px; text-decoration: none; }
.share-progress { margin: 0; font-weight: 700; color: var(--brand-700); }
.share-progress[hidden] { display: none; }

@media (max-width: 640px) {
    .share-item { grid-template-columns: 52px minmax(0, 1fr); padding: 12px; gap: 10px; }
    .share-icon, .share-thumb { width: 52px; height: 52px; font-size: 22px; }
    .share-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}

/* 자료공유 카테고리 */
.share-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.share-chips[hidden] { display: none; }
.share-chips button {
    padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
    font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-muted); cursor: pointer;
}
.share-chips button.is-active { border-color: transparent; background: var(--brand-600); color: #fff; }
.share-list[hidden], .story-grid[hidden], .story-view[hidden] { display: none; }

/* 스토리 카드 */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.story-grid .share-empty { grid-column: 1 / -1; }
.story-card {
    display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: #fff;
    border: 1px solid var(--line); color: inherit; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
}
.story-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -10px rgba(11, 61, 115, 0.25); }
.story-cover { position: relative; aspect-ratio: 4 / 3; background: var(--brand-50); overflow: hidden; }
.story-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-cover.is-text { display: grid; place-items: center; padding: 18px; background: linear-gradient(135deg, #eef5fd, #dbe9fa); }
.story-cover.is-text span { font-family: 'Gowun Batang', serif; font-size: 15px; line-height: 1.7; color: var(--brand-900); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.story-count { position: absolute; right: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(15, 23, 42, 0.65); color: #fff; font-size: 12px; font-weight: 700; }
.story-card-text { display: grid; gap: 4px; padding: 12px 14px 14px; }
.story-card-text b { font-size: 15.5px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.story-card-text small { font-size: 12.5px; color: var(--ink-muted); }

/* 스토리 크게 보기 */
.story-view { border-radius: 16px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.story-view-body { padding: 26px 32px 34px; max-width: 860px; margin: 0 auto; }
.story-photos { display: grid; gap: 10px; margin: 6px 0 20px; }
.story-photos:empty { display: none; }
.story-photos img { width: 100%; height: auto; display: block; border-radius: 12px; }
#story-text[hidden] { display: none; }

/* 편집 창 - 사진 */
.sf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.sf-photos:empty { display: none; }
.sf-photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--brand-50); }
.sf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-photo button {
    position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: none; border-radius: 50%;
    background: rgba(15, 23, 42, 0.7); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}
.sc-field[hidden] { display: none; }
@media (max-width: 600px) {
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .story-view-body { padding: 18px 16px 24px; }
}
