body {
    background-color: #f6f6fd;
    color: #5c4b3b;
    font-family: 'Zen Maru Gothic', sans-serif;
}

/* 背景アニメーション */
.background-animation {
    position: fixed;
    inset: 0;

    overflow: hidden;

    z-index: -1;
}

.background-animation span {
    position: absolute;

    display: block;

    width: 200px;
    height: 200px;

    background:  #e3c2a1;

    border-radius: 50%;

    animation: float 20s linear infinite;
}

.background-animation span:nth-child(1) {
    top: 10%;
    left: 10%;
}

.background-animation span:nth-child(2) {
    top: 60%;
    left: 70%;
}

.background-animation span:nth-child(3) {
    top: 30%;
    left: 80%;
}

.background-animation span:nth-child(4) {
    top: 80%;
    left: 20%;
}

.background-animation span:nth-child(5) {
    top: 50%;
    left: 40%;
}

@keyframes float {

    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-30px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* ページ表示時のアニメーション。 */
.fade-in {
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {

    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 日記カードの画像サイズ */
.image-wrapper {
    height: 300px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.diary-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

/* 日記カードのアニメーション */
.diary-card {
    border: none;
    border-radius: 24px;
    overflow: hidden;
    background-color: #fffaf4;
    transition: 0.3s;
}

/* 日記カードのhover時に浮かせる */
.diary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* ボタンのアニメーション */
.custom-btn {
    background-color: #d4a373;
    /* border-color: #5c4b3b; */
    border: none;
    border-radius: 12px;
}

.custom-btn:hover {
    background-color: #ccd5ae;
}

/* ボタンクリック時の動作 */
.custom-btn:active {
    transform: scale(0.98);
}

/* Navbar */
.navbar {
    background-color: #d4a373;
}

.nav-link {
    transition: 0.3s;
}

.nav-link:hover {
    opacity: 0.7;
}

/* アルバム */
.masonry {
    column-count: 3;
    column-gap: 16px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
}

.album-image {
    width: 100%;
    border-radius: 16px;
    transition: 0.3s;
}

.album-image:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.album-link {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 16px;
}

.album-image {
    width: 100%;
    border-radius: 16px;
    transition: 0.3s;
    display: block;
}

.detail-button {
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
}

.album-link:hover .detail-button {
    opacity: 1;
    transform: translateY(0);
}

.album-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0,0,0,0.45);

    color: white;

    opacity: 0;

    transition: 0.3s;

    display: flex;
    flex-direction: column;
    justify-content: end;

    padding: 20px;

    pointer-events: none;
}

.album-overlay .btn {
    pointer-events: auto;
}

.album-link:hover .album-overlay {
    opacity: 1;
}

.album-link:hover .album-image {
    transform: scale(1.03);
}

@media (max-width: 768px) {

    .masonry {
        column-count: 2;
    }
}

@media (max-width: 576px) {

    .masonry {
        column-count: 1;
    }
}

/* paginationを隠す */
nav p.small {
    display: none;
}

/* 走る猫 */
#running-cat {
    position: fixed;

    right: 20px;
    bottom: 20px;

    z-index: 9999;

    animation: fadeOut 1s ease 5s forwards;
}

/* 猫画像 */
#cat-animation {
    width: 120px;

    animation:
        runCycle 0.5s steps(1) infinite,
        bounce 0.5s ease-in-out infinite;
}

/* 画像切り替え */
@keyframes runCycle {

    0% {
        content: url('/images/loading/cat1.png');
    }

    33% {
        content: url('/images/loading/cat2.png');
    }

    66% {
        content: url('/images/loading/cat3.png');
    }

    100% {
        content: url('/images/loading/cat1.png');
    }
}

/* 少し上下させる演出 */
@keyframes bounce {

    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* 5秒後に消える */
@keyframes fadeOut {

    to {
        opacity: 0;
        visibility: hidden;
    }
}


/* ローディング画面 */
#loading-screen {
    position: fixed;
    inset: 0;

    background: #fdfaf6;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    z-index: 9999;
}

/* Loading文字 */
#loading-screen p {
    margin-top: 16px;

    color: #5c4b3b;

    font-weight: bold;
}

