/* フォント定義（元のパスを流用） */
@font-face {
    font-family: "Kaisotai";
    src: url("font/Kaisotai-Next-Up-B.woff") format("woff");
}
@font-face {
    font-family: "Makinas";
    src: url("font/Makinas-4-Flat.woff") format("woff");
}
@font-face {
    font-family: "Zen Kaku Gothic New";
    src: url("font/Zen-Kaku-Gothic-New.woff") format("woff");
    font-weight: normal;
}
@font-face {
    font-family: "Zen Kaku Gothic New";
    src: url("font/Zen-Kaku-Gothic-New-Bold.woff") format("woff");
    font-weight: bold;
}

/* 基本 */
:root {
    --bg-1: #f6f8fb;
    --bg-2: #e9f1ff;
    --primary: #223a77;
    --muted: #9aa6bd;
    --card: #ffffff;
    --soft-shadow: 0 6px 18px rgba(20, 30, 60, 0.08);
    --glass: rgba(255, 255, 255, 0.75);
}

* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
    margin: 0;
    font-family: "Makinas", "Kaisotai", "Zen Kaku Gothic New", sans-serif;
    background: linear-gradient(180deg, var(--bg-1), #ffffff);
    color: #0b1b2b;
}
a {
    color: inherit;
    text-decoration: none;
}

/* 全体レイアウト */
.site-container {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: 28px;
    padding: 28px;
    min-height: 100vh;
    align-items: start;
}

/* サイドバー */
.sidebar {
    background: linear-gradient(180deg, #1e3b6f 0%, #274a82 100%);
    color: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(25, 40, 80, 0.25);
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.12);
    background: white;
}
.brand-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.brand-name {
    font-weight: 700;
    font-family: "Zen Kaku Gothic New";
    letter-spacing: 0.6px;
}

/* nav */
.main-nav {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    transition: all 0.18s;
}
.nav-item svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: white;
    stroke-width: 1.6;
    opacity: 0.9;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

/* footer socials */
.sidebar-footer {
    margin-top: auto;
}
.socials {
    display: flex;
    gap: 8px;
}
.social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-weight: 700;
}

/* main area */
.main-area {
    max-width: 1100px;
    width: 100%;
}

/* プロフィールヘッダー */
.profile-header {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.85),
        rgba(245, 250, 255, 0.9)
    );
    border-radius: 18px;
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: var(--soft-shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.profile-left {
    display: flex;
    gap: 18px;
    align-items: center;
}
.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 26px rgba(30, 50, 90, 0.12);
}
.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name-block {
    display: flex;
    flex-direction: column;
}
.display-name {
    font-size: 22px;
    margin: 0;
    color: var(--primary);
    font-weight: 800;
    font-family: "Zen Kaku Gothic New";
}
.handle {
    color: var(--muted);
    margin-top: 6px;
    font-weight: 600;
}
.bio {
    margin-top: 10px;
    color: #33495f;
    max-width: 720px;
    line-height: 1.55;
}

/* pill links */
.profile-links {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.pill {
    background: rgba(34, 58, 119, 0.06);
    border: 1px solid rgba(34, 58, 119, 0.06);
    font-size: 12px; /* 文字サイズを小さく */
    padding: 4px 10px; /* ボタンの高さ・横幅を小さく */
    border-radius: 20px; /* pill形 */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(34, 58, 119, 0.08);
}

/* tabs */
.tabs {
    display: flex;
    gap: 14px;
    border-top: 1px solid rgba(10, 20, 40, 0.04);
    padding-top: 12px;
}
.tab {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}
.tab.active {
    background: rgba(34, 58, 119, 0.06);
    color: var(--primary);
    box-shadow: inset 0 -2px 0 rgba(34, 58, 119, 0.12);
}

/* フィード */
.feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 投稿カード */
.post-card {
    background: var(--card);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    border: 1px solid rgba(10, 20, 40, 0.03);
}
.post-header {
    display: flex;
    gap: 12px;
    align-items: center;
}
.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(10, 20, 40, 0.04);
}
.post-meta {
    display: flex;
    flex-direction: column;
}
.post-name {
    font-weight: 800;
    color: #12213a;
}
.post-handle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}

