/*
Theme Name: 小説サイトテーマ (Shousetsu Theme)
Description: 小説投稿・閲覧サイト用のカスタムテーマ。スマートフォンでの縦書き表示に対応。
Version: 1.0
Author: Myaako
Text Domain: shousetsu-theme
*/

/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font: 88%/1.5 "メイリオ", Meiryo, "ＭＳ Ｐゴシック", Osaka, "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro";
    color: #2d3748;
    background-color: #FAF9F6;
}

/* ヘッダー */
.site-header {
    background-color: #ffffff;
    color: #2d3748;
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Profile Header Section - Facebook Style */
.profile-header {
    position: relative;
    background-color: #ffffff;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cover-photo {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
}

.profile-info {
    position: relative;
    background-color: #ffffff;
    padding: 0 2rem 2rem;
    display: flex;
    align-items: flex-end;
    gap: 2rem;
}

.avatar-container {
    position: relative;
    margin-top: -90px;
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 6px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background-color: #f8f9fa;
    object-fit: cover;
    display: block;
    aspect-ratio: 1 / 1;
}

.profile-details {
    flex: 1;
    padding-top: 1rem;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.profile-description {
    font-size: 1.1rem;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

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

.header-content {
    flex: 1;
    text-align: center;
}

.site-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a202c;
    letter-spacing: 0.025em;
}

.site-description {
    font-size: 1rem;
    color: #718096;
    font-weight: 400;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem;
}

/* 小説グリッド */
.novels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.novel-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f7fafc;
}

.novel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.novel-cover {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.novel-info {
    padding: 2rem;
}

.novel-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a202c;
    line-height: 1.4;
}

.novel-author {
    font-size: 0.95rem;
    color: #718096;
    margin-bottom: 1rem;
    font-weight: 400;
}

.novel-summary {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 小説詳細ページ */
.novel-detail {
    background: #ffffff;
    border-radius: 12px;
    padding: 2.5rem;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #f7fafc;
}

.novel-detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.novel-detail-cover {
    width: 200px;
    height: 280px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.novel-detail-cover:hover {
    transform: scale(1.05);
}

.novel-detail-info {
    flex: 1;
    margin-left: 2.5rem;
}

.novel-detail-title {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a202c;
    line-height: 1.3;
}

.novel-meta {
    margin-bottom: 1.5rem;
}

.novel-meta-item {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #718096;
}

.twitter-link {
    display: inline-block;
    background-color: #3182ce;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.twitter-link:hover {
    background-color: #2c5aa0;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.novel-detail-summary {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2d3748;
}

/* 縦書き本文ページ */
.novel-reading {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 0;
}

/* .novel-content styles moved to single-novel-read.php for reading page */
/* This prevents conflicts with the reading page implementation */

.novel-text {
    display: inline-block;
    vertical-align: top;
    white-space: pre-wrap;
    padding-right: 2rem;
}

/* ページネーション */
.pagination-wrapper {
    margin: 3rem 0 2rem;
    text-align: center;
}

.pagination-wrapper .page-numbers {
    display: inline-block;
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    background: #ffffff;
    color: #4a5568;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.pagination-wrapper .page-numbers:hover {
    background: #f7fafc;
    color: #2d3748;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.pagination-wrapper .page-numbers.current {
    background: #3182ce;
    color: #ffffff;
    border-color: #3182ce;
    cursor: default;
}

.pagination-wrapper .page-numbers.current:hover {
    background: #3182ce;
    transform: none;
}

.pagination-wrapper .page-numbers.prev,
.pagination-wrapper .page-numbers.next {
    font-weight: 600;
    padding: 0.75rem 1.25rem;
}

.pagination-wrapper .page-numbers.dots {
    background: transparent;
    border: none;
    color: #a0aec0;
    cursor: default;
}

.pagination-wrapper .page-numbers.dots:hover {
    background: transparent;
    transform: none;
}

/* フッター */
.site-footer {
    background-color: #f7fafc;
    color: #4a5568;
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid #e2e8f0;
}

/* Navigation Menu */
.primary-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 1rem 0;
    padding: 0;
}

.primary-menu li {
    margin: 0 1.5rem;
}

.primary-menu a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.primary-menu a:hover,
.primary-menu a:focus {
    color: #2d3748;
    background-color: #f7fafc;
}

/* Footer */
.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-links {
    margin-bottom: 1.5rem;
}

.footer-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.footer-menu li {
    margin: 0 1.5rem 0.5rem;
}

.footer-links a,
.footer-menu a {
    color: #718096;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-menu a:hover {
    color: #4a5568;
}

/* Author Twitter Button Styles */
.author-with-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.author-twitter-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    color: #1da1f2;
    text-decoration: none;
    border: 1px solid #1da1f2;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.author-twitter-link:hover {
    background-color: #1da1f2;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(29, 161, 242, 0.3);
}

.author-twitter-link svg {
    flex-shrink: 0;
}

/* Avatar Twitter Button Styles */
.avatar-twitter-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #1da1f2;
    text-decoration: none;
    border: 2px solid #1da1f2;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.2);
}

