/* =========================================================
   制作実績ページ（page1〜page3 共通）
   ========================================================= */
:root {
    --w-text: #222;
    --w-sub: #666;
    --w-line: #dde6ef;
    --w-bg: #fff;
    --w-bg-soft: #f3f7fb;
    --w-accent: #2a6fb0;
    --w-accent-soft: #e6f0fa;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--w-bg);
    color: var(--w-text);
    font-family: "Noto Sans JP", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    vertical-align: bottom;
}

a {
    color: inherit;
}

.w-sp-only {
    display: none;
}

/* ---------------- Header ---------------- */
.w-header {
    border-bottom: 1px solid var(--w-line);
    background: var(--w-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.w-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.w-header__logo img {
    height: 40px;
    width: auto;
}

.w-header__back,
.w-bottom__back {
    font-size: 14px;
    text-decoration: none;
    color: var(--w-accent);
    border: 1px solid var(--w-accent);
    border-radius: 999px;
    padding: 6px 18px;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}

.w-header__back:hover,
.w-bottom__back:hover {
    background: var(--w-accent);
    color: #fff;
}

/* ---------------- Main ---------------- */
.w-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

.w-title {
    text-align: center;
    margin-bottom: 40px;
}

.w-title__en {
    margin: 0;
    font-size: 14px;
    letter-spacing: 0.2em;
    color: var(--w-accent);
}

.w-title__ja {
    margin: 4px 0 16px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.w-title__lead {
    margin: 0;
    color: var(--w-sub);
    font-size: 15px;
}

/* ---------------- Filter ---------------- */
.w-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

.w-filter__btn {
    font: inherit;
    font-size: 14px;
    padding: 6px 18px;
    border-radius: 999px;
    border: 1px solid var(--w-line);
    background: var(--w-bg);
    color: var(--w-text);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.w-filter__btn:hover {
    border-color: var(--w-accent);
}

.w-filter__btn[aria-pressed="true"] {
    background: var(--w-accent);
    border-color: var(--w-accent);
    color: #fff;
}

/* ---------------- List ---------------- */
.w-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 32px 24px;
}

.w-card__btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.w-card__img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--w-bg-soft);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.w-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.w-card__btn:hover .w-card__img,
.w-card__btn:focus-visible .w-card__img {
    transform: scale(1.04);
}

/* 画像が複数ある実績の枚数表示 */
.w-card__count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--w-sub);
    border: 1px solid var(--w-line);
}

.w-card__body {
    padding: 12px 2px 0;
}

.w-card__meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--w-sub);
}

.w-card__cat {
    background: var(--w-accent-soft);
    color: var(--w-accent);
    border-radius: 4px;
    padding: 0 8px;
}

.w-card__client {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--w-sub);
}

.w-card__title {
    display: block;
    font-size: 15px;
    font-weight: 500;
}

.w-empty {
    text-align: center;
    color: var(--w-sub);
}

.w-bottom {
    text-align: center;
    margin-top: 64px;
}

.w-bottom__back {
    display: inline-block;
    padding: 10px 32px;
}

/* ---------------- Footer ---------------- */
.w-footer {
    background: var(--w-bg-soft);
    text-align: center;
    padding: 32px 24px;
    font-size: 13px;
    color: var(--w-sub);
}

.w-footer p {
    margin: 0;
}

.w-footer__name {
    font-weight: 700;
    color: var(--w-text);
}

.w-footer__copy {
    margin-top: 8px !important;
    font-size: 12px;
}

/* ---------------- Modal ---------------- */
.w-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

.w-modal.is-open {
    display: flex;
}

.w-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 40, 0.75);
}

.w-modal__content {
    position: relative;
    width: min(1000px, 92vw);
    max-height: 92vh;
    background: var(--w-bg);
    border-radius: 8px;
    padding: 40px 64px 28px;
    display: flex;
    align-items: center;
}

