@charset "UTF-8";

* {
    box-sizing: border-box;
}

html,body {
    margin: 0;
}

/* ベース（背景画像） */
body {
    background-image: url('./img/prof.webp');
    background-repeat: no-repeat;
    min-height: 100svh;

    background-size: cover; /* 画像を画面サイズに合わせて拡大縮小する */
    background-position: center top; /* 画像の位置を中央上にする */
    background-attachment: fixed; /* 背景画像を固定 */
}

/* ===== Design category ===== */

.category-nav {
  display: flex;
  justify-content: space-between;
  max-width: 1300px;
  margin: 0 auto;
  gap: clamp(20px, 8vw, 120px);
  padding: 0 clamp(20px, 5vw, 60px);
}

/* 共通 */
.nav-item {
  width: clamp(150px, 17vw, 220px);
  aspect-ratio: 220 / 300;
  height: auto;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
  transition: background-image 0.4s ease;
}

/* ---- default（薄） ---- */
.nav-item.web  {
    background-image: url("./img/web-off.webp"); 
}
.nav-item.sns  {
    background-image: url("./img/sns-off.webp");
}
.nav-item.book {
    background-image: url("./img/book-off.webp");
}

/* ---- hover（濃） ---- */
.nav-item.web:hover  {
    background-image: url("./img/web-on.webp");
}
.nav-item.sns:hover  {
    background-image: url("./img/sns-on.webp");
}
.nav-item.book:hover {
    background-image: url("./img/book-on.webp");
}

/* ---- current（常に濃・hover無効） ---- */
.nav-item.current {
  pointer-events: none;
}

.nav-item.book.current {
  background-image: url("./img/book-on.webp");
}


.book-project {
    width: min(1100px, 90%);
    margin: 0 auto;
    padding: 80px 0;
}

.book-gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(50px, 10vw, 160px);
}

/* buttonの初期スタイルを解除 */
.project-image-button {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
}

.book-image {
    display: block;
    width: 160px;
    height: auto;
    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}

/* ホバー時のClick表示 */
.image-overlay {
    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;

    color: #fff;
    font-family: "Alata", sans-serif;
    font-size: 20px;
    letter-spacing: 0.12em;
    background-color: rgba(45, 55, 55, 0.45);

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.project-image-button:hover .book-image,
.project-image-button:focus-visible .book-image {
    transform: scale(1.05);
    filter: brightness(0.65);
}

.project-image-button:hover .image-overlay,
.project-image-button:focus-visible .image-overlay {
    opacity: 1;
}

/* 作品説明 */
.book-description {
    margin-top: 60px;
    padding: 32px 45px;

    /* 半透明の白背景 */
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    box-shadow: 0 8px 25px rgba(80, 100, 100, 0.12);
}

.book-details {
    margin: 0;
    color: #626d6d;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 12px;
    line-height: 1.8;
}

.book-details > div {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 0 10px;
}

.book-details dt {
    font-weight: 500;
}

.book-details dd {
    margin: 0;
}

/* 拡大モーダル */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(15px, 3vw, 40px);
}

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

.modal-background {
    position: absolute;
    inset: 0;
    background-color: rgba(20, 30, 30, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    width: min(650px, 90vw);
    height: min(850px, 88dvh);
    padding: 50px 30px 30px;

    background-color: rgba(235, 245, 243, 0.7);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

#modal-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 閉じるボタン */
.modal-close {
    position: absolute;
    top: 8px;
    right: 16px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    color: #008783;
    font-size: 38px;
    line-height: 1;
    background: transparent;
    cursor: pointer;
    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.modal-close:hover {
    color: #318f8b;
    transform: rotate(90deg);
}

.modal-close:focus-visible {
    outline: 3px solid #68c9c3;
    outline-offset: 2px;
}

body.modal-open {
    overflow: hidden;
}

.footer {
    text-align: center; /* フッターのテキストを中央揃えに設定 */
    font-family:'Zen Kaku Gothic', sans-serif; /* フォントを'Zen Kaku Gothic New'に設定 */
    font-size: 12px; /* フォントサイズを12pxに設定 */
    color: #636F6F; /* フォントカラーを#636F6Fに設定 */
    margin-top: 30px; /* 上部の余白を30pxに設定 */
    margin-bottom: 0; /* 下部の余白を0に設定 */
}

/* ----------------------------
   スクロール追従 TOPボタン
---------------------------- */
.scroll-top {
        position: fixed;
        right: 50px;

        /* Netlify表示やスマホ下部から離す */
        bottom: calc(75px + env(safe-area-inset-bottom));

        z-index: 999;

        /* タップできる範囲を確保 */
        display: grid;
        place-items: center;

        width: 44px;
        height: 44px;
    }

    .scroll-top img {
        display: block;
        width: 30px;
        height: auto;
    }

.scroll-top img {
    display: block;
    width: 50px;
    height: auto;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* ホバー時：ふわっと薄く */
.scroll-top:hover img {
  opacity: 0.6;
  transform: translateY(-4px); /* 少し浮かせると上品 */
}

html {
  scroll-behavior: smooth;
}


/* ========================================
   BOOKページ スマホ表示
======================================== */

@media screen and (max-width: 768px) {

    body {
        position: relative;
        isolation: isolate;

        min-height: 100svh;

        /* 従来のbody背景を解除 */
        background-image: none;
    }

    /* 背景専用レイヤー */
    body::before {
        content: "";

        position: fixed;
        inset: 0;
        z-index: -1;

        background-image: url("./img/phone-prof.webp");
        background-repeat: no-repeat;
        background-position: center top;
        background-size: cover;

        pointer-events: none;
    }

    /* BOOK作品画像を縦並びにする */
    .book-gallery {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;

        gap: 40px;
    }

    /* 画像を囲むボタン */
    .project-image-button {
        width: min(100%, 200px);
    }

    /* BOOK作品画像 */
    .book-image {
        display: block;
        width: 100%;
        height: auto;
    }

    /* =========================
       BOOK紹介文
    ========================= */

    .book-description {
        width: 100%;
        margin-top: 50px;
        padding: 25px 22px;

        background-color: rgba(255, 255, 255, 0.55);
    }

    .book-details {
        font-size: clamp(12px, 3.4vw, 14px);
        line-height: 1.8;
    }

    /* 項目名と内容を縦並びにする */
    .book-details > div {
        display: grid;
        grid-template-columns: 1fr;
        gap: 5px;

        margin-bottom: 22px;
    }

    .book-details > div:last-child {
        margin-bottom: 0;
    }

    /* 項目名 */
    .book-details dt {
        color: #087f83;
        font-weight: 600;
    }

    /* 説明内容 */
    .book-details dd {
        margin: 0;
    }

    .modal {
        padding: 15px;
    }

    .modal-content {
        width: min(92vw, 420px);

        /* 固定の縦幅を解除 */
        height: auto;
        max-height: calc(100dvh - 30px);

        padding: 48px 20px 22px;
    }

    #modal-image {
        display: block;
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 72dvh;

        object-fit: contain;
    }

    .scroll-top {
        position: fixed;
        right: 16px;

        /* Netlify表示やスマホ下部から離す */
        bottom: calc(75px + env(safe-area-inset-bottom));

        z-index: 999;

        /* タップできる範囲を確保 */
        display: grid;
        place-items: center;

        width: 44px;
        height: 44px;
    }

    .scroll-top img {
        display: block;
        width: 30px;
        height: auto;
    }

}