/* ============================================================
   nowick_magazine.css - 2026 Liquid Glass Magazine Widget
   공통 CSS 변수 시스템 기반 스킨 공유 스타일시트
   PHP 7.4 / Rhymix CMS 전용
   ============================================================ */

/* ── 1. CSS 변수 (위젯 인라인 style에서 주입) ── */
.nw-widget {
    --nw-accent: #8c25f4;
    --nw-accent-rgb: 140,37,244;
    --nw-secondary: #a3e635;
    --nw-opacity: 0.10;
    --nw-blur: 12px;
    --nw-radius: 16px;
    --nw-gap: 16px;

    /* 다크 테마 기본값 */
    --nw-bg: #130f1a;
    --nw-surface: #1e1826;
    --nw-surface-2: #2a2233;
    --nw-border: rgba(255,255,255,0.08);
    --nw-text-primary: #f1f0f3;
    --nw-text-secondary: #9d8fb0;
    --nw-text-muted: #6b5e7a;

    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: transparent;
    color: var(--nw-text-primary);
    line-height: 1.5;
    box-sizing: border-box;
}

/* ── 2. 라이트 테마 ── */
.nw-widget[data-theme="light"] {
    --nw-bg: #f7f5f8;
    --nw-surface: #ffffff;
    --nw-surface-2: #f0ecf6;
    --nw-border: rgba(0,0,0,0.08);
    --nw-text-primary: #1a1625;
    --nw-text-secondary: #5a4e6e;
    --nw-text-muted: #9d8fb0;
}

/* ── 3. 시스템 자동 테마 ── */
@media (prefers-color-scheme: light) {
    .nw-widget[data-theme="auto"] {
        --nw-bg: #f7f5f8;
        --nw-surface: #ffffff;
        --nw-surface-2: #f0ecf6;
        --nw-border: rgba(0,0,0,0.08);
        --nw-text-primary: #1a1625;
        --nw-text-secondary: #5a4e6e;
        --nw-text-muted: #9d8fb0;
    }
}

.nw-widget * {
    box-sizing: border-box;
}

/* ── 4. 글래스 카드 (Liquid Glass) ── */
.nw-glass-card {
    background: rgba(var(--nw-accent-rgb), var(--nw-opacity));
    backdrop-filter: blur(var(--nw-blur));
    -webkit-backdrop-filter: blur(var(--nw-blur));
    border: 1px solid rgba(var(--nw-accent-rgb), 0.15);
    border-radius: var(--nw-radius);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.25s cubic-bezier(0.4,0,0.2,1),
                border-color 0.25s ease;
    overflow: hidden;
}

.nw-glass-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(var(--nw-accent-rgb), 0.25);
    border-color: rgba(var(--nw-accent-rgb), 0.35);
}

/* ── 5. 위젯 헤더 ── */
.nw-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--nw-gap);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--nw-border);
}

.nw-widget-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--nw-text-primary);
    letter-spacing: -0.02em;
}

.nw-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--nw-accent);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(var(--nw-accent-rgb), 0.12);
    border: 1px solid rgba(var(--nw-accent-rgb), 0.2);
    transition: background 0.2s ease, color 0.2s ease;
}

.nw-more-btn:hover {
    background: rgba(var(--nw-accent-rgb), 0.22);
    color: var(--nw-text-primary);
    text-decoration: none;
}

.nw-footer {
    margin-top: var(--nw-gap);
    text-align: center;
}

.nw-more-btn-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nw-text-primary);
    text-decoration: none;
    background: rgba(var(--nw-accent-rgb), 0.15);
    border: 1px solid rgba(var(--nw-accent-rgb), 0.25);
    border-radius: 100px;
    transition: background 0.2s ease;
}

.nw-more-btn-full:hover {
    background: rgba(var(--nw-accent-rgb), 0.28);
    text-decoration: none;
}

/* ── 6. 공통 뱃지 & 카테고리 ── */
.nw-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 100px;
}

.nw-badge-new {
    background: linear-gradient(135deg, var(--nw-accent), rgba(var(--nw-accent-rgb),0.7));
    color: #fff;
    /* 젤리(Jelly) 효과 */
    box-shadow: 0 2px 8px rgba(var(--nw-accent-rgb), 0.5),
                inset 0 1px 0 rgba(255,255,255,0.3);
}

