/* ==========================================================================
   Project Sync: Phase 4 "The Gate" Master Stylesheet (v2.0)
   Last Updated: 2025-12-30 (UI Refinements)
   ========================================================================== */

/* -------------------------------------------
   0. Variables & Reset (変数の定義)
------------------------------------------- */
:root {
    /* Colors */
    --color-bg: #ffffff;
    --color-text: #333333;
    --color-text-sub: #999999;
    --color-accent: #000000;
    --color-link: #333333;
    --color-border: #eee; /* 薄い境界線 */
    --color-border-bold: #333; /* 太い境界線 */
    
    /* Fonts */
    --font-serif: "Hiragino Mincho ProN", "HiraMinProN-W3", "Yu Mincho", "YuMincho", serif;
    --font-sans: "Helvetica Neue", "Arial", sans-serif;
    --font-mono: 'Courier New', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.6;
    text-decoration: none;
}

/* -------------------------------------------
   1. Layout Structure (骨格)
------------------------------------------- */
.container {
    width: 100%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

main:not(.torii-gate-container) > .container {
    max-width: 740px;
}

main {
    flex: 1;
}

/* -------------------------------------------
   Terminal Specific Layout (ターミナル専用設定)
   既存の .container とは独立して、さらに幅を絞り込む
------------------------------------------- */

/* PC・タブレット: 幅を720pxに固定し、画面中央に配置 */
.terminal-container {
    max-width: 720px;       /* 記事(.container)の740pxより少しタイトに */
    margin: 0 auto;         /* 左右中央寄せ */
    padding: 4rem 2rem;     /* 上下の余白 */
    
    /* 画面の高さがある場合、上下も中央に来るようにする */
    min-height: 80vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* グリッドの間隔調整 */
.terminal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2カラム */
    gap: 2rem; /* 間隔を狭める */
}

/* スマホ表示: 幅制限を解除 */
@media (max-width: 768px) {
    .terminal-container {
        max-width: 100%;
        min-height: auto;
        padding: 4rem 1.5rem;
        display: block; /* Flex解除 */
    }
    
    .terminal-grid {
        grid-template-columns: 1fr; /* 1カラムに戻す */
        gap: 2.5rem;
    }
}

/* -------------------------------------------
   2. Header (Minimal Navigation)
------------------------------------------- */
.site-header-minimal {
    padding: 1.2rem 2rem;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.return-to-terminal {
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: opacity 0.3s;
}

.return-to-terminal:hover {
    opacity: 0.6;
}

.return-to-terminal .icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.site-identity-mini a {
    text-decoration: none;
    color: var(--color-text-sub);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.home .site-header-minimal,
body.page-template-page-terminal .site-header-minimal {
    display: none;
}

/* -------------------------------------------
   3. Front Page: "The Torii"
------------------------------------------- */
.torii-gate-container {
    height: 100vh;
    width: 100%;
    max-width: 100% !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fbfbfb;
    position: relative;
    padding: 20px;
}

.torii-content {
    text-align: center;
    max-width: 600px;
}

.hero-message {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin: 0 0 1.5rem 0;
    color: var(--color-accent);
}

.jp-message {
    display: block;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--color-text-sub);
    letter-spacing: 0.2em;
    margin-top: 1rem;
}

.enter-terminal-btn {
    display: inline-block;
    margin-top: 4rem;
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    position: relative;
    padding-bottom: 8px;
    transition: opacity 0.5s ease;
}

.enter-terminal-btn .btn-line {
    content: '';
    display: block;
    width: 100%;
    height: 1.2px;
    background-color: var(--color-text);
    margin-top: 8px;
    transform: scaleX(0.3);
    transform-origin: center;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.enter-terminal-btn:hover .btn-line {
    transform: scaleX(1.0);
}

/* Animations */
.fade-in { opacity: 0; animation: fadeIn 1.5s forwards; }
.fade-in-delay { opacity: 0; animation: fadeIn 1.5s 0.8s forwards; }
.fade-in-delay-2 { opacity: 0; animation: fadeIn 1.5s 1.6s forwards; }

@keyframes fadeIn {
    to { opacity: 1; }
}

/* -------------------------------------------
   4. Terminal Page (Phase 5: Product Hub)
------------------------------------------- */
.terminal-container {
    padding: 4rem 2rem;
    max-width: 800px; /* 画面中央に寄せるための幅制限 */
    margin: 0 auto;   /* 中央揃え */
    font-family: var(--font-sans);
    color: var(--color-text);
}

/* --- Header Area: Centered Hub Style --- */
.terminal-header {
    text-align: center; /* Phase 5: 中央揃え */
    margin-bottom: 3.5rem;
    border-bottom: 2px solid var(--color-border-bold);
    padding-bottom: 2rem;
}

.terminal-title {
    font-size: 1.8rem;
    letter-spacing: 0.2em;
    margin: 0 0 1rem 0;
    font-weight: 400;
}

/* Status Badges */
.terminal-status {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.status-box {
    background: #f5f5f5; /* 背景色（変数がなければ #f5f5f5） */
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--color-text-sub);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-box .label {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--color-text-sub);
    opacity: 0.7;
    letter-spacing: 0.05em;
}

.status-box .value {
    font-weight: bold;
    letter-spacing: 0.1em;
    color: var(--color-text);
}

/* --- Grid Layout: Vertical Stack (Zones) --- */
.terminal-grid {
    display: flex;
    flex-direction: column; /* 縦積みに変更 */
    gap: 3rem; /* セクション間の余白 */
}

/* Section Labels */
.section-label {
    font-size: 0.75rem;
    color: var(--color-text-sub);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.15em;
    font-weight: 600;
}

/* --- Link Lists & Typography --- */
.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li {
    margin-bottom: 1rem;
}

.link-list a {
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    align-items: center;
    transition: all 0.2s;
    font-size: 1.1rem;
    padding: 5px 0;
}

.link-list a:hover {
    opacity: 0.7;
    color: var(--color-text); /* ホバー時の色はテキスト色のまま薄くする */
}

/* Code/Icon Numbers (01, 02...) */
.link-list .code, 
.link-list .icon {
    display: inline-block;
    width: 40px; /* 固定幅で揃える */
    font-size: 0.9rem;
    color: var(--color-text-sub); /* 薄いグレー */
    font-family: var(--font-mono); /* 等幅フォント */
    flex-shrink: 0;
}

/* --- ZONE 1: PRIMARY (Special Card Style) --- */
.primary-sector .primary-item a {
    display: block; /* 全体をリンク領域に */
    background: #fafafa; /* 薄いグレー背景 */
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-text); /* 左側に太いアクセント線 */
    padding: 2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.primary-sector .primary-item a:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* 浮き上がる演出 */
    transform: translateY(-2px);
    opacity: 1; /* オパシティ変化は無効化 */
}

.primary-item strong {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    letter-spacing: 0.05em;
}

.primary-item small {
    display: block;
    color: var(--color-text-sub);
    font-size: 0.9rem;
    font-weight: normal;
}

.primary-item .code {
    color: var(--color-text); /* プライマリーの番号は濃く */
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

/* --- Sanctuary / Locked Area (Previous Styles Kept) --- */
.sanctuary-sector {
    background-color: #f9f9f9;
    padding: 2rem;
    border: 1.2px solid var(--color-border);
    opacity: 0.6; /* 閉鎖中感を出す */
}

.sanctuary-sector.unlocked {
    border-color: var(--color-border-bold);
    background-color: #fff;
    opacity: 1;
}

.gate-block {
    text-align: center;
    padding: 1rem 0;
}

/* --- Footer Area --- */
.terminal-footer-area {
    margin-top: 5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
    text-align: center;
}

.logout-link {
    font-size: 0.8rem;
    color: var(--color-text-sub);
    text-decoration: underline;
}

.header-search {
    margin-top: 2rem;
    opacity: 0.6;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .terminal-container {
        padding: 3rem 1.5rem;
    }
    
    .primary-sector .primary-item a {
        padding: 1.5rem;
    }
    
    .primary-item strong {
        font-size: 1.2rem;
    }
}

/* -------------------------------------------
   5. Content Typography
------------------------------------------- */
article {
    margin-bottom: 80px;
}

.entry-header h1 {
    font-size: 28px;
    line-height: 1.5;
    margin-bottom: 10px;
    font-weight: normal;
}

.entry-header time {
    display: block;
    font-size: 12px;
    color: var(--color-text-sub);
    font-family: var(--font-sans);
    margin-bottom: 50px;
    letter-spacing: 0.05em;
}

.entry-content p {
    margin-bottom: 2em;
    text-align: justify;
}

.entry-content h2 {
    font-size: 20px;
    margin-top: 60px;
    margin-bottom: 30px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    font-weight: normal;
    letter-spacing: 0.1em;
}

blockquote {
    margin: 40px 0;
    padding: 20px 30px;
    background-color: #fcfcfc;
    border-left: 2px solid var(--color-border-bold);
    font-style: italic;
    color: var(--color-text-sub);
    font-size: 0.95em;
}

/* -------------------------------------------
   6. Footer (Adjusted: Centered & Horizontal)
------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 40px;
    padding-bottom: 40px;
    text-align: center; /* フッター全体を中央揃え */
    font-size: 11px;
    color: #ccc;
    font-family: var(--font-sans);
}

/* Footer Navigation: Make it Horizontal */
.site-footer ul, 
.site-footer .menu {
    display: flex; /* 横並びにする */
    justify-content: center; /* 中央に寄せる */
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0; /* 下にスペース */
    gap: 30px; /* 項目間の間隔 */
}

.site-footer li {
    margin: 0;
}

.site-footer a {
    text-decoration: none;
    color: var(--color-text-sub);
    letter-spacing: 0.1em;
}

.site-footer a:hover {
    color: var(--color-text);
}

.site-info {
    text-align: center; /* コピーライト中央配置 */
    width: 100%;
    margin-top: 20px;
    opacity: 0.7;
}

/* -------------------------------------------
   7. Mobile Responsive
------------------------------------------- */
@media screen and (max-width: 768px) {
    body { font-size: 15px; }
    .hero-message { font-size: 2rem; }
    .container { padding-left: 20px; padding-right: 20px; }
    
    /* モバイルではフッターナビを縦に戻すか狭める */
    .site-footer ul {
        gap: 15px;
    }
}

/* --------------------------------===========
   8. Search & Tools (Subtle Design)
   ========================================= */

/* --------------------------------===========
   9. Privacy & Utility Pages (Left Text, Centered Box)
   ========================================= */

/* タイトル等は中央 */
.page-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: normal;
    letter-spacing: 0.2em;
    margin: 3rem 0;
}

/* コンテンツ全体を中央配置しつつ、文章は左揃えにする */
.contact-content-wrapper,
.entry-content {
    max-width: 700px; /* 幅を制限 */
    margin: 0 auto;   /* 画面中央に配置 */
    text-align: left; /* テキストは左揃え */
}

/* 特定のブロック（住所など） */
.contact-address-box {
    text-align: left; /* 左揃えに変更 */
    background: #f9f9f9;
    padding: 2rem;
    margin: 2rem auto; /* ボックス自体は中央 */
    border: 1px solid var(--color-border);
    max-width: 600px;
}

.contact-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.contact-list li {
    position: relative;
    padding-left: 1.5em;
    margin-bottom: 1em;
    line-height: 1.7;
    text-align: left;
}

.contact-list li::before {
    content: "■";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.8em;
    color: var(--color-text);
}

/* Disclaimer Dates (右寄せのままにするか左にするか) */
/* ここでは流れに合わせて右下にひっそりと置く */
.disclaimer-dates {
    text-align: right;
    margin-top: 4rem;
    font-size: 0.8rem;
    color: var(--color-text-sub);
}

/* ==========================================================================
   11. Single Post Styles (Add to bottom)
   ========================================================================== */

/* Header Area (Centered) */
.single-header {
    text-align: center;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.entry-title {
    font-size: 2rem;
    font-weight: normal;
    line-height: 1.4;
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

.entry-date {
    display: block;
    font-family: var(--font-mono);
    color: var(--color-text-sub);
    font-size: 0.9rem;
}

/* Post Navigation (Prev/Next) */
.post-navigation {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.nav-previous, .nav-next {
    max-width: 45%;
}

.nav-previous a, .nav-next a {
    display: block;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: opacity 0.3s;
}

.nav-previous a:hover, .nav-next a:hover {
    opacity: 0.6;
}

/* モバイル対応：ナビゲーションを縦並びにする */
@media (max-width: 600px) {
    .entry-title {
        font-size: 1.5rem;
    }
    
    .post-navigation .nav-links {
        flex-direction: column;
    }
    
    .nav-previous, .nav-next {
        max-width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }
}