/*
Theme Name: Estrella Garden
Description: 星光下の花園 — 文学同人創作ブログ純自定義テーマ
Author: mitsuki
Version: 2.0.0
Text Domain: estrella-garden
*/

/* ========================================
   1. CSS 変数システム
   ======================================== */
:root {
    /* カラー */
    --star-navy: #2C3E6B;
    --star-navy-deep: #1A2744;
    --star-navy-darker: #12203D;
    --star-gold: #D4AF37;
    --star-gold-soft: rgba(212, 175, 55, 0.15);
    --star-gold-glow: rgba(212, 175, 55, 0.3);
    --bg-color: #F8F7F3;
    --bg-card: rgba(255, 255, 255, 0.92);
    --text-color: #2D2D2D;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --border-color: rgba(44, 62, 107, 0.06);
    --border-gold: rgba(212, 175, 55, 0.12);

    /* スペーシング */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;

    /* 角丸 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* フォント */
    --font-body: 'Noto Serif SC', 'Noto Serif', Georgia, serif;
    --font-display: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
    --font-sm: 13px;
    --font-base: 15px;
    --font-md: 17px;
    --font-lg: 20px;
    --font-xl: 28px;
    --font-2xl: clamp(2rem, 4vw, 3rem);

    /* トランジション */
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.15s;
    --transition-base: 0.25s;
    --transition-slow: 0.4s;

    /* レイアウト */
    --container-width: 1100px;
    --content-width: 720px;
    --content-wide: 900px;
    --sidebar-width: 280px;
}

/* ========================================
   2. ダークモード
   ======================================== */
body.dark-mode {
    --bg-color: #141821;
    --bg-card: rgba(28, 33, 48, 0.88);
    --text-color: #C8CCD5;
    --text-muted: #8890A0;
    --text-light: #5A6070;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-gold: rgba(212, 175, 55, 0.08);
}

/* ========================================
   3. リセット & ベース
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: var(--font-base);
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

a {
    color: var(--star-navy);
    text-decoration: none;
    transition: color var(--transition-fast) var(--ease-out);
}
a:hover { color: var(--star-gold); }

body.dark-mode a { color: var(--text-color); }
body.dark-mode a:hover { color: var(--star-gold); }

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

/* フォーカス可視 */
:focus-visible {
    outline: 2px solid var(--star-gold);
    outline-offset: 2px;
}

/* スクロールバー */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(44, 62, 107, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(44, 62, 107, 0.25); }
body.dark-mode ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

::selection {
    background: var(--star-gold-glow);
    color: var(--star-navy);
}
body.dark-mode ::selection {
    background: rgba(212, 175, 55, 0.35);
    color: #FAFAF7;
}

/* ========================================
   4. 導航バー
   ======================================== */
.estrella-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.estrella-navbar-brand {
    font-size: 20px;
    color: var(--star-gold) !important;
    text-decoration: none;
}

.estrella-navbar-title {
    font-family: var(--font-display);
    font-size: var(--font-md);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.estrella-navbar-actions {
    display: flex;
    gap: var(--space-sm);
}

.estrella-navbar-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    font-size: 16px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.estrella-navbar-btn:hover { color: var(--star-gold); }

/* 記事ページでは沉浸ナビに切替 */
body.single .estrella-navbar { display: none; }

/* 検索オーバーレイ */
.estrella-search-overlay[hidden] { display: none !important; }

.estrella-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.9);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.estrella-search-inner {
    width: 90%;
    max-width: 500px;
    position: relative;
}

