/* --- Neon Abyss Reviews - Main Stylesheet --- */

/* --- 1. CSSリセット & 基本設定 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* カラーパレット */
    --color-background: #0d0d1a;
    --color-surface: #1a1a2e;
    --color-text: #e0e0e0;
    --color-text-muted: #888;
    --color-neon-primary: #FF00E5; /* config.phpから読み込む場合はPHP環境が必要 */
    --color-neon-secondary: #00ffff; /* Cyan */
    --color-border: rgba(255, 0, 229, 0.3);

    /* タイポグラフィ */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Noto Sans JP', sans-serif;
    
    /* エフェクト */
    --shadow-glow-primary: 0 0 8px var(--color-neon-primary);
    --shadow-glow-secondary: 0 0 8px var(--color-neon-secondary);

    /* レイアウト */
    --header-height: 70px;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- 2. 基本要素のスタイル --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--color-neon-secondary);
    text-shadow: var(--shadow-glow-secondary);
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-neon-primary);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    color: #fff;
    text-shadow: var(--shadow-glow-primary);
}

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

/* --- 3. 共通レイアウト & コンポーネント --- */
.container {
    max-width: 1200px;
    width: 94%;
    margin-left: auto;
    margin-right: auto;
}

.site-main {
    padding-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding-bottom: 4rem; /* フッター分のスペース */
}

.button-primary {
    display: inline-block;
    padding: 0.8em 1.5em;
    font-family: var(--font-display);
    font-weight: bold;
    text-align: center;
    color: var(--color-neon-secondary);
    background-color: transparent;
    border: 2px solid var(--color-neon-secondary);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.button-primary:hover {
    color: var(--color-background);
    background-color: var(--color-neon-secondary);
    box-shadow: var(--shadow-glow-secondary);
    text-shadow: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- 4. ヘッダー & フッター --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(13, 13, 26, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.site-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-neon-primary);
    text-shadow: var(--shadow-glow-primary);
}

.header-search {
    flex-grow: 1;
    max-width: 400px;
    margin: 0 1.5rem;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 45px 0 15px;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-neon-primary);
    box-shadow: var(--shadow-glow-primary);
}

.search-button {
    position: absolute;
    top: 0;
    right: 0;
    height: 40px;
    width: 45px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.3s ease;
}

.search-button:hover {
    color: var(--color-neon-primary);
}

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

.main-nav a {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.site-footer {
    padding: 2rem 0;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.9rem;
}

.footer-nav {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.footer-nav a {
    color: var(--color-text-muted);
}
.footer-nav a:hover {
    color: var(--color-neon-primary);
}

.affiliate-disclosure, .copyright {
    color: var(--color-text-muted);
    max-width: 800px;
    margin: 0.5rem auto;
}

/* --- 5. 404ページ専用スタイル --- */
.page-404 {
    text-align: center;
    padding: 5rem 0;
}
.page-404 .error-code {
    font-family: var(--font-display);
    font-size: 10rem;
    line-height: 1;
    color: var(--color-neon-primary);
    text-shadow: 0 0 20px var(--color-neon-primary);
}
.page-404 h1 {
    font-size: 3rem;
    margin-top: 0;
}
.page-404 p {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- 6. ホームページ & アーカイブページ --- */
.hero-section {
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
}
.hero-title {
    font-size: 3.5rem;
    color: var(--color-neon-primary);
    text-shadow: var(--shadow-glow-primary);
}
.hero-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-muted);
}
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}
.section-title span {
    background: var(--color-background);
    padding: 0 20px;
}
.section-title::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 1px;
    background: var(--color-border);
    left: -10%;
    top: 50%;
    z-index: -1;
}

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

.product-card {
    background: var(--color-surface);
    border: 1px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-neon-primary);
    box-shadow: 0 10px 30px rgba(255, 0, 229, 0.2), var(--shadow-glow-primary);
}

.card-image-wrapper {
    position: relative;
    padding-top: 141.6%; /* アスペクト比 1:1.416 */
    background: #2a2a4e;
}
.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out;
}
.product-image.lazy {
    opacity: 0;
}
.product-image.loaded {
    opacity: 1;
}

.card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    text-shadow: none;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}
.card-author {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}
.card-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}
.stars {
    --percent: calc(var(--rating) / 5 * 100%);
    display: inline-block;
    font-size: 1.2rem;
    font-family: Times;
    line-height: 1;
}
.stars::before {
    content: '★★★★★';
    letter-spacing: 3px;
    background: linear-gradient(90deg, var(--color-neon-secondary) var(--percent), #333 var(--percent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rating-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-neon-secondary);
}

.archive-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
}
.archive-header h1 {
    margin-bottom: 0.5rem;
}
.archive-header p {
    color: var(--color-text-muted);
}

/* --- 7. 個別レビューページ --- */
.single-product-page {
    padding-top: 2rem;
}
.breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.breadcrumbs .separator {
    margin: 0 0.5em;
}

