/* ============================================
   印刷スタイル（Print Styles）
   ============================================ */

/* 印刷時の基本設定 */
@media print {
    /* ページ設定 */
    @page {
        size: A4;
        margin: 2cm;
    }

    /* 印刷時のカラー調整（背景色を白に、テキストを黒に） */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* 不要な要素の非表示 */
    header,
    nav,
    footer,
    .skip-link,
    button,
    form,
    .scroll-indicator,
    .shop-box,
    .about-hero__ribbon,
    .about-divider,
    .breadcrumb,
    /* インタラクティブ要素 */
    a[href^="#"],
    a[href^="javascript:"],
    /* ローディング要素 */
    .loading-indicator,
    .spinner,
    .char-count,
    .help-text {
        display: none !important;
    }

    /* リンクのURLを表示 */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    /* 外部リンクとメールリンクのURLのみ表示 */
    a[href^="http"]:after,
    a[href^="mailto:"]:after {
        content: " (" attr(href) ")";
    }

    /* 内部リンクはURLを表示しない */
    a[href^="#"]:after,
    a[href^="/"]:after {
        content: "";
    }

    /* ページ区切りの設定 */
    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    h2,
    h3 {
        page-break-inside: avoid;
    }

    p,
    li {
        orphans: 3;
        widows: 3;
    }

    /* 画像の印刷最適化 */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* 長いコンテンツの改ページ制御 */
    article,
    section {
        page-break-inside: avoid;
    }

    table {
        page-break-inside: avoid;
    }

    /* コードブロックや引用の印刷 */
    pre,
    blockquote {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        padding: 1em;
    }

    /* 印刷時のフォントサイズ調整 */
    body {
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }

    h1 {
        font-size: 24pt !important;
        page-break-before: always;
        page-break-after: avoid;
    }

    h2 {
        font-size: 18pt !important;
        page-break-before: auto;
        page-break-after: avoid;
    }

    h3 {
        font-size: 14pt !important;
        page-break-before: auto;
        page-break-after: avoid;
    }

    /* 印刷時の余白調整 */
    main {
        padding: 0 !important;
        margin: 0 !important;
    }

    section {
        padding: 1em 0 !important;
        margin: 1em 0 !important;
    }

    /* カードやメッセージボックスの印刷 */
    .card,
    .message {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        padding: 1em !important;
        margin: 1em 0 !important;
        background: white !important;
    }

    /* アニメーションやトランジションを無効化 */
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    /* 印刷時の見出しスタイル */
    h1::after,
    h2::after {
        display: none !important;
    }

    /* 印刷時のリストスタイル */
    ul,
    ol {
        margin-left: 1.5em !important;
    }

    /* 印刷時の引用スタイル */
    blockquote {
        border-left: 4px solid #ccc !important;
        padding-left: 1em !important;
        margin: 1em 0 !important;
        font-style: italic;
    }

    /* 印刷時の表スタイル */
    table {
        border-collapse: collapse !important;
        width: 100% !important;
    }

    th,
    td {
        border: 1px solid #ccc !important;
        padding: 0.5em !important;
    }

    th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
    }
}

