/*
Theme Name: FANZA紹介テーマ
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: FANZA作品を紹介するためのWordPressテーマ。ジャンル、女優、レーベル、シリーズ、メーカーのタグ付けに対応。無限スクロール＆絞り込み検索機能搭載。
Version: 4.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fanza-theme
*/

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
.site-header {
    background: var(--bg-primary);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--primary-color);
}

.site-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* Navigation */
.main-navigation {
    margin-top: 16px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.main-navigation a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-secondary);
}

.main-navigation a:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

/* Main Content */
.site-main {
    padding: 40px 0;
    min-height: 400px;
}

/* Single Post */
.single-post {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.entry-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.3;
}

.entry-meta {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

/* Main Image */
.main-image {
    margin-bottom: 32px;
    text-align: center;
}

.main-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Sample Video */
.sample-video {
    margin-bottom: 32px;
    width: 100%;
}

.sample-video h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.video-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
}

.video-container iframe,
.video-container video {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .video-container {
        aspect-ratio: 4 / 3;
    }
}

/* Image Gallery */
.image-gallery {
    margin-bottom: 32px;
}

.image-gallery h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

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

.gallery-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.gallery-grid img:hover {
    opacity: 0.95;
    transform: scale(1.02);
}

/* AV Details */
.av-details {
    margin-bottom: 32px;
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.av-details h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.av-details table {
    width: 100%;
    border-collapse: collapse;
}

.av-details th,
.av-details td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.av-details th {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    width: 180px;
    font-size: 14px;
}

.av-details td {
    background: var(--bg-primary);
}

.av-details tr:last-child th,
.av-details tr:last-child td {
    border-bottom: none;
}

/* Taxonomies */
.post-taxonomies {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.taxonomy-section {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.taxonomy-section strong {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 100px;
}

.taxonomy-section a {
    display: inline-block;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.taxonomy-section a:hover {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

/* Archive Page */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    margin-bottom: 40px;
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: var(--transition);
}

.page-numbers:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    cursor: default;
}

.page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}

.page-numbers.dots:hover {
    background: transparent;
    color: var(--text-primary);
}

.page-numbers.prev,
.page-numbers.next {
    font-weight: 600;
}

.post-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.post-card-content {
    padding: 20px;
}

.post-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-card-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--primary-color);
}

.post-card-excerpt {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.post-card-meta {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.post-card-no-image {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.no-posts p {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0;
}

/* Entry Content */
.entry-content {
    margin-top: 24px;
    line-height: 1.7;
}

.entry-content p {
    margin-bottom: 16px;
}

.entry-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

.entry-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.entry-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.entry-content a:hover {
    color: var(--primary-dark);
}

/* Purchase Button */
.purchase-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 12px 28px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    margin: 24px 0;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.purchase-button:hover {
    background: var(--primary-dark);
}

/* Red CTA Button */
.cta-button-red {
    display: inline-block;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 16px 40px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    margin: 24px 0;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    position: relative;
    overflow: hidden;
}

.cta-button-red:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
    color: #ffffff;
}

.cta-button-red:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}

/* Footer */
.site-footer {
    background: var(--text-primary);
    color: var(--text-light);
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-copyright {
    font-size: 14px;
    margin-bottom: 12px;
}

.footer-links {
    margin: 12px 0;
    font-size: 14px;
}

.footer-links span {
    margin: 0 8px;
    opacity: 0.5;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-notice {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 16px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Page Header */
.page-header {
    background: var(--bg-primary);
    padding: 40px 0;
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.page-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 16px 0;
    }

    .site-title {
        font-size: 24px;
    }

    .single-post {
        padding: 24px;
    }

    .entry-title {
        font-size: 26px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 6px;
    }

    .main-navigation a {
        display: block;
        text-align: center;
    }

    .av-details {
        padding: 16px;
    }

    .av-details th {
        width: 100px;
        font-size: 12px;
        padding: 10px;
    }

    .av-details td {
        font-size: 14px;
        padding: 10px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .gallery-grid img {
        height: 150px;
    }

    .page-header {
        padding: 32px 0;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 14px;
    }

    .taxonomy-section {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .taxonomy-section strong {
        min-width: auto;
        width: 100%;
        margin-bottom: 4px;
    }

    .video-container {
        max-width: 100%;
        padding-bottom: 56.25%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .entry-title {
        font-size: 22px;
    }

    .post-card-title {
        font-size: 16px;
    }

    .purchase-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .cta-button-red {
        padding: 14px 30px;
        font-size: 16px;
    }

    .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .main-navigation,
    .purchase-button,
    .filter-section {
        display: none;
    }

    body {
        background: white;
    }

    .single-post {
        box-shadow: none;
        padding: 0;
    }
}

/* ================================
   絞り込み検索フィルター
   ================================ */

.filter-section {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-toggle:hover {
    background: var(--primary-dark);
}

.filter-toggle.active {
    background: var(--primary-dark);
}

.filter-icon {
    font-size: 18px;
}

.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.filter-panel.active {
    max-height: 1000px;
    padding: 20px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.filter-reset-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-reset-btn:hover {
    background: var(--border-color);
}

.filter-keyword {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.filter-keyword label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.filter-keyword-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
}

.filter-keyword-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-keyword-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.filter-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 0;
}

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

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-result {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.filter-result p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ================================
   ローディングインジケータ
   ================================ */

.loading-indicator,
.filter-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 15px;
}

.loading-indicator p,
.filter-loading p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.end-message {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.end-message p {
    margin: 0;
}

/* ローディング中のグリッド */
.posts-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ================================
   レスポンシブ: フィルター
   ================================ */

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filter-panel.active {
        padding: 15px;
    }

    .filter-toggle {
        padding: 12px 15px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-reset-btn {
        width: 100%;
    }
}
