/* ========================================
   Works Page Styles
   WordPress化時: is_page('works')で条件分岐して読み込み
======================================== */

/* ===== Page-Specific Settings ===== */
.works-page,
.works-detail-page {
    background-color: #ffffff;
    font-family: 'Zen Kaku Gothic New', sans-serif;
}

/* Content Header - 白背景 */
.works-page .content-header,
.works-detail-page .content-header {
    background: #ffffff !important;
    backdrop-filter: blur(10px);
    color: #333333 !important;
}

.works-page .content-header.scrolled,
.works-detail-page .content-header.scrolled {
    background: #ffffff !important;
    color: #333333 !important;
}

/* Header Location */
.works-page .header-location,
.works-detail-page .header-location {
    color: #333333 !important;
}

/* Hamburger Menu */
.works-page .hamburger-menu,
.works-detail-page .hamburger-menu {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #333333 !important;
}

.works-page .hamburger-menu::before,
.works-page .hamburger-menu::after,
.works-page .hamburger-menu .hamburger-line,
.works-detail-page .hamburger-menu::before,
.works-detail-page .hamburger-menu::after,
.works-detail-page .hamburger-menu .hamburger-line {
    background: #333333 !important;
}

/* ===== Works Page Components ===== */

/* ========================================
   Main Work Card
======================================== */

.main-work-card {
    margin-top: 40px;
}

.work-location {
    font-size: 0.9rem;
    color: #999999;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.work-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: #333333;
    margin-bottom: 30px;
    letter-spacing: 0.05em;
}

.work-main-image {
    width: 100%;
    margin-bottom: 30px;
}

.work-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.work-area {
    font-size: 1rem;
    color: #666666;
    margin-bottom: 30px;
    letter-spacing: 0.05em;
}

.work-description {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(51, 51, 51, 0.1);
}

.work-description p {
    font-size: 1rem;
    line-height: 1.9;
    color: #333333;
    letter-spacing: 0.05em;
}

/* Work Gallery */
.work-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.gallery-image {
    width: 100%;
}

.gallery-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Other Works Section
======================================== */

.other-works-section {
    background-color: #ffffff;
    padding: 60px 40px;
}

.other-works-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.other-work-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.3s ease;
}

.other-work-card:hover {
    opacity: 0.8;
}

.other-work-location {
    font-size: 0.85rem;
    color: #999999;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.other-work-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333333;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.other-work-image {
    width: 100%;
}

.other-work-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Works Page専用: LINE Contact Section タイトル調整 */
.works-page .line-contact-section .section-title-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* ========================================
   Works Grid (Archive Page)
======================================== */

.works-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

/* Works Page専用: 背景色 */
.works-page .works-section {
    background: #FFFFFF !important;
}

/* Single Works: ギャラリー上部マージン */
.single-works .wp-block-gallery {
    margin-top: 60px;
}

.works-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.works-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.works-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.works-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.works-card-content {
    padding: 20px;
}

.works-card-location {
    font-size: 0.85rem;
    color: #999999;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.works-card-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333333;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.works-card-area {
    font-size: 0.9rem;
    color: #666666;
    letter-spacing: 0.05em;
}

.no-works {
    text-align: center;
    color: #666666;
    font-size: 1rem;
    padding: 60px 20px;
}

/* ===== Pagination Styles ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 60px 0 40px;
    padding: 0;
}

.pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    align-items: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 15px;
    background: transparent;
    color: #333333;
    text-decoration: none;
    border: 1px solid rgba(51, 51, 51, 0.2);
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.pagination .page-numbers:hover {
    background: rgba(51, 51, 51, 0.05);
    border-color: rgba(51, 51, 51, 0.4);
    color: #333333;
}

.pagination .page-numbers.current {
    background: #333333;
    color: #ffffff;
    border-color: #333333;
    cursor: default;
}

.pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
    min-width: auto;
    padding: 0 5px;
}

.pagination .page-numbers.dots:hover {
    background: transparent;
    border: none;
}

/* Previous/Next Arrows */
.pagination .prev,
.pagination .next {
    font-size: 1rem;
}

.pagination .prev i,
.pagination .next i {
    font-size: 0.875rem;
}

/* Disabled state */
.pagination .page-numbers.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   Responsive Styles
======================================== */

/* Tablet and Mobile */
@media (max-width: 1024px) {
    /* タブレット・スマホ時の最初のセクションにヘッダー分のpadding-topを追加 */
    .works-page .content-section:first-of-type,
    .works-detail-page .content-section:first-of-type {
        padding-top: 120px;
    }

    /* Works Grid - タブレット対応 */
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .other-works-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    /* スマホ時のスクロール位置調整（ヘッダー領域を考慮） */
    .works-page,
    .works-detail-page {
        scroll-padding-top: 110px;
    }

    /* 最初のセクションにヘッダー分のpadding-topを追加（スマホ用に再定義） */
    .works-page .content-section:first-of-type,
    .works-detail-page .content-section:first-of-type {
        padding-top: 100px;
    }

    /* Works Grid - スマホ対応 */
    .works-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 30px;
    }

    .work-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Pagination responsive */
    .pagination {
        margin: 40px 0 30px;
    }

    .pagination ul {
        gap: 6px;
    }

    .pagination .page-numbers {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
        font-size: 0.85rem;
    }

    /* Hide some page numbers on mobile */
    .pagination .page-numbers:not(.prev):not(.next):not(.current):not(.dots) {
        display: none;
    }

    .pagination .page-numbers:not(.prev):not(.next):not(.current):not(.dots):nth-child(-n+3),
    .pagination .page-numbers:not(.prev):not(.next):not(.current):not(.dots):nth-last-child(-n+3) {
        display: inline-flex;
    }
}