/* 投稿本文 */
.post-body {
    margin-top: 12px;
    color: #23364b;
    line-height: 1.7;
}
.post-body .links a {
    color: #1b6fb8;
    font-weight: 700;
}
.post-image {
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
}
.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* muted small card */
.post-card.muted {
    opacity: 0.92;
    background: linear-gradient(180deg, #fbfdff, #ffffff);
    border: 1px dashed rgba(10, 20, 40, 0.03);
}

/* right rail */
.right-rail {
    position: sticky;
    top: 28px;
    height: calc(100vh - 56px);
    padding-top: 4px;
}
.widget {
    background: var(--glass);
    backdrop-filter: blur(6px);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(10, 20, 40, 0.04);
}
.widget h3 {
    margin: 0 0 10px 0;
}

/* レスポンシブ */
@media (max-width: 1100px) {
    .site-container {
        grid-template-columns: 220px 1fr;
        gap: 18px;
        padding: 18px;
    }
    .right-rail {
        display: none;
    }
}
@media (max-width: 840px) {
    .site-container {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    .sidebar {
        position: relative;
        height: auto;
        border-radius: 12px;
        padding: 12px 14px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    .sidebar .brand-name {
        display: none;
    }
    .main-area {
        order: 2;
    }
    .sidebar-footer {
        display: none;
    }
    .profile-header {
        padding: 14px;
    }
    .avatar-large {
        width: 88px;
        height: 88px;
    }
    .display-name {
        font-size: 18px;
    }
    .tabs {
        gap: 8px;
        flex-wrap: wrap;
    }
}

/* アイコン専用 pill */
.icon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(34, 58, 119, 0.06);
    border: 1px solid rgba(34, 58, 119, 0.06);
    box-shadow: 0 6px 14px rgba(20, 30, 60, 0.06);
}
.icon-pill img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    display: block;
}
.icon-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(20, 35, 70, 0.12);
}

/* --- Right rail: Twitter風ウィジェット群 --- */
.right-rail {
    position: sticky;
    top: 28px;
    height: auto;
    align-self: start;
    min-width: 260px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* widget 共通 */
.widget {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 18px rgba(20, 30, 60, 0.06);
    border: 1px solid rgba(10, 20, 40, 0.04);
    font-size: 14px;
}

/* widget タイトル */
.widget-title {
    margin: 0 0 8px 0;
    font-weight: 800;
    font-size: 15px;
    color: #12213a;
    font-family: "Zen Kaku Gothic New", sans-serif;
}

/* 検索 */
.search-widget .search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f6f8fb;
    padding: 8px;
    border-radius: 10px;
}
.search-widget input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
}
.icon-search {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    color: #6b7b8f;
}

/* トレンドリスト */
.trends-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.trend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}
.trend-item:hover {
    background: rgba(30, 50, 90, 0.03);
}
.trend-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.trend-hash {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f0f6ff;
    color: #1b6fb8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.trend-text .trend-topic {
    font-weight: 700;
    color: #102135;
}
.trend-text .trend-sub {
    font-size: 12px;
    color: #7e93a8;
}

/* trend count */
.trend-count {
    font-weight: 700;
    color: #2c6aa8;
    font-size: 13px;
}

/* "もっと見る" リンク */
.show-more {
    display: inline-block;
    margin-top: 8px;
    color: #2c6aa8;
    font-weight: 700;
    text-decoration: none;
    font-size: 13px;
}

/* フォローリスト */
.follow-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.follow-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.12s;
}
.follow-item:hover {
    background: rgba(30, 50, 90, 0.03);
}
.follow-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(10, 20, 40, 0.04);
}
.follow-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.follow-name {
    font-weight: 800;
    color: #0e2940;
}
.follow-handle {
    font-size: 13px;
    color: #7e93a8;
}
.follow-btn {
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, #f0f6ff);
    border: 1px solid rgba(30, 80, 160, 0.12);
    font-weight: 800;
    font-size: 13px;
    color: #1b5fb8;
    text-decoration: none;
    white-space: nowrap;
}
.follow-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(20, 40, 80, 0.08);
}

