/**
 * Kento Works - 案例展示样式
 * 
 * @package Kento_Works
 * @version 1.0.0
 */

/* Kento Works Archive Page */
.kento-page-header {
    padding: 100px 0;
    background-image: url(../img/hp-works-bg.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.archive .kento-page-header {
    margin-top: 80px;
}

.kento-page-header .headline {
    font-family: "Noto Sans JP", sans-serif !important;
    font-size: 2rem !important;
    line-height: 1.2;
}

.kento-filter-section {
    width: 90%;
    max-width: 2000px;
    margin: 0 auto;
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.kento-filter-title {
    font-family: "Noto Sans JP", sans-serif;
    font-size: .875rem;
    font-weight: 500;
    color: #9c9c9d;
    min-width: 100px;
}

#kento_works_category_filter,
#kento_works_media_filter {
    width: 100%;
}

.kento-page-header-inner {
    width: 90%;
    max-width: 2000px;
    margin: 0 auto;
    text-align: center;
}

#kento_works_category_filter ul,
#kento_works_media_filter ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

#kento_works_category_filter ul li,
#kento_works_media_filter ul li {
    padding: 8px 16px;
    border-radius: 999px;
    background: #f4f6f7;
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    cursor: pointer;
}

#kento_works_category_filter ul li a,
#kento_works_media_filter ul li a {
    color: #6e6e73;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

#kento_works_category_filter ul li:hover,
#kento_works_category_filter ul li.active,
#kento_works_media_filter ul li:hover,
#kento_works_media_filter ul li.active {
    background: #1d1d1f;
    border-color: #1d1d1f;
}

#kento_works_category_filter ul li:hover a,
#kento_works_category_filter ul li.active a,
#kento_works_media_filter ul li:hover a,
#kento_works_media_filter ul li.active a {
    color: #ffffff;
}

#kento_works_archive {
    width: 90%;
    max-width: 2000px;
    margin: 0 auto;
}

#kento_works_list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

.kento-works-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.kento-works-media-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: .5rem;
    margin-bottom: 1rem;
}

.kento-works-image-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.kento-works-image {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.kento-works-image-link:hover .kento-works-image {
    transform: scale(1.05);
}

.kento-works-video {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.kento-works-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f0f0f0; /* 添加背景色，避免灰色显示 */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    pointer-events: none;
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.7);
}

.play-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    pointer-events: none;
}

.play-button:hover {
    transform: scale(1.1);
    background: #ffffff;
}

/* YouTube视频样式 */
.kento-works-youtube {
    cursor: pointer;
}

.youtube-thumbnail,
.video-thumbnail {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #000;
}

.youtube-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.kento-works-youtube:hover .youtube-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.youtube-play-button {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.youtube-play-button:hover {
    transform: scale(1.1);
}

.youtube-play-button svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.kento-works-info {
    padding: 0;
}

.kento-works-title {
    font-family: "Noto Sans JP", sans-serif !important;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0 !important;
    line-height: 1.3;
    color: #1d1d1f;
}

.kento-works-category {
    margin-bottom: 0;
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    display: inline-block;
    padding-right: 8px;
    border-right: 1px solid #eaeaea;
    font-size: 0.75rem;
    color: #6e6e73;
}

.kento-works-more-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #1d1d1f;
    color: #ffffff;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.kento-works-more-btn:hover {
    background: #6e6e73;
    color: #ffffff;
}

/* 全屏视频播放器 */
.kento-works-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kento-works-video-modal.active {
    display: flex;
    opacity: 1;
}

.kento-works-video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
}

.kento-works-video-modal video,
.kento-works-video-modal iframe {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-container,
.youtube-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.youtube-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 1rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
}

.kento-works-video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.kento-works-video-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.kento-works-video-modal-close::before,
.kento-works-video-modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #ffffff;
    transform: rotate(45deg);
}

.kento-works-video-modal-close::after {
    transform: rotate(-45deg);
}

.kento-works-pagination {
    text-align: center;
}

.kento-works-pagination .page-numbers {
    display: flex;
    margin-bottom: 4rem;
    color: #1d1d1f;
}

.kento-works-pagination .page-numbers li {
    padding: 6px 12px;
    background: #f4f6f7;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.kento-works-pagination .page-numbers.current,
.kento-works-pagination .page-numbers:hover,
.kento-works-pagination .page-numbers:hover a {
    background: #1d1d1f;
    color: #ffffff;
}

.no-kento-works {
    text-align: center;
    padding: 80px 0;
    color: #6e6e73;
    font-size: 1.125rem;
}

/* Kento Works Single Page */
.kento-main-contents {
    width: 90%;
    max-width: 880px;
    margin: 0 auto;
}

.kento-works-media-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.kento-works-video-container,
.kento-works-image-container {
    width: 100%;
    border-radius: .5rem;
    overflow: hidden;
}

.kento-works-video-container video,
.kento-works-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.kento-works-youtube-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    width: 100%;
}

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

.kento-works-info-section {
    margin-bottom: 3rem;
}

.kento-works-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: #6e6e73;
}

.meta-label {
    font-weight: 600;
    color: #1d1d1f;
}

.kento-works-categories a {
    color: #1d1d1f;
    text-decoration: none;
}

.kento-works-categories a:hover {
    text-decoration: underline;
}

.kento-works-excerpt {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #6e6e73;
}

.kento-works-content-section {
    margin-bottom: 80px;
}

.kento-works-content-section .post_content {
    font-size: 1rem;
    line-height: 1.8;
    color: #1d1d1f;
}

