/**
 * 患者様用資料ダウンロード - スタイルシート
 * 医療クリニック向けシンプル・モノクロデザイン
 */

/* ========================================
   アーカイブページ全体
   ======================================== */
.pmd-archive-wrapper {
    width: 100%;
    padding: 40px 20px;
    background-color: #ffffff;
}

.pmd-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   コンテナ
   ======================================== */
.pmd-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   グリッドレイアウト
   ======================================== */
.pmd-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* ========================================
   カードデザイン
   ======================================== */
.pmd-card {
    background-color: #ffffff;
    border: 1px solid #DCDCDC;
    border-radius: 0;
    overflow: hidden;
    transition: none;
    display: flex;
    flex-direction: column;
}

.pmd-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pmd-card-link:hover,
.pmd-card-link:focus {
    text-decoration: none;
    color: inherit;
}

.pmd-no-file {
    cursor: default;
    opacity: 0.6;
}

/* ========================================
   サムネイル
   ======================================== */
.pmd-card-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f5f5f5;
}

.pmd-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ファイル形式バッジ */
.pmd-file-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #333333;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   カードコンテンツ
   ======================================== */
.pmd-card-content {
    padding: 20px;
    flex-grow: 1;
}

.pmd-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: visible;
    min-height: 51px;
}

/* ========================================
   ローディング
   ======================================== */
.pmd-loading {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.pmd-loading.active {
    display: block;
}

.pmd-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333333;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: pmd-spin 1s linear infinite;
}

@keyframes pmd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pmd-loading p {
    font-size: 14px;
    color: #666666;
    margin: 0;
}

/* ========================================
   すべて表示メッセージ
   ======================================== */
.pmd-no-more {
    text-align: center;
    padding: 30px 20px;
    color: #999999;
    font-size: 14px;
    display: none;
}

.pmd-no-more.active {
    display: block;
}

.pmd-no-more p {
    margin: 0;
}

/* ========================================
   資料なしメッセージ
   ======================================== */
.pmd-no-materials {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666666;
    font-size: 16px;
}

.pmd-no-materials p {
    margin: 0;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */

/* タブレット（768px以下） */
@media screen and (max-width: 768px) {
    .pmd-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* スマートフォン（600px以下） */
@media screen and (max-width: 600px) {
    .pmd-archive-wrapper {
        padding: 30px 15px;
    }
    
    .pmd-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pmd-card-content {
        padding: 15px;
    }
    
    .pmd-card-title {
        font-size: 15px;
        min-height: 48px;
    }
    
    .pmd-file-badge {
        font-size: 11px;
        padding: 4px 8px;
        top: 8px;
        right: 8px;
    }
}

/* 極小デバイス（360px以下） */
@media screen and (max-width: 360px) {
    .pmd-archive-wrapper {
        padding: 20px 10px;
    }
    
    .pmd-card-title {
        font-size: 14px;
    }
}

/* ========================================
   印刷対応
   ======================================== */
@media print {
    .pmd-loading,
    .pmd-no-more {
        display: none !important;
    }
    
    .pmd-card {
        break-inside: avoid;
    }
}

/* ========================================
   アクセシビリティ
   ======================================== */
.pmd-card-link:focus {
    outline: 2px solid #333333;
    outline-offset: 2px;
}

/* ハイコントラストモード対応 */
@media (prefers-contrast: high) {
    .pmd-card {
        border: 2px solid #000000;
    }
}

/* ダークモード（医療サイトでは通常不使用だが、念のため定義） */
@media (prefers-color-scheme: dark) {
    .pmd-archive-wrapper {
        background-color: #ffffff;
    }
    
    .pmd-card {
        background-color: #ffffff;
    }
    
    .pmd-card-title {
        color: #333333;
    }
}