.nw-badge-inline {
    font-size: 0.6rem;
    padding: 1px 5px;
    vertical-align: middle;
    margin-left: 4px;
}

.nw-badge-category {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.nw-category-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--nw-accent);
    background: rgba(var(--nw-accent-rgb), 0.12);
    border: 1px solid rgba(var(--nw-accent-rgb), 0.2);
    padding: 2px 10px;
    border-radius: 100px;
    text-decoration: none;
}

.nw-category-badge--accent {
    background: var(--nw-secondary);
    color: #1a1625;
    border-color: transparent;
}

/* ── 7. 메타 정보 ── */
.nw-list-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.nw-list-meta--white .nw-meta-item {
    color: rgba(255,255,255,0.8);
}

.nw-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: var(--nw-text-secondary);
}

.nw-meta-item svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.nw-meta-voted {
    color: #f59e0b;
}

.nw-price {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--nw-accent) !important;
}

/* ================================================================
   8. 목록형 (List) 스킨
   ================================================================ */
.nw-list-skin {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--nw-gap);
}

.nw-list-item {
    display: flex;
    gap: 14px;
    padding: 14px;
}

.nw-list-thumb-link {
    flex-shrink: 0;
}

.nw-list-thumb {
    position: relative;
    width: 100px;
    height: 72px;
    border-radius: calc(var(--nw-radius) * 0.6);
    overflow: hidden;
    background: var(--nw-surface-2);
}

.nw-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nw-list-thumb:hover img {
    transform: scale(1.06);
}

.nw-list-thumb .nw-badge {
    position: absolute;
    top: 5px;
    left: 5px;
}

.nw-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nw-list-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nw-list-title a {
    color: var(--nw-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nw-list-title a:hover {
    color: var(--nw-accent);
}

.nw-list-summary {
    margin: 0;
    font-size: 0.78rem;
    color: var(--nw-text-secondary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.5;
}

/* ================================================================
   9. 웹진형 (Webzine) 스킨
   ================================================================ */
.nw-webzine-skin {
    display: flex;
    flex-direction: column;
    gap: var(--nw-gap);
}

.nw-webzine-hero {
    position: relative;
    border-radius: var(--nw-radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    min-height: 220px;
    background: var(--nw-surface);
}

.nw-webzine-hero-link {
    display: block;
    text-decoration: none;
    height: 100%;
}

.nw-webzine-hero-img {
    position: absolute;
    inset: 0;
}

.nw-webzine-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.nw-webzine-hero:hover .nw-webzine-hero-img img {
    transform: scale(1.04);
}

.nw-webzine-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
}

.nw-webzine-hero-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nw-webzine-hero-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    letter-spacing: -0.02em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.nw-webzine-hero-summary {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nw-webzine-sub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--nw-gap);
}

.nw-webzine-sub-item {
    overflow: hidden;
}

.nw-webzine-sub-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    height: 100%;
}

.nw-webzine-sub-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--nw-surface-2);
}

.nw-webzine-sub-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nw-webzine-sub-item:hover .nw-webzine-sub-thumb img {
    transform: scale(1.06);
}

.nw-webzine-sub-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nw-webzine-sub-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nw-text-primary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nw-webzine-sub-title a {
    color: inherit;
    text-decoration: none;
}

.nw-webzine-sub-title a:hover {
    color: var(--nw-accent);
}

/* ================================================================
   10. 블로그/카드형 (Blog) 스킨
   ================================================================ */
.nw-blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--nw-gap);
}

@media (min-width: 768px) {
    .nw-blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.nw-blog-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nw-blog-card-img-link {
    display: block;
    text-decoration: none;
}

.nw-blog-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--nw-surface-2);
}

.nw-blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nw-blog-card:hover .nw-blog-card-img img {
    transform: scale(1.06);
}

.nw-blog-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nw-text-muted);
}

