/* =========================
   基本設定
========================= */

@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 45px 25px;

    color: #555555;

    font-family:
        "DotGothic16",
        sans-serif;

    font-weight: 400;

    background-color: #f8faf7;

    background-image:
        linear-gradient(#cbd8ca 1px, transparent 1px),
        linear-gradient(90deg, #cbd8ca 1px, transparent 1px);

    background-size: 24px 24px;
}

/* =========================
   サイト全体
========================= */

.site {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto;

    background: #ffffff;

    border: 2px solid #222222;

    /* 画像の雰囲気に合わせて角丸なし */
    border-radius: 0;

    overflow: hidden;
}


/* =========================
   ヘッダー
========================= */

header {
    padding: 25px 30px 20px;

    text-align: center;

    background: #ffffff;

    border-bottom: 2px solid #222222;
}

header h1 {
    margin: 5px 0 10px;

    line-height: 1.6;
}

header h1 img {
    width: 500px;
    max-width: 90%;
    height: auto;

    display: block;
    margin: 0 auto;
}

.subtitle {
    margin: 0;

    color: #777777;

    font-family: monospace;

    font-size: 12px;

    letter-spacing: 3px;
}

.header-deco {
    color: #a4b5a3;

    font-size: 14px;

    letter-spacing: 8px;
}


/* =========================
   左メニュー＋本文
========================= */

.layout {
    display: grid;

    grid-template-columns: 155px 1fr;

    gap: 0;

    padding: 0;
}


/* =========================
   左メニュー
========================= */

.menu {
    padding: 22px 15px;

    background: #ffffff;

    border-right: 2px solid #222222;

    align-self: stretch;
}

.menu h2 {
    margin: 0 0 15px;

    padding: 0 0 12px;

    color: #555555;

    text-align: center;

    font-size: 15px;
    font-weight: normal;

    border-bottom: 1px solid #222222;

    font-weight: bold;

}

.menu nav {
    display: flex;

    flex-direction: column;
}

.menu nav a {
    display: block;

    padding: 10px 5px;

    color: #444444;

    font-size: 14px;

    font-weight: bold;

    letter-spacing: 1px;

    text-decoration: none;

    border-bottom: 1px dotted #aaaaaa;

    transition: 0.15s;
}

.menu nav a:hover {
    padding-left: 10px;

    color: #222222;

    background: #eef4ec;
}

.menu-decoration {
    margin-top: 30px;

    color: #a4b5a3;

    text-align: center;

    line-height: 1.6;

    font-size: 18px;
}


/* =========================
   メイン
========================= */

main {
    min-width: 0;

    background: #ffffff;
}


/* =========================
   セクション
========================= */

section {
    margin: 0;

    background: #ffffff;

    border: none;

    border-bottom: 1px solid #222222;

    border-radius: 0;

    overflow: visible;
}

section h2 {
    margin: 0;

    padding: 10px 16px;

    color: #444444;

    font-size: 17px;
    font-weight: normal;

    background: #ffffff;

    border: none;

    border-bottom: 1px solid #222222;
}


/* =========================
   ようこそ
========================= */

.welcome {
    display: flex;

    gap: 25px;

    padding: 25px;
}

.welcome-text {
    flex: 1;

    color: #555555;

    line-height: 1.6;

    font-size: 15px;
}

.welcome-text p {
    margin: 0 0 12px;
}

.small-note {
    color: #8da58e;

    font-size: 12px;
}

.welcome-picture {
    width: 230px;
    height: 140px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: #9aaa99;

    background: #f5f8f4;

    border: 1px solid #555555;

    border-radius: 0;

    font-size: 11px;

    letter-spacing: 1px;
}

.welcome-picture img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
}


/* =========================
   更新履歴
========================= */

.updates {
    padding: 15px 20px;
}

.updates p {
    margin: 0;

    padding: 8px 0;

    font-size: 13px;

    border-bottom: 1px dotted #aaaaaa;
}

.updates p:last-child {
    border-bottom: none;
}

.updates time {
    display: inline-block;

    width: 105px;

    color: #777777;

    font-family: monospace;
}