.product-main-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.product-gallery img {
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
.product-title {
    margin-top: 0;
}
.product-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}
.product-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.product-rating .stars {
    font-size: 1.5rem;
}
.product-rating .rating-value {
    font-size: 1.2rem;
}
.product-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}
.cta-button {
    text-align: center;
    font-size: 1.2rem;
    padding: 1em;
}

.product-info-table table {
    width: 100%;
    border-collapse: collapse;
}
.product-info-table th, .product-info-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.product-info-table th {
    width: 120px;
    color: var(--color-text-muted);
    font-weight: normal;
}

.product-description {
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
}
.product-description h2 {
    margin-bottom: 1.5rem;
}
.product-description p {
    max-width: 80ch; /* 読みやすい幅に制限 */
}

/* --- 8. ランキングページ --- */
.ranking-list {
    list-style: none;
}
.ranking-item {
    background-color: var(--color-surface);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.ranking-item:hover {
    border-color: var(--color-neon-secondary);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.1);
}
.ranking-link-wrapper {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1.5rem;
}
.ranking-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-neon-secondary);
    min-width: 50px;
    text-align: center;
}
.ranking-image img {
    width: 80px;
    height: 112px;
    object-fit: cover;
    border-radius: 4px;
}
.ranking-details {
    flex-grow: 1;
}
.ranking-title {
    font-family: var(--font-body);
    color: var(--color-text);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    text-shadow: none;
}
.ranking-author {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.ranking-details .card-rating {
    font-size: 0.9rem;
}
.ranking-details .rating-value {
    font-size: 0.9rem;
}
.ranking-score {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* --- 9. ページネーション & コントロールバー --- */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.per-page-selector select {
    background-color: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.3em 0.5em;
    cursor: pointer;
}
.pagination {
    margin-top: 3rem;
}
.pagination-list {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}
.pagination-link {
    display: block;
    padding: 0.5em 1em;
    min-width: 40px;
    text-align: center;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: all 0.2s ease;
}
.pagination-item a.pagination-link:hover {
    border-color: var(--color-neon-primary);
    color: #fff;
}
.pagination-item.active .pagination-link {
    background-color: var(--color-neon-primary);
    border-color: var(--color-neon-primary);
    color: var(--color-background);
    font-weight: bold;
    cursor: default;
}
.pagination-link.disabled {
    color: var(--color-text-muted);
    background-color: transparent;
    border-color: #444;
    cursor: not-allowed;
}
.pagination-item.page-selector select {
    background-color: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.5em 1em;
    font-size: 1rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 1em;
    padding-right: 2.5em; /* 矢印のスペース確保 */
}

/* --- 10. レスポンシブデザイン --- */

/* タブレット・スマートフォン (768px以下) */
@media (max-width: 768px) {
    /* ヘッダー */
    .site-header {
        height: auto;
    }
    .header-container {
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    .site-main {
        padding-top: 120px; /* ヘッダーの高さに応じて調整 */
    }
    .header-search {
        order: 3; /* ロゴとメニューボタンの下に配置 */
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    /* ヒーローセクション */
    .hero-title {
        font-size: 2.5rem;
    }
    .section-title {
        font-size: 1.8rem;
    }

    /* シングルページ */
    .single-product-page .product-main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .product-gallery img {
        width: 100%;
        height: auto;
    }
    .single-product-page .product-title {
        font-size: 1.75rem;
        line-height: 1.4;
    }
    .single-product-page .product-description {
        padding-top: 1.5rem;
    }
    .single-product-page .product-description h2 {
        font-size: 1.5rem;
    }
    .product-info-table table,
    .product-info-table tbody,
    .product-info-table tr,
    .product-info-table th,
    .product-info-table td {
        display: block;
        width: 100%;
    }
    .product-info-table tr {
        margin-bottom: 1.2rem;
        padding-bottom: 1.2rem;
        border-bottom: 1px solid var(--color-border);
    }
    .product-info-table tr:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .product-info-table th,
    .product-info-table td {
        border: none;
        padding: 2px 0;
        text-align: left;
    }
    .product-info-table th {
        width: auto;
        font-weight: bold;
        color: var(--color-text-muted);
    }
    .breadcrumbs {
        word-break: break-all;
    }
}

/* スマートフォン (480px以下) */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    .container {
        width: 92%;
    }
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .hero-title {
        font-size: 2rem;
    }
    .main-nav ul {
        gap: 1rem;
    }
    .main-nav a {
        font-size: 0.9rem;
    }

    /* シングルページ */
    .single-product-page .product-title {
        font-size: 1.5rem;
    }
    .product-cta-buttons .cta-button {
        padding: 0.8em 1em;
        font-size: 1rem;
    }
    .product-rating .stars {
        font-size: 1.3rem;
    }
    .product-rating .rating-value {
        font-size: 1rem;
    }
}