@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    background-color: #f8f8f8;
    line-height: 1.8;
    min-height: 100vh;
}

a {
    color: #333;
    text-decoration: none;
}

a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* ===== Header Bar ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.site-logo {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #333;
}

.site-logo:hover {
    opacity: 1;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    font-size: 0.85rem;
    color: #666;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: #333;
    opacity: 1;
}

/* ===== Page Layout ===== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    gap: 40px;
}

/* ===== Sidebar – Profile ===== */
.sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 88px;
}

.profile-card {
    background: #fff;
    border-radius: 8px;
    padding: 28px 24px;
    border: 1px solid #e8e8e8;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a8d8ea, #aa96da);
    margin-bottom: 16px;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.profile-bio {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 16px;
}

.follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.82rem;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}

.follow-btn:hover {
    background: #555;
}

.follow-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    min-width: 0;
}

/* ===== Tabs ===== */
.content-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 0.88rem;
    font-family: 'Noto Sans JP', sans-serif;
    color: #999;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #333;
    border-bottom-color: #333;
}

/* ===== Card Grid ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
}

.article-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    overflow: hidden;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .card-cover img {
    transform: scale(1.03);
}

.card-body {
    padding: 16px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #999;
}

.card-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a8d8ea, #aa96da);
    overflow: hidden;
}

.card-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #999;
}

.card-likes svg {
    width: 14px;
    height: 14px;
}

/* ===== Post Page ===== */
.post-page-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    gap: 40px;
}

.post-main {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.post-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    overflow: hidden;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 40px;
    max-width: 720px;
    margin: 0 auto;
}

.post-content h1 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 12px;
}

.post-date {
    font-size: 0.82rem;
    color: #999;
    margin-bottom: 36px;
}

.post-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.post-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 12px;
}

.post-body p {
    margin-bottom: 24px;
    line-height: 2.0;
}

.post-body ul,
.post-body ol {
    margin-bottom: 24px;
    padding-left: 1.6em;
    list-style: disc;
}

.post-body ol {
    list-style: decimal;
}

.post-body li {
    margin-bottom: 6px;
    line-height: 1.9;
}

.post-body blockquote {
    margin: 28px 0;
    padding: 16px 24px;
    border-left: 3px solid #ddd;
    color: #666;
    background: #fafafa;
    border-radius: 0 4px 4px 0;
}

.post-body pre {
    margin: 24px 0;
    padding: 16px 20px;
    background: #f6f6f6;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
}

.post-body code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

.post-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.post-body img {
    display: block;
    margin: 28px auto;
    border-radius: 6px;
}

/* ===== Like Button ===== */
.like-section {
    text-align: center;
    padding: 32px 0 8px;
    border-top: 1px solid #f0f0f0;
    margin-top: 48px;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 2px solid #e8e8e8;
    border-radius: 24px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-family: 'Noto Sans JP', sans-serif;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}

.like-btn:hover {
    border-color: #e8467f;
    color: #e8467f;
}

.like-btn.liked {
    border-color: #e8467f;
    color: #e8467f;
}

.like-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.25s;
}

.like-btn:hover svg,
.like-btn.liked svg {
    fill: #e8467f;
}

.like-btn.liked svg {
    transform: scale(1.15);
}

/* ===== Author Footer ===== */
.author-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    margin-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.author-footer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a8d8ea, #aa96da);
    flex-shrink: 0;
    overflow: hidden;
}

.author-footer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-footer-info {
    flex: 1;
}

.author-footer-name {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.author-footer-date {
    font-size: 0.78rem;
    color: #999;
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 0.78rem;
    color: #bbb;
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 0.9rem;
}

/* ===== No posts ===== */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
    font-size: 0.9rem;
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 960px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .page-container,
    .post-page-layout {
        flex-direction: column;
        padding: 20px 16px;
        gap: 20px;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-sticky {
        position: static;
    }

    .profile-card {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 20px 24px;
    }

    .profile-avatar {
        width: 56px;
        height: 56px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .profile-info {
        flex: 1;
    }

    .profile-name {
        margin-bottom: 4px;
    }

    .profile-bio {
        margin-bottom: 8px;
    }

    .post-content {
        padding: 28px 20px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    html {
        font-size: 15px;
    }

    .site-header {
        height: 48px;
        padding: 0 16px;
    }

    .site-logo {
        font-size: 1.1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-content {
        padding: 24px 16px;
    }

    .post-content h1 {
        font-size: 1.35rem;
    }

    .post-body h2 {
        font-size: 1.15rem;
    }
}