.more {
    padding: 10px 18px;

    text-align: right !important;

    border: none !important;
}

a {
    color: #63896c;

    text-decoration: underline;
}

a:hover {
    color: #222222;
}


/* =========================
   イラスト
========================= */

.illust-list {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;

    padding: 20px;
}

.illust-placeholder {
    aspect-ratio: 1 / 1;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #9aaa99;

    background: #f6f8f5;

    border: 1px solid #777777;

    border-radius: 0;

    font-family: monospace;

    font-size: 11px;

    transition: 0.15s;
}

.illust-placeholder:hover {
    transform: none;

    background: #edf3eb;

    box-shadow: none;
}

/* =========================
   HOME 最新日記
========================= */

.latest-diary {
    display: flex;

    align-items: flex-start;

    gap: 25px;

    padding: 25px 30px;
}


/* =========================
   日記画像
========================= */

#latest-diary-image {
    display: block;

width: 230px;
height: 160px;

    flex-shrink: 0;

    border: 1px solid #777777;

    overflow: hidden;
}

#latest-diary-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: 0.15s;
}

#latest-diary-image:hover img {
    opacity: 0.7;
}


/* =========================
   日記本文
========================= */

.latest-diary-text {
    flex: 1;

    min-width: 0;
}


/* 日付 */

.latest-diary-text .diary-date {
    margin-bottom: 8px;

    color: #777777;

    font-family: monospace;

    font-size: 13px;
}


/* タイトル */

.latest-diary-text h3 {
    margin: 0 0 12px;

    color: #444444;

    font-size: 20px;

    font-weight: bold;
}


/* 本文 */

.latest-diary-text > p {
    margin: 0 0 15px;

    color: #555555;

    font-size: 14px;

    line-height: 1.6;
}


/* 続きを読む */

.latest-diary-text .more {
    margin-top: 20px;

    text-align: right;
}

/* =========================
   フッター
========================= */

footer {
    padding: 18px;

    color: #888888;

    text-align: center;

    background: #ffffff;

    border-top: none;

    font-family: monospace;

    font-size: 11px;
}


/* =========================
   日記ページ
========================= */

.diary-entry {
    padding: 25px 25px 30px;

    border-bottom: 1px dashed #999999;
}

.diary-entry:last-of-type {
    border-bottom: none;
}

.diary-entry-date {
    margin-bottom: 8px;

    color: #777777;

    font-family: monospace;

    font-size: 13px;
}

.diary-entry h3 {
    margin: 0 0 15px;

    color: #444444;

    font-size: 17px;

    font-weight: bold;
}

.diary-entry p {
    margin: 0 0 12px;

    color: #555555;

    font-size: 14px;

    line-height: 1.6;
}

/* =========================
   日記一覧
========================= */

.diary-card {
    display: flex;

    gap: 20px;

    padding: 20px;

    border-bottom: 1px dashed #999999;
}


/* 日記サムネ */

.diary-card-image {
    width: 180px;
    height: 140px;

    display: block;

    flex-shrink: 0;

    border: 1px solid #777777;

    background: #f5f8f4;

    overflow: hidden;
}

.diary-card-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: 0.15s;
}

.diary-card-image:hover img {
    opacity: 0.7;
}


/* 日記本文 */

.diary-card-text {
    flex: 1;

    min-width: 0;
}

.diary-card-text time {
    color: #777777;

    font-family: monospace;

    font-size: 13px;
}

.diary-card-text h3 {
    margin: 6px 0 10px;

    font-size: 18px;

    font-weight: bold;
}

.diary-card-text h3 a {
    color: #444444;

    text-decoration: none;
}

.diary-card-text h3 a:hover {
    text-decoration: underline;
}

.diary-card-text p {
    margin: 0 0 12px;

    color: #555555;

    font-size: 14px;

    line-height: 1.6;
}

.read-more {
    font-size: 13px;
}

.diary-main-image {
    width: 100%;
    max-width: 500px;

    height: auto;

    display: block;

    margin: 0 auto 25px;

    border: 1px solid #777777;
}

