/*
 * Crete Guide page styles.
 * All classes start with "cg-" (Crete Guide) so they never clash with the rest of the site.
 * Colours reuse the brand variables from layouts/app.blade.php (--brand-orange, --brand-blue).
 * Plain CSS on purpose: no Tailwind rebuild is needed when this file changes.
 * The map is Google Maps (see public/js/guide-map.js).
 *
 * Minimal redesign (Oct 2026):
 *   - Light "paper" background instead of the navy bar. Serif title (Instrument Serif,
 *     same as the homepage hero).
 *   - Colour is used sparingly: small dots on chips, soft tinted icons in the list.
 *     Map pins keep their full colour so they stand out on the map.
 *   - List items are simple rows with thin lines, not boxed cards.
 *   - The map has rounded corners and sits inside the page on desktop.
 */

.cg {
    --ink: #1F2328;          /* main text */
    --muted: #6B7280;        /* secondary text */
    --line: #E7E3DB;         /* thin borders */
    --paper: #FAF8F4;        /* warm off-white background */
    background: var(--paper); color: var(--ink);
}

/* ---------- Top bar ---------- */
.cg-top {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between;
    padding: 28px 24px 16px;
}
/* h2 = the homepage section (the homepage already has its own h1) */
.cg-title h1, .cg-title h2 {
    font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
    font-size: 2.4rem; line-height: 1; letter-spacing: -.01em;
}
.cg-title p { margin-top: 6px; font-size: .9rem; color: var(--muted); }
.cg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Search: a pill with the magnifier icon inside */
.cg-search {
    display: flex; align-items: center; gap: 8px; min-width: 260px;
    padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
    background: #fff; color: var(--muted); transition: border-color .2s;
}
.cg-search:focus-within { border-color: var(--ink); }
#cg-search {
    flex: 1; min-width: 0; padding: 9px 0; border: 0; outline: none;
    /* White background set on purpose: the site's CSS reset makes inputs transparent */
    background: #fff; color: var(--ink); font-size: .9rem;
}

/* Phones: a compact header so the map is visible without scrolling.
   Search takes the full width; the buttons share ONE row below it. */
@media (max-width: 640px) {
    .cg-top { padding: 18px 14px 10px; gap: 12px; }
    .cg-title h1, .cg-title h2 { font-size: 1.9rem; }
    .cg-title p { display: none; } /* the chips already show the counts */
    .cg-actions { width: 100%; gap: 6px; }
    .cg-search { flex: 1 1 100%; min-width: 0; }
    .cg-actions .cg-btn { flex: 1 1 0; justify-content: center; padding: 8px 6px; font-size: .8rem; white-space: nowrap; }
    .cg-chips { padding: 4px 14px 12px; }
}

/* ---------- Buttons ---------- */
/* Quiet outlined pills. Only "My list" is filled, so the eye goes there. */
.cg-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
    border-radius: 999px; border: 1px solid var(--line);
    background: transparent; color: var(--ink); font-size: .85rem; font-weight: 500;
    cursor: pointer; transition: background .2s, border-color .2s;
}
.cg-btn:hover { background: #fff; border-color: #CFC9BE; }
.cg-btn i { font-size: .8rem; color: var(--muted); }
a.cg-btn { text-decoration: none; } /* the homepage "Full screen" link looks like a button */
.cg-btn-main { background: var(--ink); border-color: var(--ink); color: #fff; }
.cg-btn-main:hover { background: #000; border-color: #000; }
.cg-btn-main i { color: #fff; }
/* Saved count: a small orange badge */
#cg-saved-count {
    min-width: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--brand-orange); color: #fff; font-size: .7rem; line-height: 18px; text-align: center;
}

/* ---------- Category chips ---------- */
/* "On" chips look normal, "off" chips fade out. The colour is just a small dot. */
.cg-chips { display: flex; gap: 6px; padding: 0 24px 16px; overflow-x: auto; }
.cg-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
    background: transparent; color: var(--muted); font-size: .82rem; font-weight: 500;
    cursor: pointer; opacity: .55; transition: all .2s;
}
.cg-chip:hover { opacity: 1; }
.cg-chip.is-on { background: #fff; color: var(--ink); opacity: 1; }
.cg-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip); }
.cg-chip-count { font-size: .72rem; color: var(--muted); }