.estrella-search-inner input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-body);
    font-size: var(--font-lg);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    color: #fff;
    outline: none;
}
.estrella-search-inner input:focus {
    border-color: var(--star-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}
.estrella-search-inner input::placeholder { color: rgba(255, 255, 255, 0.4); }

.estrella-search-close {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    padding: var(--space-sm);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}
.estrella-search-close:hover { color: var(--star-gold); }

/* ========================================
   5. Banner
   ======================================== */
.estrella-banner {
    position: relative;
    height: 45vh;
    min-height: 280px;
    background: linear-gradient(135deg, #080E1A 0%, var(--star-navy) 50%, var(--star-navy-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    margin-top: 56px;
}

.estrella-banner.is-home {
    height: 100vh;
    min-height: 500px;
    margin-top: 0;
}

/* ホーム画面ではナビバーを半透明に */
body.home .estrella-navbar {
    background: rgba(10, 15, 30, 0.4);
    border-bottom-color: transparent;
}

.estrella-banner-content {
    text-align: center;
    color: #fff;
    z-index: 3;
    position: relative;
}

.estrella-banner-deco {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 8px;
    margin: var(--space-sm) 0;
}

.estrella-deco-line {
    display: inline-block;
    width: 80px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    vertical-align: middle;
    margin: 0 8px;
}

.estrella-banner-title {
    font-family: var(--font-display);
    font-size: var(--font-2xl);
    font-weight: 300;
    letter-spacing: 6px;
    color: #fff;
    margin: var(--space-sm) 0;
}

.estrella-banner-subtitle {
    font-family: var(--font-display);
    font-size: var(--font-md);
    font-weight: 300;
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 3px;
    margin: var(--space-sm) 0;
}

/* Banner 挿絵 */
.estrella-banner-character {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 45%;
    max-width: 500px;
    z-index: 2;
    mix-blend-mode: screen;
    mask-image: linear-gradient(to top, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, transparent 0%, black 15%, black 85%, transparent 100%);
}

.estrella-banner-character img {
    width: 100%;
    height: auto;
}

/* デスクトップ対角構図 */
@media (min-width: 1024px) {
    .estrella-banner.is-home .estrella-banner-content {
        max-width: 45%;
        margin-left: auto;
        margin-right: 8%;
        text-align: right;
    }
    .estrella-banner.is-home .estrella-banner-title {
        font-size: clamp(2.5rem, 4vw, 4.2rem);
    }
    .estrella-banner.is-home .estrella-deco-line {
        width: 100px;
    }
}

/* スクロールガイド */
.estrella-scroll-guide {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 4;
    color: rgba(255, 255, 255, 0.5);
    animation: estrella-float 3s ease-in-out infinite;
}

.estrella-guide-star { font-size: 14px; }
.estrella-guide-line { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.3); }
.estrella-guide-text { font-size: 11px; letter-spacing: 3px; font-family: var(--font-display); }

@keyframes estrella-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* ========================================
   6. メインレイアウト
   ======================================== */
.estrella-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.estrella-container.is-single {
    max-width: none;
    padding: 0;
}

.estrella-main {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
}

@media (max-width: 768px) {
    .estrella-main {
        grid-template-columns: 1fr;
    }
    .estrella-sidebar { display: none; }
}

/* ========================================
   7. 文章カード
   ======================================== */
.estrella-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    transition: transform var(--transition-base) var(--ease-out),
                box-shadow var(--transition-base) var(--ease-out),
                border-color var(--transition-base) var(--ease-out);
    position: relative;
    cursor: pointer;
}

.estrella-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 8px 30px rgba(44, 62, 107, 0.12),
                0 4px 8px rgba(0, 0, 0, 0.06),
                0 0 20px rgba(212, 175, 55, 0.18),
                inset 0 0 12px rgba(212, 175, 55, 0.04);
}

body.dark-mode .estrella-card { border-color: var(--border-gold); }
body.dark-mode .estrella-card:hover {
    border-color: rgba(212, 175, 55, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 22px rgba(212, 175, 55, 0.15);
}

/* 星塵頂部帯 */
.estrella-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 7px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.5;
    transition: opacity var(--transition-base);
    background:
        radial-gradient(circle 2px at 12% 50%, rgba(212, 175, 55, 0.6) 0%, transparent 100%),
        radial-gradient(circle 1px at 28% 50%, rgba(230, 220, 180, 0.4) 0%, transparent 100%),
        radial-gradient(circle 1.5px at 52% 50%, rgba(212, 175, 55, 0.5) 0%, transparent 100%),
        radial-gradient(circle 1px at 70% 50%, rgba(200, 210, 240, 0.4) 0%, transparent 100%),
        radial-gradient(circle 2px at 90% 50%, rgba(212, 175, 55, 0.45) 0%, transparent 100%);
}
.estrella-card:hover::before { opacity: 0.85; }
body.dark-mode .estrella-card::before { opacity: 0.8; }
body.dark-mode .estrella-card:hover::before { opacity: 1; }

/* カードボディ */
.estrella-card-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.estrella-card-body {
    padding: var(--space-lg);
}