/* =========================
   スマホ対応
========================= */

@media (max-width: 700px) {

    body {
        padding: 15px 8px;

        background-size: 18px 18px;
    }

    .site {
        width: 100%;

        border-width: 1px;
    }

    header {
        padding: 20px 15px 15px;

        border-bottom-width: 1px;
    }

    header h1 img {
        width: 400px;
    }

    .subtitle {
        font-size: 10px;

        letter-spacing: 2px;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .latest-diary {
    flex-direction: column;

    gap: 15px;

    padding: 18px;
}

#latest-diary-image {
    width: 100%;
    max-width: 300px;

    height: auto;

    aspect-ratio: 3 / 2;
}

    /* スマホではメニューを横並びにする */
    .menu {
        padding: 10px;

        border-right: none;
        border-bottom: 1px solid #222222;
    }

    .menu h2 {
        margin-bottom: 8px;

        padding-bottom: 7px;
    }

    .menu nav {
        display: grid;

        grid-template-columns: repeat(4, 1fr);

        gap: 0;
    }

    .menu nav a {
        padding: 8px 5px;

        text-align: center;

        border-bottom: 1px dotted #aaaaaa;
    }

    .menu-decoration {
        display: none;
    }

    section h2 {
        padding: 9px 12px;

        font-size: 15px;
    }

    .welcome {
        flex-direction: column;

        padding: 18px;
    }

    .welcome-picture {
        width: 100%;
        height: 180px;
    }

    .illust-list {
        grid-template-columns:
            repeat(2, 1fr);

        gap: 10px;

        padding: 12px;
    }

    .updates {
        padding: 10px 12px;
    }

    .updates time {
        width: 90px;
    }

    .diary {
        padding: 15px;
    }
}

/* テキストの頭浮かせてるやつ */

main section h3,
main section p {
    margin-left: 25px;
    margin-right: 25px;
}

/* =========================
   らくがき一覧
========================= */

.rakugaki-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 25px;
}

.rakugaki-item {
    width: 100%;
    aspect-ratio: 1 / 1;

    padding: 0;

    cursor: pointer;

    border: 1px solid #777777;
    background: #f5f8f4;

    overflow: hidden;
}

.rakugaki-item img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: 0.15s;
}

.rakugaki-item:hover img {
    opacity: 0.7;
}

/* =========================
   らくがき 拡大表示
========================= */

.rakugaki-item {
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.rakugaki-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: 0.15s;
}

.rakugaki-item:hover img {
    opacity: 0.7;
}


/* 拡大表示の画面 */

#rakugaki-modal {
    position: fixed;

    width: auto;
    max-width: 90vw;
    max-height: 90vh;

    padding: 45px 25px 25px;

    border: 2px solid #222222;
    background: #ffffff;

    overflow: auto;
}


/* 周りの暗い部分 */

#rakugaki-modal::backdrop {
    background: rgba(0, 0, 0, 0.65);
}


/* 拡大された画像 */

#rakugaki-large {
    display: block;

    max-width: 80vw;
    max-height: 80vh;

    width: auto;
    height: auto;

    margin: 0 auto;
}


/* 閉じるボタン */

#rakugaki-close {
    position: absolute;

    top: 8px;
    right: 10px;

    width: 30px;
    height: 30px;

    padding: 0;

    border: none;
    background: none;

    color: #444444;

    font-family: sans-serif;
    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}

#rakugaki-close:hover {
    color: #8da58e;
}

/* 日記の投稿者 */

.diary-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.9em;
}


.diary-author img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

.diary-content-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.diary-content-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.diary-image {
    flex-shrink: 0;
    width: 180px;
    height: 120px;
    object-fit: cover;
    object-position: center;
    margin: -55px 0 0 0;
    border: 1px solid #222222;
}

.diary-detail-image {
    margin: 20px 0;
}

.diary-detail-image img {
    width: 350px;
    height: auto;
    border: 1px solid #222222;
    display: block;
}

#diary-detail {
    padding: 10px 25px 30px 25px;
}

