/* ==========================
   共通
========================== */

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

body {
    font-family:
        "Noto Sans JP",
        "Hiragino Sans",
        "Yu Gothic",
        sans-serif;

    background: #f5f5f5;
    color: #333;
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    width: 100%;
}


/* ==========================
   レイアウト
========================== */

.container {
    width: min(1100px, 92%);
    margin: 40px auto;
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.month-title {
    margin: 50px 0 20px;
    font-size: 1.6rem;
    border-left: 6px solid #5c8d89;
    padding-left: 12px;
}


/* ==========================
   一覧ページ
========================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    transition: .2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,.15);
}

.card img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.card-date {
    text-align: center;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: bold;
}


/* ==========================
   日記ページ
========================== */

#date-title {
    margin-bottom: 30px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 35px 0;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 10px;
    cursor: pointer;
    transition: .2s;
}

.photo-grid img:hover {
    transform: scale(1.02);
}

.diary-text {
    max-width: 800px;
    margin: 0 auto;

    background: white;
    padding: 35px;

    border-radius: 16px;

    white-space: pre-wrap;

    font-family:
        "Noto Sans JP",
        "Hiragino Sans",
        "Yu Gothic",
        sans-serif;

    font-size: 1.05rem;
    line-height: 2;
    letter-spacing: 0.05em;

    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;

    max-width: 800px;
    margin: 40px auto 20px;
}

/* ==========================
   ライトボックス
========================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 30px;
    z-index: 1000;
}

.lightbox img {
    width: auto;
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.lightbox.show {
    display: flex;
}

/* ==========================
   共通ボタン
========================== */
.button-link {
    display: inline-block;
    padding: 10px 18px;

    background: white;
    color: #5c8d89;

    border: 2px solid #5c8d89;
    border-radius: 999px;

    font-size: 1rem;
    font-weight: 600;

    text-decoration: none;

    transition:
        background-color .2s,
        color .2s,
        transform .2s;
}

.button-link:hover {
    background: #5c8d89;
    color: white;
    transform: translateY(-2px);
}

.next-button {
    margin-left: auto;
}

/* ==========================
   スマホ
========================== */
@media (max-width: 768px) {

    .container {
        width: 94%;
        margin: 20px auto;
    }

    .page-title {
        font-size: 2rem;
        margin: 10px 0 20px;
    }

    .month-title {
        margin: 35px 0 15px;
        font-size: 1.4rem;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .card-date {
        padding: 8px;
        font-size: 0.9rem;
    }

    .photo-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 20px 0;
    }

    .button-link {
        padding: 7px 14px;
        font-size: 0.9rem;
    }

    .diary-text {
        padding: 22px;
        font-size: 1rem;
        line-height: 1.9;
    }

    .page-nav {
        margin-top: 30px;
    }

    .lightbox{
        padding:0;
    }

    .lightbox img{
        max-width:100vw;
        max-height:100vh;
    }
}