/*
Theme Name: Civic Platform
Theme URI: https://example.com
Author: Civic Platform Team
Author URI: https://example.com
Description: 政策プラットフォーム専用テーマ。公共性とシンプルさを重視したデザイン。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: civic-platform
*/

/* ===================================
   リセット・基本設定
=================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #1d4ed8;
}

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

/* ===================================
   レイアウト
=================================== */
.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.site-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-navigation a {
    color: #4b5563;
    font-weight: 500;
}

.main-navigation a:hover {
    color: #2563eb;
}

.user-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.btn-secondary:hover {
    background: #eff6ff;
}

.site-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.site-footer {
    background: #1f2937;
    color: #9ca3af;
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.site-footer a {
    color: #d1d5db;
}

/* ===================================
   インデックスページ
=================================== */
.index-page {
    padding: 2rem 0;
}

.index-header {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.index-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.search-box button {
    padding: 0.75rem 2rem;
}

.shortcut-commands {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shortcut-btn {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.shortcut-btn:hover {
    background: #e5e7eb;
}

.index-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.index-main {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.index-sidebar {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.task-list {
    list-style: none;
}

.task-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.task-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.task-urgent {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
}

/* ===================================
   コンテンツ一覧
=================================== */
.archive-header {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.archive-header h1 {
    font-size: 2rem;
    color: #1f2937;
}

.filter-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.post-card-header {
    padding: 1.5rem;
}

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.post-card-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.post-card-excerpt {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-card-footer {
    padding: 0 1.5rem 1.5rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

/* ===================================
   単一ページ
=================================== */
.single-content {
    background: #fff;
    padding: 3rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.entry-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.entry-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.entry-meta {
    display: flex;
    gap: 2rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.entry-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.entry-content h2 {
    font-size: 1.875rem;
    margin: 2rem 0 1rem;
    color: #1f2937;
}

.entry-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: #1f2937;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.meta-section {
    background: #f9fafb;
    padding: 2rem;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.meta-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.meta-table {
    width: 100%;
}

.meta-table th,
.meta-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.meta-table th {
    background: #f3f4f6;
    font-weight: 600;
    width: 30%;
}

/* ===================================
   フォーム
=================================== */
.entry-form {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-required {
    color: #dc2626;
}

.form-help {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* ===================================
   ステータスバッジ
=================================== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-draft {
    background: #f3f4f6;
    color: #4b5563;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-answered {
    background: #dbeafe;
    color: #1e40af;
}

/* ===================================
   ページネーション
=================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    color: #4b5563;
}

.pagination a:hover {
    background: #f3f4f6;
}

.pagination .current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* ===================================
   地図表示
=================================== */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 2rem 0;
}

/* ===================================
   レスポンシブ
=================================== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .index-content {
        grid-template-columns: 1fr;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .single-content {
        padding: 1.5rem;
    }
    
    .entry-title {
        font-size: 1.75rem;
    }
}

/* ===================================
   ユーティリティ
=================================== */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
