* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    height: 32px;
    /* ヘッダー内に収める */
}

.logo img {
    height: 100%;
    width: auto;
    max-width: 160px;
    /* 横に伸びすぎ防止 */
    display: block;
}

.floating-star {
    position: fixed;
    right: 16px;
    bottom: 40px;

    font-size: 60px;
    color: #000;

    opacity: 1;
    /* うるさくならない */
    pointer-events: none;
    /* 完全に飾り */

    z-index: 100;
    /* 通常UIより上、モーダルより下 */
}


body {
    font-family:
        "Inter",
        "YakuHanJP",
        "Hiragino Kaku Gothic ProN",
        "Hiragino Sans",
        -apple-system,
        BlinkMacSystemFont,
        "Helvetica Neue",
        Arial,
        sans-serif;
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
    font-weight: 400;
    line-height: 1.53em;
    letter-spacing: .05em;
}

.body-descriptionbox {
    border-top-right-radius: 12px;
    background: #fff04e;
    color: #747474;
}

.body-description {
    font-size: 12px;
    letter-spacing: .001em;
    line-height: 1.53em;
    padding: 10px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.05em;

    margin: 0;
    padding: 10px 0px;

    color: #000;
}

/* =========================
   Header
========================= */
header {
    display: flex;
    justify-content: space-between;
    padding: 16px;
}

header a {
    margin-left: 12px;
    color: #000;
    text-decoration: none;
}

nav a svg {
    width: 24px;
    /* アイコンの幅 */
    height: 24px;
    /* アイコンの高さ */
    display: inline-block;
    vertical-align: middle;
}

nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

header nav {
    display: flex;
    align-items: center;
    gap: 12px;
    /* アイコン間のスペース */
}


/* =========================
   Layout
========================= */
.viewport {
    overflow: hidden;
}

.pages {
    display: flex;
    width: 200vw;
    transition: transform 0.3s ease;
}

.sidebar {
    display: block;
}

.sidebar,
.works {
    width: 100vw;
    padding: 16px;
}

/* =========================
   Tag Dropdown (大カテゴリ＋小カテゴリ)
========================= */
.tag-toggle {
    width: 100%;
    background: none;
    border: none;
    color: #000;
    font-size: 16px;
    text-align: left;
    padding: 12px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-toggle .arrow {
    transition: transform 0.3s ease;
}

.tag-list {
    list-style: none;
    margin-top: 12px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}

.tag-list.is-open {
    max-height: 500px;
    /* タグ数に合わせて十分な値 */
}

/* 矢印回転 */
.tag-toggle.is-open .arrow {
    transform: rotate(180deg);
}

/* 大カテゴリ */
.tag-list li.genre {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

/* 小カテゴリ */
.tag-list li.subCategory {
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 12px;
    margin-bottom: 4px;
    color: #555;
}

.tag-list li.active {
    background-color: #ff4e4e;
    /* ハイライト色 */
    color: #ffffff;
    font-weight: 700;
}


/* =========================
   Works Grid
========================= */
.works {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.work {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
}

.work-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

.work-category {
    text-transform: capitalize;
}

.work.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work h3 {
    margin-top: 4px;
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.001em;
}

/* =========================
   PC Layout
========================= */
@media (min-width: 769px) {
    .viewport {
        overflow: visible;
    }

    .pages {
        width: 100%;
        transform: none !important;
    }

    .sidebar {
        width: 240px;
        flex-shrink: 0;
    }

    .works {
        width: auto;
        grid-template-columns: repeat(4, 1fr);
        padding-right: 10%;
    }

    #slide-indicator {
        display: none;
    }
}


/* =========================
   Modal
========================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.open .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-media {
    width: 100%;
    max-width: 100%;
}

.media-inner {
    position: relative;
    width: 100%;
    background: #000;
}

.media-inner img {
    position: static;
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.media-inner iframe,
.media-inner video {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
}

/* =========================
   Modal Info Layout
========================= */
.modal-info {
    color: #fff;
    margin: 16px 24px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* タイトル中央揃え */
}

.modal-info .top-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    /* 大カテゴリと日付の間隔 */
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: #ddd;
}

.modal-info .modal-category {
    text-transform: capitalize;
}

.modal-info .modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-top: 4px;
}

#modal-close-global {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10010;

    width: 44px;
    height: 44px;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;

    font-size: 24px;
    cursor: pointer;

    display: none;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(6px);
}

#modal-close-global:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* =========================
   Modal Buttons
========================= */
.close {
    position: absolute;
    top: 8px;
    background: none;
    color: #000;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.close {
    right: 8px;
}

button:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* =========================
   Scroll Settings
========================= */

:root {
    --header-height: 56px;
}

body {
    height: 100%;
    overflow: hidden;
}

.sidebar,
.works {
    -ms-overflow-style: none;
    /* IE / Edge */
    scrollbar-width: none;
    /* Firefox */
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}


.sidebar::-webkit-scrollbar,
.works::-webkit-scrollbar {
    display: none;
    /* Chrome / Safari */
}

/* =========================
   Mobile Slide Indicator
========================= */
#slide-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

#slide-indicator.is-active {
    opacity: 0.6;
    pointer-events: auto;
}

#slide-indicator.is-menu {
    transform: translate(calc(-50% + 45vw), -50%);
}

#slide-indicator.is-works {
    transform: translate(calc(-50% - 45vw), -50%);
}

#slide-indicator svg {
    width: 32px;
    height: 32px;
    transition: transform 0.4s ease;
}

#slide-indicator.is-works svg {
    transform: rotate(180deg);
}