.prose p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.prose h3 {
    margin-top: 0 !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
nav,
.nav-link,
.tsk {
    font-family: 'xants', sans-serif;
}

mux-player {
    /* Hide all controls at once */
    --controls: none;

    /* Hide the error dialog */
    --dialog: none;

    /* Hide the loading indicator */
    --loading-indicator: none;

    /* Target all sections by excluding the section prefix */
    --play-button: none;
    --live-button: none;
    --seek-backward-button: none;
    --seek-forward-button: none;
    --mute-button: none;
    --captions-button: none;
    --airplay-button: none;
    --pip-button: none;
    --fullscreen-button: none;
    --cast-button: none;
    --playback-rate-button: none;
    --volume-range: none;
    --time-range: none;
    --time-display: none;
}

/* 詳細ビュー用カスタムスタイル */
.blog-detail-hero-gradient {
    background: linear-gradient(135deg,
            rgba(139, 69, 19, 0.8) 0%,
            rgba(75, 85, 99, 0.7) 35%,
            rgba(99, 102, 241, 0.6) 70%,
            rgba(147, 51, 234, 0.8) 100%);
}

.blog-detail-content-card {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(248, 250, 252, 0.9) 100%);
    backdrop-filter: blur(20px);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.25),
        0 8px 32px -8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.blog-detail-floating-action {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

.blog-detail-text-shadow {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.blog-detail-glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 詳細ビューの静的背景 */
.blog-detail-animated-bg {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 50%, #C084FC 100%);
}

/* ローディングスピナー */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* プログレッシブエンハンスメント用のアニメーション */
.blog-modal-enter {
    animation: blogModalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.blog-modal-exit {
    animation: blogModalFadeOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes blogModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes blogModalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* レスポンシブデザイン改善 */
@media (max-width: 1024px) {
    .blog-detail-content-wrapper {
        width: 85%;
    }
}

@media (max-width: 768px) {
    .blog-detail-content-wrapper {
        width: 95%;
    }

    .blog-detail-hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }
}

@media (max-width: 640px) {
    .blog-detail-content-wrapper {
        width: 100%;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .blog-detail-hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .blog-detail-content-card {
        margin: -1rem 0.25rem 0;
        border-radius: 1.5rem;
    }

    .blog-detail-floating-action {
        animation: none;
        /* モバイルではアニメーションを無効化 */
    }
}

@media (max-width: 480px) {
    .blog-detail-content-wrapper {
        width: 100%;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .blog-detail-hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .blog-detail-content-card {
        margin: -0.75rem 0.125rem 0;
        border-radius: 1rem;
    }
}

/* 詳細ビュー内の画像を中央揃え・統一サイズに */
.prose img {
    margin: 1rem auto !important;
    display: block !important;
    width: 90% !important;
    max-width: 90% !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

@media (min-width: 640px) {
    .prose img {
        width: 80% !important;
        max-width: 80% !important;
        border-radius: 0.75rem !important;
        margin: 1.5rem auto !important;
    }
}

@media (min-width: 768px) {
    .prose img {
        width: 70% !important;
        max-width: 70% !important;
        margin: 2rem auto !important;
    }
}

/* スマホでの段落の調整 */
.prose p {
    margin-bottom: 1rem !important;
}

@media (max-width: 640px) {
    .prose p {
        margin-bottom: 0.75rem !important;
    }

    .prose h1, .prose h2, .prose h3 {
        margin-top: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }
}

/* ▼ 追加：ヒーロー動画（Mux iframe）のトリミング表示 */
.hero-frame-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 128px);
    overflow: hidden;
}

.hero-frame-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 120%;
    min-height: 120%;
    transform: translate(-50%, -50%);
    border: none;
    pointer-events: none;
    /* クリック不要なら付与 */
}

.hero-frame-wrapper video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 120%;
    min-height: 120%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

@media (max-width: 640px) {
    .hero-frame-wrapper iframe {
        min-width: 300%;
    }
    .hero-frame-wrapper video {
        min-width: 300%;
    }
}

/* Loading Screen Styles */
#loading-screen {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 25%, #C084FC 50%, #DDD6FE 75%, #8B5CF6 100%);
    background-size: 300% 300%;
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 100% 50%;
    }

    50% {
        background-position: 100% 100%;
    }

    75% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.loading-logo h1 {
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }

    to {
        text-shadow: 0 0 40px rgba(255, 255, 255, 0.8), 0 0 60px rgba(139, 92, 246, 0.7), 0 0 80px rgba(168, 85, 247, 0.5);
    }
}

.loading-bar-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 20px auto;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, #8B5CF6, #A855F7, #C084FC, #fff);
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
        transform: translateX(-100%);
    }

    50% {
        width: 100%;
        transform: translateX(0%);
    }

    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.spinner-ring {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top: 2px solid #8B5CF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.1s;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    opacity: 0.8;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* Fade out animation */
#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

/* iOS Performance Optimizations */
video {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.work-item video,
.rounded-2xl video {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: auto;
}

/* Reduce motion for iOS */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
