/* ============================================================
   hyunni.com — style.css
   ============================================================ */

@font-face {
    font-family: 'Noto Sans KR';
    src: url('/assets/fonts/NotoSansKR-Regular.ttf') format('truetype');
    font-weight: 400;
}

/* ── 리셋 & 기본 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --header-h: 56px;
    --sidebar-w: 220px;
    --red: #e60023;
    --blue: #3b6ef5;
    --bg: #f5f5f5;
    --white: #fff;
    --border: #e8e8e8;
    --text: #111;
    --text2: #555;
    --text3: #999;
    --radius: 16px;
    --col-w: 236px;
    --col-gap: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,0.10);
}

body {
    font-family: 'Noto Sans KR', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ── 헤더 ── */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 200;
}

.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    text-decoration: none;
}

.header-search {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}

.header-search input {
    width: 100%;
    height: 40px;
    border-radius: 24px;
    border: none;
    background: var(--bg);
    padding: 0 44px 0 18px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: box-shadow .2s;
}

.header-search input:focus {
    box-shadow: 0 0 0 2px var(--blue);
    background: var(--white);
}

.header-search .search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    pointer-events: none;
}

.header-right {
    flex-shrink: 0;
}

.header-login-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: var(--text);
    color: var(--white);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}

.header-login-btn:hover {
    background: #333;
}

/* ── 메인 레이아웃 ── */
.main-wrap {
    padding-top: calc(var(--header-h) + 20px);
    padding-bottom: 60px;
}

/* ── Masonry Grid ── */
.masonry-wrap {
    padding: 0 16px;
}

.masonry {
    display: flex;
    gap: var(--col-gap);
    align-items: flex-start;
}

.masonry-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--col-gap);
    min-width: 0;
}

/* ── 핀 카드 ── */
.pin-card {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    position: relative;
    cursor: pointer;
    transition: box-shadow .2s;
}

.pin-card:hover {
    box-shadow: var(--shadow);
}

.pin-card img {
    width: 100%;
    display: block;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* 이미지만 있을 때 (제목/설명 없음) */
.pin-card.no-meta img {
    border-radius: var(--radius);
}

.pin-card .pin-meta {
    padding: 10px 12px 12px;
}

.pin-card .pin-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pin-card .pin-cat {
    font-size: 12px;
    color: var(--text3);
}

/* hover 오버레이 */
.pin-card .pin-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 10px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.pin-card:hover .pin-overlay {
    opacity: 1;
    pointer-events: auto;
}

.pin-like-btn {
    background: var(--white);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
}

.pin-like-btn svg {
    width: 18px;
    height: 18px;
    stroke: #aaa;
    fill: none;
    stroke-width: 2;
    transition: stroke .15s, fill .15s;
}

.pin-like-btn:hover svg,
.pin-like-btn.liked svg {
    stroke: var(--red);
    fill: var(--red);
}

.pin-like-btn:hover { transform: scale(1.1); }

/* ── 스켈레톤 로딩 ── */
.skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: var(--radius);
    break-inside: avoid;
    margin-bottom: var(--col-gap);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 로딩 스피너 ── */
.loading-more {
    text-align: center;
    padding: 24px;
    color: var(--text3);
    font-size: 14px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── 핀 상세 페이지 ── */
.pin-detail-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(300px, 420px) 1fr;
    gap: 40px;
    align-items: start;
}

.pin-detail-img {
    border-radius: var(--radius);
    overflow: hidden;
    background: #eee;
    position: sticky;
    top: calc(var(--header-h) + 20px);
}

.pin-detail-img img {
    width: 100%;
    height: auto;
    display: block;
}

.pin-detail-info {
    padding-top: 8px;
}

.pin-detail-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.pin-detail-desc {
    font-size: 15px;
    color: var(--text2);
    line-height: 1.7;
    margin-bottom: 16px;
}

.pin-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text3);
}

/* 태그 */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-chip {
    padding: 5px 12px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text2);
    transition: background .15s;
}

.tag-chip:hover {
    background: var(--border);
    color: var(--text);
}

/* 좋아요 버튼 */
.like-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 24px;
    border: 2px solid var(--border);
    background: var(--white);
    font-size: 15px;
    font-weight: 600;
    transition: all .2s;
    margin-bottom: 28px;
}

.like-btn-large:hover {
    border-color: var(--red);
    color: var(--red);
}

.like-btn-large.liked {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
}

/* ── 코멘트 ── */
.comment-section { border-top: 1px solid var(--border); padding-top: 20px; }

.comment-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.comment-form textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    height: 80px;
    outline: none;
    transition: border-color .2s;
}

.comment-form textarea:focus { border-color: var(--blue); }

.comment-form button {
    padding: 0 20px;
    background: var(--text);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    align-self: flex-end;
    height: 40px;
    transition: background .15s;
}

.comment-form button:hover { background: #333; }

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.comment-body .comment-ip {
    font-size: 12px;
    color: var(--text3);
    margin-bottom: 4px;
}

.comment-body .comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.comment-body .comment-time {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
}

/* ── 관련 핀 ── */
.related-pins { margin-top: 60px; padding: 0 16px; }

.related-pins h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 0 4px;
}

/* ── 섹션 타이틀 ── */
.section-header {
    padding: 0 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.section-header .count {
    font-size: 13px;
    color: var(--text3);
}

/* ── 빈 상태 ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text3);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── 검색 결과 ── */
.search-header {
    padding: 0 20px 16px;
}

.search-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.search-header span {
    font-size: 14px;
    color: var(--text3);
    margin-left: 8px;
}

/* ── 반응형 ── */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .header-search { max-width: none; }

    .pin-detail-wrap {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .pin-detail-img { position: static; }
}

@media (max-width: 480px) {
    .masonry-wrap { padding: 0 8px; }
}

/* ── 핀 모달 ── */
#pin-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

#pin-modal.active {
    display: block;
}

.pin-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}

.pin-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1100px;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pin-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-modal-body {
    display: flex;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
}

.pin-modal-left {
    flex: 0 0 auto;
    max-width: 55%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pin-modal-left img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pin-modal-right {
    flex: 1;
    overflow-y: auto;
    padding: 28px 24px;
}

.pin-modal-actions {
    margin-bottom: 16px;
}

.pin-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

@media (max-width: 768px) {
    .pin-modal-body {
        flex-direction: column;
        height: auto;
    }
    .pin-modal-left {
        max-width: 100%;
        max-height: 50vh;
    }
    .pin-modal-container {
        width: 96vw;
        max-height: 95vh;
        top: 50%;
    }
}
/* 전체 배경 흰색 */
body { background: #fff; }


.related-pins .masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    align-items: start;
}

.related-pins .masonry .pin-card {
    width: 100%;
}

#related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    align-items: start;
}