.estrella-card-title {
    font-size: var(--font-md);
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: var(--space-sm);
}
.estrella-card-title a { color: var(--text-color); }
.estrella-card-title a:hover { color: var(--star-gold); }

.estrella-card-meta {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.estrella-card-sep {
    margin: 0 6px;
    font-size: 8px;
    vertical-align: middle;
    color: var(--star-gold);
    opacity: 0.5;
}

.estrella-card-excerpt {
    font-size: var(--font-base);
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.estrella-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.estrella-tag {
    font-size: 12px;
    padding: 3px 10px;
    background: rgba(44, 62, 107, 0.06);
    border: 1px solid rgba(44, 62, 107, 0.12);
    border-radius: 12px;
    color: var(--star-navy);
    transition: all var(--transition-fast);
}
.estrella-tag:hover {
    background: rgba(44, 62, 107, 0.12);
    border-color: var(--star-gold);
    color: var(--star-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}

body.dark-mode .estrella-tag {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
}
body.dark-mode .estrella-tag:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--star-gold);
    color: var(--star-gold);
}

.estrella-card-deco {
    text-align: center;
    font-size: 10px;
    color: var(--star-gold);
    opacity: 0.3;
    margin-top: var(--space-md);
}

/* 軌道星 */
.estrella-orbit-star {
    position: absolute !important;
    pointer-events: none !important;
    z-index: 10 !important;
    font-size: 8px !important;
    color: rgba(212, 175, 55, 0.7) !important;
    opacity: 0 !important;
    transition: opacity var(--transition-base) !important;
    text-shadow: 0 0 4px rgba(212, 175, 55, 0.5) !important;
    line-height: 1 !important;
    top: 2px;
    left: 10%;
}
.estrella-card:hover .estrella-orbit-star {
    opacity: 1 !important;
    animation: estrella-orbit 4s linear infinite !important;
}

@keyframes estrella-orbit {
    0%   { top: 2px; left: 10%; }
    25%  { top: 10%; left: calc(100% - 10px); }
    50%  { top: calc(100% - 10px); left: 85%; }
    75%  { top: 85%; left: 2px; }
    100% { top: 2px; left: 10%; }
}

/* ========================================
   8. サイドバー
   ======================================== */
.estrella-profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: 76px;
}

.estrella-profile-header {
    height: 80px;
    overflow: hidden;
    position: relative;
}

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

body.dark-mode .estrella-profile-cover { filter: brightness(0.75); }

.estrella-profile-avatar {
    display: flex;
    justify-content: center;
    margin-top: -30px;
    position: relative;
    z-index: 2;
}

.estrella-profile-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.estrella-profile-body {
    text-align: center;
    padding: var(--space-sm) var(--space-md) var(--space-lg);
}

.estrella-profile-name {
    font-family: var(--font-display);
    font-size: var(--font-md);
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: var(--space-xs);
}

.estrella-profile-greeting {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.estrella-profile-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
}

.estrella-stat { text-align: center; }
.estrella-stat-num {
    display: block;
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--star-gold);
}
.estrella-stat-label {
    font-size: 11px;
    color: var(--text-light);
}

/* ========================================
   8b. カテゴリページ — 作品カード壁 + 章節リスト + 画廊
   ======================================== */
.estrella-category-main {
    display: block;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) 120px;
}

/* 作品ヘッダー */
.estrella-work-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-xl) 0;
}

.estrella-work-header-parent {
    font-size: var(--font-sm);
    margin-bottom: var(--space-sm);
}
.estrella-work-header-parent a {
    color: var(--text-muted);
    letter-spacing: 2px;
}

.estrella-work-header-title {
    font-family: var(--font-body);
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--star-navy);
    margin-bottom: var(--space-md);
}
body.dark-mode .estrella-work-header-title { color: var(--text-color); }

/* 竪書きタイトル */
.estrella-vertical-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    display: inline-block;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    letter-spacing: 0.15em;
    line-height: 1.8;
    margin: var(--space-lg) auto;
    padding: var(--space-md) var(--space-sm);
    border-right: 1px solid var(--border-gold);
    border-left: 1px solid var(--border-gold);
}

