/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');

/* =========================
   基本設定
========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #363b43;
    color: #cccccc;
    font-family: 'DotGothic16', sans-serif;
}

/* =========================
   ページタイトル・文章
========================= */
.text {
    width: 100%;
    margin: 30px auto;
    padding: 0 16px;
    font-size: clamp(16px, 2.5vw, 28px);
    line-height: 1.8;
    text-align: center;
}

.text h1 {
    margin: 0 0 20px;
    font-size: 1.5em;
}

.text p {
    margin: 0;
}

.text .normal,
.text .top {
    margin-left: 0;
}

/* =========================
   ハンバーガーメニュー
========================= */
#navArea nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1002;

    width: 300px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;

    padding: 110px 32px 32px;
    background-color: #2e3b58;
    color: #ffffff;

    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

/* メニューを開く */
#navArea.open nav {
    transform: translateX(0);
}

/* メニュー一覧 */
#navArea nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 16px;
    text-align: left;
}

/* メニュー項目 */
#navArea nav li {
    display: block;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

/* メニューリンク */
#navArea nav a {
    display: flex;
    align-items: baseline;
    gap: 16px;

    padding: 16px 0;
    color: #ffffff;
    text-decoration: none;

    transition: color 0.2s ease;
}

/* 番号 */
#navArea nav a span {
    flex-shrink: 0;
    font-size: 12px;
    color: #6dc7eb;
}

/* マウスを乗せたとき */
#navArea nav a:hover {
    color: #6dc7eb;
}

/* 背景マスク */
#mask {
    position: fixed;
    inset: 0;
    z-index: 1001;

    background: rgba(43, 42, 39, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* メニューを開いたとき */
#navArea.open #mask {
    opacity: 1;
    visibility: visible;
}

/* =========================
   円を描きながら回るボタン
========================= */
#btn19 {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1003;

    width: 90px;
    height: 90px;
    padding: 0;
    border: none;
    border-radius: 50%;

    background-color: #ebf2f5;
    cursor: pointer;
}

/* 3本線 */
#btn19 span {
    position: absolute;
    left: 25px;

    display: block;
    width: 40px;
    height: 3px;
    border-radius: 2px;

    background-color: #2b2a27;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* 各線の位置 */
#btn19 span:nth-of-type(1) {
    top: 29px;
}

#btn19 span:nth-of-type(2) {
    top: 44px;
}

#btn19 span:nth-of-type(3) {
    top: 59px;
}

/* 円を描く枠 */
#btn19::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;

    display: block;
    width: 84px;
    height: 84px;
    margin: -45px 0 0 -45px;

    border: 4px solid transparent;
    border-radius: 50%;
    transition: all 0.75s;
    pointer-events: none;
}

/* 開いたら×に変化 */
#btn19.active span:nth-of-type(1) {
    transform: translateY(15px) rotate(-45deg);
}

#btn19.active span:nth-of-type(2) {
    opacity: 0;
    animation: bar-hide 0.8s forwards;
}

#btn19.active span:nth-of-type(3) {
    transform: translateY(-15px) rotate(45deg);
}

/* 円を回しながら描く */
#btn19.active::after {
    animation: active-btn19 0.7s 0.25s forwards;
}

@keyframes active-btn19 {
    0% {
        border-color: transparent;
        transform: rotate(0);
    }

    25% {
        border-color: transparent #15d8ff transparent transparent;
    }

    50% {
        border-color: transparent #15d8ff #2b2a27 transparent;
    }

    75% {
        border-color: transparent #2b2a27 #2b2a27 #2b2a27;
    }

    100% {
        border-color: #2b2a27;
        transform: rotate(-680deg);
    }
}

@keyframes bar-hide {
    to {
        visibility: hidden;
    }
}

/* =========================
   制作ギャラリー
========================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* PC：最大3列 */
.container .gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;

    margin: 0;
    padding: 0;
    list-style: none;
}

/* 各作品 */
.container .item {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.container figure {
    margin: 0;
}

/* 画像の縦横比を維持 */
.container .gallery img {
    display: block;
    width: 100%;
    height: auto;

    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.container .gallery img:hover {
    opacity: 0.8;
}

/* キーボード操作 */
.container .gallery img:focus-visible {
    outline: 2px solid #6dc7eb;
    outline-offset: 4px;
}

/* 作品名 */
.container figcaption {
    padding-top: 10px;
    margin: 0;

    font-size: 16px;
    font-weight: bold;
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
}

/* =========================
   画像の拡大表示
========================= */
#imageModal {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 40px;
    background: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

/* 拡大中 */
#imageModal.show {
    display: flex;
}

/* 拡大画像：縦横比を維持 */
#imageModal img {
    display: block;

    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    max-height: 85dvh;

    object-fit: contain;
    cursor: default;
}

/* 閉じるボタン */
#imageModal .close {
    position: absolute;
    top: 16px;
    right: 24px;
    z-index: 1;

    padding: 0;
    border: none;
    background: transparent;
    color: #ffffff;

    font-family: sans-serif;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
}

/* =========================
   フォーカス表示
========================= */
#navArea nav a:focus-visible,
#btn19:focus-visible,
#imageModal .close:focus-visible {
    outline: 2px solid #6dc7eb;
    outline-offset: 4px;
}

/* =========================
   スマートフォン対応
========================= */
@media screen and (max-width: 600px) {
    .text {
        margin: 24px auto;
        padding: 0 12px;
        font-size: clamp(14px, 4vw, 16px);
    }

    .text h1 {
        font-size: 1.5em;
    }

    /* メニュー */
    #navArea nav {
        width: min(240px, 85vw);
        padding: 88px 24px 24px;
    }

    /* ボタンを小さく */
    #btn19 {
        width: 64px;
        height: 64px;
    }

    #btn19 span {
        left: 17px;
        width: 30px;
    }

    #btn19 span:nth-of-type(1) {
        top: 20px;
    }

    #btn19 span:nth-of-type(2) {
        top: 31px;
    }

    #btn19 span:nth-of-type(3) {
        top: 42px;
    }

    #btn19.active span:nth-of-type(1) {
        transform: translateY(11px) rotate(-45deg);
    }

    #btn19.active span:nth-of-type(3) {
        transform: translateY(-11px) rotate(45deg);
    }

    #btn19::after {
        width: 60px;
        height: 60px;
        margin: -32px 0 0 -32px;
    }

    /* ギャラリー：2列 */
    .container {
        padding: 10px 12px;
    }

    .container .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 16px;
    }

    .container figcaption {
        font-size: 14px;
    }

    /* 画像拡大 */
    #imageModal {
        padding: 16px;
    }

    #imageModal .close {
        top: 12px;
        right: 16px;
    }
}

/* =========================
   動きを減らす設定
========================= */
@media (prefers-reduced-motion: reduce) {
    #navArea *,
    #btn19,
    #btn19::after,
    #btn19 span,
    .container .gallery img {
        transition: none !important;
        animation: none !important;
    }
}