/* --- 基本設定 --- */
:root {
    --main-color: #333;
    --bg-color: #fdfdfd;
    --accent-color: #555;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    color: var(--main-color);
    background-color: var(--bg-color);
    line-height: 1.8;
}

html {
    scroll-behavior: smooth;
}

/* --- 27行目付近の .container をこれ1つにまとめます --- */
.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto 120px; /* セクション間の「外側」の隙間 */
    padding: 20px 0;      /* 中身とラベルの「内側」の隙間 */
    position: relative;   /* ラベルを左上に置くための基準 */
}
/* --- ヘッダー --- */
header {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav li { margin-left: 20px; }
nav a { text-decoration: none; color: var(--main-color); font-size: 14px; }

/* --- ヒーローエリア --- */
#top.hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('images/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

#top.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-content h1 {
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); 
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

/* --- 作品リスト（index） --- */
.works-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.work-item {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    /* --- ここを調整します --- */
    border: 1px solid #e0e0e0; /* 薄いグレーの枠線を追加 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 影を少し強めて立体感を出します */
    margin-bottom: 20px; /* 記事同士の隙間をしっかり確保 */
    align-items: center;
}

.work-item:hover {
    transform: translateY(-5px); /* ホバー時に少し上に浮き上がる演出 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); /* 浮いた時に影を濃くする */
    border-color: #bbb; /* 枠線の色も少し濃くする */
}


.work-item img {
    width: 200px !important;
    height: 120px !important;
    object-fit: cover;
    flex-shrink: 0;
}

.work-info {
    padding: 20px;
}

/* --- 記事詳細ページ（work01.htmlなど） --- */
.work-visual {
    width: 100%;
    max-width: 600px; /* ここでお好みの幅に固定 */
    margin: 0 auto 30px;
}

.work-visual img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 8px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* これが「16:9」の比率を作る魔法の数字です */
    height: 0;
}

.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* --- アニメーション --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.0s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- トップへ戻るボタン --- */
.back-to-top {
    position: fixed;
    right: 20px; bottom: 20px;
    width: 50px; height: 50px;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    z-index: 1000;
    font-size: 20px;
    transition: opacity 0.3s;
}

/* --- 記事詳細ページ内の画像を 400px に制限する --- */
.work-detail .work-visual img {
    display: block;
    width: 100% !important;
    max-width: 300px !important;
    height: auto !important;
    margin: 20px auto;
}

/* --- 記事一覧（index）の画像を強制固定 --- */
/* ID指定(#works-list)を先頭につけるのが、本番で巨大化させない最大のコツです */
#works-list .work-item img {
    width: 200px !important;
    height: 120px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* スマホ表示のときの調整 */
@media (max-width: 600px) {
    #works-list .work-item {
        flex-direction: column;
        align-items: center;
    }
    #works-list .work-item img {
        width: 100% !important; /* スマホでは横幅に合わせる */
        max-width: 250px !important; /* でも250px以上にはしない */
        height: auto !important;
    }
}

/* 背景画像を動かさず、中身（文字や枠）だけが動くようにする */
#top.hero {
    background-image: url('images/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* これが「隙間から見える」魔法の1行です */
    background-attachment: fixed; 
    
    min-height: 60vh; /* 少し高さを出すと効果が分かりやすいです */
}

.scroll-change-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 50px auto;
    height: 400px;
}

.scroll-change-container img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity 1.5s ease; /* 1.5秒かけてゆっくり変化 */
}


/* 1枚目の画像の設定 */
.image-before {
    opacity: 1;
    z-index: 2; /* 2枚目より上に配置 */
}

/* スクロールして画面に入った（activeがついた）時の設定 */
.image-before.active {
    opacity: 0; /* 透明にして下の画像を見せる */
}

/* 外側の枠：縦スクロールを禁止し、横だけを許可する */
.horizontal-scroll-wrapper {
    overflow-x: auto !important; /* 横スクロールは出す */
    overflow-y: hidden !important; /* 縦スクロールは絶対に出さない */
    white-space: nowrap;
    padding-bottom: 10px; /* スクロールバーと画像の隙間 */
    width: 100%;
    -webkit-overflow-scrolling: touch; /* スマホ用慣性スクロール */
}

/* 中身：画像を横に並べる */
.horizontal-scroll-content {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center; /* 縦方向の中央揃え */
}

/* スマホ用のメディアクエリ(@media)の中に、もし縦に並べる命令があったら削除してください */

/* 各アイテムのサイズ調整 */
.scroll-item {
    flex: 0 0 auto;
    /* ここを 300px から 100%（または 90%）に変更します */
    width: 100vw; 
    height: 60vh; /* 高さは画面の6割くらいにするとバランスが良いです */
    padding: 0%; /* 左右に少し隙間を作ると「次がある」のが分かって親切です */
    box-sizing: border-box; /* パディングを含めて100%にします */
}

.scroll-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.scroll-item:hover img {
    transform: scale(1.05); /* ホバーで少し拡大する演出 */
}

/* 文字の後ろでチカチカするカーソル */
.typing::after {
    content: "|";
    animation: blink 0.7s infinite;
}

@keyframes blink { 0% { opacity:1; } 50% { opacity:0; } 100% { opacity:1; }}

.icon-animation-container {
    position: relative;
    width: 200px;  /* 深田さんのアイコンのサイズに合わせてください */
    height: 200px;
    margin: 50px auto;
    overflow: hidden; /* はみ出し防止 */
}

.anim-icon {
    position: absolute; /* 3枚を同じ場所に重ねる魔法の1行です */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0; /* 基本は全員隠します */
    transition: opacity 0.3s ease; /* パッと変わるのが嫌な場合はここを調整 */
}

/* 1枚目だけ、最初は見えるようにしておきます */
.icon1 {
    opacity: 1;
    z-index: 3;
}
.icon2 { z-index: 2; }
.icon3 { z-index: 1; }

/* ダークセクションの設定 */
.dark-section {
    background-color: rgba(0, 60, 34, 1) !important; /* 暗い背景色。お好みで濃紺などに変えても素敵ですわ */
    color: #ffffff !important;         /* 文字色を白にします */
    width: 100% !important;           /* 画面の端から端まで色を塗るために必要です */
    max-width: none !important;
    padding: 40px 10%;                  /* 上下の余白を少し広げると高級感が出ますわ */

    /* 余白を含めて「横幅100%」に収めるための魔法の1行です */
    box-sizing: border-box !important;

/* これが「斜め」にする魔法の命令です */
    clip-path: polygon(0 15%, 100% 0%, 100% 85%, 0% 100%);

}

/* セクション内の見出しやタイピング文字も白くします */
.dark-section h2,
.dark-section p,
.dark-section .content-box {
    color: #ffffff !important;
}

/* タイピングのカーソル（|）も白く光らせましょう */
.dark-section .typing::after {
    color: #ffffff;
}


/* ラベルの箱 */
.section-label {
    position: absolute;
    top: -20px;   /* セクションの枠から少し上にはみ出させるとお洒落です */
    left: 0;
    width: 150px; /* 画像のサイズに合わせて調整してください */
    height: auto;
    z-index: 5;
}

/* 背景画像 */
.section-label img {
    width: 100%;
    height: auto;
    display: block;
}

/* 画像の上に重なるテキスト */
.section-label span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 画像の真ん中に配置 */
    color: #ffffff; /* 画像が濃い色なら白、薄いなら黒（#333）に */
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.1em;
    white-space: nowrap;
}