/* ========================================
   RaWi-Novel - 共通スタイル
   ======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', system-ui, sans-serif;
    background-color: #F6F0EA;
    color: #1D1B19;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================================
   Header
   ======================================== */
.site-header {
    background-color: #1a1612;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 4px -1px rgba(0,0,0,0.2), 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 0 24px;
}

.site-logo {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e8c97a;
    letter-spacing: 0.08em;
    transition: color 0.15s;
}

.site-logo:hover {
    color: #f5d990;
}

/* ========================================
   Hamburger Button
   ======================================== */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
    transition: background-color 200ms cubic-bezier(0.2,0,0,1);
}

.hamburger:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}

.hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   Navigation Drawer
   ======================================== */
.nav-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    background-color: #24201c;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 150;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.35);
}

.nav-drawer.is-open {
    transform: translateX(0);
}

.nav-drawer ul {
    list-style: none;
    padding: 20px 0;
}

.nav-drawer ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px 14px 20px;
    color: #ccc4b8;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    border-left: 3px solid transparent;
    border-radius: 0 24px 24px 0;
    margin-right: 12px;
    transition: background-color 200ms cubic-bezier(0.2,0,0,1), color 150ms, border-color 150ms;
}

.nav-drawer ul li a:hover {
    background-color: rgba(232,201,122,0.08);
    color: #e8c97a;
    border-left-color: transparent;
}

.nav-drawer ul li a.active {
    background-color: rgba(232,201,122,0.14);
    color: #e8c97a;
    border-left-color: #e8c97a;
    font-weight: 500;
}

/* ========================================
   Overlay (for nav drawer close)
   ======================================== */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 140;
}

.nav-overlay.is-open {
    display: block;
}

/* ========================================
   Main Content
   ======================================== */
.site-main {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 36px 20px;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background-color: #1a1612;
    color: #7a7060;
    text-align: center;
    padding: 28px 16px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    font-weight: 400;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.footer-inner p {
    margin: 0;
}

.footer-contact {
    color: #7a7060;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 150ms;
}

.footer-contact:hover {
    color: #e8c97a;
}

/* ========================================
   Page Title
   ======================================== */
.page-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8c97a;
    color: #1a1612;
}

/* ========================================
   Section Title (in card)
   ======================================== */
.section-title {
    font-size: 1.05rem;
    font-weight: bold;
    margin-bottom: 12px;
    color: #2d2926;
}

/* ========================================
   Card
   ======================================== */
.card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 24px 28px;
    margin-bottom: 24px;
}

/* ========================================
   Feature Links (top page)
   ======================================== */
.feature-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.feature-link {
    display: inline-block;
    padding: 10px 22px;
    background-color: #1a1612;
    color: #e8c97a;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    transition: background-color 0.15s, color 0.15s;
}

.feature-link:hover {
    background-color: #2e2922;
    color: #f5d990;
}

/* ========================================
   Utility
   ======================================== */
.text-muted {
    color: #9c9080;
    font-size: 0.875rem;
    margin-top: 8px;
}

/* ========================================
   404 Error Page
   ======================================== */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    min-height: 50vh;
}

.error-code {
    font-size: 6rem;
    font-weight: bold;
    color: #e8c97a;
    line-height: 1;
    letter-spacing: -0.04em;
}

.error-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1a1612;
    margin: 16px 0 12px;
}

.error-desc {
    font-size: 0.9rem;
    color: #9c9080;
    line-height: 1.8;
    margin-bottom: 32px;
}

.error-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background-color: #1a1612;
    color: #e8c97a;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: bold;
    transition: background-color 0.15s, color 0.15s;
}

.error-back-btn:hover {
    background-color: #2e2922;
    color: #f5d990;
}

.error-contact {
    margin-top: 24px;
    font-size: 0.85rem;
    color: #9c9080;
}

.error-contact a {
    color: #c8a84b;
    text-decoration: none;
}

.error-contact a:hover {
    text-decoration: underline;
}

/* ========================================
   Header Auth
   ======================================== */
.header-spacer { flex: 1; }

.btn-header-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #e8c97a, #d4b260);
    color: #1a1612;
    border: none;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 150ms cubic-bezier(0.2,0,0,1), box-shadow 200ms;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-header-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(232,201,122,0.35);
    color: #1a1612;
}

.header-user-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ccc4b8;
    font-size: 0.85rem;
    text-decoration: none;
    padding: 6px 16px 6px 8px;
    border-radius: 24px;
    transition: background 200ms cubic-bezier(0.2,0,0,1), color 150ms;
}

.header-user-link:hover {
    background: rgba(255,255,255,0.1);
    color: #e8c97a;
}

.header-user-link i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(232,201,122,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #e8c97a;
}

.header-user-name {
    color: #e8c97a;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* legacy: keep for backward compat but no longer rendered */
.header-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ccc4b8;
    font-size: 0.82rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (min-width: 768px) {
    .site-main {
        padding: 48px 32px;
    }

    .page-title {
        font-size: 1.75rem;
    }
}
