@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.sns.current {
  background-image: url("./img/sns-on.webp");
}

/* ================================
   共通項目（ここまで！）
================================ */

.sns-design {
    position: relative;
    width: 100%;
    padding: 25px 0 80px;
    isolation: isolate;
}

/* メイン部分の白い透過長方形 */
.sns-design::before {
    content: "";
    position: absolute;
    z-index: -1;

    inset: 0;
    left: 50%;
    transform: translateX(-50%);

    width: min(1400px, calc(100% - 40px));

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

/*　４列の作品一覧 */
.sns-gallery {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(210px, 100%), 1fr)
    );

    gap: 50px clamp(20px, 5vw, 70px);

    width: min(1240px, calc(100% - 80px));
    margin: 50px auto;
    padding: 0;
}

/*　サムネイル */
.project-image-button {
    position: relative;
    display: block;

    width: 100%;
    max-width: 255px;
    margin: 0 auto;
    padding: 0;

    overflow: hidden;
    border: 0;
    background-color: transparent;
    box-shadow: 8px 8px 6px rgba(50, 60, 60, 0.2);
    

    cursor: pointer;
}

/* すべて正方形で揃える */
.sns-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;

    object-fit: cover;
    object-position: center;

    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: 25px;
    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 .sns-image,
.project-image-button:focus-visible .sns-image {
    transform: scale(1.05);
    filter: brightness(0.65);
}

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

.project-image-button:focus-visible {
    outline: 3px solid #68c9c3;
    outline-offset: 5px;
}

/* 拡大表示部分 */
.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.65);
    backdrop-filter: blur(4px);
}

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

    display: flex;
    flex-direction: column;

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

    border-radius: 4px;
    background-color: rgba(225, 240, 238, 0.82);
    backdrop-filter: blur(5px);

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.modal-scroll {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1;
    min-height: 0;
    width: 100%;

    overflow: hidden;
}

.modal-info {
    flex-shrink: 0;
    margin-top: 20px;
    padding-top: 18px;

    color: #626d6d;
    border-top: 1px solid rgba(98, 109, 109, 0.3);
}

.modal-description {
    margin: 0 0 12px;

    font-family: "Noto Sans JP", sans-serif;
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 0.04em;
}

.modal-tools {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 0;
    font-family: "Alata", "Noto Sans JP", sans-serif;
    font-size: 13px;
}

.modal-tools-label {
    color: #008783;
    font-weight: 600;
    letter-spacing: 0.08em;
}

#modal-image {
    display: block;

    width: auto;
    height: auto;

    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;
}

.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;
}


/* ========================================
   スマートフォン共通
   ヘッダー・ナビ・TOPアイコン
======================================== */
@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;
    }

    .modal {
        padding: 15px;
    }

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

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

        padding: 48px 20px 22px;
        overflow-y: auto;
    }

    .modal-scroll {
        flex: none;
        width: 100%;
        height: auto;
        min-height: 0;
    }

    #modal-image {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 55dvh;
    }

    .modal-info {
        margin-top: 16px;
        padding-top: 14px;
    }

    .modal-description {
        font-size: clamp(12px, 3.4vw, 14px);
        line-height: 1.7;
    }

    .modal-tools {
        flex-wrap: wrap;
        font-size: clamp(11px, 3.2vw, 13px);
    }

    .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;
    }
}