/* ナビゲーションバー */
nav {
    background-color: #1a1a1d;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 10px 0;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}

nav ul {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

nav ul li a:hover {
    text-decoration: underline;
}

/* ヒーロースペース */
.hero {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(to bottom, #1a1a1d, #4e4e50);
    color: #fff;
    margin-top: 80px; /* ナビゲーションバーの高さ分の余白を追加 */
}

/* Aboutセクション */
.about-content {
    text-align: center;
    margin: 0 auto;
    max-width: 800px;
}

/* Worksセクション */
.works-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 横4列がデフォルト */
    gap: 20px;
    padding: 20px;
    max-width: 1200px; /* セクション最大幅 */
    margin: 0 auto;
}

.work-item {
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    max-width: 280px; /* 最大サイズ */
    min-width: 200px; /* 最小サイズ */
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.work-item img {
    max-width: 100%;
    border-radius: 8px;
    height: auto;
}

.work-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.modal-content {
    display: flex; /* コンテンツを左右に分割 */
    align-items: flex-start; /* 左上揃え */
    gap: 20px; /* 左右のスペースを確保 */
    max-width: 800px; /* モーダル全体の最大幅 */
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    text-align: left;
    width: 90%; /* 親要素に対する相対幅 */
    position: relative;
}

.modal-content img {
    max-width: 100%;
    border-radius: 8px;
}

/* 左側の画像ブロック */
.modal-content div:first-child {
    flex: 1; /* 左側の領域 */
    display: flex;
    flex-direction: column; /* 画像を縦並び */
    gap: 10px; /* 画像間の余白 */
}

/* 右側のテキストブロック */
.modal-content div:last-child {
    flex: 2; /* 右側の広い領域 */
}

/* バツ印 */
.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    z-index: 1100; /* 他の要素に覆われないように */
}

.close:hover {
    color: red;
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.fade-in {
    animation: fadeIn 0.5s forwards;
}

/* フェードアウトアニメーション */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.modal.fade-out {
    animation: fadeOut 0.5s forwards;
}

/* フッター */
footer {
    background-color: #1a1a1d; /* ダーク系背景 */
    color: #fff; /* テキスト色を白に設定 */
    text-align: center; /* 中央揃え */
    padding: 20px 0; /* 上下の余白 */
    margin-top: 40px; /* コンテンツとの間に余白 */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto; /* 水平方向の中央揃え */
}

.footer-links {
    list-style: none; /* リストマーカーを削除 */
    padding: 0; /* デフォルト余白を削除 */
    margin: 10px 0 0; /* 上部に余白 */
    display: flex; /* リンクを横並びに表示 */
    justify-content: center; /* 水平中央揃え */
    gap: 20px; /* リンク間に間隔を設定 */
}

.footer-links li {
    display: inline; /* リンクをインライン要素に */
}

.footer-links a {
    text-decoration: none; /* 下線を削除 */
    color: #fff; /* リンク色を白に設定 */
    font-size: 14px; /* リンク文字サイズ */
    transition: color 0.3s ease; /* 色の変化を滑らかに */
}

.footer-links a:hover {
    color: #ffcc00; /* ホバー時にアクセントカラー */
}

/* レスポンシブ対応：画面幅に基づく変更 */
/* 横幅が992px未満：横3列表示 */
@media (max-width: 992px) {
    .works-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 横幅が768px未満：横2列表示 */
@media (max-width: 768px) {
    .works-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 横幅が480px未満：縦並び */
@media (max-width: 480px) {
    .works-container {
        grid-template-columns: 1fr;
    }
}