/* small footer */
.small-footer {
    padding: 10px;
    font-size: 12px;
    color: #7e93a8;
}
.small-footer .footer-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* レスポンシブ: 右カラムは小画面で非表示（既存ルールと合わせる） */
@media (max-width: 1100px) {
    .right-rail {
        display: none;
    }
}

.site-footer {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 96px;
    padding: 0 96px;
    box-sizing: border-box;
    position: relative; /* 必須 */
}

/* 上側に line */
.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 44px;
    right: 44px;
    height: 1px;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

/* brand block */
.footer-brand-block {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 120px;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 40px 0;
    box-sizing: border-box;
}

.footer-brand-block-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 56px;
    align-items: flex-start; /* ← これだけ変える */
}

.footer-brand-textblock {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* ← ここも left に */
    gap: 8px;
    text-align: left; /* 明示 */
}

.footer-brand-title {
    font-family: "Kaisotai", sans-serif;
    font-size: 24px;
    line-height: 145%;
    letter-spacing: -2%;
    color: #000;
    text-align: center;
}

.footer-brand-subtitle {
    font-family: "Makinas", sans-serif;
    font-size: 16px;
    line-height: 145%;
    letter-spacing: -0.5%;
    color: rgba(0, 0, 0, 0.55);
    text-align: center;
}

.footer-brand-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
}

.footer-link-icon1 {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.footer-link-icon2 {
    width: 34px;
    height: 24px;
    object-fit: contain;
}
.footer-link-icon3 {
    width: 32px;
    height: 24px;
    object-fit: contain;
}

/* nav block */

.footer-nav-block {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start; /* ← これで上詰め */
}

.footer-nav-col {
    width: 130px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    justify-content: center;
}

.footer-nav-col-header {
    width: 100%;
    padding-bottom: 16px;
    box-sizing: border-box;
}

.footer-nav-col-header a {
    font-family: "Makinas", sans-serif;
    font-size: 16px;
    line-height: 145%;
    letter-spacing: -0.5%;
    text-decoration: none;
    color: #000;
}

.footer-nav-item {
    font-family: "Makinas", sans-serif;
    font-size: 16px;
    line-height: 145%;
    letter-spacing: -0.5%;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.55);
}

/* 親（丸いフレーム）に aspect-ratio を指定し、幅だけ制御する */
.avatar-large,
.brand-avatar,
.post-avatar,
.follow-avatar {
    /* 基本サイズ（必要なら px を調整） */
    width: 120px;
    /* 高さは自動。aspect-ratio で正方形を維持 */
    aspect-ratio: 1 / 1;
    display: inline-block; /* レイアウトに応じて変更可 */
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto; /* flex コンテナ内で伸縮させたくない場合 */
}

/* 画像は必ずボックスにフィット、縦横比を崩さない */
.avatar-large img,
.brand-avatar img,
.post-avatar,
.follow-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 中央を切り抜いて自然に表示 */
    display: block;
}

/* 既存で height を明示している場合は上書き（重要度のために !important を入れても可） */
.avatar-large {
    height: auto;
}
.brand-avatar {
    height: auto;
}
.post-avatar {
    height: auto;
}
.follow-avatar {
    height: auto;
}

/* 投稿アバターは小さめのサイズに */
.post-avatar {
    width: 48px; /* 既存の 48x48 を維持 */
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
}

/* フォロー候補のアバター */
.follow-avatar {
    width: 44px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
}

/* サイドバーの小さな brand-avatar（既存スタイルと組み合わせ）*/
.brand-avatar {
    width: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
}

/* レスポンシブ：小画面では幅のみを小さくする（高さは自動で正方形） */
@media (max-width: 840px) {
    .avatar-large {
        width: 88px;
    } /* 既存ルールに合わせた縮小 */
    .brand-avatar {
        width: 44px;
    }
    .post-avatar {
        width: 40px;
    }
    .follow-avatar {
        width: 40px;
    }
}

/* 古いブラウザ向けフォールバック（必要なら有効化） */
/*  .avatar-large { position: relative; }
 .avatar-large::before { content: ""; display: block; padding-top: 100%; } 
 .avatar-large > img { position: absolute; top:0; left:0; width:100%; height:100%; } 
*/