.latest-diary {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.latest-diary {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.latest-diary:not(:last-child) {
    border-bottom: 1px dashed #999999;
}

.latest-diary > a img {
    width: 180px;
    height: 120px;
    object-fit: cover;
    object-position: center;
    border: 1px solid #222222;
    display: block;
}

.latest-diary-text {
    flex: 1;
}

.latest-diary-text h3 {
    margin-top: 5px;
}

.latest-diary-text p {
    margin-top: 8px;
}

.latest-diary-author {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    font-size: 0.85em;
}

.latest-diary-author img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 50%;
}

.latest-diary-title-link {
    color: inherit;
    text-decoration: none;
}

.latest-diary-title-link h3 {
    margin-top: 5px;
}

.latest-diary-title-link:hover {
    text-decoration: underline;
}

.diary-filter {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.filter-button {
    padding: 5px 14px;
    border: 2px solid #000000;
    background: #ffffff;
    color: #555555;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.filter-button:hover {
    background: #eeeeee;
}

.filter-button.active {
    background: #222222;
    color: #eeeeee;
}

.filter-button {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-button img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 50%;
}

.diary-category-filter {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.category-button {
    padding: 5px 14px;
    border: 2px solid #000000;
    background: #ffffff;
    color: #555555;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.category-button:hover {
    background: #eeeeee;
}

.category-button.active {
    background: #000000;
    color: #ffffff;
}

.diary-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diary-category {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #000000;
    background: #f8faf7;
    font-size: 0.8em;
    font-weight: bold;
}

.diary-preview p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 10;
    line-clamp: 10;
    overflow: hidden;
    margin-bottom: 5px;
}

.diary-read-more {
    font-size: 0.8em;
    color: #999;
    text-decoration: none;
}

.diary-read-more:hover {
    text-decoration: underline;
}

.diary-image {
    width: 130px;
    height: 175px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    margin: 0;
    border: 1px solid #222222;
}

.diary-content-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.diary-preview {
    flex: 1;
    min-width: 0;
}

@media (max-width: 700px) {

    /* 日記一覧 */
    .diary-entry {
        padding: 18px 15px 22px;
    }

    .diary-content-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .diary-preview {
        width: 100%;
    }

    /* スマホの日記サムネ */
    .diary-image {
        width: 100%;
        max-width: 260px;
        height: 150px;
        margin: 0 auto;
        object-fit: cover;
    }

    /* 投稿者 */
    .diary-author {
        font-size: 0.85em;
    }

    .diary-author img {
        width: 28px;
        height: 28px;
    }

    /* 日付・カテゴリ */
    .diary-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* 日記タイトル */
    .diary-entry h3 {
        font-size: 16px;
        line-height: 1.5;
    }

    /* 日記本文 */
    .diary-entry p {
        font-size: 13px;
        line-height: 1.7;
    }

    /* 「続きを読む」 */
    .diary-read-more {
        font-size: 11px;
    }

    /* 投稿者フィルター */
    .diary-filter,
    .diary-category-filter {
        flex-wrap: wrap;
        gap: 6px;
        padding: 0 8px;
    }

    .filter-button,
    .category-button {
        padding: 5px 9px;
        font-size: 12px;
    }

}

@media (max-width: 700px) {

    main section h3,
    main section p {
        margin-left: 10px;
        margin-right: 10px;
    }

    .diary-preview p {
        margin-left: 0;
        margin-right: 0;
    }


    
}

/* =========================
   スマホ版 日記ページ調整
========================= */

@media (max-width: 700px) {

    /* 日記全体 */
    .diary-entry {
        padding: 16px 12px 20px;
    }

    /* 投稿者 */
    .diary-author {
        margin-bottom: 4px;
    }

    /* 日付・カテゴリ */
    .diary-meta {
        margin-bottom: 5px;
    }

    /* タイトル */
    .diary-entry h3 {
        margin: 5px 0 10px;
        font-size: 16px;
        line-height: 1.4;
    }

    /* 本文＋画像 */
    .diary-content-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .diary-preview {
        width: 100%;
    }

    /* スマホでは画像を画面いっぱいに */
    .diary-image {
        width: 100%;
        max-width: none;
        height: auto !important;
        margin: 0;
        object-fit: cover;
    }

    /* 続きを読む */
    .diary-read-more {
        font-size: 11px;
    }


    /* =========================
       スマホ版 メニュー
    ========================= */

    .menu {
        padding: 8px 5px;
    }

    .menu h2 {
        margin-bottom: 6px;
        padding-bottom: 6px;
    }

    .menu nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
        gap: 0;
    }

    .menu nav a {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        min-width: 0;

        padding: 8px 2px;

        text-align: center;
        white-space: nowrap;

        font-size: 12px;
        letter-spacing: 0;

        border-bottom: none;
        border-right: 1px dotted #aaaaaa;
    }

    .menu nav a:last-child {
        border-right: none;
    }

    .menu nav a:hover {
        padding-left: 2px;
    }
}

/* =========================
   雑記・個別記事 スマホ強制設定
========================= */

@media screen and (max-width: 700px) {

    body {
        font-size: 14px;
    }

    .site {
        width: 100%;
        max-width: none;
        margin: 0;
        border-left: none;
        border-right: none;
    }

    .layout {
        display: block;
    }

    main {
        width: 100%;
        box-sizing: border-box;
    }

    #diary-detail {
        width: 100%;
        box-sizing: border-box;
        padding: 10px 12px 30px !important;
    }

    #diary-detail h1 {
        font-size: 20px !important;
        line-height: 1.45 !important;
        margin: 5px 0 15px !important;
        overflow-wrap: anywhere;
    }

    #diary-detail .diary-detail-image {
        width: 100% !important;
        margin: 15px 0 18px !important;
    }

    #diary-detail .diary-detail-image img {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    #diary-detail .diary-detail-content {
        width: 100%;
    }

    #diary-detail .diary-detail-content p {
        margin: 0 !important;
        font-size: 14px !important;
        line-height: 1.8 !important;
    }

}
/* =========================
   スマホ版 仕上げ調整
========================= */

