body {
    font-family: sans-serif;
    font-size: 16px;
    background-color: #f8f8f8;
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

header {
    background-image: url('header.jpeg');
    background-size: cover;
    background-position: center 60%;
    background-repeat: no-repeat;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    position: relative;
    height: 200px; /* ヘッダーの高さを固定 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* h1のスタイルも修正して見やすくする */
header h1 {
    margin: 0;
    color: #fff; /* 白色に変更 */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* テキストの視認性向上 */
    font-size: 2.5em;
    position: relative;
    z-index: 1;
}

/* オーバーレイを追加して文字を見やすくする */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3); /* 暗めのオーバーレイ */
    z-index: 0;
}

/* ナビゲーション用のスタイル */
nav {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 40px; /* ナビゲーションの高さを固定 */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 40px;
}

nav ul li {
    position: relative;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 10px 5px;
    transition: color 0.3s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #007bff;
    transition: width 0.3s ease;
}

nav a:hover {
    color: #007bff;
}

nav a:hover::after {
    width: 100%;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

header nav ul li {
    display: inline;
    margin: 0 10px;
}

header nav a {
    text-decoration: none;
    color: #333;
}

main {
    padding: 20px;
}

section {
    margin-bottom: 40px;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    scroll-margin-top: 70px; /* ナビゲーションの高さ + 余白分 */
}

section h2 {
    color: #007bff;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

section h3 {
    color: #6c757d;
    margin-top: 15px;
    margin-bottom: 10px;
}

section ul {
    list-style: disc;
    padding-left: 20px;
}

section a {
    color: #007bff;
    text-decoration: none;
}

section a:hover {
    text-decoration: underline;
}

#gallery img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* ギャラリーグリッドのスタイル */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.gallery-image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Fancybox カスタマイズ */
.fancybox__backdrop {
    background: rgba(0, 0, 0, 0.9);
}

.fancybox__content {
    padding: 0;
    background: transparent;
}

.fancybox__content img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.fancybox__caption {
    text-align: center;
    font-size: 1em;
    padding: 10px;
}

/* Fancybox アニメーション */
.fancybox-fadeIn {
    animation: fancybox-fadeIn 0.3s ease-in-out;
}

.fancybox-fadeOut {
    animation: fancybox-fadeOut 0.3s ease-in-out;
}

@keyframes fancybox-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fancybox-fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* アーティスト情報のスタイル調整 */
.artwork-info {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 8px;
    border-radius: 8px 0 8px 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.8em;
    min-width: 0;
}

.artist-name {
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
}

/* ソーシャルアイコンのスタイル */
.social-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.social-icon {
    display: inline-flex;
    align-items: center;
}

.social-icon img {
    width: 15px;
    height: 15px;
}

/* Pixivアイコン専用のスタイル */
.pixiv-icon img {
    width: 19px;
    height: 19px;
}

/* Xアイコン専用のスタイル */
.x-icon img {
    background-color: #000;
    border-radius: 3px;
    padding: 2px;
}

footer {
    text-align: center;
    padding: 10px;
    color: #777;
    border-top: 1px solid #eee;
}

footer a {
    color: #007bff;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}

/* 最新情報リストのスタイル */
.news-list {
    margin: 1em 0;
    line-height: 1.4;
}

.news-list dt {
    font-weight: bold;
    color: #333;
    margin-top: 1.2em;
    padding-left: 1em;
    position: relative;
}

.news-list dd {
    margin: 0.3em 0 0 1em;
}

.news-list dd a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-list dd a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 定義リストの共通スタイル */
.profile-list, .news-list {
    margin: 1em 0;
    line-height: 1.4;
}

.profile-list dt, .news-list dt {
    display: inline-block;
    font-weight: bold;
    color: #333;
    margin: 0.25em 0;
}

.profile-list dd, .news-list dd {
    display: inline;
    margin: 0;
}

.profile-list dt::after, .news-list dt::after {
    content: ":";
    margin: 0 0.25em 0 0;
}

.profile-list dd::after, .news-list dd::after {
    content: "";
    display: block;
    margin-bottom: 0.125em;
}

/* リンクのスタイル */
.profile-list dd a, .news-list dd a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.profile-list dd a:hover, .news-list dd a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 画面幅が600px未満の場合に適用 */
@media screen and (max-width: 599px) {
    body {
        font-size: 14px;
        padding: 10px;
    }

    header {
        height: 150px; /* スマートフォンではヘッダーを少し小さく */
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }

    header nav ul li {
        display: block;
        margin: 5px 0;
    }

    main {
        padding: 10px;
    }

    section {
        padding: 15px;
        margin-bottom: 30px;
    }

    #gallery div {
        grid-template-columns: 1fr; /* 小さい画面では画像を縦に並べる */
    }

    .video-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    nav {
        padding: 10px 0;
    }
    
    nav ul {
        gap: 20px;
    }
    
    nav ul li {
        font-size: 0.9em;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .gallery-image img {
        height: 150px; /* スマホではより小さく */
    }

    .news-list dt {
        margin-top: 1em;
    }
    
    .news-list dd {
        margin-left: 0.5em;
    }

    .profile-list dt, .news-list dt {
        margin: 0.3em 0;
    }
}

/* YouTube動画のレスポンシブ対応 */
.video-wrapper {
    max-width: 853px; /* 一般的なYouTube埋め込みサイズ (16:9) */
    margin: 0 auto;
    overflow: hidden;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9のアスペクト比 */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 注目動画セクションのスタイル */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.video-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.video-item:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
}

.play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-left: 20px solid #fff;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

.video-link {
    text-decoration: none;
    color: inherit;
}

/* プロフィールセクションの動画スタイル */
#profile .video-wrapper {
    max-width: 400px;
    margin: 20px 0;
}

#profile .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9のアスペクト比 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#profile .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

#profile .video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#profile .video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#profile .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
}

#profile .play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-left: 20px solid #fff;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

/* セクションフッターのスタイル */
.section-footer {
    text-align: right;
    margin: 1em 0 0 0;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

.submit-artwork {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    padding: 0.5em 1.2em;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.submit-artwork:hover {
    background: #007bff;
    color: #fff;
}

.featured-section {
    margin-bottom: 3em;
    padding: 1.5em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.featured-section h3 {
    font-size: 1.2em;
    margin: -1.5em -1.5em 1em -1.5em;
    padding: 1em 1.5em;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
    position: relative;
}

/* サブセクションタイトル用の装飾 */
.featured-section > h3 {
    font-size: 1.2em;
    margin: -1.5em -1.5em 1em -1.5em;
    padding: 1em 1.5em;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.featured-section > h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.2em;
    background: #007bff;
}

/* 動画タイトル用のスタイル */
.video-item h3 {
    font-size: 1em;
    margin: 0.5em;
    padding: 0;
    background: none;
    border: none;
    color: #333;
}

.video-item h3::before {
    display: none;
}

.more-link {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    padding: 0.5em 1.2em;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.more-link:hover {
    background: #007bff;
    color: #fff;
}