.estrella-work-header-meta {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.estrella-work-header-desc {
    font-size: var(--font-base);
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

.estrella-work-card-sep {
    margin: 0 6px;
    color: var(--text-light);
}

/* 作品カード壁 */
.estrella-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.estrella-work-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    color: var(--text-color);
    transition: all var(--transition-base) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.estrella-work-card:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 8px 30px rgba(44, 62, 107, 0.1), 0 0 20px rgba(212, 175, 55, 0.12);
    color: var(--text-color);
}

.estrella-work-card-deco {
    font-size: 20px;
    color: var(--star-gold);
    margin-bottom: var(--space-md);
}

.estrella-work-card-title {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--star-navy);
}
body.dark-mode .estrella-work-card-title { color: var(--text-color); }

.estrella-work-card-desc {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.estrella-work-card-stats {
    font-size: var(--font-sm);
    color: var(--star-gold);
    font-weight: 500;
}

/* Tab 切替 */
.estrella-work-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-md);
}

.estrella-work-tab {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: var(--font-base);
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    position: relative;
    transition: color var(--transition-fast);
}

.estrella-work-tab.active {
    color: var(--star-gold);
    font-weight: 600;
}

.estrella-work-tab.active::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--space-md) - 1px);
    left: 0;
    right: 0;
    height: 2px;
    background: var(--star-gold);
}

.estrella-tab-panel { display: none; }
.estrella-tab-panel.active { display: block; }

/* 章節リスト */
.estrella-chapter-list {
    max-width: 700px;
    margin: 0 auto;
}

.estrella-chapter-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    transition: background var(--transition-fast);
    gap: var(--space-md);
}
.estrella-chapter-item:hover {
    background: var(--star-gold-soft);
}
.estrella-chapter-item:first-child {
    border-top: 1px solid var(--border-color);
}

.estrella-chapter-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.estrella-chapter-title {
    flex: 1;
    font-size: var(--font-base);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.estrella-chapter-meta {
    font-size: var(--font-sm);
    color: var(--text-light);
    display: flex;
    gap: var(--space-md);
    flex-shrink: 0;
}

/* 画廊グリッド */
.estrella-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.estrella-gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base) var(--ease-out);
}

.estrella-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.estrella-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.estrella-gallery-title {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-sm);
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .estrella-vertical-title {
        writing-mode: horizontal-tb;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--border-gold);
        padding: 0 0 var(--space-sm);
    }
    .estrella-works-grid {
        grid-template-columns: 1fr;
    }
    .estrella-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   9. 記事ページ（沉浸読書モード）
   ======================================== */

/* 沉浸ナビ */
.estrella-immersive-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    z-index: 1000;
    transition: background var(--transition-base);
}

.estrella-immersive-nav.is-scrolled {
    background: rgba(18, 32, 61, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.estrella-immersive-home {
    font-size: 18px;
    color: var(--star-gold) !important;
}

.estrella-immersive-right {
    display: flex;
    gap: var(--space-sm);
}

.estrella-darkmode-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: var(--space-sm);
}

/* 記事ヘッダー */
.estrella-article-header {
    background: linear-gradient(180deg, var(--star-navy-darker) 0%, var(--star-navy) 50%, var(--star-navy-deep) 100%);
    padding: calc(80px + var(--space-2xl)) var(--space-lg) var(--space-2xl);
    text-align: center;
    position: relative;
    width: 100vw;
}

.estrella-article-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('images/title-texture.png') repeat;
    background-size: 256px;
    opacity: 0.15;
    pointer-events: none;
}

.estrella-article-header-inner {
    max-width: var(--content-wide);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.estrella-article-title {
    font-family: var(--font-body);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
    margin: var(--space-md) 0;
}

.estrella-article-meta {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-sm);
}
.estrella-article-meta a { color: rgba(255, 255, 255, 0.6); }
.estrella-article-meta a:hover { color: var(--star-gold); }

.estrella-work-info {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-md);
}
.estrella-work-info a { color: rgba(255, 255, 255, 0.6); }
.estrella-info-sep { margin: 0 6px; opacity: 0.4; }

