/*
Theme Name: Illust Stock Theme
Theme URI:
Author:
Description: フリーイラスト素材配布サイト用テーマ（ソコスト風シンプルデザイン）
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: illust-stock
*/

/* ===========================
   リセット・基本スタイル
=========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    color: #333;
    background-color: #f8f8f8;
    line-height: 1.7;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    color: #0044aa;
    text-decoration: underline;
}

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

ul, ol {
    list-style: none;
}

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

.site-main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-area {
    display: flex;
    gap: 40px;
    padding: 30px 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* ===========================
   ヘッダー
=========================== */
.site-header {
    background-color: #fff;
    border-bottom: 2px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

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

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.site-title a {
    color: #222;
}

.site-title a:hover {
    text-decoration: none;
    color: #0066cc;
}

.site-description {
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

/* ===========================
   ナビゲーション
=========================== */
.header-nav ul {
    display: flex;
    gap: 4px;
}

.header-nav li a {
    display: block;
    padding: 8px 14px;
    border-radius: 6px;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.header-nav li a:hover {
    background-color: #f0f4ff;
    color: #0066cc;
    text-decoration: none;
}

/* ===========================
   検索バー
=========================== */
.header-search {
    display: flex;
    align-items: center;
}

.search-form {
    display: flex;
    border: 2px solid #ddd;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s;
}

.search-form:focus-within {
    border-color: #0066cc;
}

.search-input {
    border: none;
    outline: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    width: 220px;
    background: transparent;
}

.search-btn {
    background: #0066cc;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    color: #fff;
    font-size: 1rem;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #0044aa;
}

/* ===========================
   ヒーローエリア（トップページ）
=========================== */
.hero-area {
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    padding: 50px 20px;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
}

.hero-area h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 12px;
}

.hero-area p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 24px;
}

/* ===========================
   カテゴリタブ / フィルター
=========================== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 0 10px;
}

.category-tab {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #555;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.category-tab:hover,
.category-tab.active {
    background: #0066cc;
    color: #fff;
    text-decoration: none;
}

/* ===========================
   イラスト一覧グリッド
=========================== */
.illust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.illust-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s, transform 0.2s;
}

.illust-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
}

.illust-card-thumb {
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px;
}

.illust-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
}

.illust-card:hover .illust-card-thumb img {
    transform: scale(1.04);
}

.illust-card-body {
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
}

.illust-card-title {
    font-size: 0.8rem;
    color: #444;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================
   イラスト詳細ページ
=========================== */
.single-illust-wrap {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    padding: 36px;
    margin-bottom: 30px;
}

.single-illust-inner {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.illust-preview {
    width: 400px;
    flex-shrink: 0;
}

.illust-preview-img {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
}

.illust-preview-img img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.illust-info {
    flex: 1;
    min-width: 0;
}

.illust-info h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 12px;
}

.illust-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
}

.illust-description {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 24px;
}

/* ===========================
   ダウンロードボタン
=========================== */
.download-section {
    margin-bottom: 28px;
}

.download-section h3 {
    font-size: 0.9rem;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn-download:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-download:active {
    transform: translateY(0);
}

.btn-download-png {
    background: #0066cc;
    color: #fff;
}

.btn-download-jpg {
    background: #28a745;
    color: #fff;
}

.btn-download-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download-icon {
    font-size: 1.2rem;
}

.btn-download-format {
    font-size: 0.8rem;
    opacity: 0.85;
}

.btn-download-arrow {
    font-size: 1rem;
}

/* AdSense エリア */
.ad-area {
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin: 24px 0;
    color: #aaa;
    font-size: 0.8rem;
}

/* ===========================
   タグ
=========================== */
.illust-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.illust-tag {
    display: inline-block;
    background: #f0f4ff;
    color: #0066cc;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    transition: background 0.2s;
}

.illust-tag:hover {
    background: #d4e4ff;
    text-decoration: none;
}

/* ===========================
   サイドバー
=========================== */
.widget {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    padding: 20px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget ul li a:hover {
    color: #0066cc;
    text-decoration: none;
}

.widget-count {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.75rem;
    color: #888;
}

/* ===========================
   ページネーション
=========================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 36px 0 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    color: #555;
    transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
    background: #f0f4ff;
    color: #0066cc;
    text-decoration: none;
}

.pagination .current {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* ===========================
   フッター
=========================== */
.site-footer {
    background: #2a2a2a;
    color: #ccc;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 20px;
}

.footer-nav {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: #aaa;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-copy {
    border-top: 1px solid #444;
    padding-top: 16px;
    font-size: 0.8rem;
    color: #777;
}

/* ===========================
   レスポンシブ
=========================== */
@media (max-width: 900px) {
    .content-area {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .single-illust-inner {
        flex-direction: column;
    }
    .illust-preview {
        width: 100%;
    }
    .illust-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 600px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }
    .header-nav {
        order: 3;
        width: 100%;
    }
    .header-search {
        order: 2;
    }
    .search-input {
        width: 140px;
    }
    .hero-area h1 {
        font-size: 1.5rem;
    }
    .illust-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .single-illust-wrap {
        padding: 20px;
    }
}

/* ===========================
   ユーティリティ
=========================== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e8e8;
}
