/**
 * フロント共通 — キャンプ場予約系検索一覧のレイアウト・トーンを参考
 * （カード型・自然系グリーン・柔らかい影）
 */

:root {
    --page-bg: #eef2eb;
    --surface: #ffffff;
    --text: #1e2820;
    --text-muted: #5a6458;
    --primary: #1e4d2e;
    --primary-hover: #2d6a42;
    --accent-warm: #62280a;
    --border-soft: #dde5d8;
    --shadow-card: 0 2px 14px rgba(25, 55, 35, 0.09);
    --radius-lg: 14px;
    --radius-md: 10px;
    --font-sans: system-ui, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    line-height: 1.55;
    color: var(--text);
    background: var(--page-bg);
}

a {
    color: var(--primary);
}
a:hover {
    color: var(--primary-hover);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
}

.main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* ヘッダー（軽い緑みのバー） */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(180deg, #fafcf9 0%, #f3f7f0 100%);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    flex-wrap: wrap;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--primary);
}

.nav-toggle {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #cfe0d1;
    border-radius: 8px;
    background: #fff;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    flex-direction: column;
    padding: 0;
}

.nav-toggle-bar {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: var(--primary);
    border-radius: 999px;
}

.nav {
    display: flex;
    gap: 0.65rem 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}
.nav a:hover {
    background: rgba(30, 77, 46, 0.08);
    color: var(--primary);
}

.nav-user {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.nav-mode-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #f0e8d8;
    color: #6a4a1a;
    border: 1px solid #e0d0b0;
}
.nav-mode-post {
    background: #e8f2e8;
    color: var(--primary);
    border-color: #cde0d0;
}

.site-footer {
    padding: 2rem 1rem;
    text-align: center;
    color: #8a9287;
    font-size: 0.82rem;
    border-top: 1px solid var(--border-soft);
    background: #e8ece5;
}

