/* Custom CSS for PME Documentation */

/* Language switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.language-switcher a {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
}

.language-switcher a.active {
    background: #0d82d0;
    color: white;
}

.language-switcher a:not(.active) {
    background: #f5f5f5;
    color: #333;
}

.language-switcher a:hover {
    background: #e0e0e0;
}

/* Dark mode support */
[data-theme="dark"] .language-switcher {
    background: rgba(30, 30, 30, 0.9);
    border-color: #555;
}

[data-theme="dark"] .language-switcher a:not(.active) {
    background: #333;
    color: #ccc;
}

[data-theme="dark"] .language-switcher a:hover {
    background: #444;
}

/* Feature card styling for sphinx-design */
.feature-card {
    transition: all 0.3s ease;
    border: 1px solid var(--color-card-border);
    background: var(--color-card-background);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--color-brand-primary);
}

.feature-card .card-header {
    background: var(--color-brand-primary);
    color: white;
    font-weight: bold;
}

.feature-card .card-body {
    padding: 1.5rem;
}

.feature-card img {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.feature-card img:hover {
    transform: scale(1.05);
}

.sd-card.feature-card-compact {
    height: 100%;
}

.sd-card.feature-card-compact .card-body {
    padding: 1rem 1.1rem;
}

.sd-card.feature-card-compact .sd-card-title {
    font-size: 1rem;
    line-height: 1.35;
}

.sd-card.feature-card-compact img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.sd-card.feature-card-compact p:last-child {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Grid adjustments for better responsive behavior */
.sd-container-fluid .sd-row {
    --sd-gutter-x: 1.5rem;
    --sd-gutter-y: 1.5rem;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    max-width: 100%;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- card-carousel 用カスタムサイズ調整 --------------- */
.sd-card-carousel {
    --sd-gap: 1.5rem;
    /* カード間隔 */
}

.sd-card-carousel .sd-card {
    flex: 0 0 clamp(400px, 60vw, 600px);
    /* カード幅。GIF画像を大きく表示するため調整 */
    scroll-snap-align: start;
}

/* モバイル用の調整 */
@media (max-width: 768px) {
    .sd-card-carousel .sd-card {
        flex: 0 0 clamp(280px, 80vw, 320px);
        /* モバイルでは画面幅の80%まで使用 */
    }

    .sd-card-carousel {
        --sd-gap: 1rem;
        /* モバイルでは間隔を少し狭く */
    }
}

/* --- 解説用 色付きカード ------------------------------------------------- */
.ex-card {
    position: relative;
    border: 1px solid var(--ex-card-border, #d0d7de);
    border-radius: 8px;
    background: var(--ex-card-bg, var(--color-card-background));
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.ex-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    /* アクセントバー */
    background: var(--ex-card-accent, transparent);
    border-radius: 8px 8px 0 0;
}

/* バリアント（色） */
.ex-card--keymap {
    --ex-card-accent: #3b82f6;
    /* blue-500 */
    --ex-card-border: rgba(59, 130, 246, .55);
}

.ex-card--hotkey {
    --ex-card-accent: #10b981;
    /* emerald-500 */
    --ex-card-border: rgba(16, 185, 129, .55);
}

.ex-card--modifier {
    --ex-card-accent: #f59e0b;
    /* amber-500 */
    --ex-card-border: rgba(245, 158, 11, .55);
}

/* ダークテーマ調整 */
[data-theme="dark"] .ex-card {
    --ex-card-bg: var(--color-card-background, #1e1e1e);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.support-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border: 1px solid var(--color-brand-primary);
    border-radius: 999px;
    color: var(--color-brand-primary);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.support-button:hover,
.support-button:focus-visible {
    background: color-mix(in srgb, var(--color-brand-primary) 10%, transparent);
    text-decoration: none;
}

.support-button-primary {
    background: var(--color-brand-primary);
    color: var(--color-background-primary);
}

.support-button-primary:hover,
.support-button-primary:focus-visible {
    background: var(--color-brand-content);
    border-color: var(--color-brand-content);
    color: var(--color-background-primary);
}
