/* ================================================================
   css/detail.css — コミック詳細ページ専用スタイル v6
================================================================ */

/* ─── パンくず ─── */
.dtl-breadcrumb {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.dtl-breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.dtl-breadcrumb a:hover { color: var(--primary); }
.dtl-sep        { opacity: .4; font-size: .8rem; }
.dtl-bc-current {
    color: var(--ink);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60vw;
}

/* ─── メインカード ─── */
.dtl-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    background: var(--white);
    border: 1.5px solid var(--rule);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    margin-bottom: 24px;
}

/* ─── 書影列 ─── */
.dtl-cover-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.dtl-cover-wrap {
    width: 100px;
    height: 140px;
    overflow: hidden;
    border-radius: 5px;
    border: 1px solid var(--rule);
    background: #f0ece0;
    box-shadow: 2px 3px 8px rgba(0,0,0,.12);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dtl-cover-img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.dtl-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}
.dtl-no-img i { font-size: 1.4rem; opacity: .3; }

/* Amazon購入ボタン（アイコン + "Amazon" のみ・はみ出し防止） */
.dtl-btn-amazon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    max-width: 100px;
    padding: 5px 6px;
    background: #ff9900;
    color: #111;
    border-radius: 4px;
    font-weight: 700;
    font-size: .72rem;
    text-decoration: none;
    text-align: center;
    transition: background .15s;
    white-space: nowrap;
    overflow: hidden;
}
.dtl-btn-amazon:hover { background: #e68a00; color: #111; }
.dtl-btn-amazon i     { font-size: .8rem; flex-shrink: 0; }

/* ─── 書誌情報列 ─── */
.dtl-info-col { display: flex; flex-direction: column; min-width: 0; }

.dtl-title {
    font-family: 'Noto Serif JP', serif;
    font-size: clamp(1rem, 2.6vw, 1.6rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rule);
}

.dtl-catch {
    font-family: 'Noto Serif JP', serif;
    font-size: .92rem;
    font-weight: 700;
    color: var(--primary);
    margin: -4px 0 10px;
    line-height: 1.5;
}
.dtl-description {
    font-size: .84rem;
    color: var(--ink);
    line-height: 1.7;
    margin: 0 0 14px;
    white-space: normal;
}

/* 書誌テーブル */
.dtl-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
    font-size: .9rem;
}
.dtl-table tr { border-bottom: 1px solid #f0ece0; }
.dtl-table tr:last-child { border-bottom: none; }
.dtl-table th {
    width: 90px;
    padding: 8px 8px 8px 0;
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .04em;
    vertical-align: middle;
    white-space: nowrap;
}
.dtl-table th i { margin-right: 3px; }
.dtl-table td {
    padding: 8px 0;
    color: var(--ink);
    line-height: 1.5;
    vertical-align: middle;
}
.dtl-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}
.dtl-link:hover { text-decoration: underline; }

/* 設置場所リンク（マップへスクロール） */
.dtl-location-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity .15s;
}
.dtl-location-link:hover { opacity: .75; }
.dtl-location-link i {
    font-size: .85rem;
    animation: bounce-hint 1.8s ease-in-out infinite;
}
@keyframes bounce-hint {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(3px); }
}

/* ─── 巻数グリッド ─── */
.dtl-volumes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0;
}
.dtl-vol-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f4ff;
    border: 1.5px solid #c5d5f5;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink);
    transition: background .15s;
}
.dtl-vol-chip.rented {
    background: #fff3cd;
    border-color: #ffc107;
    color: #7a5c00;
}
.dtl-vol-chip.avail {
    background: #e6f9ee;
    border-color: #5cb85c;
    color: #1a6b2e;
    font-weight: 900;
}
.dtl-vol-chip.unavail {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
    opacity: .7;
}
/* 貸出状況 説明行 */
.dtl-vol-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: 6px;
    align-items: center;
}
.dtl-vol-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.dtl-vol-legend-dot {
    width: 10px; height: 10px;
    border-radius: 3px;
    border: 1.5px solid;
    display: inline-block;
    flex-shrink: 0;
}
.dtl-vol-legend-dot.avail   { background:#e6f9ee; border-color:#5cb85c; }
.dtl-vol-legend-dot.rented  { background:#fff3cd; border-color:#ffc107; }
.dtl-vol-legend-dot.unavail { background:#f5f5f5; border-color:#ddd; }
.dtl-vol-note {
    font-size: .74rem;
    color: var(--muted);
    margin: 4px 0 8px;
    line-height: 1.5;
}
.dtl-vol-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}
.dtl-vol-link:hover { text-decoration: underline; }
.dtl-vol-badge {
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}
.rented-badge  { background: #ff9900; color: #111; }
.unavail-badge { background: #adb5bd; color: #fff; }

/* ─── アクションボタン ─── */
.dtl-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.dtl-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--white);
    color: var(--ink);
    border: 1.5px solid var(--rule);
    border-radius: 6px;
    font-weight: 700;
    font-size: .86rem;
    text-decoration: none;
    transition: border-color .15s;
}
.dtl-btn-back:hover { border-color: var(--muted); color: var(--ink); }

/* ─── 館内マップセクション ─── */
.dtl-map-section {
    background: var(--white);
    border: 1.5px solid var(--rule);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    scroll-margin-top: 80px;   /* sticky headerぶんのオフセット */
}
.dtl-map-title {
    font-size: .95rem;
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rule);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dtl-map-title i { color: var(--primary); }
.dtl-map-shelf-badge {
    font-size: .72rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 9px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ─── マップ外枠（スマホ横スクロール対応） ─── */
.dtl-map-outer {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1.5px solid var(--rule);
    border-radius: 8px;
    background: #f8f4ed;
    margin-bottom: 10px;
}

/* ─── マップラッパー（相対配置の親） ─── */
.dtl-map-wrap {
    position: relative;
    display: block;
    min-width: 320px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    line-height: 0;
}
.dtl-map-img {
    display: block;
    width: 100%;
    height: auto;       /* object-fit なし → %ピンが正確に配置される */
}

/* ─── Googleマップ風ピン ─── */
/*
 * ピンの「先端（下部）」が指定座標を指すよう、
 * translateX(-50%) で水平中央、translateY(-100%) で上に移動
 * → ピンの一番下の点が left/top の座標に来る
 */
.dtl-map-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    pointer-events: none;
    z-index: 10;
    /* 上下にふわふわアニメーション */
    animation: pin-bounce 1.4s ease-in-out infinite;
}
@keyframes pin-bounce {
    0%, 100% { transform: translate(-50%, -100%); }
    50%       { transform: translate(-50%, calc(-100% - 8px)); }
}

/* SVGのサイズ：見やすい大きさに */
.dtl-pin-svg {
    width: 36px;
    height: 50px;
    display: block;
    /* ドロップシャドウで立体感 */
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
}

/* ─── マップキャプション ─── */
.dtl-map-caption {
    font-size: .8rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.dtl-map-caption i { color: var(--primary); }

.dtl-map-no-image {
    text-align: center;
    color: var(--muted);
    padding: 24px;
    font-size: .88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ─── レスポンシブ ─── */
@media (max-width: 480px) {
    .dtl-card {
        grid-template-columns: 80px 1fr;
        padding: 14px 14px;
        gap: 12px;
    }
    .dtl-cover-wrap {
        width: 72px;
        height: 101px;
    }
    .dtl-btn-amazon { max-width: 72px; font-size: .65rem; }
    .dtl-table th   { width: 76px; font-size: .68rem; }
    .dtl-title      { font-size: .95rem; }
    .dtl-pin-svg    { width: 28px; height: 40px; }
}