/* 字号選択 */
.estrella-font-size {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.estrella-font-size button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.estrella-font-size button:hover { color: rgba(255, 255, 255, 0.7); }
.estrella-font-size button.active { color: var(--star-gold); font-weight: 600; }
.estrella-font-size span { color: rgba(255, 255, 255, 0.2); }

/* 正文 */
.estrella-article-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

@media (min-width: 1200px) {
    .estrella-article-content { max-width: var(--content-wide); }
}

.estrella-article-body {
    font-size: var(--font-md);
    line-height: 2;
    color: var(--text-color);
}

.estrella-article-body p { margin-bottom: 1.5em; }

.estrella-article-body h2, .estrella-article-body h3, .estrella-article-body h4 {
    font-weight: 600;
    color: var(--star-navy);
    margin: 2em 0 0.8em;
}
body.dark-mode .estrella-article-body h2,
body.dark-mode .estrella-article-body h3,
body.dark-mode .estrella-article-body h4 { color: #D6CFC0; }

.estrella-article-body hr {
    border: none;
    text-align: center;
    margin: 2em 0;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1;
}
.estrella-article-body hr::after {
    content: '✦  ·  ✦  ·  ✦';
}

.estrella-article-body blockquote {
    border-left: 3px solid var(--star-gold);
    padding: var(--space-md) var(--space-lg);
    margin: 1.5em 0;
    background: var(--star-gold-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-muted);
}

.estrella-article-body img {
    border-radius: var(--radius-sm);
    margin: 1.5em auto;
}

/* ========================================
   10. 章節ナビゲーション
   ======================================== */
.estrella-chapter-nav {
    margin-top: var(--space-xl);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
}

.estrella-nav-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.estrella-nav-item {
    flex: 1;
    text-align: center;
    padding: var(--space-md);
    transition: background var(--transition-fast);
}
.estrella-nav-item:not(:last-child) { border-right: 1px solid var(--border-color); }
.estrella-nav-item:hover { background: var(--star-gold-soft); }

.estrella-nav-label {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 2px;
}

.estrella-nav-title {
    display: block;
    font-size: var(--font-sm);
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.estrella-nav-chapter {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--star-gold);
}

.estrella-nav-item a {
    display: block;
    color: inherit;
}

/* 全話一覧 */
.estrella-toc-section { border-top: 1px solid var(--border-color); }

.estrella-toc-toggle {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: var(--font-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: color var(--transition-fast);
}
.estrella-toc-toggle:hover { color: var(--star-gold); }

.estrella-toc-list {
    max-height: 300px;
    overflow-y: auto;
}

.estrella-toc-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    transition: background var(--transition-fast);
}
.estrella-toc-item:hover { background: var(--star-gold-soft); }
.estrella-toc-item.is-current { background: var(--star-gold-soft); font-weight: 600; }

.estrella-toc-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-color);
    border-radius: 50%;
    margin-right: var(--space-md);
    flex-shrink: 0;
}
.estrella-toc-item.is-current .estrella-toc-num {
    background: var(--star-gold);
    color: #fff;
}

/* ========================================
   11. コメント
   ======================================== */
.estrella-comments-section {
    margin-top: var(--space-xl);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.estrella-comments-title {
    font-size: var(--font-md);
    margin-bottom: var(--space-lg);
    color: var(--text-color);
}

.estrella-comment-list {
    list-style: none;
}

.estrella-comment-list .comment {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--font-base);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    transition: border-color var(--transition-fast);
}
.comment-respond input:focus,
.comment-respond textarea:focus {
    border-color: var(--star-gold);
    outline: none;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.comment-respond .submit {
    background: var(--star-navy);
    color: #fff;
    border: none;
    padding: var(--space-sm) var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--font-base);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.comment-respond .submit:hover { background: var(--star-gold); }

body.dark-mode .comment-respond input,
body.dark-mode .comment-respond textarea {
    background: var(--bg-card);
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode .comment-respond .submit {
    background: rgba(212, 175, 55, 0.8);
    color: var(--star-navy);
}

/* ========================================
   12. ページネーション
   ======================================== */
.estrella-pagination {
    text-align: center;
    padding: var(--space-xl) 0;
}

.estrella-pagination .page-numbers {
    display: inline-block;
    padding: var(--space-sm) 12px;
    margin: 0 2px;
    font-size: var(--font-base);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.estrella-pagination .page-numbers:hover { color: var(--star-gold); }
.estrella-pagination .page-numbers.current {
    background: var(--star-navy);
    color: #fff;
}

/* ========================================
   13. フッター
   ======================================== */
.estrella-footer {
    background: linear-gradient(135deg, var(--star-navy-deep) 0%, var(--star-navy) 100%);
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    position: relative;
    overflow: visible;
}

.estrella-footer::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--star-navy-deep));
    pointer-events: none;
}

