/* ==========================================================================
   SNS風トップページ (home.php 専用) — ショート動画型 9:16 フィード
   配色: 深夜インク × シグナルゴールド / 見出し: Zen Kaku Gothic New
   ========================================================================== */

.sns-home {
    --feed-bg: #ffffff;
    --feed-bg-glow: rgba(255, 205, 66, 0.10);
    --feed-card: #f2f3f6;
    --feed-ink: #1b1d23;
    --feed-ink-dim: #6d7480;
    --feed-gold: #f5b800;
    --feed-gold-deep: #d99a00;
    --feed-line: rgba(20, 22, 30, 0.10);
    background:
        radial-gradient(900px 420px at 85% -10%, var(--feed-bg-glow), transparent 60%),
        radial-gradient(700px 380px at -10% 30%, rgba(90, 140, 255, 0.06), transparent 60%),
        var(--feed-bg);
    color: var(--feed-ink);
    padding: 0 0 72px;
    font-family: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
}

/* ---------- プロフィール帯 (SNSのプロフィールヘッダー風) ---------- */
.sns-profile {
    position: relative;
    max-width: 1160px;
    margin: 0 auto;
    padding: 44px 24px 26px;
    display: flex;
    align-items: flex-end;
    gap: 22px;
    flex-wrap: wrap;
}
.sns-profile::after {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--feed-gold) 0, var(--feed-line) 35%, transparent 90%);
}
.sns-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    border: 3px solid var(--feed-gold);
    box-shadow: 0 0 0 4px rgba(245, 184, 0, 0.15), 0 8px 20px rgba(20, 22, 30, 0.18);
    background: #000;
}
.sns-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sns-avatar-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 900; color: var(--feed-gold-deep);
    background: linear-gradient(145deg, #ffffff, #eceef2);
}
.sns-profile-main { flex: 1 1 300px; min-width: 0; }
.sns-profile-name {
    margin: 0 0 4px;
    font-size: clamp(22px, 3.4vw, 32px);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--feed-ink);
}
.sns-profile-name .sns-at {
    font-size: 0.5em;
    font-weight: 700;
    color: var(--feed-gold);
    vertical-align: middle;
    margin-left: 10px;
    letter-spacing: 0.08em;
}
.sns-profile-bio {
    margin: 0;
    color: var(--feed-ink-dim);
    font-size: 14px;
    line-height: 1.7;
}
.sns-profile-stats {
    display: flex;
    gap: 26px;
    padding: 10px 0 4px;
    flex: 0 0 auto;
}
.sns-stat { text-align: center; }
.sns-stat b {
    display: block;
    font-size: 22px;
    font-weight: 900;
    color: var(--feed-gold);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.sns-stat span {
    font-size: 11px;
    color: var(--feed-ink-dim);
    letter-spacing: 0.12em;
}

/* ---------- フィードグリッド (9:16 ショート動画型) ---------- */
.sns-feed {
    max-width: 1160px;
    margin: 0 auto;
    padding: 40px 24px 0;
}
.sns-feed-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--feed-ink-dim);
    text-transform: uppercase;
}
.sns-feed-label::before {
    content: "";
    width: 10px; height: 10px;
    background: var(--feed-gold);
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: 0 0 12px rgba(255, 205, 66, 0.8);
}
.sns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

