/* =====================================================
   ⭐ お気に入りページ
   favorites.css

   ※ 写真関連CSSは favorites-photo.css に分離
===================================================== */


/* =====================================================
   ページ本体
===================================================== */

.favorites-page {

    width: 100%;
    max-width: 100%;

    box-sizing: border-box;

    padding: 12px 12px 110px;

    overflow-x: hidden;

    writing-mode: horizontal-tb;

}


/* =====================================================
   共通
===================================================== */

.favorites-page *,
.favorites-page *::before,
.favorites-page *::after {

    box-sizing: border-box;

    writing-mode: horizontal-tb;

}


/* =====================================================
   ヘッダー
===================================================== */

.favorites-header {

    width: 100%;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr);

    align-items: center;

    gap: 10px;

    margin-bottom: 14px;

}


/* =====================================================
   戻るボタン
===================================================== */

.favorites-header > button {

    flex-shrink: 0;

    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 8px 11px;

    background: #fff !important;

    color: var(--text) !important;

    font-size: 0.78rem;

    line-height: 1.2;

    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        0 2px 7px rgba(0,0,0,0.07);

}


/* =====================================================
   タイトル
===================================================== */

.favorites-header-title {

    min-width: 0;

    writing-mode: horizontal-tb;

}


.favorites-header-title h2 {

    margin: 0;

    font-size: 1.3rem;

    line-height: 1.4;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    writing-mode: horizontal-tb;

}


.favorites-header-title p {

    margin: 3px 0 0;

    font-size: 0.75rem;

    line-height: 1.4;

    opacity: 0.65;

    white-space: normal;

    writing-mode: horizontal-tb;

}


/* =====================================================
   セクション
===================================================== */

.favorites-section {

    width: 100%;

    margin-bottom: 15px;

    padding: 16px 12px;

    border-radius: 18px;

    background: #fff;

    box-shadow:
        0 3px 14px rgba(0,0,0,0.06);

}


/* =====================================================
   セクションヘッダー
===================================================== */

.favorites-section-header {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 10px;

}


.favorites-section-header > div {

    min-width: 0;

    flex: 1 1 auto;

}


.favorites-section-header h3 {

    margin: 0;

    font-size: 1rem;

    line-height: 1.4;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    writing-mode: horizontal-tb;

}


.favorites-section-header p {

    margin: 3px 0 0;

    font-size: 0.75rem;

    line-height: 1.4;

    opacity: 0.65;

    writing-mode: horizontal-tb;

}


/* =====================================================
   ⭐ 操作ボタン
   ＋ 🗑 📤 🔀
===================================================== */

.favorites-tools {

    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 8px;

    margin-bottom: 10px;

}


.favorites-tools button {

    width: 100%;

    height: 42px;

    min-height: 42px;

    padding: 0;

    border: 1px solid var(--border);

    border-radius: 10px;

    background: #fff !important;

    color: var(--text) !important;

    font-size: 18px;

    font-weight: normal;

    line-height: 1;

    display: flex;

    align-items: center;

    justify-content: center;

    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        0 2px 7px rgba(0,0,0,0.07);

    transition:
        transform 0.1s ease,
        box-shadow 0.15s ease;

}


.favorites-tools button:active {

    transform: scale(0.96);

    box-shadow:
        0 1px 3px rgba(0,0,0,0.08);

}


/* =====================================================
   イベント一覧
===================================================== */

.favorites-event-list {

    width: 100%;

}


/* =====================================================
   イベント
===================================================== */

.favorites-event {

    width: 100%;

    min-width: 0;

    min-height: 64px;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        24px;

    align-items: center;

    gap: 9px;

    padding: 10px 7px;

    border-bottom:
        1px solid rgba(0,0,0,0.07);

    background: transparent;

    text-align: left;

    cursor: pointer;

}


.favorites-event:last-child {

    border-bottom: none;

}


/* =====================================================
   日付
===================================================== */

.favorites-event-date {

    min-width: 0;

    font-size: 12px;

    opacity: 0.65;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


/* =====================================================
   イベント名
===================================================== */

.favorites-event-title {

    min-width: 0;

    font-size: 14px;

    font-weight: 700;

    line-height: 1.4;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


/* =====================================================
   カテゴリー
===================================================== */

.favorites-event-category {

    font-size: 12px;

    white-space: nowrap;

}


/* =====================================================
   矢印
===================================================== */

.favorites-event-arrow {

    width: 24px;

    min-width: 24px;

    text-align: center;

    font-size: 20px;

    opacity: 0.45;

}


/* =====================================================
   編集モード
===================================================== */

.favorites-event-editing {

    background: rgba(0,0,0,0.04);

    border-radius: 12px;

    box-shadow:
        inset 0 0 0 2px var(--accent);

}


/* =====================================================
   空表示
===================================================== */

.favorites-empty {

    padding: 20px 10px;

    text-align: center;

    font-size: 13px;

    opacity: 0.55;

}


/* =====================================================
   モーダルボタン
===================================================== */

.favorites-modal-buttons {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 8px;

    margin-top: 12px;

}


.favorites-modal-buttons button {

    min-height: 42px;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 9px;

    background: #fff !important;

    color: var(--text) !important;

    font-size: 13px;

    cursor: pointer;

}


/* =====================================================
   📤 共有一覧
===================================================== */

.favorite-share-list {

    display: flex;

    flex-direction: column;

    gap: 8px;

    margin: 12px 0;

}


.favorite-share-list button {

    width: 100%;

    min-height: 44px;

    border: 1px solid var(--border);

    border-radius: 11px;

    background: #fff !important;

    color: var(--text) !important;

    font-size: 14px;

    cursor: pointer;

}


/* =====================================================
   ⭐ お気に入り操作アイコン
   1日手帳と同じデザイン
===================================================== */

.favorites-section-header .memory-header-actions {

    display: flex;

    align-items: center;

    gap: 6px;

    flex-shrink: 0;

}


.favorites-section-header
.memory-header-actions button {

    width: 28px;

    height: 28px;

    padding: 0;

    margin: 0;

    background: none;

    border: none;

    color: var(--text);

    font-size: 20px;

    line-height: 1;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

}


/* =====================================================
   📱 スマホ
===================================================== */

@media (max-width: 420px) {

    .favorites-page {

        padding-left: 10px;

        padding-right: 10px;

    }


    .favorites-header {

        gap: 8px;

    }


    .favorites-header > button {

        padding: 7px 9px;

        font-size: 0.75rem;

    }


    .favorites-header-title h2 {

        font-size: 1.15rem;

    }


    .favorites-section {

        padding: 14px 10px;

    }


    .favorites-tools {

        grid-template-columns:
            repeat(4, 1fr);

        gap: 6px;

    }


    .favorites-tools button {

        height: 40px;

        min-height: 40px;

        font-size: 16px;

    }


    .favorites-event {

        grid-template-columns:
            minmax(0,1fr)
            auto
            22px;

        gap: 7px;

        padding-left: 4px;

        padding-right: 4px;

    }


    .favorites-event-title {

        font-size: 13px;

    }

}


/* =====================================================
   📱 極端に狭い画面
===================================================== */

@media (max-width: 350px) {

    .favorites-header-title h2 {

        font-size: 1rem;

    }


    .favorites-section-header {

        gap: 6px;

    }


    .favorites-tools {

        gap: 5px;

    }


    .favorites-tools button {

        height: 38px;

        min-height: 38px;

        font-size: 15px;

    }


    .favorites-event-title {

        font-size: 12px;

    }

}