.estrella-footer-lily {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 60px;
    background: url('images/footer-lily.png') repeat-x center bottom;
    background-size: auto 60px;
    opacity: 0.25;
    mask-image: linear-gradient(to bottom, transparent, black);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black);
    pointer-events: none;
}

.estrella-footer-content { position: relative; z-index: 2; }
.estrella-footer-star { font-size: 16px; color: var(--star-gold); margin-bottom: var(--space-sm); }
.estrella-footer-title { color: rgba(255, 255, 255, 0.7); font-size: var(--font-sm); letter-spacing: 1px; margin-bottom: var(--space-sm); }
.estrella-footer-nav { margin-bottom: var(--space-md); }
.estrella-footer-nav a { color: rgba(255, 255, 255, 0.5); font-size: var(--font-sm); }
.estrella-footer-nav a:hover { color: var(--star-gold); }
.estrella-footer-sep { color: rgba(255, 255, 255, 0.3); margin: 0 8px; }
.estrella-footer-copy { font-size: 11px; color: rgba(255, 255, 255, 0.25); }

/* ========================================
   14. 404
   ======================================== */
.estrella-404 {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
}

.estrella-404-illustration img {
    width: 100%;
    max-width: 400px;
    height: auto;
    mask-image: radial-gradient(circle, black 50%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle, black 50%, transparent 80%);
    margin-bottom: var(--space-lg);
}

.estrella-404-deco { font-size: 24px; color: var(--star-gold); margin-bottom: var(--space-md); }
.estrella-404 h1 { font-size: var(--font-2xl); color: var(--star-navy); }
body.dark-mode .estrella-404 h1 { color: var(--text-color); }
.estrella-404 p { color: var(--text-muted); margin: var(--space-sm) 0 var(--space-lg); }

.estrella-404-actions { display: flex; gap: var(--space-md); }

.estrella-btn {
    padding: var(--space-sm) var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--font-base);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}
