/* =========================================================================
   写真集ベストセラーサイト - ダークテーマ
   （参照元 comic260731 のスタイルを写真集向けに改修:
     - 表紙が横長（3:2）のため aspect-ratio を変更
     - エピソード/ビューア/ジャンル系スタイルを削除
     - 評価★・価格・Amazon斡旋CTA・隣接ナビを追加）
   ========================================================================= */

:root {
    --bg:            #0f1115;
    --bg-elevated:   #1a1f2e;
    --bg-card:       #1e2433;
    --border:        #2a3142;
    --text:          #e5e7eb;
    --text-muted:    #9ca3af;
    --text-dim:      #6b7280;
    --accent:        #4a9eff;
    --accent-hover:  #6db5ff;
    --accent-gold:   #fbbf24;
    --accent-silver: #cbd5e1;
    --accent-bronze: #d97706;
    --amazon:        #ff9900;
    --amazon-dark:   #e88b00;
    --danger:        #ef4444;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover:  0 8px 30px rgba(74, 158, 255, 0.2);
    --transition:    0.2s ease;
}

/* ----------------------------- Reset / Base ----------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
                 "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

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

/* ----------------------------- Header ----------------------------- */
.site-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header__logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
}
.site-header__logo:hover { color: var(--accent); }

/* ----------------------------- Container ----------------------------- */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px;
    flex: 1;
}

/* ----------------------------- Footer ----------------------------- */
.site-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    margin-top: auto;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer__inner p { margin: 4px 0; }

.site-footer__note {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* ----------------------------- Buttons ----------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn--lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn--block {
    display: flex;
    width: 100%;
}

/* ----------------------------- Page Title / Breadcrumb ----------------------------- */
.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { color: var(--text-dim); }
.breadcrumb__current { color: var(--text); }

/* ----------------------------- Gallery Header (index) ----------------------------- */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-header h1 {
    font-size: 1.75rem;
}

.gallery-header__meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* ----------------------------- Photo Card ----------------------------- */
.photo-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition),
                border-color var(--transition);
}
.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.photo-card__link {
    display: block;
    color: inherit;
}

/* 表紙は縦長（書籍カバー本来のアスペクト比） */
.photo-card__cover {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--bg-elevated);
}
.photo-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.photo-card:hover .photo-card__cover img {
    transform: scale(1.05);
}

.photo-card__body {
    padding: 12px 14px 16px;
}
.photo-card__title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    /* 2行で省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.photo-card__author {
    font-size: 0.8rem;
    color: var(--text-muted);
    /* 1行で省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----------------------------- Photo Detail (photo.php) ----------------------------- */
.photo-detail {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 28px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* 表紙は縦長（書籍カバー本来のアスペクト比） */
.photo-detail__cover {
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    align-self: start;
}
.photo-detail__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-detail__info h1 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 10px;
}
.photo-detail__author {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 16px;
}

.photo-detail__stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.stat {
    display: flex;
    flex-direction: column;
}
.stat__label {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 2px;
}
.stat__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}
.stat__value--sm {
    font-size: 0.95rem;
    color: var(--accent-gold);
}

/* ----------------------------- 今すぐ読むCTA ----------------------------- */
.read-cta-box {
    margin-top: 24px;
    padding: 24px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    text-align: center;
}

.read-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 64px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #7c6dff);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(74, 158, 255, 0.3);
    transition: transform var(--transition), box-shadow var(--transition),
                filter var(--transition);
}
.read-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(74, 158, 255, 0.4);
    filter: brightness(1.1);
    color: #fff;
}
.read-cta__icon {
    font-size: 1.3rem;
}
.read-cta__main {
    font-size: 1.2rem;
    letter-spacing: 0.06em;
}

.read-cta__note {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ----------------------------- Section Heading ----------------------------- */
.section-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-heading__count {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ----------------------------- ECサイトリンクエリア ----------------------------- */
.ec-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.ec-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 22px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all var(--transition);
}
.ec-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    color: var(--text);
}

.ec-link__name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.ec-link__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 電子書籍容量バッジ */
.ec-link__size {
    margin-top: 6px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent);
}

/* ブランドカラー（上辺アクセント + ホバー時の枠） */
.ec-link--amazon { border-bottom: 4px solid var(--amazon); }
.ec-link--amazon:hover { border-color: var(--amazon); }
.ec-link--rakuten { border-bottom: 4px solid #bf0000; }
.ec-link--rakuten:hover { border-color: #bf0000; }
.ec-link--yahoo { border-bottom: 4px solid #d91522; }
.ec-link--yahoo:hover { border-color: #d91522; }

/* ----------------------------- 404 ----------------------------- */
.not-found {
    text-align: center;
    padding: 80px 20px;
}
.not-found__title {
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 12px;
}
.not-found__msg {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

/* ----------------------------- Utility ----------------------------- */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 768px) {
    .photo-detail {
        grid-template-columns: 1fr;
    }
    .photo-detail__cover {
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }
    .photo-detail__stats {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .container { padding: 16px 12px; }
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .photo-card__body { padding: 8px 10px 12px; }
    .photo-card__title { font-size: 0.82rem; }
    .gallery-header h1 { font-size: 1.3rem; }
    .read-cta { padding: 16px 40px; }
    .read-cta__main { font-size: 1.05rem; }
}

/* Reduced motion 対応 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
