/* ==========================================
    Single Works - Detail Page
   ========================================== */

/* About/Philosophy スタイルのメインセクション */
.works-detail-section {
    padding: 100px 0 80px;
    background: var(--color-bg);
    overflow: hidden;
}

.works-detail-section .about-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.works-detail-section .about-text-block {
    position: relative;
}

.works-detail-section .about-catch {
    font-family: var(--font-serif);
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 24px;
    color: var(--color-text);
}

.works-detail-section .about-desc {
    font-size: 15px;
    line-height: 2;
    color: var(--color-text);
    margin-bottom: 32px;
}

.works-detail-section .about-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* カテゴリタグ */
.works-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.works-detail-tag {
    display: inline-block;
    border: 1px solid #4A6741;
    color: #4a6741;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.works-detail-tag:hover {
    background: #4A6741;
    color: #fff;
}

/* ==========================================
    Editor Content Section (the_content)
   ========================================== */
.works-content-section {
    padding: 0 0 80px;
    background: var(--color-bg);
}

.works-content-body {
    max-width: 900px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 2;
    color: var(--color-text);
}

.works-content-body p {
    margin-bottom: 1.5em;
}

.works-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 24px 0;
}

.works-content-body h2,
.works-content-body h3,
.works-content-body h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin: 2em 0 0.8em;
    line-height: 1.5;
    color: var(--color-text);
}

.works-content-body h2 {
    font-size: clamp(20px, 2.5vw, 28px);
}

.works-content-body h3 {
    font-size: clamp(18px, 2vw, 24px);
}

.works-content-body ul,
.works-content-body ol {
    padding-left: 1.5em;
    margin-bottom: 1.5em;
}

.works-content-body li {
    margin-bottom: 0.5em;
}

.works-content-body blockquote {
    border-left: 3px solid var(--color-primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: rgba(45, 90, 39, 0.04);
    font-style: normal;
}

.works-content-body figure {
    margin: 32px 0;
    text-align: center;
}

.works-content-body figcaption {
    font-size: 13px;
    color: var(--color-text-light, #888);
    margin-top: 8px;
}

/* ==========================================
    Gallery Section
   ========================================== */
.works-gallery-section {
    padding: 80px 0;
    background: #fff;
}

.works-gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.works-gallery-item {
    cursor: pointer;
}

.works-gallery-item__image {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 4 / 3;
}

.works-gallery-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.works-gallery-item:hover .works-gallery-item__image img {
    transform: scale(1.05);
}

.works-gallery-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.works-gallery-item:hover .works-gallery-item__overlay {
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
}

.works-gallery-item__caption {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    font-style: normal;
    text-align: center;
}

/* ==========================================
    Post Navigation
   ========================================== */
.works-nav-section {
    padding: 60px 0 80px;
    border-top: 1px solid #e0e0e0;
}

.works-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.works-nav__link {
    font-size: 14px;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.works-nav__link:hover {
    color: var(--color-primary);
}

.works-nav__link.is-disabled {
    visibility: hidden;
}

.works-nav__arrow {
    font-size: 18px;
}

.works-nav__list {
    padding: 10px 24px;
    border: 1px solid var(--color-text);
    border-radius: 4px;
}

.works-nav__list:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ==========================================
    Lightbox
   ========================================== */
.works-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.works-lightbox.is-active {
    opacity: 1;
    visibility: visible;
}

.works-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.works-lightbox__content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.works-lightbox__image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 2px;
    user-select: none;
}

.works-lightbox__caption {
    color: #fff;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    font-style: normal;
    max-width: 600px;
}

.works-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 2;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.works-lightbox__close:hover {
    opacity: 1;
}

.works-lightbox__prev,
.works-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    padding: 16px 12px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 4px;
}

.works-lightbox__prev:hover,
.works-lightbox__next:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.works-lightbox__prev {
    left: 20px;
}

.works-lightbox__next {
    right: 20px;
}

.works-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: var(--font-en);
}

/* ==========================================
    Responsive
   ========================================== */
@media (max-width: 768px) {
    .works-detail-section .about-inner {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 20px;
    }

    .works-detail-section .about-image {
        order: -1;
    }

    .works-gallery-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .works-nav {
        gap: 20px;
    }

    .works-nav__label {
        font-size: 12px;
    }

    .works-lightbox__prev,
    .works-lightbox__next {
        font-size: 36px;
        padding: 12px 8px;
    }

    .works-lightbox__prev {
        left: 8px;
    }

    .works-lightbox__next {
        right: 8px;
    }

    .works-lightbox__close {
        top: 12px;
        right: 12px;
        font-size: 32px;
    }
}