@media (max-width: 700px) {

    /* サイト左右の黒い枠線を戻す */
    .site {
        border-left: 2px solid #222222 !important;
        border-right: 2px solid #222222 !important;
    }


    /* =========================
       スマホ版 メニュー
    ========================= */

    /* 「情報」の右側には点線を付けない */
    .menu nav > a:nth-of-type(4) {
        border-right: none;
    }


    /* 管理者専用を2段目にする */
    .menu nav .admin-link {
        grid-column: 1 / -1;
        margin: 0;
        padding: 0;
        border-top: 1px solid #222222;
    }

    /* 管理者専用のリンク */
    .menu nav .admin-link a {
        display: block;
        width: 100%;
        padding: 8px 5px;
        border: none;
        text-align: left;
    }

}

/* =========================
   新ギャラリー
========================= */

.gallery-intro {
    margin-bottom: 20px;
}


/* =========================
   作者ごとのエリア
========================= */

.gallery-authors {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 20px;

    padding: 10px 20px 25px;
}


.gallery-author {
    min-width: 0;

    border: 1px solid #777777;

    background: #ffffff;
}


/* 作者タイトル */

.gallery-author-title {
    display: flex;

    align-items: center;

    gap: 8px;

    padding: 9px 12px;

    color: #444444;

    background: #eef4ec;

    border-bottom: 1px dotted #aaaaaa;

    font-size: 14px;
}


/* =========================
   作品グリッド
========================= */

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    padding: 12px;
}


/* 作品 */

.gallery-work {
    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    padding: 0;

    overflow: hidden;

    cursor: pointer;

    border: 1px solid #777777;

    background: #f5f8f4;
}


.gallery-work img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: opacity 0.15s;
}


.gallery-work:hover img {
    opacity: 0.7;
}


/* 複数枚表示 */

.gallery-count {
    position: absolute;

    right: 5px;
    bottom: 5px;

    padding: 2px 5px;

    color: #ffffff;

    background: rgba(0, 0, 0, 0.65);

    font-family: monospace;

    font-size: 11px;

    line-height: 1;
}