.w-modal__figure {
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.w-modal__img {
    max-width: 100%;
    max-height: calc(92vh - 200px);
    object-fit: contain;
}

.w-modal.has-gallery .w-modal__img {
    max-height: calc(92vh - 270px);
}

/* 動画（YouTube は 16:9、ショート動画は 9:16） */
.w-modal__video {
    --w-video-max-h: calc(92vh - 200px);
    width: min(100%, calc(var(--w-video-max-h) * 16 / 9));
    aspect-ratio: 16 / 9;
    background: #000;
}

.w-modal.has-gallery .w-modal__video {
    --w-video-max-h: calc(92vh - 270px);
}

.w-modal__video.is-vertical {
    width: min(100%, calc(var(--w-video-max-h) * 9 / 16));
    aspect-ratio: 9 / 16;
}

.w-modal__video[hidden] {
    display: none;
}

.w-modal__video iframe,
.w-modal__video video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* mp4 は元の縦横比のまま表示 */
.w-modal__video:has(video) {
    width: auto;
    aspect-ratio: auto;
    background: none;
}

.w-modal__video video {
    width: auto;
    max-width: 100%;
    max-height: var(--w-video-max-h);
}

/* 同じ実績の画像の切り替え */
.w-modal__gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.w-modal__gallery[hidden] {
    display: none;
}

.w-modal__thumb {
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: var(--w-bg-soft);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s;
}

.w-modal__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.w-modal__thumb:hover,
.w-modal__thumb[aria-current="true"] {
    opacity: 1;
}

.w-modal__thumb[aria-current="true"] {
    border-color: var(--w-accent);
}

/* 動画のサムネイルには再生マーク */
.w-modal__thumb--video {
    position: relative;
}

.w-modal__thumb--video::after {
    content: "▶";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 2px;
}

/* 外部サイトへのリンク */
.w-modal__link {
    align-self: center;
    margin-top: 10px;
    font-size: 14px;
    text-decoration: none;
    color: var(--w-accent);
    border: 1px solid var(--w-accent);
    border-radius: 999px;
    padding: 4px 18px;
    transition: background-color 0.2s, color 0.2s;
}

.w-modal__link::after {
    content: " ↗";
}

.w-modal__link:hover {
    background: var(--w-accent);
    color: #fff;
}

.w-modal__link[hidden] {
    display: none;
}

.w-modal__caption {
    margin-top: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.w-modal__meta {
    font-size: 12px;
    color: var(--w-sub);
}

.w-modal__client {
    font-size: 14px;
    color: var(--w-sub);
}

.w-modal__title {
    font-size: 17px;
    font-weight: 700;
}

.w-modal__text {
    margin-top: 6px;
    font-size: 14px;
    color: var(--w-sub);
    white-space: pre-line;
}

.w-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: var(--w-sub);
    cursor: pointer;
}

.w-modal__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--w-line);
    background: var(--w-bg);
    font-size: 26px;
    line-height: 1;
    color: var(--w-text);
    cursor: pointer;
}

.w-modal__arrow:hover {
    border-color: var(--w-accent);
    color: var(--w-accent);
}

.w-modal__arrow--prev {
    left: 10px;
}

.w-modal__arrow--next {
    right: 10px;
}

/* ---------------- SP ---------------- */
@media (max-width: 767px) {
    .w-sp-only {
        display: inline;
    }

    .w-header__inner {
        padding: 10px 16px;
    }

    .w-header__logo img {
        height: 30px;
    }

    .w-header__back {
        font-size: 12px;
        padding: 4px 12px;
    }

    .w-main {
        padding: 40px 16px 64px;
    }

    .w-title__ja {
        font-size: 26px;
    }

    .w-title__lead {
        font-size: 14px;
    }

    .w-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 12px;
    }

    .w-card__title {
        font-size: 14px;
    }

    .w-modal__content {
        padding: 48px 16px 20px;
    }

    .w-modal__arrow {
        top: auto;
        bottom: 12px;
        transform: none;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .w-modal__caption {
        padding: 0 40px;
    }
}