/* ---------- Shared / saved list banner ---------- */
.cg-banner {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin: 0 24px 12px; padding: 10px 14px; border-radius: 12px;
    background: #FFF4EC; font-size: .9rem; font-weight: 600;
}
.cg-banner[hidden] { display: none; }
.cg-banner .cg-btn { background: #fff; }

/* ---------- Main area: list + map ---------- */
/* Phones: map on top, list below. Desktop (900px+): list left, map right. */
.cg-main { display: flex; flex-direction: column-reverse; }
/* Phones: 50vh is enough for the (wide, flat) island, and the list peeks in below */
.cg-map { height: 50vh; z-index: 0; }
.cg-list { padding: 4px 14px 14px; }

@media (min-width: 900px) {
    .cg-main { flex-direction: row; gap: 8px; padding: 0 16px 16px 8px; height: calc(100vh - 210px); min-height: 520px; }
    .cg-list { width: 360px; flex: 0 0 360px; overflow-y: auto; padding: 0 8px 0 16px; }
    .cg-map { flex: 1; height: auto; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
    /* Homepage section: a fixed height, because the block is not the whole page there */
    .cg-embedded .cg-main { height: 620px; }
}

/* ---------- List rows ---------- */
.cg-card {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 10px;
    border-bottom: 1px solid var(--line); border-radius: 10px; cursor: pointer;
    transition: background .2s;
}
.cg-card:hover { background: #fff; }
.cg-card-body { flex: 1; min-width: 0; }
.cg-card h3 { font-size: .95rem; font-weight: 600; color: var(--ink); }
.cg-dot, .cg-pin {
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
    border-radius: 50%; color: #fff;
}
/* List icon: soft tint of the category colour */
.cg-dot {
    width: 32px; height: 32px; font-size: .78rem;
    background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c);
}
.cg-meta { font-size: .75rem; color: var(--muted); margin: 2px 0 4px; }
.cg-desc {
    font-size: .83rem; line-height: 1.45; color: #4B5563;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cg-empty { padding: 30px 10px; text-align: center; color: var(--muted); }
/* "127 spots" line on top of the list */
.cg-count {
    margin: 4px 10px 2px; font-size: .7rem; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

/* Heart (save) button */
.cg-heart {
    border: 0; background: none; font-size: 1rem; color: #C4BFB6; cursor: pointer; padding: 4px;
    transition: color .2s;
}
.cg-heart:hover { color: var(--brand-orange); }
.cg-heart.is-saved { color: var(--brand-orange); }

/* ---------- Map pins and popups ---------- */
/* Map pin: solid category colour, so it is easy to spot on the map */
.cg-pin {
    width: 24px; height: 24px; font-size: .62rem; background: var(--c);
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    transition: transform .15s;
}
.cg-pin:hover { transform: scale(1.2); }

/* Numbered circle for a group of nearby pins (see clusterPin() in guide-map.js).
   White with dark text: calm on the blue sea, and does not fight the coloured pins. */
.cg-cluster {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: #fff; color: var(--ink); font-weight: 600; font-size: .8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
    cursor: pointer; transition: transform .15s, background .15s, color .15s;
}
.cg-cluster.is-big { width: 40px; height: 40px; font-size: .9rem; }
.cg-cluster:hover { transform: scale(1.1); background: var(--ink); color: #fff; }
.cg-popup { color: #1F2328; }
.cg-popup h3 { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.35rem; font-weight: 400; line-height: 1.1; }
.cg-popup p { margin: 4px 0; font-size: .83rem; line-height: 1.45; }

/* Blue "you are here" dot after "Near me" */
.cg-user-dot {
    width: 18px; height: 18px; border-radius: 50%; background: #2563EB;
    border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37, 99, 235, .25);
}
/* flex-wrap: on narrow phones the buttons go to a 2nd line instead of making the popup scroll */
.cg-popup-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 10px; }
.cg-popup-actions a, .cg-popup-actions button:not(.cg-heart) {
    /* inline-flex + nowrap: keeps icon and text on one line (the "Go" button wrapped before) */
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    padding: 6px 10px; border-radius: 999px; border: 1px solid #E7E3DB; background: #fff;
    color: #1F2328 !important; font-size: .78rem; font-weight: 500; cursor: pointer; text-decoration: none;
}
.cg-popup-actions a:first-child { background: #1F2328; border-color: #1F2328; color: #fff !important; }
.cg-popup-actions .fa-whatsapp { color: #25D366; font-size: .95rem; }

/* ---------- Toast message ---------- */
.cg-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px);
    padding: 10px 18px; border-radius: 999px; background: #1F2328; color: #fff; font-size: .85rem;
    opacity: 0; pointer-events: none; transition: all .3s; z-index: 1000;
}
.cg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
