/**
 * Arkhe Blogcard Auto Converter
 * ブログカードスタイル - Arkheテーマ準拠
 */

/* ブログカード基本スタイル */
.ark-block-blogCard {
    margin: 2em 0;
}

.arkb-boxLink {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #fff;
    text-decoration: none;
}

.arkb-boxLink:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

/* Inner Container */
.arkb-boxLink__inner {
    display: flex;
    align-items: stretch;
    min-height: 120px;
}

/* サムネイル画像 */
.arkb-boxLink__figure {
    flex: 0 0 180px;
    margin: 0;
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.arkb-boxLink__figure.is-fixed-ratio {
    aspect-ratio: 16 / 9;
}

.arkb-boxLink__img {
    width: 100%;
    height: 100%;
    display: block;
}

.arkb-boxLink__img.arkb-obf-cover {
    object-fit: cover;
    object-position: center;
}

/* lazyload対応 */
.arkb-boxLink__img.lazyloaded {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Body */
.arkb-boxLink__body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    gap: 8px;
}

/* タイトル */
.arkb-boxLink__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #1f2937;
    text-decoration: none;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.arkb-boxLink:hover .arkb-boxLink__title {
    color: #2563eb;
}

/* 抜粋 */
.arkb-boxLink__content {
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* More (サイト名表示) */
.arkb-boxLink__more {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: auto;
}

.arkb-boxLink__more__favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 2px;
}

.arkb-boxLink__more__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 外部リンクアイコン */
.arkb-boxLink__inner[data-type="external"] .arkb-boxLink__title::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"/></svg>');
    background-size: contain;
    opacity: 0.4;
    vertical-align: middle;
}

/* レスポンシブ: PC表示設定 */
@media (min-width: 769px) {
    .arkb-boxLink__content.arkb-only-sp {
        display: none;
    }
    
    .arkb-boxLink__content.arkb-only-pc {
        display: -webkit-box;
    }
}

/* レスポンシブ: スマホ表示 */
@media (max-width: 768px) {
    .arkb-boxLink__inner {
        flex-direction: column;
        min-height: auto;
    }
    
    .arkb-boxLink__figure {
        flex: 0 0 auto;
        width: 100%;
        max-height: 180px;
    }
    
    .arkb-boxLink__body {
        padding: 12px;
    }
    
    .arkb-boxLink__title {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }
    
    .arkb-boxLink__content {
        font-size: 12px;
    }
    
    .arkb-boxLink__content.arkb-only-pc {
        display: none;
    }
    
    .arkb-boxLink__content.arkb-only-sp {
        display: -webkit-box;
    }
}

/* 画像なしの場合 */
.arkb-boxLink__inner:not(:has(.arkb-boxLink__figure)) .arkb-boxLink__body {
    padding: 20px;
}

/* フォーカス状態（アクセシビリティ） */
.arkb-boxLink:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .arkb-boxLink {
        background: #1f2937;
        border-color: #374151;
    }
    
    .arkb-boxLink:hover {
        border-color: #4b5563;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .arkb-boxLink__figure {
        background: #111827;
    }
    
    .arkb-boxLink__title {
        color: #f9fafb;
    }
    
    .arkb-boxLink:hover .arkb-boxLink__title {
        color: #60a5fa;
    }
    
    .arkb-boxLink__content {
        color: #9ca3af;
    }
    
    .arkb-boxLink__more {
        color: #6b7280;
    }
}

/* 印刷用スタイル */
@media print {
    .arkb-boxLink {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .arkb-boxLink:hover {
        transform: none;
        box-shadow: none;
    }
    
    .arkb-boxLink__title {
        color: #000 !important;
    }
    
    .arkb-boxLink__inner[data-type="external"] .arkb-boxLink__title::after {
        content: " ↗";
        background: none;
    }
}

/* RTL言語対応 */
[dir="rtl"] .arkb-boxLink__inner {
    direction: rtl;
}

[dir="rtl"] .arkb-boxLink__figure {
    order: 2;
}

[dir="rtl"] .arkb-boxLink__body {
    order: 1;
}

/* 高コントラストモード */
@media (prefers-contrast: high) {
    .arkb-boxLink {
        border-width: 2px;
    }
    
    .arkb-boxLink__title {
        font-weight: 700;
    }
}

/* アニメーション無効化設定 */
@media (prefers-reduced-motion: reduce) {
    .arkb-boxLink,
    .arkb-boxLink__img {
        transition: none;
        animation: none;
    }
}