/* 作者ギャラリーへのリンク */

.gallery-more {
    margin: 0;

    padding: 0 12px 12px;

    text-align: right;
}


/* =========================
   ライトボックス
========================= */

#gallery-modal {
    width: min(900px, 92vw);

    height: min(90vh, 800px);

    padding: 0;

    border: 2px solid #222222;

    background: #ffffff;

    overflow: hidden;
}


#gallery-modal::backdrop {
    background: rgba(0, 0, 0, 0.65);
}


/* ライトボックス内部 */

.gallery-modal-inner {
    position: relative;

    display: flex;

    flex-direction: column;

    width: 100%;
    height: 100%;
}


/* =========================
   ×ボタン
========================= */

.gallery-modal-close {
    position: absolute;

    z-index: 10;

    top: 8px;
    right: 10px;

    width: 34px;
    height: 34px;

    padding: 0;

    border: none;

    color: #444444;

    background: rgba(255, 255, 255, 0.85);

    font-family: sans-serif;

    font-size: 28px;

    line-height: 30px;

    cursor: pointer;
}


.gallery-modal-close:hover {
    color: #63896c;
}


/* =========================
   画像エリア
   ★ここだけスクロール
========================= */

.gallery-image-area {
    flex: 1;

    min-height: 0;

    padding: 45px 20px 20px;

    overflow-y: auto;

    overflow-x: hidden;

    background: #f7f9f6;

    text-align: center;
}


/* 画像 */

.gallery-image-area img {
    display: block;

    width: auto;

    max-width: 100%;

    height: auto;

    margin: 0 auto 20px;

    border: 1px solid #777777;

    background: #ffffff;
}


.gallery-image-area img:last-child {
    margin-bottom: 0;
}


/* =========================
   作品情報
   ★ここは固定
========================= */

.gallery-info {
    flex-shrink: 0;

    max-height: 180px;

    padding: 15px 20px;

    border-top: 1px solid #222222;

    background: #ffffff;

    overflow-y: auto;
}


.gallery-info h3 {
    margin: 0 0 8px;

    color: #444444;

    font-size: 17px;
}


/* タグ */

.gallery-modal-tags {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;

    margin-bottom: 8px;
}


.gallery-modal-tags span {
    padding: 3px 7px;

    color: #63896c;

    background: #eef4ec;

    border: 1px solid #cbd8ca;

    font-size: 11px;
}


/* 説明 */

.gallery-modal-description {
    margin: 0;

    color: #555555;

    font-size: 13px;

    line-height: 1.7;

    white-space: pre-wrap;
}


/* =========================
   スマホ
========================= */

@media (max-width: 700px) {

    .gallery-authors {
        grid-template-columns: 1fr;

        gap: 18px;

        padding: 10px 12px 20px;
    }


    .gallery-grid {
        grid-template-columns:
            repeat(3, 1fr);

        gap: 7px;

        padding: 9px;
    }


    .gallery-author-title {
        font-size: 13px;
    }


    #gallery-modal {
        width: 94vw;

        height: 90vh;

        border-width: 1px;
    }


    .gallery-image-area {
        padding: 40px 10px 10px;
    }


    .gallery-info {
        max-height: 160px;

        padding: 12px 14px;
    }


    .gallery-info h3 {
        font-size: 15px;
    }


    .gallery-modal-description {
        font-size: 12px;

        line-height: 1.6;
    }

}


/* =========================
   ギャラリー投稿
   小さい画像プレビュー
   ========================= */

.gallery-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.gallery-preview-item {
    width: 110px;
    height: 110px;
    box-sizing: border-box;
    padding: 5px;
    border: 1px solid #555;
    background: #ffffff;
    cursor: grab;
    position: relative;
    transition:
        opacity 0.15s,
        border-color 0.15s,
        transform 0.15s;
}

.gallery-preview-item:active {
    cursor: grabbing;
}

.gallery-preview-item.is-dragging {
    opacity: 0.4;
}

