* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: "GenEiNuGothic-EB";
    src: url("assets/fonts/GenEiNuGothic-EB.ttf") format("truetype");
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

main {
    position: relative;
    width: 100%;
    min-height: 100vh; /* テキストが少なくても画面全体に背景を敷く */

    background-image: url("assets/images/VoronoiBG.png");
    background-size: cover;
    background-attachment: fixed;
}

/* --- 1. バナーを画面横いっぱいに広げる指定 --- */
.banner {
    width: 100%;           /* 画面横幅いっぱいに広げる */
    position: relative;     /* 矢印の基準位置にする */
    margin: 0;
}

.banner .splide__track {
    overflow: visible;

    -webkit-mask-image: url('assets/images/Banner_Mask.png');
    mask-image: url('assets/images/Banner_Mask.png');

    -webkit-mask-mode: alpha;
    mask-mode: alpha;
    
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    
    -webkit-mask-position: center;
    mask-position: center;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
}

.containers {
    padding-top: 2rem;
    margin-top: 2rem;
    width: 75vw;
    margin-left: auto;
    margin-right: auto;
}

.titles {
    width: 100%;
    font-family: "GenEiNuGothic-EB", sans-serif;
    font-size: 2rem;
    color: #000;
    border-bottom: 2px solid #BF264C;
}

.three-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-top: 1rem;
}

.three-cards {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 1;
    border-radius: 1rem;
    background: #bfbfbf;
    border: 1px solid #bfbfbf;
    box-sizing: border-box;
    overflow: hidden;
    transition: filter 0.2s linear;
}

.three-cards:hover {
    filter: brightness(120%) saturate(0.85);
}

.three-cards img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: switchTwoImages 8s infinite;
}

.slideshow {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 2枚の画像を同じ位置にピッタリ重ねる */
.three-cards .slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 2枚目（上にかぶさる画像）だけを一定周期で出したり消したりする */
.slideshow img:nth-child(2) {
    animation: bannerSwitch 10s infinite steps(1);
}

/* ホバーで一時停止 */
.three-cards:hover .slideshow img {
    animation-play-state: paused;
}

/* --- バナー切替用キーフレーム --- */
/* 前半（0%〜49.99%）は非表示で1枚目が見える
   後半（50%〜100%）は表示されて2枚目に切り替わる */
@keyframes bannerSwitch {
    0%, 49.99% {
        opacity: 0;
    }
    50%, 100% {
        opacity: 1;
    }
}

.topics-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    padding-top: 1rem;
    gap: 1rem;
    padding-top: 1rem;
}

.topics-grid-cards {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 1rem;

    background: #bfbfbf;
    transition: filter 0.2s linear;
}

.topics-grid-cards:hover {
    filter: brightness(120%) saturate(0.85);
}

.topics-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 1rem 1rem 0 0;

    background: #f3f3f3;
}

@media screen and (max-aspect-ratio: 1 / 1) {
    .three-cards-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-top: 0;
    }

    .topics-grid-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 1rem;
        padding-top: 1rem;
    }
}

@media (prefers-color-scheme: dark) {
  main {
    /* ダークモード用の背景画像 */
        background-image: url("assets/images/VoronoiBG-Dark.png");
    }

    .titles {
        color: #fff;
    }
}