/* カード本体 */
.sns-card {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    background: var(--feed-card);
    border: 1px solid var(--feed-line);
    transform: translateY(0);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
    opacity: 0;
    animation: snsCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
/* 段差出現 */
.sns-card:nth-child(8n+1) { animation-delay: 0.02s; }
.sns-card:nth-child(8n+2) { animation-delay: 0.07s; }
.sns-card:nth-child(8n+3) { animation-delay: 0.12s; }
.sns-card:nth-child(8n+4) { animation-delay: 0.17s; }
.sns-card:nth-child(8n+5) { animation-delay: 0.22s; }
.sns-card:nth-child(8n+6) { animation-delay: 0.27s; }
.sns-card:nth-child(8n+7) { animation-delay: 0.32s; }
.sns-card:nth-child(8n+8) { animation-delay: 0.37s; }
@keyframes snsCardIn {
    from { opacity: 0; transform: translateY(22px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sns-card:hover {
    transform: translateY(-8px);
    border-color: rgba(245, 184, 0, 0.6);
    box-shadow:
        0 16px 36px rgba(20, 22, 30, 0.20),
        0 0 0 1px rgba(245, 184, 0, 0.30);
}
.sns-card-link {
    position: absolute;
    inset: 0;
    z-index: 5;
    text-decoration: none;
}

/* サムネイル */
.sns-card-thumb {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.sns-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.001);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.sns-card:hover .sns-card-thumb img { transform: scale(1.07); }
.sns-card-thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 900;
    color: rgba(217, 154, 0, 0.45);
    background:
        radial-gradient(300px 300px at 30% 20%, rgba(245, 184, 0, 0.14), transparent 70%),
        linear-gradient(160deg, #f7f8fa 0%, #e7e9ee 100%);
    letter-spacing: 0.05em;
}

/* 下部グラデ + タイトル */
.sns-card-info {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 3;
    padding: 52px 12px 12px;
    background: linear-gradient(180deg, transparent 0%, rgba(6, 7, 10, 0.55) 40%, rgba(6, 7, 10, 0.92) 100%);
    pointer-events: none;
}
.sns-card-title {
    margin: 0 0 8px;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.45;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.sns-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
}
.sns-card-meta span { flex: 0 0 auto; }
.sns-card-meta .sns-dot { opacity: 0.5; }

/* カテゴリチップ */
.sns-card-chip {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #1a1400;
    background: linear-gradient(135deg, var(--feed-gold), var(--feed-gold-deep));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

/* SNS由来ポスト用の再生風バッジ(将来のX同期投稿で使用) */
.sns-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: var(--feed-gold);
    font-size: 12px;
    pointer-events: none;
}

/* ---------- ページネーション ---------- */
.sns-home .pagination, .sns-home .navigation.pagination {
    margin: 40px auto 0;
    max-width: 1160px;
    padding: 0 24px;
    text-align: center;
}
.sns-home .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    margin: 0 3px;
    border-radius: 10px;
    border: 1px solid var(--feed-line);
    background: var(--feed-card);
    color: var(--feed-ink-dim);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.sns-home .page-numbers:hover { border-color: var(--feed-gold); color: var(--feed-gold); }
.sns-home .page-numbers.current {
    background: linear-gradient(135deg, var(--feed-gold), var(--feed-gold-deep));
    color: #1a1400;
    border-color: transparent;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 782px) {
    .sns-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .sns-card { border-radius: 12px; }
    .sns-card-title { font-size: 12px; -webkit-line-clamp: 2; }
    .sns-profile { padding: 28px 16px 20px; gap: 14px; }
    .sns-avatar { width: 64px; height: 64px; }
    .sns-feed { padding: 22px 16px 0; }
    .sns-profile-stats { gap: 18px; }
    .sns-stat b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .sns-card { animation: none; opacity: 1; }
    .sns-card, .sns-card-thumb img { transition: none; }
}

/* ---------- X同期ポスト用カード (sns_post) ---------- */
.sns-card--x {
    background: linear-gradient(165deg, #ffffff 0%, #f2f4f8 100%);
    border: 1px solid rgba(20, 22, 30, 0.12);
}
.sns-card--x .sns-x-head {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 0;
    pointer-events: none;
}
.sns-card--x .sns-x-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--feed-gold);
    background: #dde0e6;
    flex: 0 0 auto;
}
.sns-card--x .sns-x-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sns-card--x .sns-x-name {
    font-size: 11px;
    font-weight: 800;
    color: var(--feed-ink);
    line-height: 1.2;
    min-width: 0;
}
.sns-card--x .sns-x-name small {
    display: block;
    font-weight: 500;
    color: var(--feed-ink-dim);
    font-size: 9.5px;
}
.sns-card--x .sns-x-logo {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 4;
    width: 26px; height: 26px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: #0f1419;
    color: #fff;
    font-weight: 900;
    font-size: 14px;
    pointer-events: none;
}
.sns-card--x .sns-x-text {
    position: absolute;
    top: 52px; left: 0; right: 0; bottom: 44px;
    z-index: 2;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.75;
    color: var(--feed-ink);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 12;
    -webkit-box-orient: vertical;
    pointer-events: none;
}
.sns-card--x .sns-x-text .sns-x-tag { color: #1d7bd7; font-weight: 700; }
/* 画像付きXポスト: 下半分に画像 */
.sns-card--x.has-media .sns-x-text { bottom: 52%; -webkit-line-clamp: 5; }
.sns-card--x .sns-x-media {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    top: 48%;
    z-index: 1;
    overflow: hidden;
}
.sns-card--x .sns-x-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sns-card--x .sns-x-foot {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--feed-ink-dim);
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.92) 35%);
    pointer-events: none;
    white-space: nowrap;
}
.sns-card--x.has-media .sns-x-foot {
    color: #fff;
    background: linear-gradient(180deg, transparent, rgba(6, 7, 10, 0.85));
}
.sns-card--x .sns-x-foot .gold { color: var(--feed-gold-deep); }

/* ---------- エリア分割 (SNS棚 / 記事グリッド) ---------- */
.sns-section { margin: 0 0 44px; }
.sns-section:last-child { margin-bottom: 0; }
.sns-more-link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--feed-gold-deep);
    text-decoration: none;
}
.sns-more-link:hover { text-decoration: underline; }

/* Xポストの横スクロール棚 */
.sns-shelf {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 250px;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 4px 14px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.sns-shelf .sns-card {
    aspect-ratio: 9 / 14;
    scroll-snap-align: start;
}
.sns-shelf::-webkit-scrollbar { height: 8px; }
.sns-shelf::-webkit-scrollbar-track { background: rgba(20, 22, 30, 0.05); border-radius: 4px; }
.sns-shelf::-webkit-scrollbar-thumb { background: rgba(245, 184, 0, 0.5); border-radius: 4px; }
.sns-shelf::-webkit-scrollbar-thumb:hover { background: var(--feed-gold); }

.sns-no-articles {
    color: var(--feed-ink-dim);
    font-size: 14px;
    padding: 30px 0;
}
@media (max-width: 782px) {
    .sns-shelf { grid-auto-columns: 200px; gap: 10px; }
}

/* ---------- Xポスト縦並びグリッド (4カラム) ---------- */
.sns-grid--x { grid-template-columns: repeat(4, 1fr); }
.sns-grid--x .sns-card { aspect-ratio: 9 / 14; }
@media (max-width: 1000px) {
    .sns-grid--x { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 782px) {
    .sns-grid--x { grid-template-columns: repeat(2, 1fr); }
}