.avatar-twitter-link:hover {
    background-color: #1da1f2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 161, 242, 0.4);
}

.avatar-twitter-link svg {
    flex-shrink: 0;
}

.footer-social {
    margin-bottom: 1.5rem;
    text-align: center;
}

.footer-social .twitter-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1da1f2;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 1px solid #1da1f2;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: transparent;
}

.footer-social .twitter-link:hover {
    background: #1da1f2;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.footer-social .twitter-link svg {
    transition: transform 0.3s ease;
}

.footer-social .twitter-link:hover svg {
    transform: scale(1.1);
}

.footer-copyright {
    font-size: 0.85rem;
    color: #a0aec0;
    text-align: center;
}

/* Content Layout */
.content-wrapper {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}



/* Sidebar Styles */
.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.search-widget,
.filter-widget {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Search Form */
.novel-search-form {
    margin: 0;
}

.search-input-group {
    display: flex;
    border: 1px solid #ced4da;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
}

.search-input::placeholder {
    color: #6c757d;
}

.search-button {
    background: #007bff;
    border: none;
    padding: 0.75rem 1rem;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background: #0056b3;
}

.search-icon {
    font-size: 1rem;
}

/* Taxonomy Lists */
.taxonomy-list {
    margin: 0;
}

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

.genre-item {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.genre-item a {
    color: #495057;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    flex: 1;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.genre-item a:hover,
.genre-item.active a {
    background: #e3f2fd;
    color: #1976d2;
}

.genre-item .count {
    color: #6c757d;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.tag-item:hover,
.tag-item.active {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

/* Clear Filters */
.clear-filters {
    text-align: center;
    margin-top: 1rem;
}

.clear-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.clear-button:hover {
    background: #c82333;
    color: white;
}

/* Search Results Info */
.search-results-info {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #155724;
}

.search-results-info p {
    margin: 0;
    font-size: 0.9rem;
}

.no-terms {
    color: #6c757d;
    font-style: italic;
    margin: 0;
    font-size: 0.9rem;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 1001;
    flex-shrink: 0;
}

.hamburger-menu:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: #333;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* レスポンシブデザイン */
@media (max-width: 1200px) {
    .novels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .novels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Profile Header Responsive */
    .cover-photo {
        height: 250px;
    }
    
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 1rem 1.5rem;
        gap: 1rem;
    }
    
    .avatar-container {
        margin-top: -75px;
    }
    
    .profile-avatar {
        width: 120px;
        height: 120px;
        border-width: 5px;
        aspect-ratio: 1 / 1;
    }
    
    .profile-name {
        font-size: 2rem;
    }
    
    .profile-description {
        font-size: 1rem;
    }
    
    /* Show hamburger menu on mobile */
    .hamburger-menu {
        display: flex;
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        right: -320px;
        width: 320px;
        height: 100vh;
        background-color: #fff;
        z-index: 1000;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 60px;
    }
    
    /* Show sidebar when active */
    .sidebar.active {
        right: 0;
    }
    
    .content-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-widget,
    .filter-widget {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .novels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .main-content {
        padding: 1.5rem;
        width: 100%;
    }
    
    .novel-detail {
        padding: 2rem;
    }
    
    .novel-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .novel-detail-cover {
        width: 150px;
        height: 210px;
    }
    
    .novel-detail-title {
        font-size: 1.75rem;
    }
    
    .novel-detail-info {
        margin-left: 0;
        margin-top: 1.5rem;
    }
    
    /* .novel-content mobile styles handled in single-novel-read.php */
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* 縦書き専用のスマートフォン対応 */
@media (max-width: 600px) {
    .novels-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .site-header {
        padding: 1rem;
    }
    
    .site-title {
        font-size: 1.75rem;
    }
    
    .novel-detail {
        padding: 1.5rem;
    }
    
    .novel-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    /* ページネーション - スマートフォン対応 */
     .pagination-wrapper {
         margin: 2rem 0 1.5rem;
     }
     
     .pagination-wrapper .page-numbers {
         padding: 0.6rem 0.8rem;
         margin: 0 0.15rem;
         font-size: 0.9rem;
         min-width: 40px;
     }
     
     .pagination-wrapper .page-numbers.prev,
     .pagination-wrapper .page-numbers.next {
         padding: 0.6rem 1rem;
         font-size: 0.85rem;
     }
     
     .novel-detail-cover {
         width: 140px;
         height: 196px;
         margin-bottom: 1.5rem;
     }
     
     .novel-detail-title {
         font-size: 1.5rem;
     }
     
     .novel-detail-info {
         margin-left: 0;
         margin-top: 0;
     }
     
     .novel-card-content {
         padding: 1.5rem;
     }
     
     /* .novel-content mobile styles handled in single-novel-read.php */
     
     .novel-text {
         padding-right: 1rem;
     }
     
     .search-widget,
     .filter-widget {
         padding: 1rem;
         margin-bottom: 1rem;
     }
     
     .sidebar {
         width: 280px;
         right: -280px;
     }
}