.gallery-preview-item.drag-over {
    border-color: #333;
    transform: scale(1.05);
}

/* 画像 */
.gallery-preview-image-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8faf7;
}

.gallery-preview-image-box img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 「1枚目」などは小さく画像の上に表示 */
.gallery-preview-number {
    position: absolute;
    left: 5px;
    top: 5px;
    z-index: 2;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: bold;
}

/* ファイル名とドラッグ説明は非表示 */
.gallery-preview-name,
.gallery-preview-drag {
    display: none;
}

/* =========================
   ギャラリー確認画面
   ========================= */

.gallery-confirm-area {
    margin-top: 25px;
}

.gallery-confirm-box {
    padding: 15px;
    border: 2px solid #555;
    background: #fff;
}

.gallery-confirm-box p {
    margin: 8px 0;
}

.gallery-confirm-box strong {
    display: block;
    margin-top: 12px;
}

.gallery-confirm-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.gallery-confirm-images img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    background: #f8faf7;
    border: 1px solid #cbd8ca;
}

.gallery-confirm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.gallery-confirm-buttons button {
    padding: 10px 18px;
    border: 2px solid #555;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}

.gallery-confirm-buttons button:hover {
    background: #f0f5ef;
}

.gallery-modal-actions {
    display: none;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.gallery-modal-actions button {
    padding: 7px 14px;
    border: 1px solid #555;
    background: #fff;
    color: #555;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.gallery-modal-actions button:hover {
    background: #f0f4ef;
}

#gallery-modal-delete {
    border-color: #999;
}

.gallery-edit-form {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #aaa;
}

.gallery-edit-form h3 {
    margin-top: 0;
}

.gallery-edit-form label {
    display: block;
    margin-bottom: 12px;
    font-weight: bold;
}

.gallery-edit-form input,
.gallery-edit-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
    padding: 8px;
    border: 1px solid #999;
    background: #fff;
    font-family: inherit;
}

.gallery-edit-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.gallery-edit-buttons button {
    padding: 7px 14px;
    border: 1px solid #555;
    background: #fff;
    color: #555;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.gallery-edit-images {
    margin-bottom: 20px;
}

.gallery-edit-images h4 {
    margin: 0 0 10px;
}

.gallery-edit-images-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.gallery-edit-image-item {
    border: 1px solid #999;
    background: #fff;
    padding: 5px;
}

.gallery-edit-image-number {
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: bold;
}

.gallery-edit-image-item img {
    display: block;
    width: 100%;
    max-height: 150px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid #555;
}

.gallery-edit-image-delete {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 5px;
    border: 1px solid #999;
    background: #fff;
    color: #555;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.gallery-edit-image-delete:hover {
    background: #f0f4ef;
}

.gallery-edit-form {
    max-height: 70vh;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #999;
    background: #fff;
}

/* =========================
   作者別ギャラリー
   5列・画像メイン表示
========================= */

/* =========================
   作者ページは横幅いっぱい
========================= */

#gallery-author-container {
    display: block;
    width: 100%;
    padding: 0;
}

/* 外側の作者枠を消す */
#gallery-author-container .gallery-author {
    border: none;
    background: transparent;
    padding: 0;
}

/* 「つふじの作品」の見出しを消す */
#gallery-author-container .gallery-author-title {
    display: none;
}

/* 5列にする */
#gallery-author-container .gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    padding: 0;
}

/* 作品ボタンの枠を消す */
#gallery-author-container .gallery-work {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    overflow: hidden;
    display: block;
}

/* サムネイル */
#gallery-author-container .gallery-work img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
}

/* 複数画像の枚数表示 */
#gallery-author-container .gallery-count {
    position: absolute;
}

/* =========================
   作者別ギャラリー
   スマホ
========================= */

@media (max-width: 900px) {

    #gallery-author-container .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

}


@media (max-width: 600px) {

    #gallery-author-container .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

}

/* =========================
   管理者メニュー
========================= */

.admin-menu {
    max-width: 700px;
    margin: 30px auto;
    padding: 25px;
    border: 2px solid #000;
    background: #fff;
}