.kento-works-content-section .post_content h2,
.kento-works-content-section .post_content h3,
.kento-works-content-section .post_content h4 {
    font-family: "Racing Sans One", sans-serif !important;
    margin-top: 48px;
    margin-bottom: 24px;
}

.kento-works-content-section .post_content h2 {
    font-size: 2rem;
}

.kento-works-content-section .post_content h3 {
    font-size: 1.5rem;
}

.kento-works-content-section .post_content h4 {
    font-size: 1.25rem;
}

.kento-works-content-section .post_content p {
    margin-bottom: 24px;
}

.kento-works-content-section .post_content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.kento-works-content-section .wp-block-image {
    margin-bottom: 2rem;
}

/* Kento Works Back to Archive Button */
.kento-works-back-to-archive {
    margin-top: 60px;
    text-align: center;
}

.kento-works-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 24px 48px;
    background: #ff3638;
    border-radius: 50rem;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: bolder;
}

.kento-works-back-btn:hover {
    background: #1d1d1f;
    color: #ffffff;
    text-decoration: none;
}

.back-arrow {
    font-size: 1.25rem;
    font-weight: bold;
}

.back-text {
    font-weight: 500;
}

/* Kento Works Password Protection */
.kento-works-password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none; /* 默认隐藏，避免闪烁 */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.kento-works-password-form {
    background: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    text-align: center;
}

.password-form-header h2 {
    font-family: "Noto Sans JP", sans-serif !important;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 1rem !important;
}

.password-form-header p {
    color: #6e6e73;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.password-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.password-input-group input[type="password"],
.password-input-group input[type="text"] {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e5e5e7;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.password-input-group input:focus {
    outline: none;
    border-color: #ff3638;
}

.password-submit-btn {
    padding: 1rem;
    background: #ff3638;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.password-submit-btn:hover {
    background: #e62e30;
}

.password-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
}


.password-message {
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    margin-top: 1rem;
}

.password-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.password-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 隐藏未认证的内容 */
.kento-works-password-protected .kento-works-archive,
.kento-works-password-protected .kento-main-contents {
    display: none;
}

/* Kento Works Simple Navigation */
.kento-works-simple-navigation {
    margin-top: 80px;
    margin-bottom: 80px;
    padding-top: 40px;
    border-top: 1px solid #eeeeee;
}

.kento-works-simple-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.kento-works-simple-nav-item {
    flex: 1;
    width: 50%;
}

.kento-works-simple-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #f4f6f7;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #1d1d1f;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.kento-works-simple-nav-item:hover a {
    background: #1d1d1f;
    color: #ffffff;
}

.nav-arrow {
    font-size: 1.25rem;
    font-weight: bold;
}

.nav-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kento-works-simple-nav-prev a {
    text-align: left;
}

.kento-works-simple-nav-next a {
    text-align: right;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .kento-page-header {
        padding: 4rem 0;
    }

    .archive .kento-page-header {
        margin-top: 60px;
    }

    .kento-page-header .headline {
        font-size: 1.5rem !important;
    }

    .kento-filter-section  {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }
    
    .kento-filter-title {
        font-size: 0.875rem;
        margin-bottom: 16px;
    }

    #kento_works_category_filter ul,
    #kento_works_media_filter ul {
        gap: 8px;
    }

    #kento_works_category_filter ul li a,
    #kento_works_media_filter ul li a {
        font-size: 0.875rem;
    }

    #kento_works_list {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 40px;
    }

    .kento-works-media-wrap {
        aspect-ratio: 16/10;
    }

    /* 移动端视频优化 */
    .kento-works-video video {
        background-color: #e5e5e7; /* 移动端更浅的背景色 */
    }
    
    /* 确保视频容器有最小高度 */
    .kento-works-video {
        min-height: 200px;
    }

    .kento-works-simple-nav-item {
        font-size: 0.75rem;
    }
    
    .kento-works-title {
        font-size: 1rem;
    }

    .kento-works-more-btn {
        padding: 6px 16px;
        font-size: 0.75rem;
    }
    
    .kento-works-video-modal-content {
        width: 95%;
    }
    
    .kento-works-video-modal-close {
        top: -40px;
        width: 32px;
        height: 32px;
    }

    .kento-works-info-section {
        margin-bottom: 40px;
        padding: 24px 0;
    }

    .kento-works-excerpt {
        font-size: 1rem;
    }

    .kento-works-content-section {
        margin-bottom: 40px;
    }

    .kento-works-back-to-archive {
        margin-top: 40px;
    }

    .kento-works-back-btn {
        padding: 12px 24px;
        font-size: 0.875rem;
        gap: 8px;
    }

    .back-arrow {
        font-size: 1rem;
    }

    .kento-works-simple-navigation {
        margin-top: 30px;
        padding-top: 30px;
    }

    /* 密码保护移动端样式 */
    .kento-works-password-form {
        padding: 1.5rem;
        margin: 1rem;
    }

    .password-form-header h2 {
        font-size: 1.25rem;
    }

    .password-input-group {
        flex-direction: column;
        gap: 1rem;
    }

    .password-submit-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }

    .kento-works-simple-nav-container {
        gap: 16px;
    }

    .kento-works-simple-nav-item a {
        padding: 12px 16px;
        gap: 8px;
        font-size: 0.75rem;
    }

    .nav-arrow {
        font-size: 1rem;
    }

    .kento-works-simple-nav-next a {
        flex-direction: row-reverse;
        text-align: right;
    }
}

@media screen and (min-width: 2000px) {
    #kento_works_list {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 60px;
    }

    .kento-works-simple-nav-item a {
        padding: 20px 32px;
        font-size: 1rem;
    }

    .nav-arrow {
        font-size: 1.5rem;
    }
} 