/* 基本的なリセットとページ全体のスタイル */
body {
    margin: 0;
    font-family: sans-serif; /* ページ全体の基本はゴシック体 */
    background-color: #eeeeee;
    color: #000000;
}

a {
    color: #000000;
    text-decoration: none;
}

/* ページ全体のコンテナ */
.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 20px;
}

/* メインコンテンツ */
main {
    width: 100%;
}

.page-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-family: serif;
}

/* CSS Gridによるギャラリーレイアウト */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.grid-item {
    width: 100%;
}

/* 複数列・複数行にまたがるアイテムのスタイル */
.span-col-2 {
    grid-column: span 2;
}

.span-col-3 {
    grid-column: span 3;
}

.span-row-2 {
    grid-row: span 2;
}

/* 画像とキャプションのスタイル */
.grid-item figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item figcaption {
    position: absolute;
    top: 20px;
    left: 20px;
    width: auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    text-align: left;
    color: #000;
    font-size: 1em;
    line-height: 1.4;
    max-width: 80%;
    opacity: 0.7;
    transition: opacity 0.3s ease-out, background 0.3s ease-out;
    font-family: serif;
}

/* ホバー時のスタイル */
.grid-item:hover figcaption {
    opacity: 1;
    background: #fff;
}

/* フッター */
footer {
    padding: 40px 0;
    text-align: center;
}

.copyright {
    font-size: 0.8em;
}

/* モバイル向けのスタイル */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* 1列にする */
    }

    .span-col-2,
    .span-col-3,
    .span-row-2 {
        grid-column: span 1; /* スパン指定をリセット */
        grid-row: span 1;
    }
}