.admin-menu h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 2px dotted #000;
    text-align: center;
    font-size: 20px;
}

.admin-menu-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.admin-menu-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #000;
    background: #f8faf7;
    color: #000;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    box-shadow: 4px 4px 0 #000;
}

.admin-menu-buttons a:hover {
    background: #dfe9df;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

#logout-button {
    display: block;
    margin: 25px auto 0;
    padding: 8px 20px;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    cursor: pointer;
    font-family: inherit;
}

#logout-button:hover {
    background: #eee;
}


/* スマホ */
@media (max-width: 700px) {

    .admin-menu {
        margin: 20px 10px;
        padding: 18px;
    }

    .admin-menu-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .admin-menu-buttons a {
        min-height: 70px;
    }

}

/* =========================
   トップページ：最近のイラスト
========================= */

#latest-illust-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 15px 0;
}

#latest-illust-list .illust {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid #9b9b9b;
    background: #fff;
}

#latest-illust-list .illust a {
    display: block;
    width: 100%;
    height: 100%;
}

#latest-illust-list .illust img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================
   トップ・最近のイラスト
   スマホは3件・横一列
========================= */

@media (max-width: 700px) {

    #latest-illust-list.illust-list {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        width: 100% !important;
        gap: 8px !important;
        padding: 12px 0 !important;
        overflow: hidden;
    }

    #latest-illust-list.illust-list .illust {
        width: 100% !important;
        aspect-ratio: 3 / 4 !important;
        margin: 0 !important;
    }

    #latest-illust-list.illust-list .illust:nth-child(n + 4) {
        display: none;
    }

}

.youtube-thumbnail {
    display: block;
    max-width: 400px;
    margin: 15px 0;
    border: 2px solid #000;
    background: #fff;
}

.youtube-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
}

#diary-content-text {
    white-space: pre-wrap;
}

.gallery-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.gallery-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #e3f0e3;
    color: #4f6b4f;
    border: 1px solid #b8cdb8;
    font-size: 13px;
    cursor: pointer;
}

.gallery-tag:hover {
    background: #cfe2cf;
}

/* =========================
   更新情報 ＋ 今日のうに
========================= */

.top-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.top-info > section {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* 真ん中の縦線 */
.top-info::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #222;
}

/* 今日のうに側 */
.pet-box {
    text-align: center;
}

/* うにのエリア */
.pet-area {
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}


#pet-character {
    font-size: 64px;
    line-height: 1;
}

.pet-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.pet-buttons button {
    padding: 8px 12px;
    background: #fff;
    border: 2px solid #000;
    font-family: inherit;
    cursor: pointer;
}
.pet-count-box {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);

    width: 120px;

    border: 2px solid #000;
    background: #fff;
    box-sizing: border-box;
}

.pet-count-title {
    width: 100%;
    padding: 4px 0;

    border-bottom: 2px solid #000;

    text-align: center;
    font-size: 13px;
    font-weight: bold;
    box-sizing: border-box;
}

.pet-count-digits {
    display: flex;
    justify-content: center;
}

.pet-count-digits span {
    width: 22px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-right: 1px solid #000;

    font-size: 14px;
    font-weight: bold;
    box-sizing: border-box;
}

.pet-count-digits span:last-child {
    border-right: none;
}


.pet-buttons button:hover {
    background: #f0f5ef;
}

/* スマホ */
@media (max-width: 700px) {

    .top-info {
        grid-template-columns: 1fr;
    }

    .top-info::after {
        display: none;
    }

    .pet-box {
        padding-left: 0;
    }
}


/* =========================
   今日のうに：ハートパーティクル
========================= */

.heart-particle {
    position: absolute;
    pointer-events: none;
    font-size: 22px;
    animation: heart-float 1.2s ease-out forwards;
}

@keyframes heart-float {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-70px);
    }
}

#pet-character {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#uni-character {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    display: block;
    animation: uni-breathe 1.8s steps(1, end) infinite;
}

@keyframes uni-breathe {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }

    100% {
        transform: translateY(0);
    }
}