/* ==================================================================
   資料ダウンロード ポップアップ（共通スタイル）  2026-09-17
   ------------------------------------------------------------------
   contact.html / entry.html など、js/doc-download.js を読み込むページ用。
   index.html は同じスタイルをページ内 <style> に直書きしており、この
   ファイルは読み込んでいない。見た目を変えるときは両方を揃えること。
   ヘッダーの「資料のダウンロード」ボタン自体の配色は css/styles_v2.css
   （.header-cta .doc-dl-btn）に定義済み。
   ================================================================== */

/* --------------------------------------------------------------
   ページ内の「資料のダウンロード」ボタン／リンク
   （js/doc-download.js がフッター「お問い合わせ」列に差し込む。
     index.html と同じ見た目）
   -------------------------------------------------------------- */
/* PCの他リンクはインライン。行の高さを揃えるため inline-block にする */
.footer-links-v2 .doc-dl-link {
    display: inline-block;
    vertical-align: baseline;
    padding: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: calc(14px + var(--fs-bump));
    line-height: inherit;
    text-align: left;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-links-v2 .doc-dl-link:hover,
.footer-links-v2 .doc-dl-link:focus-visible {
    color: var(--accent-gold, #D4AF37);
    padding-left: 5px;
}

@media (max-width: 768px) {
    .footer-links-v2 .doc-dl-link {
        display: block;
        font-size: calc(12px + var(--fs-bump));
        padding: 3px 0;
    }

    .footer-links-v2 .doc-dl-link:hover,
    .footer-links-v2 .doc-dl-link:focus-visible {
        padding: 3px 0 3px 5px;
    }
}

/* --------------------------------------------------------------
   資料選択ポップアップ
   -------------------------------------------------------------- */
.doc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.doc-modal-overlay.active {
    display: flex;
}

.doc-modal {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.doc-modal-header {
    background: linear-gradient(135deg, var(--primary-red-dark, #6B0F0F) 0%, var(--primary-red, #8B1A1A) 100%);
    padding: 18px 56px;
    text-align: center;
}

.doc-modal-title {
    margin: 0;
    color: #fff;
    font-size: calc(18px + var(--fs-bump));
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.5;
    font-family: 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', serif;
}

.doc-modal-sub {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: calc(12px + var(--fs-bump));
    letter-spacing: 0.05em;
}

.doc-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    cursor: pointer;
    font-size: calc(24px + var(--fs-bump));
    line-height: 1;
    color: var(--primary-red, #8B1A1A);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.doc-modal-close:hover {
    background: #fff;
    transform: scale(1.08);
}

.doc-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #E8E5E0);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: all 0.25s ease;
}

.doc-item:hover,
.doc-item:focus-visible {
    border-color: var(--primary-red, #8B1A1A);
    background: var(--bg-cream, #FAF8F5);
    box-shadow: 0 4px 14px rgba(139, 26, 26, 0.12);
    transform: translateY(-1px);
}

.doc-item-ico {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: var(--bg-cream, #FAF8F5);
    border: 1px solid var(--border-color, #E8E5E0);
    color: var(--primary-red, #8B1A1A);
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-item-body {
    flex: 1;
    min-width: 0;
}

.doc-item-title {
    display: block;
    font-size: calc(15px + var(--fs-bump));
    font-weight: 700;
    color: var(--text-dark, #1a1a1a);
    line-height: 1.5;
}

.doc-item-desc {
    display: block;
    margin-top: 2px;
    font-size: calc(12px + var(--fs-bump));
    color: var(--text-light, #666);
    line-height: 1.6;
}

.doc-item-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-item-size {
    font-size: calc(11px + var(--fs-bump));
    color: var(--text-light, #666);
    white-space: nowrap;
}

.doc-item-arrow {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-red, #8B1A1A);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease;
}

.doc-item:hover .doc-item-arrow {
    background: var(--primary-red-dark, #6B0F0F);
}

/* --- 資料の複数選択（チェックボックス） --- */
.doc-select-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #E8E5E0);
}

.doc-selectall {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: calc(13px + var(--fs-bump));
    font-weight: 700;
    color: var(--text-dark, #1a1a1a);
    line-height: 1.4;
    cursor: pointer;
}

.doc-select-count {
    font-size: calc(12px + var(--fs-bump));
    color: var(--text-light, #666);
    white-space: nowrap;
}

.doc-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--primary-red, #8B1A1A);
    cursor: pointer;
}

/* リストの項目は a（直リンク）→ label（チェックボックス）に変更 */
.doc-item {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.doc-item.is-checked {
    border-color: var(--primary-red, #8B1A1A);
    background: var(--bg-cream, #FAF8F5);
}

.doc-item:focus-within {
    border-color: var(--primary-red, #8B1A1A);
    box-shadow: 0 0 0 2px rgba(139, 26, 26, 0.18);
}

/* --- ダウンロード実行ボタン --- */
.doc-actions {
    margin-top: 18px;
}

.doc-dl-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--primary-red, #8B1A1A);
    border-radius: 8px;
    background: var(--primary-red, #8B1A1A);
    color: #fff;
    font-family: inherit;
    font-size: calc(15px + var(--fs-bump));
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.doc-dl-submit:hover:not(:disabled),
.doc-dl-submit:focus-visible:not(:disabled) {
    background: #fff;
    color: var(--primary-red, #8B1A1A);
    box-shadow: 0 4px 14px rgba(139, 26, 26, 0.18);
}

.doc-dl-submit:disabled {
    background: #EFECE7;
    border-color: var(--border-color, #E8E5E0);
    color: #9a958e;
    cursor: default;
}

.doc-dl-submit.is-busy {
    cursor: progress;
}

.doc-dl-spinner {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: docDlSpin 0.7s linear infinite;
}

@keyframes docDlSpin {
    to {
        transform: rotate(360deg);
    }
}

.doc-dl-hint {
    margin: 8px 0 0;
    text-align: center;
    font-size: calc(12px + var(--fs-bump));
    color: var(--text-light, #666);
    line-height: 1.7;
}

.doc-dl-hint.is-error {
    color: var(--primary-red, #8B1A1A);
}

.doc-modal-note {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border-color, #E8E5E0);
    font-size: calc(11px + var(--fs-bump));
    color: var(--text-light, #666);
    line-height: 1.8;
}

@media (max-width: 768px) {
    .doc-modal-header {
        padding: 16px 50px;
    }

    .doc-modal-title {
        font-size: calc(16px + var(--fs-bump));
    }

    .doc-modal-body {
        padding: 16px;
    }

    .doc-item {
        gap: 10px;
        padding: 12px;
    }

    .doc-item-ico {
        width: 36px;
        height: 36px;
    }

    .doc-item-title {
        font-size: calc(14px + var(--fs-bump));
    }

    .doc-item-desc {
        font-size: calc(11px + var(--fs-bump));
    }

    .doc-item-meta {
        flex-direction: column;
        gap: 4px;
    }

    .doc-item-size {
        font-size: calc(10px + var(--fs-bump));
    }

    .doc-check {
        width: 20px;
        height: 20px;
    }

    .doc-selectall {
        font-size: calc(12px + var(--fs-bump));
    }

    .doc-select-count {
        font-size: calc(11px + var(--fs-bump));
    }

    .doc-dl-submit {
        padding: 14px 16px;
        font-size: calc(14px + var(--fs-bump));
    }
}