/* ヒーロー */
.hero {
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.35rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.hero h1 {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.03em;
}

.lead {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* ツールバー・フォーム操作 */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.35rem;
}

.sort-form {
    display: flex;
    gap: 0.65rem 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.sort-form label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.sort-form select {
    padding: 0.5rem 2rem 0.5rem 0.65rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface);
    font: inherit;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-width: 15rem;
    max-width: 100%;
}

.meta {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    justify-content: center;
    margin: 1.5rem 0 2rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.pagination-prev,
.pagination-next {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.pagination-prev:hover,
.pagination-next:hover {
    color: var(--primary-hover);
}

.pagination-status {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.post-next-actions {
    margin: 0 0 1rem;
    font-size: 0.92rem;
}

.post-next-actions a {
    font-weight: 700;
}

/* 一覧カード（検索結果型） */
.item-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.item-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.item-card:hover {
    box-shadow: 0 8px 28px rgba(25, 55, 35, 0.12);
    transform: translateY(-2px);
}

.item-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.item-card .thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(145deg, #e5ebe3 0%, #dce4d8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.no-img {
    color: #a0aaa0;
    font-size: 0.85rem;
}

.card-body {
    padding: 1rem 1.1rem 1.15rem;
}

.card-kicker {
    margin: 0 0 0.35rem;
}

.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #e8f2e8;
    color: var(--primary);
}

.badge-cat {
    background: #edf5ee;
    border: 1px solid #cfe3d4;
}

.card-title {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
}

.desc {
    margin: 0 0 0.55rem;
    font-size: 0.86rem;
    color: var(--accent-warm);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price {
    margin: 0;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--accent-warm);
    letter-spacing: 0.02em;
}

.price-label {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    vertical-align: middle;
}

/* パネル・フォーム共通 */
.panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.panel h1, .panel h2 {
    margin-top: 0;
    color: var(--primary);
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    margin-bottom: 0.25rem;
}

.panel-head h1 {
    margin: 0;
    font-size: 1.5rem;
    flex: 1 1 12rem;
}

.panel-head-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
    font-size: 0.88rem;
}

.panel-head-links a:not([class*="btn-"]) {
    font-weight: 700;
    white-space: nowrap;
}

.panel-head-links .btn-secondary {
    white-space: nowrap;
}

.form label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form select,
.form textarea {
    width: 100%;
    max-width: 36rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    font: inherit;
    background: #fafcfa;
}

.form textarea:focus,
.form input:focus,
.form select:focus {
    outline: 2px solid rgba(30, 77, 46, 0.25);
    border-color: var(--primary);
    background: var(--surface);
}

/* 下限〜上限を1行に（.form の number 幅100% を打ち消す） */
.form .inline-range {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.form .inline-range input.input-price {
    width: 7.25rem;
    max-width: none;
    flex: 0 0 auto;
    text-align: right;
}

.form .inline-range .range-sep {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--text-muted);
}

.label-row-range {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.6rem 0.85rem;
    margin-bottom: 1rem;
}

.label-row-range .label-row-range__text {
    flex: 0 0 auto;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

@media (max-width: 36rem) {
    .label-row-range {
        flex-wrap: wrap;
    }

    .label-row-range .inline-range {
        flex: 1 1 auto;
        min-width: min(100%, 12rem);
    }
}

.form button,
.actions form button[type="submit"],
.btn-secondary,
.btn-small {
    cursor: pointer;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    font: inherit;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(30, 77, 46, 0.25);
}

.form button:hover,
.actions form button[type="submit"]:hover,
.btn-secondary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #3d5244;
    box-shadow: none;
}

/* ボタン型リンク：`.btn-secondary` と同一パディング（上記グループ）*/
a.btn-secondary {
    display: inline-block;
    text-decoration: none;
}

/* 薄グレー背景のセカンダリ（ログアウトなど） */
.btn-secondary.btn-muted {
    background: #e8ebe6;
    color: var(--text);
    border: 1px solid var(--border-soft);
    box-shadow: none;
}

.btn-secondary.btn-muted:hover {
    background: #dde4d8;
    color: var(--primary-hover);
}

.btn-small {
    padding: 0.28rem 0.6rem;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    box-shadow: none;
}

.btn-danger {
    background: #a53a2f;
}

.btn-danger-outline {
    background: transparent;
    color: #9a3328;
    border: 2px solid #c45345;
    box-shadow: none;
}

.btn-danger-outline:hover {
    background: rgba(196, 83, 69, 0.1);
    color: #7a281f;
}

/* `.form button` より優先してアウトラインを維持 */
section.actions .form-revoke-deal button.btn-danger-outline {
    background: transparent;
    color: #9a3328;
    border: 2px solid #c45345;
    box-shadow: none;
}

section.actions .form-revoke-deal button.btn-danger-outline:hover {
    background: rgba(196, 83, 69, 0.1);
    color: #7a281f;
}

.form-revoke-deal {
    margin-top: 0.75rem;
}

.form-revoke-deal .hint {
    margin-bottom: 0.65rem;
}

.comment-contact-hidden {
    margin: 0.35rem 0 0;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-md);
    background: #f4f6f3;
    border: 1px dashed var(--border-soft);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
}

.alert-error {
    background: #fdeff0;
    color: #622;
    border: 1px solid #f0c4c8;
}

.alert-success {
    background: #ecf8ef;
    color: #153;
    border: 1px solid #bde5c8;
}

.alert-warn {
    background: #fff9e8;
    color: #640;
    border: 1px solid #edd9a8;
}

.hint, .notice {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.hint.hint-text-danger {
    color: #c62828;
    font-weight: 600;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-soft);
}

.deal-history-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
}

.deal-history-list li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
}

.deal-history-list a {
    font-weight: 700;
}

.panel h2 {
    margin: 1.35rem 0 0.5rem;
    font-size: 1.05rem;
    color: var(--primary);
}

.panel h2:first-of-type {
    margin-top: 0.5rem;
}

.drop-area {
    position: relative;
    border: 2px dashed var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: #f7faf6;
    margin-bottom: 2rem;
}