.nw-blog-card-no-img svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.nw-blog-card-img-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nw-blog-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nw-blog-card-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nw-blog-card-title a {
    color: var(--nw-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nw-blog-card-title a:hover {
    color: var(--nw-accent);
}

.nw-blog-card-summary {
    margin: 0;
    font-size: 0.76rem;
    color: var(--nw-text-secondary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.5;
}

/* ================================================================
   11. SNS/피드형 (Feed) 스킨
   ================================================================ */
.nw-feed-list {
    display: flex;
    flex-direction: column;
    gap: var(--nw-gap);
}

.nw-feed-item {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nw-feed-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nw-feed-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nw-accent), rgba(var(--nw-accent-rgb),0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    /* 젤리 효과 */
    box-shadow: 0 3px 10px rgba(var(--nw-accent-rgb),0.4),
                inset 0 1px 0 rgba(255,255,255,0.3);
}

.nw-feed-author-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nw-feed-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nw-text-primary);
}

.nw-feed-date {
    font-size: 0.72rem;
    color: var(--nw-text-muted);
}

.nw-feed-cat {
    margin-left: auto;
}

.nw-feed-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--nw-text-primary);
}

.nw-feed-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nw-feed-title a:hover {
    color: var(--nw-accent);
}

.nw-feed-summary {
    margin: 0;
    font-size: 0.82rem;
    color: var(--nw-text-secondary);
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.nw-feed-thumb-link {
    display: block;
    text-decoration: none;
}

.nw-feed-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: calc(var(--nw-radius) * 0.75);
    overflow: hidden;
    background: var(--nw-surface-2);
}

.nw-feed-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nw-feed-thumb:hover img {
    transform: scale(1.04);
}

.nw-feed-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid var(--nw-border);
}

.nw-feed-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--nw-text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nw-feed-action-btn:hover {
    color: var(--nw-accent);
}

.nw-feed-action-btn svg {
    width: 16px;
    height: 16px;
}

.nw-feed-views {
    margin-left: auto;
}

.nw-feed-read-more {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--nw-accent);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(var(--nw-accent-rgb), 0.12);
    border: 1px solid rgba(var(--nw-accent-rgb), 0.2);
    transition: background 0.2s ease;
    margin-left: auto;
}

.nw-feed-read-more:hover {
    background: rgba(var(--nw-accent-rgb), 0.22);
    text-decoration: none;
}

/* ================================================================
   12. 쇼핑몰형 (Shop) 스킨
   ================================================================ */
.nw-shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--nw-gap);
}

@media (min-width: 768px) {
    .nw-shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .nw-shop-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.nw-shop-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nw-shop-card-img-link {
    display: block;
    text-decoration: none;
}

.nw-shop-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--nw-surface-2);
}

.nw-shop-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}

.nw-shop-card:hover .nw-shop-card-img img {
    transform: scale(1.08);
}

.nw-shop-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nw-text-muted);
}

.nw-shop-no-img svg {
    width: 56px;
    height: 56px;
    opacity: 0.3;
}

.nw-shop-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}

.nw-shop-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--nw-accent-rgb), 0.0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.nw-shop-card:hover .nw-shop-hover-overlay {
    background: rgba(var(--nw-accent-rgb), 0.35);
}

.nw-shop-hover-btn {
    opacity: 0;
    transform: translateY(8px);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 100px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nw-shop-card:hover .nw-shop-hover-btn {
    opacity: 1;
    transform: translateY(0);
}

.nw-shop-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nw-shop-card-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nw-shop-card-title a {
    color: var(--nw-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nw-shop-card-title a:hover {
    color: var(--nw-accent);
}

.nw-shop-card-desc {
    margin: 0;
    font-size: 0.74rem;
    color: var(--nw-text-secondary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.5;
}

.nw-shop-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--nw-border);
}

.nw-shop-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--nw-accent);
    letter-spacing: -0.03em;
    /* 젤리 효과 글씨 */
    text-shadow: 0 0 20px rgba(var(--nw-accent-rgb), 0.4);
}

.nw-shop-price--inquiry {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--nw-text-muted);
}

.nw-shop-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nw-shop-seller {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.73rem;
    color: var(--nw-text-muted);
}

.nw-shop-seller svg {
    width: 12px;
    height: 12px;
}

/* ── 반응형 공통 ── */
@media (max-width: 480px) {
    .nw-blog-grid,
    .nw-shop-grid {
        grid-template-columns: 1fr;
    }

    .nw-webzine-sub-grid {
        grid-template-columns: 1fr;
    }

    .nw-list-thumb {
        width: 80px;
        height: 60px;
    }
}
