body{
    font-family:"Avenir","Zen Kaku Gothic Antique",sans-serif;
    font-size: 14px; 
    font-weight: 500;
    margin-top: 48px;
    margin-left: 24px;
    margin-right: 24px;
    background-color: #f2f2f2;
    -webkit-text-size-adjust: 100%; 
}

html, body {
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

main{
    padding-top: 24px;
    padding-bottom: 60px;
}

.header-wrap {
    position: fixed;
    padding-top: 24px;
    top:0px;
    left:28px;
    right:28px;
    z-index: 20;
    background: #f2f2f2;
}

.header {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr 1fr;  
    gap: 24px;
    padding-bottom:10px;
}

.border_header {
    border-top: 1px solid #cacaca;
    background-color: #f2f2f2;
    padding-top: 6px;
}

.footer-wrap {
    position: fixed;
    padding-bottom: 24px;
    bottom:0px;
    left:28px;
    right:28px;
    z-index: 20;
    background: #f2f2f2;
}

.footer {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr 1fr;  
    gap: 24px;
}

.border_footer {
    border-top: 1px solid #cacaca;
    background-color: #f2f2f2;
    padding-bottom: 10px;
}

.row {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr 1fr;
    gap: 24px;
    padding: 0 4px;      
    position: relative;
    overflow: hidden;
    z-index: 1;
    background-color: #f2f2f2;
    height: 28px;        
    align-items: center; 
}

.row > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 28px;   
}

.row > div:first-child {
    cursor: pointer;
    position: relative;
}

/* ホバー演出 */
.row.hovered > div:first-child,
.row.active > div:first-child {
    padding-left: 4em;
}

.row.hovered > div:first-child::before,
.row.active > div:first-child::before {
    content: "⇒ ⇒ ⇒ ";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}

/* 画像レイヤー */
#image-layer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50;
    pointer-events: none; 
    overflow-y: scroll;
    overflow-x: hidden;
    background-color: rgba(255, 255, 255, 0);
    scrollbar-width: none;
}
#image-layer::-webkit-scrollbar { display: none; }
#image-layer.locked-active { pointer-events: auto; }

#image-layer-content {
    position: relative;
    width: 100%;
    min-height: 100dvh;
}

.image-item {
    position: absolute;
    cursor: grab;
    z-index: 10;
}

.image-item img {
    max-width: 30vw;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

a, a:visited { color: #000000; text-decoration: none; }
a:hover { color: #0033ff; opacity: 1; }
.tag-item:hover { color: #0033ff; opacity: 1; }


/* 選択されたタグのスタイル */
.tag-item.is-active {
    text-decoration: line-through;
    color: #0033ff; /* 任意：少し薄くすると選択中であることが分かりやすくなります */
}


   .about-container {
        /* ここで上部の余白を調整します */
         margin-top: -50px;
        /* PROJECTページの文字サイズ感に合わせる設定 */
        font-size: 14px;
        line-height: 1.8;
    }


/* --- Mobile Responsive Layout (Screen width < 768px) --- */
@media screen and (max-width: 767px) {
    body {
        height:100dvh;
        font-size: 10px;
        margin-top: 100px;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    .header {
        display: none !important;
    }

    .header-wrap {
        background-color: #f2f2f2 !important; /* 背景色を強制的に合わせる */
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        padding-top: calc(max(24px, env(safe-area-inset-top)));
    }

    /* 3. フッターがツールバーに隠れないようにする */
    .footer-wrap {
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 0px) !important;
        /* iOSのセーフエリア（下のバー）を考慮 */
        padding-bottom: calc(max(24px, env(safe-area-inset-bottom)));
        /*padding-bottom: env(safe-area-inset-bottom, 0px);*/
    }

    /* 4. コンテンツがフッターに被らないよう、mainの末尾に余白を追加 */
    main {
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }

    .mobile-tag-list {
        background-color: #f2f2f2;
    }

    .mobile-tag-list {
        background-color: #f2f2f2;
        z-index: 20;
    }

    .about-container {
        /* ここで上部の余白を調整します */
         margin-top: -75px;
        /* PROJECTページの文字サイズ感に合わせる設定 */
        font-size: 10px;
        line-height: 1.7;
    }
    
    
    .header-wrap {
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
    }

    .header, .border_header {
        display: none !important;
    }

    main {
        padding-top: 0px !important; /* タグリストが表示される分広げる */
    }

    /* 各行の調整 */
    .row {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        padding: 10px 0 !important;
        gap: 0 !important;
    }

    /* 【解決策】元の黒い文字が入っているdiv（2, 3, 4番目）をスマホ時のみ完全に消す */
    /* JSが後から追加する要素は .row-footer-mobile なので、これには影響しません */
    .row > div:nth-child(2),
    .row > div:nth-child(3),
    .row > div:nth-child(4) {
        display: none !important;
    }

    /* タイトル（1番目）の調整 */
    .row > div:first-child {
        font-size: 10px !important;
        font-weight: bold !important;
        margin-bottom: 12px !important;
        padding-left: 0 !important; /* ⇒⇒⇒を消す */
    }
    .row > div:first-child::before {
        content: "" !important;
    }

    /* JSで生成されたグレーの行（row-footer-mobile）の調整 */
    .row-footer-mobile {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
        color: #888 !important; /* ここでグレーに指定 */
        margin-top: 8px !important;
    }

    /* フッター（PROJECT/ABOUT）の調整 */
    .footer-wrap {
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
    }

    .footer {
        display: flex !important;
        justify-content: space-between !important;
    }

    .footer > div:nth-child(2),
    .footer > div:nth-child(3) {
        display: none !important;
    }

}

@supports (height: 100dvh) {
    .header-wrap {
        /* Twitterの上のバーに食い込まないように調整 */
        padding-top: calc(max(24px, env(safe-area-inset-top)));
    }

    .footer-wrap {
        /* Twitterの下のバーに隠れないように調整 */
        padding-bottom: calc(max(24px, env(safe-area-inset-bottom)));
        bottom: 0;
    }
    
    #mobile-detail-layer {
        height: 100dvh !important;
    }
}


/* 選択されたタグのスタイル */
.tag-item.is-active,
.mobile-tag-list span.is-active {
    text-decoration: line-through;
    color: #0033ff;
}


/* 共通の「選択中」スタイル */
.is-active, 
.tag-item.is-active, 
.mobile-tag-list span.is-active,
.menu-item.is-active {
    text-decoration: line-through !important;
    color: #0033ff !important;
}