.drop-area-lead {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.drop-area input[type="file"][name="images[]"] {
    display: block;
    margin-top: 0.45rem;
    margin-bottom: 0.25rem;
}

.drop-area.dragover {
    background: #eef5ef;
    border-color: var(--primary);
}

.preview-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preview-list li {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #e5ebe3;
}

.preview-list img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-list button {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 0 0.25rem;
    font-size: 0.7rem;
}

.sortable-images {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sortable-images li {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    padding: 0.4rem;
    border-radius: var(--radius-md);
}

.sortable-images img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    padding: 0 0.25rem;
    color: #889080;
}

/* 詳細 */
.item-detail .price-big {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--accent-warm);
    margin: 0.5rem 0 1rem;
}

/* 詳細ギャラリー … 一覧カードのサムネ（.item-card .thumb）と同じ比率・切り抜き */
.detail-gallery {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    margin: 0 0 1rem;
}

.detail-gallery-item {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: linear-gradient(145deg, #e5ebe3 0%, #dce4d8 100%);
}

.detail-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list li {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-soft);
}

.comment-list header {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.my-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.my-item {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-soft);
}

.thumb-sm {
    width: 72px;
    height: 72px;
    background: #e5ebe3;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.thumb-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-item .meta {
    flex: 1;
}

.flags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin: 0.2rem 0;
}

/* マイ投稿：管理画面（items）と同じピル表現（admin.css と同系・一般ページ用） */
.my-item-admin-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.35rem 0 0.15rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border-soft);
}

.my-item-admin-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 0.15rem;
}

.my-item-admin-tags .admin-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.my-item-admin-tags .admin-pill-public {
    background: #edf5ee;
    color: var(--primary);
    border-color: #cfe3d4;
}

.my-item-admin-tags .admin-pill-muted {
    background: #ecefec;
    color: #555;
    border-color: #ddd;
}

.my-item-admin-tags .admin-pill-warn {
    background: #fff4e5;
    color: #8a4a10;
    border-color: #f0d4a8;
}

.my-item-admin-tags .admin-pill-ok {
    background: #e8f5ec;
    color: #1a5c30;
    border-color: #c5e5cf;
}

.my-item-admin-tags .admin-pill-info {
    background: #e8f0fa;
    color: #1e4a7a;
    border-color: #c8daf0;
}

.my-item-admin-tags .admin-pill-done {
    background: #e8f4ec;
    color: #0d5c2e;
    border-color: #a8d9b8;
}

.badge-muted {
    background: #ecefec;
    color: #444;
    font-size: 0.72rem;
}

.badge-ok {
    background: #e2f4e8;
    color: #062;
    font-size: 0.72rem;
}

.badge-warn {
    background: #fff2e0;
    color: #620;
    font-size: 0.72rem;
}

.badge-deal-ok {
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 0.72rem;
}

.badge-deal-verified {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #b8dfbf;
    font-size: 0.72rem;
}

/* 画像上の「売買認証済み」：中央・大きめ */
.deal-verified-on-image {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    max-width: 92%;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: rgba(30, 77, 46, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.deal-verified-fallback {
    margin: 0.35rem 0 0.5rem;
}

.deal-verified-on-image--inline {
    position: static;
    transform: none;
    display: inline-block;
    max-width: 100%;
    font-size: 0.95rem;
    pointer-events: auto;
}

.badge-deal-wait {
    background: #fff8e1;
    color: #bf360c;
    font-size: 0.72rem;
}

.badge-deal-none {
    background: #f0f0f0;
    color: #555;
    font-size: 0.72rem;
}

.badge-unknown {
    background: #ececec;
    color: #444;
    font-size: 0.72rem;
}

.small {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.hidden-offscreen {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.actions form {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 48rem) {
    .site-header {
        padding: 0.7rem 0.9rem;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-header .nav {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
        padding-top: 0.45rem;
        border-top: 1px solid var(--border-soft);
    }

    .site-header.nav-open .nav {
        display: flex;
    }

    .site-header .nav a {
        display: block;
        padding: 0.5rem 0.45rem;
    }
}
