/* =========================
   共通レイアウト
========================= */
body {

    margin: 0;

    font-family: -apple-system, BlinkMacSystemFont,
                 "Hiragino Kaku Gothic ProN",
                 "Noto Sans JP", sans-serif;

    background: #fff;

    color: #333;
}

main.container {
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height); /* ← 追加 */

    min-height: 100vh;
    
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
}

/* =========================
   共通カード
========================= */
.intro-card,
.post-form-card,
.info-card,
.post {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    margin: 20px auto;
    max-width: 680px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.site-catch {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin: 24px 0 32px;
    color: #444;
}

.top-lead {
    max-width: 640px;
    margin: 0 auto 48px;
    color: #555;
    line-height: 1.9;
    font-size: 0.95rem;
    text-align: center;
}

.top-lead p {
    margin-bottom: 1.4em;
}

.user-count {
    text-align: center;
    padding: 20px 0;
    font-size: 0.85rem;
    color: #777;
}

.small {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.site-footer{
    text-align:center;
    padding:30px 0;
    font-size:14px;
    color:#777;
    border-top:1px solid #eee;
}

.site-footer .user-count{
    margin-bottom: 6px;
    font-size: 14px;
    text-align: center;
    margin: 0 auto;
    display: block;
}

/* =========================
   リセット & 共通設定
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}


/* warning-bar がある時だけ */
body.has-warning {
    padding-top: 56px; /* warning-bar の高さ */
}

/* =========================
   ログイン画面
========================= */
.post-form-card{
    max-width:640px;
    margin:40px auto;
    padding:30px;
    background:#fff;
    border-radius:10px;
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
    text-align:center;
}

.intro-card{
    text-align:center;
    margin:40px auto 20px;
}

.page-title{
    font-size:26px;
    margin-bottom:10px;
}

.page-description{
    color:#666;
}

.intro-card{
    text-align:center;
    margin:40px auto 20px;
}

.page-title{
    font-size:26px;
    margin-bottom:10px;
}

.page-description{
    color:#666;
}

.post-form-card form p{
    margin-bottom:18px;
    text-align:left;
}

.post-form-card input{
    width:100%;
    padding:10px;
    border:1px solid #ccc;
    border-radius:6px;
    font-size:14px;
}

.post-form-card input{
    width:100%;
    padding:10px;
    border:1px solid #ccc;
    border-radius:6px;
    font-size:14px;
}

.submit-btn{
    width:100%;
    padding:12px;
    background:#222;
    color:#fff;
    border:none;
    border-radius:6px;
    font-size:15px;
    cursor:pointer;
    margin-top:10px;
}

.submit-btn:hover{
    background:#000;
}

.form-footer{
    margin-top:20px;
    font-size:14px;
}

.form-footer a{
    color:#0077ff;
    text-decoration:none;
}

.form-footer a:hover{
    text-decoration:underline;
}

/* =========================
   ログアウト（フッター上）
========================= */

.logout-wrapper {
    display: flex;
    justify-content: center;
    margin: 40px 0 20px;
}

.logout-pill {
    background: #ffffff;
    color: #555;
    border: 1px solid #ddd;
    padding: 8px 26px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-pill:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}



/* ===== マイページ ===== */
.mypage {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    text-align: center;
    margin-bottom: 40px;
}

.avatar {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #eee;
}

section {
    margin-bottom: 40px;
}

section h3 {
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.message-card {
    background: #f9fafb;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
}



/* ===== 共通カードレイアウト ===== */

.card {
    max-width: 640px;
    margin: 40px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.card-title {
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4rem;
}

.card-form .form-group {
    margin-bottom: 16px;
}

.card-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.card-form textarea,
.card-form input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.card-actions {
    text-align: center;
    margin-top: 24px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
}

.btn.primary {
    background: #222;
    color: #fff;
}

.card-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}



/* ===== メッセージフォーム ===== */

.message-form {
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
}

.form-textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid #ccc;
    resize: vertical;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}





.content-card {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.section-title {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.list-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.list-item:last-child {
    border-bottom: none;
}

.item-title {
    display: block;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

.item-title:hover {
    text-decoration: underline;
}

.item-meta {
    font-size: 0.85rem;
    color: #777;
    margin-top: 2px;
}

.empty-text {
    color: #888;
    font-size: 0.9rem;
}



.profile-image-area {
    text-align: center;
    margin-bottom: 12px;
}

.profile-image {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}






/* ===== マイページメッセージフォーム ===== */
.badge.unread {
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 6px;
}

.important {
    color: gold;
    margin-right: 4px;
}




/* ===== 応援（Buy Me a Coffee） ===== */

/* ===== 応援（支援）セクション ===== */
.support-card {
    margin: 32px auto 0;
    padding: 20px;
    max-width: 520px;
    background: #fff7f9;            /* ほんのり桜背景 */
    border: 1px solid #f3c1d1;      /* 桜色の枠線 */
    border-radius: 12px;
    text-align: center;
}

.support-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 16px;
}

/* 🌸 応援ボタン */
.btn.support {
    display: inline-block;
    padding: 10px 20px;
    background: #e86a8d;            /* 桜の花びら色 */
    color: #fff;
    border-radius: 999px;           /* やさしい丸み */
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn.support:hover {
    background: #d95c7d;
    transform: translateY(-1px);
}

/* ※ 任意注意書き */
.support-note {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #888;
}

/* 🌸 = */
/* 「この場所を応援してくれた人」 */
.supporter-badge {
    margin-left: 6px;
    font-size: 0.9em;
    color: #e86a8d;      /* さくら色 */
    vertical-align: middle;
    opacity: 0.9;
}

.supporter-message {
    margin-top: 4px;
    font-size: 0.85em;
    color: #b85c7a; /* 桜色 */
    text-align: center;
}





/* 投稿日 + 管理操作 横並び */
.meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px; /* 投稿日と同じ */
    color: #777;
}

/* 投稿日 */
.meta-date {
    white-space: nowrap;
}

/* 管理用リンク */
.meta-link {
    all: unset;               /* ← これが決定打 */
    cursor: pointer;
    font-size: inherit;
    color: #b00020;
    text-decoration: underline;
}

.meta-link:hover {
    color: #ff0033;
}

/* 危険操作 */
.meta-link.danger {
    color: #b00020;
}

.meta-link.danger:hover {
    color: #ff0033;
}

/* formをインライン化 */
.inline-form {
    display: inline;
    margin: 0;
    all: unset; 
}

.action-row {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}


.important {
    color: #e53935;
    font-weight: bold;
}



/* プロフィール画像クリックで拡大表示 */
.avatar-clickable {
    cursor: pointer;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0,0,0,0.85);
}

.image-modal-content {
    display: block;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    margin-top: 5%;
}

.image-modal .close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}







/* 保存セクション専用 */
.saved-section-title {
    font-size: 20px;
    font-weight: bold;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

/* 保存専用カード */
.saved-list-item {
    background: #ffffff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: 0.2s ease;
}

.saved-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* 未読だけ強調 */
.unread {
    background: #fff3cd;
    font-weight: bold;
}

/* マイページ */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.action-item {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: 0.2s;
}

.action-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}


/* =========================
   ダッシュボード全体
========================= */
.dashboard {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* =========================
   タイトル
========================= */
.dashboard-title {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 28px;
    color: #333;
}

/* =========================
   セクション
========================= */
.dashboard-section {
    margin-bottom: 28px;
}

.dashboard-section h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: #555;
}

/* =========================
   ボタン
========================= */
.dashboard-button {
    display: block;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;

    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;

    background: #e5e7eb;
    color: #333;

    transition: background 0.2s, transform 0.1s;
}

.dashboard-button:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

/* メイン */
.dashboard-button.primary {
    background: #4f46e5;
    color: white;
}

.dashboard-button.primary:hover {
    background: #4338ca;
}

/* サブ */
.dashboard-button.ghost {
    background: white;
    border: 1px solid #ccc;
}

/* =========================
   時計
========================= */
.dashboard-clock {
    text-align: center;
    font-size: 1.1rem;
    margin: 20px 0 28px;
    color: #666;
}

/* =========================
   建設中表示
========================= */
.disabled-box {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
}

/* PWA */
/* =========================
📲 PWA Install Popup
========================= */

.pwa-popup {
    position: fixed;
    inset: 0;

    display: none;

    justify-content: center;
    align-items: center;

    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);

    z-index: 99999;
}

/* 表示 */
.pwa-popup.show {
    display: flex;
}

/* 本体 */
.pwa-popup-content {
    width: 85%;
    max-width: 340px;

    padding: 24px 20px;

    border-radius: 24px;

    background: rgba(20,20,20,0.95);

    text-align: center;

    color: white;

    box-shadow:
        0 10px 40px rgba(0,0,0,0.5);

    animation: popupFade 0.25s ease;
}

/* タイトル */
.pwa-popup-content h3 {
    margin-top: 0;
    margin-bottom: 10px;

    font-size: 22px;
}

/* 説明 */
.pwa-popup-content p {
    margin-bottom: 20px;

    color: rgba(255,255,255,0.75);
    line-height: 1.6;
}

/* ボタン群 */
.pwa-buttons {
    display: flex;
    gap: 10px;
}

/* ボタン共通 */
.pwa-buttons button {
    flex: 1;

    border: none;
    border-radius: 999px;

    padding: 12px;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

/* インストール */
#pwa-install-btn {
    background: linear-gradient(
        135deg,
        #ff2d55,
        #ff5e62
    );

    color: white;
}

/* 閉じる */
#pwa-close-btn {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
}

