@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Nunito:wght@400;600;700&display=swap');

:root {
    --cream: #f6f1e6;
    --honey: #d9a441;
    --sage: #6b7f4f;
    --sage-dark: #4e5e39;
    --ink: #33301f;
    --line: #ddd3ba;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    background: var(--cream);
    color: var(--ink);
}

h1, h2, h3 { font-family: 'Fraunces', serif; font-weight: 600; margin: 0; }

header {
    background: var(--sage-dark);
    color: var(--cream);
    padding: 18px 24px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

header h1 { font-size: 1.4rem; }
header a { color: var(--honey); text-decoration: none; font-weight: 700; }
header a:hover { text-decoration: underline; }

.subtitle { color: var(--line); font-size: 0.9rem; }

main { max-width: 1000px; margin: 0 auto; padding: 20px; }

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 18px;
}

label { display: block; font-weight: 700; margin: 12px 0 4px; font-size: 0.92rem; }

input[type=text], input[type=email], input[type=tel], input[type=url], textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
}

textarea { min-height: 70px; resize: vertical; }

.checkbox-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.checkbox-row label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px 12px;
    margin: 0;
    cursor: pointer;
    font-size: 0.88rem;
}

button, .btn {
    background: var(--sage);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
}
button:hover, .btn:hover { background: var(--sage-dark); }

#map { height: 65vh; min-height: 400px; border-radius: 10px; border: 1px solid var(--line); }

.status-msg { padding: 10px 14px; border-radius: 6px; margin-top: 12px; font-size: 0.9rem; }
.status-msg.ok { background: #e8efe0; color: var(--sage-dark); }
.status-msg.err { background: #f6dede; color: #8a2e2e; }

.leaflet-popup-content { font-family: 'Nunito', sans-serif; }
.leaflet-popup-content h3 { font-size: 1rem; margin-bottom: 4px; }
.popup-tag {
    display: inline-block;
    background: var(--cream);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.75rem;
    margin: 2px 3px 0 0;
}
.popup-note { font-size: 0.85rem; color: #555; margin-top: 6px; font-style: italic; }

.hint { font-size: 0.82rem; color: #777; margin-top: 3px; }

footer { text-align: center; padding: 20px; color: #8a8368; font-size: 0.85rem; }

/* ---------------- v3 additions ---------------- */

/* Search row on the main map (ZIP + near-me + status message). */
.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}
.search-row input[type=text] {
    max-width: 220px;
    padding: 8px 10px;
}
.search-row button {
    padding: 8px 14px;
    font-size: 0.9rem;
}
.search-row .hint { margin: 0; }

/* Popup: product-type chip is a warmer honey tone to stand out. */
.popup-tag.popup-tag-product { background: #fbeacc; }

/* Stale-listing marker: turn the default blue Leaflet icon grayscale. */
.stale-marker { filter: grayscale(1) opacity(0.65); }

/* "See full listing" link inside popup. */
.popup-more { margin-top: 8px; font-size: 0.85rem; }
.popup-more a { color: var(--sage-dark); font-weight: 700; }

/* Stale-warning line inside popup and banner on the listing page. */
.popup-stale {
    font-size: 0.82rem;
    color: #8a5a1a;
    margin-top: 6px;
    padding: 4px 8px;
    background: #fbeacc;
    border-radius: 4px;
}
.stale-banner {
    background: #fbeacc;
    color: #8a5a1a;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.92rem;
}

/* Success panel after a listing is submitted — edit-token display. */
.edit-link-box {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}
.edit-link-box input {
    flex: 1;
    padding: 10px 12px;
    font-family: monospace;
    font-size: 0.85rem;
    background: #f6f1e6;
    border: 2px solid var(--honey);
    border-radius: 6px;
}
.edit-link-box button {
    padding: 10px 16px;
    background: var(--honey);
    color: white;
}
.edit-link-box button:hover { background: #b8862a; }

/* Flash messages on edit.php after save/confirm/errors. */
.flash-ok  { background: #e8efe0; color: var(--sage-dark); border-color: var(--sage); }
.flash-err { background: #f6dede; color: #8a2e2e; border-color: #c88; }

/* "Danger" button variant for delete actions. */
button.danger { background: #b33; }
button.danger:hover { background: #922; }
