/* ===================================================
   基本設定
   =================================================== */

:root {
    /* ---------------------------------- */
    /* 色の変数を定義 (ライトモード)      */
    /* ---------------------------------- */
    /* アクセントカラー */
    --accent-color: #17a2b8;
    --accent-color-light: #e8f7fa;
    --accent-color-shadow: rgba(23, 162, 184, 0.1);

    /* 背景色 */
    --background-color: #f7f7f7;
    --background-surface: #ffffff; /* カードやヘッダーなど */
    --background-disabled: #f7f7f7;

    /* 文字色 */
    --text-color-primary: #333;   /* 基本の文字色 */
    --text-color-strong: #111;    /* 見出しなど強い文字 */
    --text-color-secondary: #666; /* サブテキストなど */
    --text-color-subtle: #777;    /* さらに薄い文字 */
    --text-color-disabled: #999;
    --text-color-accent: var(--accent-color);
    --text-color-inverse: #ffffff;

    /* フッターの色 */
    --footer-background: #333;
    --footer-text: #ccc;
    --footer-link-hover: #ffffff;

    /* その他 */
    --border-color: #eee;
    --border-color-interactive: #ddd;
    --shadow-color-light: rgba(0, 0, 0, 0.05);
    --shadow-color-medium: rgba(0, 0, 0, 0.07);
    --shadow-color-strong: rgba(0, 0, 0, 0.1);
    --scrollbar-track-color: #f0f0f0;
    --scrollbar-thumb-color: #ccc;
    --scrollbar-thumb-hover-color: #aaa;
}

@media (prefers-color-scheme: dark) {
    /* ---------------------------------- */
    /* ダークモード時の色を上書き         */
    /* ---------------------------------- */
    :root {
        /* 背景色 */
        --background-color: #121212;
        --background-surface: #1e1e1e;
        --background-disabled: #2a2a2a;

        /* 文字色 */
        --text-color-primary: #e0e0e0;
        --text-color-strong: #ffffff;
        --text-color-secondary: #a0a0a0;
        --text-color-subtle: #888888;
        --text-color-disabled: #666;
        --text-color-inverse: #121212;
        
        /* フッターの色は同じでOK */

        /* その他 */
        --border-color: #333;
        --border-color-interactive: #444;
        --shadow-color-light: rgba(255, 255, 255, 0.03);
        --shadow-color-medium: rgba(255, 255, 255, 0.05);
        --shadow-color-strong: rgba(255, 255, 255, 0.07);
        --scrollbar-track-color: #2a2a2a;
        --scrollbar-thumb-color: #555;
        --scrollbar-thumb-hover-color: #777;
    }

    /* 画像の明るさを少し抑えて、ダークモードに馴染ませる */
    img {
        filter: brightness(.85) contrast(1.1);
    }
}


body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Segoe UI', Arial, sans-serif;
    background-color: var(--background-color); 
    color: var(--text-color-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===================================================
   ヘッダー
   =================================================== */
header {
    background-color: var(--background-surface);
    padding: 15px 30px;
    box-shadow: 0 1px 3px var(--shadow-color-light);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.3s ease-in-out;
}

.header-hidden {
    transform: translateY(-100%);
}

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

.header-left h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-color-strong);
}

.header-left h1 a {
    text-decoration: none;
    color: inherit;
}