/* アニメ */
@keyframes popupFade {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 全画面共通 */
/* =========================
   戻るボタンエリア
========================= */
.terms-actions{
    margin-top: 40px;

    display: flex;
    justify-content: center;
}

/* =========================
   戻るボタン
========================= */
.btn-back{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 12px 20px;

    border: none;
    border-radius: 999px;

    background: #f3f4f6;
    color: #374151;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform .15s ease,
        background .15s ease,
        box-shadow .15s ease;

    box-shadow:
        0 2px 8px rgba(0,0,0,0.06);
}

/* SVG */
.btn-back svg{
    width: 22px;
    height: 22px;

    flex-shrink: 0;

    stroke: currentColor;
}

/* hover */
.btn-back:hover{
    background: #e5e7eb;

    transform: translateY(-1px);

    box-shadow:
        0 6px 16px rgba(0,0,0,0.08);
}

/* active */
.btn-back:active{
    transform: scale(0.96);
}

/* ダークモード対応したい未来用 */
@media (prefers-color-scheme: dark){

    .btn-back{
        background: #2a2a2a;
        color: #f3f4f6;
    }

    .btn-back:hover{
        background: #3a3a3a;
    }
}

/* ==========================
   SPIRYTUS Toast
========================== */

.sp-toast-container {
    position: fixed;
    top: 200px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000000000;
    pointer-events: none;
}

.sp-toast {
    min-width: 280px;
    max-width: 420px;

    padding: 15px 20px;
    margin-bottom: 12px;

    border-radius: 14px;

    color: #fff;

    font-size: 15px;
    font-weight: bold;

    text-align: center;

    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);

    animation: spToastIn .35s ease;
}

.sp-toast.success {
    background: #27ae60;
}

.sp-toast.error {
    background: #e74c3c;
}

.sp-toast.warning {
    background: #f39c12;
}

.sp-toast.info {
    background: #3498db;
}

@keyframes spToastIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.sp-toast.hide {
    animation: spToastOut .35s forwards;
}

@keyframes spToastOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}


/* =========================================
   SPIRYTUS 固定ヘッダー・フッター
========================================= */

/* ヘッダー */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    width: 100%;
    height: var(--header-height);

    z-index: 9000;

    background: #fff;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

/* フッター */
.feed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    width: 100%;
    height: var(--footer-height);

    z-index: 9000;

    background: #fff;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

/* =========================================
   キーボード・画像拡大時は非表示
========================================= */

body.ui-chrome-hidden .site-header {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

body.ui-chrome-hidden .feed-footer {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}