.estrella-btn-gold { background: var(--star-gold); color: #fff; }
.estrella-btn-gold:hover { background: #C9A030; color: #fff; }
.estrella-btn-outline { background: transparent; border: 1px solid var(--star-navy); color: var(--star-navy); }
body.dark-mode .estrella-btn-outline { border-color: var(--text-muted); color: var(--text-color); }

/* ========================================
   15. 空状態 & 検索ヘッダー
   ======================================== */
.estrella-empty {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-light);
}
.estrella-empty-star { font-size: 36px; margin-bottom: var(--space-md); opacity: 0.4; }
.estrella-empty p { font-size: var(--font-base); }

.estrella-search-header h1 {
    font-size: var(--font-lg);
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: var(--space-lg);
}

/* ========================================
   16. 庭園深処メッセージ
   ======================================== */
.estrella-garden-deep {
    text-align: center;
    padding: 30px 20px 10px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}
.estrella-garden-deep.visible { opacity: 1; transform: translateY(0); }
.estrella-garden-deep span {
    font-family: var(--font-display);
    font-size: 14px;
    font-style: italic;
    letter-spacing: 2px;
    color: rgba(44, 62, 107, 0.3);
}
body.dark-mode .estrella-garden-deep span { color: rgba(212, 175, 55, 0.25); }

/* ========================================
   17. 読了星座バースト
   ======================================== */
.estrella-reading-complete { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
.estrella-constellation-burst { position: absolute; bottom: 30%; left: 50%; transform: translate(-50%, 0); width: 200px; height: 200px; }
.estrella-constellation-burst .burst-star { position: absolute; width: 4px; height: 4px; background: rgba(212, 175, 55, 0.8); border-radius: 50%; box-shadow: 0 0 6px rgba(212, 175, 55, 0.6); animation: estrella-burstStar 1.8s ease-out forwards; }
.estrella-constellation-burst .burst-line { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent); transform-origin: left center; animation: estrella-burstLine 1.8s ease-out forwards; }
.estrella-constellation-burst .burst-text { position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 13px; color: rgba(212, 175, 55, 0.8); letter-spacing: 2px; font-family: var(--font-display); animation: estrella-burstText 1.8s ease-out forwards; }

@keyframes estrella-burstStar { 0% { transform: scale(0); opacity: 0; } 30% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@keyframes estrella-burstLine { 0% { transform: scaleX(0); opacity: 0; } 30% { transform: scaleX(1); opacity: 0.6; } 100% { opacity: 0; } }
@keyframes estrella-burstText { 0% { opacity: 0; transform: translateX(-50%) translateY(10px); } 30% { opacity: 1; transform: translateX(-50%) translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ========================================
   18. スクロール渐現
   ======================================== */
.estrella-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out),
                border-color var(--transition-base) var(--ease-out),
                box-shadow var(--transition-base) var(--ease-out);
}
.estrella-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* JS 無効時 */
.no-js .estrella-card { opacity: 1; transform: none; }

/* ========================================
   19. ページ（説説など）
   ======================================== */
.estrella-page-content {
    max-width: var(--content-wide);
    margin: 0 auto;
}

.estrella-page-title {
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--star-navy);
}
body.dark-mode .estrella-page-title { color: var(--text-color); }

.estrella-page-body {
    font-size: var(--font-base);
    line-height: 1.9;
}

/* ========================================
   20. 流星（説説ページ）
   ======================================== */
.estrella-shooting-star {
    position: fixed;
    height: 2px;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(to left, rgba(180, 210, 255, 0.9) 0%, rgba(44, 62, 107, 0.3) 60%, transparent 100%);
    box-shadow: 0 0 6px rgba(180, 210, 255, 0.4);
    animation: estrella-meteor 0.6s linear forwards;
}

@keyframes estrella-meteor {
    from { transform: rotate(var(--angle, 35deg)) translateX(0); opacity: 1; }
    to { transform: rotate(var(--angle, 35deg)) translateX(calc(-100vw - 200px)); opacity: 0; }
}

/* ========================================
   21. スクロール進捗星軌
   ======================================== */
.estrella-startrail {
    position: fixed;
    right: 20px;
    top: 15%;
    bottom: 15%;
    z-index: 100;
    pointer-events: none;
}

.estrella-startrail-track {
    position: relative;
    width: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.estrella-startrail-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: rgba(212, 175, 55, 0.15);
}

.estrella-startrail-cursor {
    position: absolute;
    top: 0;
    font-size: 14px;
    color: var(--star-gold);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
    transition: top 0.1s linear;
}

.estrella-startrail-tail {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom, var(--star-gold), transparent);
    transition: height 0.1s linear;
}

.estrella-startrail-endcap {
    width: 3px;
    height: 3px;
    background: rgba(212, 175, 55, 0.3);
    border-radius: 50%;
}
.estrella-startrail-endcap.top { position: absolute; top: -6px; }
.estrella-startrail-endcap.bottom { position: absolute; bottom: -6px; }

/* ========================================
   21b. 季節感知色調
   ======================================== */
/* 夏：星光偏暖白 */
body.season-summer { --star-gold: #E0C060; }

/* 秋：全体暖金調 */
body.season-autumn { --bg-color: #F9F6F0; --border-gold: rgba(212, 175, 55, 0.18); }
body.season-autumn.dark-mode { --bg-color: #171510; }

/* ========================================
   22. prefers-reduced-motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .estrella-card { opacity: 1; transform: none; }
}

/* ========================================
   23. モバイル対応
   ======================================== */
@media (max-width: 768px) {
    .estrella-navbar-title { display: none; }

    .estrella-banner { height: 50vh; margin-top: 56px; }
    .estrella-banner.is-home { height: 85vh; margin-top: 0; }
    .estrella-banner-character { width: 60%; }
    .estrella-banner-title { font-size: clamp(1.5rem, 6vw, 2rem); }

    .estrella-container { padding: 0 var(--space-md); }
    .estrella-article-content { padding: var(--space-lg) var(--space-md); }

    .estrella-card-body { padding: var(--space-md); }

    .estrella-startrail { display: none; }
}

/* 1:1 方屏 */
@media (aspect-ratio: 1/1), (max-aspect-ratio: 1/1) {
    .estrella-banner.is-home { height: 70vh; }
    .estrella-card-body { padding: var(--space-md); }
}

/* ワイドスクリーン */
@media (min-width: 1600px) {
    .estrella-article-content { max-width: 1100px; }
}