.header-left p {
    margin: 2px 0 0;
    font-size: 0.9em;
    color: var(--text-color-secondary);
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-button,
.view-all {
    text-decoration: none;
    color: var(--text-color-accent);
    font-size: 0.95em;
    font-weight: bold;
    padding: 8px 16px;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-button:hover,
.view-all:hover {
    background-color: var(--accent-color);
    color: var(--text-color-inverse);
}


.profile-icon-link {
    display: block;
    line-height: 0;
}

.profile-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.profile-icon:hover {
    border-color: var(--accent-color);
}

/* ===================================================
   メインコンテンツ
   =================================================== */
main {
    width: 100%;
    padding: 40px 0;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

/* ===================================================
   トップページ (`index.html`) のセクション
   =================================================== */
.content-section {
    max-width: 1200px;
    margin: 0 auto 50px;
    padding: 0 30px;
    box-sizing: border-box;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.section-header h2 {
    font-size: 1.6em;
    margin: 0;
}

.section-header h2 a {
    text-decoration: none;
    color: var(--text-color-strong);
    transition: color 0.3s;
}

.section-header h2 a:hover {
    color: var(--accent-color);
}

/* 横スクロールコンテナ */
.scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0 20px 0;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.scroll-container::-webkit-scrollbar { 
    height: 8px; 
}
.scroll-container::-webkit-scrollbar-track { 
    background: var(--scrollbar-track-color); 
    border-radius: 4px; 
}
.scroll-container::-webkit-scrollbar-thumb { 
    background: var(--scrollbar-thumb-color); 
    border-radius: 4px; 
}
.scroll-container::-webkit-scrollbar-thumb:hover { 
    background: var(--scrollbar-thumb-hover-color); 
}

.articles-row {
    display: flex;
    gap: 25px;
}

/* ===================================================
   共通コンポーネント: 記事カード (`.week-card`)
   =================================================== */
.week-card {
    flex: 0 0 300px;
    width: 300px;
    background-color: var(--background-surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color-medium);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    vertical-align: top;
    white-space: normal;
}

.week-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px var(--shadow-color-strong);
}

.week-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.week-card .thumbnail {
    width: 100%;
    height: 170px;
    overflow: hidden;
    background-color: var(--border-color);
}

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

.week-card:hover .thumbnail img {
    transform: scale(1.08);
}

.week-card .card-content {
    padding: 15px 20px 20px;
}

.week-card .card-content h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.15em;
    color: var(--text-color-strong);
    line-height: 1.4;
    min-height: 2.8em; 
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.week-card .card-content .author {
    font-size: 0.85em;
    color: var(--text-color-subtle);
    margin-top: 10px;
}

/* ===================================================
   記事ページ (`week*.html`)
   =================================================== */
.article-container {
    max-width: 720px;
    margin: 0 auto;
    background-color: var(--background-surface);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color-light);
    padding: 0;
    overflow: hidden;
}

.article-main-image {
    width: 100%;
    height: 300px;
    background-color: var(--border-color);
}

.article-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding: 30px 60px;
}

.article-header h1 {
    font-size: 2.4em;
    margin: 0 0 15px;
}

.article-meta {
    font-size: 0.9em;
    color: var(--text-color-secondary);
}
.article-meta a {
    color: var(--accent-color);
    text-decoration: none;
}
.article-meta a:hover {
    text-decoration: underline;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color-primary);
    padding: 0 60px;
}

.article-content > *:first-child {
    margin-top: 40px;
}

.article-content h2 {
    font-size: 1.8rem;
    margin-top: 50px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.article-content p {
    margin-bottom: 25px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 40px auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--shadow-color-strong);
}

.article-content ul {
    padding-left: 20px;
    list-style: disc;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
    gap: 20px;
    padding: 30px 60px;
}

.nav-link-prev, .nav-link-next { 
    flex: 1; 
}

.post-navigation a, .nav-link-disabled {
    display: block;
    padding: 20px;
    border: 1px solid var(--border-color-interactive);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color-primary);
    transition: all 0.3s ease;
}

.post-navigation a:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 10px var(--accent-color-shadow);
    transform: translateY(-3px);
}

.nav-link-next { 
    text-align: right; 
}

.post-navigation span {
    display: block;
    font-size: 0.85em;
    color: var(--text-color-secondary);
    margin-bottom: 8px;
}

.post-navigation h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
}

.nav-link-disabled {
    background-color: var(--background-disabled);
    cursor: not-allowed;
}
.nav-link-disabled h3 { 
    color: var(--text-color-disabled); 
    font-weight: normal; 
}


/* ===================================================
   記事一覧ページ (`*-archive.html`)
   =================================================== */
.archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.archive-header {
    position: static;
    text-align: left;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.archive-hashtag {
    display: inline-block;
    background-color: var(--accent-color-light);
    color: var(--accent-color);
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.archive-header h1 {
    font-size: 2.2em;
    margin: 0 0 10px;
}

.archive-description {
    font-size: 1em;
    color: var(--text-color-secondary);
    margin: 0;
}

.articles-grid.archive-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, 300px);
    gap: 30px;
    justify-content: center;
}

/* ===================================================
   プロフィールページ (`about.html`)
   =================================================== */
.profile-page-container.simple {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px 40px;
    background-color: var(--background-surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color-medium);
    text-align: center;
    box-sizing: border-box;
}

.profile-header.simple {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
    position: static; /* 強制的に固定を解除 */
}

.profile-avatar-wrapper { 
    margin-bottom: 20px; 
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.profile-info.simple { 
    margin-top: 15px; 
}
.profile-name { 
    font-size: 1.6em; 
    font-weight: bold; 
    margin-bottom: 10px; 
}
.profile-handle { 
    font-size: 1em; 
    color: var(--text-color-secondary); 
    margin-top: 5px; 
    margin-bottom: 15px; 
}
.profile-handle a { 
    text-decoration: none; 
    color: inherit; 
}
.profile-handle a:hover { 
    color: var(--accent-color); 
    text-decoration: underline; 
}
.profile-bio { 
    font-size: 1em; 
    color: var(--text-color-secondary); 
    line-height: 1.6; 
    margin-bottom: 15px; 
}
.profile-meta-info { 
    font-size: 0.9em; 
    color: var(--text-color-subtle); 
}
.profile-details { 
    margin-top: 30px; 
    text-align: left; 
}
.detail-item { 
    margin-bottom: 20px; 
}
.detail-item h3 { 
    font-size: 1.1em; 
    font-weight: bold; 
    margin-bottom: 8px; 
}
.detail-item p { 
    font-size: 1em; 
    color: var(--text-color-primary); 
    margin: 0; 
}
.detail-item a { 
    color: var(--accent-color); 
    text-decoration: none; 
}
.detail-item a:hover { 
    text-decoration: underline; 
}
.detail-item i.fab { 
    margin-right: 8px; 
}

/* ===================================================
   Memory Pics ページ (`memory-pics.html`)
   =================================================== */
.memory-feed {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 30px;
    box-sizing: border-box;
}

.memory-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 40px;
}

.memory-card {
    background: var(--background-surface);
    border: 1px solid var(--border-color-interactive);
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color-medium);
}

.memory-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.memory-card-footer { 
    padding: 15px; 
}
.memory-caption { 
    margin: 0 0 10px; 
    font-size: 1em; 
}
.memory-date { 
    font-size: 0.8em; 
    color: var(--text-color-disabled); 
}

/* ===================================================
   フッター
   =================================================== */
footer {
    text-align: center;
    padding: 25px 30px;
    margin-top: auto;
    background-color: var(--footer-background);
    color: var(--footer-text);
    font-size: 0.85em;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-nav a {
    text-decoration: none;
    color: var(--footer-text);
    transition: color 0.3s ease;
}

.footer-nav a:hover { 
    color: var(--footer-link-hover); 
}

/* ===================================================
   【追加修正】スマートフォン向け表示の微調整
   =================================================== */
@media screen and (max-width: 768px) {

    /* --- 1. 文字サイズの最適化 --- */
    .header-left h1 { font-size: 1.5em; }
    .section-header h2 { font-size: 1.4em; }
    .article-header h1 { font-size: 1.9em; line-height: 1.4; }
    .article-content h2 { font-size: 1.5rem; }
    .article-content { font-size: 1.0rem; padding: 0 40px; }
    .post-navigation h3 { font-size: 1.0em; }
    .profile-name { font-size: 1.5em; }

    /* --- 2. 各種調整 --- */
    .detail-item a i {
        margin-right: 0.6em;
        width: 20px;
    }

    .profile-bio {
        text-align: center;
    }
}