/* Jinja city guide map — desktop: side panel + tall map; tablet: map then a two-column list; phone: Map/List switch,
   swipeable categories and a bottom sheet for the chosen place. Colours follow the theme (--site-navy / --site-gold). */
.cg {
    --cg-ink: var(--site-navy, #452d2a); --cg-accent: var(--site-gold, #af522a); --cg-paper: var(--jm-paper-2, #fcf0e0);
    --cg-line: var(--jm-line, rgba(69, 45, 42, .18)); --cg-muted: rgba(69, 45, 42, .72); --cg-h: min(78vh, 760px);
    margin: 18px 0 8px; color: var(--cg-ink); font-family: var(--jm-text, Inter, Arial, sans-serif);
}
.cg *, .cg *::before, .cg *::after { box-sizing: border-box; }
.cg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* search row */
.cg-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.cg-search { flex: 1 1 auto; position: relative; }
.cg-search input { width: 100%; min-height: 50px; border: 1.5px solid var(--cg-line); border-radius: 999px; padding: 0 18px 0 44px; font-size: 16px; outline: 0; background: #fff; color: var(--cg-ink); }
.cg-search::before { content: ''; position: absolute; left: 17px; top: 50%; width: 16px; height: 16px; margin-top: -9px; border: 2px solid var(--cg-muted); border-radius: 50%; }
.cg-search::after { content: ''; position: absolute; left: 30px; top: 50%; width: 7px; height: 2px; margin-top: 6px; background: var(--cg-muted); transform: rotate(45deg); }
.cg-search input:focus { border-color: var(--cg-ink); box-shadow: 0 0 0 3px rgba(69, 45, 42, .12); }
.cg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--cg-line); background: #fff; color: var(--cg-ink); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.cg-btn:hover { border-color: var(--cg-ink); color: var(--cg-ink); text-decoration: none; }
.cg-btn.primary { background: var(--cg-ink); border-color: var(--cg-ink); color: #fff; }
.cg-btn.primary:hover { background: var(--cg-accent); border-color: var(--cg-accent); color: #fff; }
.cg-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.cg-near { min-height: 50px; flex: none; }

/* categories: wrap on wide screens, swipe on phones */
.cg-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 12px; }
.cg-chip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border: 1.5px solid var(--cg-line); background: #fff; color: var(--cg-ink); border-radius: 999px; padding: 8px 14px; min-height: 40px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.cg-chip small { color: var(--cg-muted); font-weight: 500; }
.cg-chip.is-on { border-color: var(--cg-ink); background: var(--cg-ink); color: #fff; }
.cg-chip.is-on small { color: rgba(255, 255, 255, .75); }
.cg-chip-all { font-weight: 700; border-style: dashed; }
.cg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }

/* Map / List switch (phones only) */
.cg-switch { display: none; }

/* layout */
.cg-body { display: grid; grid-template-columns: minmax(290px, 380px) 1fr; gap: 14px; height: var(--cg-h); min-height: 460px; }
.cg-list { overflow: auto; border: 1px solid var(--cg-line); background: var(--cg-paper); padding: 10px; overscroll-behavior: contain; scrollbar-width: thin; }
.cg-list ol { list-style: none; margin: 0; padding: 0; }
.cg-count { margin: 4px 6px 8px; color: var(--cg-muted); font-size: 13px; }
.cg-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 8px; min-height: 52px; cursor: pointer; color: inherit; border-bottom: 1px solid var(--cg-line); }
.cg-item:hover, .cg-item:focus-visible { background: rgba(255, 255, 255, .75); outline: none; }
.cg-item-text { flex: 1; min-width: 0; }
.cg-item-text b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-item-text b em { font-style: normal; font-size: 11px; color: #fff; background: var(--cg-accent); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.cg-item-text small { display: block; color: var(--cg-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-km { font-size: 12px; font-weight: 700; white-space: nowrap; }

/* tours */
.cg-tours { margin-bottom: 8px; }
.cg-tours[hidden] { display: none; }
.cg-tours-h { margin: 4px 6px 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--cg-accent); }
.cg-tour { border: 1px solid var(--cg-line); padding: 12px; margin-bottom: 8px; background: #fff; }
.cg-tour b { display: block; font-size: 15px; font-family: var(--jm-display, Archivo, sans-serif); }
.cg-tour small { display: block; color: var(--cg-muted); margin: 2px 0 6px; }
.cg-tour-stops { display: block; font-size: 12.5px; margin-bottom: 10px; }
.cg-tour-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cg-tour-actions .cg-btn { min-height: 38px; padding: 0 14px; font-size: 13px; }

/* map */
.cg-map-wrap { position: relative; overflow: hidden; border: 1px solid var(--cg-line); min-height: 320px; background: #e8e2d8; }
.cg-map { position: absolute; inset: 0; }
.cg-map-wrap:fullscreen { border: 0; }
.cg.is-max .cg-map-wrap { position: fixed; inset: 0; z-index: 1300; }
.cg-full { position: absolute; z-index: 700; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; color: var(--cg-ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .2); display: grid; place-items: center; cursor: pointer; }
.cg-full svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cg .leaflet-control-zoom a { width: 38px; height: 38px; line-height: 38px; font-size: 20px; }

/* place card */
.cg-card { position: absolute; z-index: 800; left: 14px; bottom: 14px; width: min(400px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto; background: #fff; padding: 18px 18px 16px; box-shadow: 0 22px 60px -14px rgba(0, 0, 0, .45); animation: cgUp .22s ease-out; }
.cg-card[hidden] { display: none; }
@keyframes cgUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cg-card h3 { margin: 4px 0 6px; font-size: 21px; line-height: 1.2; padding-right: 34px; font-family: var(--jm-display, Archivo, sans-serif); }
.cg-card-cat { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--cg-muted); text-transform: uppercase; letter-spacing: .06em; }
.cg-desc { margin: 0 0 8px; font-size: 14.5px; }
.cg-meta { margin: 0 0 4px; font-size: 14px; }
.cg-close { position: absolute; top: 10px; right: 10px; border: 0; background: var(--cg-paper); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; color: var(--cg-ink); }
.cg-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 14px 0 12px; }
.cg-actions .cg-btn { min-height: 44px; }
.cg-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--cg-line); padding-top: 12px; font-size: 13.5px; }
.cg-share span { color: var(--cg-muted); font-weight: 600; }
.cg-share a, .cg-share button { border: 0; background: var(--cg-paper); color: var(--cg-ink); border-radius: 999px; padding: 8px 14px; min-height: 36px; font-weight: 700; font-size: 13px; text-decoration: none; cursor: pointer; }
.cg-share a.wa { background: #25d366; color: #063b1c; }
.cg-credit { font-size: 12px; color: var(--cg-muted); margin: 10px 2px 0; }
.cg-credit a { color: inherit; }

/* pins and clusters */
.cg-pin { background: none; border: 0; }
.cg-pin span { display: block; width: 22px; height: 22px; margin: 2px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.cg-pin.is-featured span { width: 26px; height: 26px; margin: 0; box-shadow: 0 0 0 3px var(--cg-accent), 0 2px 8px rgba(0, 0, 0, .35); }
.marker-cluster { background: rgba(69, 45, 42, .2); border-radius: 50%; }
.marker-cluster div { width: 32px; height: 32px; margin: 4px; border-radius: 50%; background: var(--site-navy, #452d2a); color: #fff; font: 700 13px/32px Arial, sans-serif; text-align: center; }
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow { transition: transform .3s ease-out, opacity .3s ease-in; }

/* /jinja-map page */
.cg-page { padding: 28px 0 40px; }
.cg-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; color: var(--site-gold, #af522a); margin: 0; }
.cg-page h1 { font-size: clamp(28px, 4.4vw, 48px); margin: 4px 0 8px; color: var(--site-navy, #452d2a); }
.cg-intro { max-width: 760px; color: rgba(69, 45, 42, .8); font-size: 16px; }
.cg-more { margin-top: 14px; }

/* tablet: map on top, list below in two columns */
@media (max-width: 1023px) {
    .cg-body { grid-template-columns: 1fr; height: auto; min-height: 0; }
    .cg-map-wrap { height: 60vh; min-height: 380px; }
    .cg-list { max-height: none; overflow: visible; }
    .cg-list ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
    .cg-tours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .cg-tours-h { grid-column: 1 / -1; }
    .cg-tour { margin: 0; }
}

/* phone: swipeable chips, Map / List switch, bottom sheet */
@media (max-width: 640px) {
    .cg-near { width: 50px; padding: 0; font-size: 0; gap: 0; }
    .cg-near svg { width: 22px; height: 22px; }
    .cg-chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px 12px; }
    .cg-chips::-webkit-scrollbar { display: none; }
    .cg-chip { scroll-snap-align: start; }
    .cg-switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--cg-paper); border: 1px solid var(--cg-line); border-radius: 999px; padding: 4px; margin: 0 0 10px; position: sticky; top: 8px; z-index: 750; }
    .cg-switch button { border: 0; background: transparent; border-radius: 999px; min-height: 42px; font-weight: 700; color: var(--cg-ink); }
    .cg-switch button.is-on { background: var(--cg-ink); color: #fff; }
    .cg-body[data-cg-mode="map"] .cg-list { display: none; }
    .cg-body[data-cg-mode="list"] .cg-map-wrap { display: none; }
    .cg-map-wrap { height: 72vh; min-height: 420px; margin: 0 -12px; border-left: 0; border-right: 0; }
    .cg-list ol, .cg-tours { grid-template-columns: 1fr; }
    .cg-card { left: 0; right: 0; bottom: 0; width: auto; max-height: 75%; padding: 22px 16px 16px; box-shadow: 0 -12px 40px -10px rgba(0, 0, 0, .4); }
    .cg-card::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--cg-line); }
    .cg-card h3 { font-size: 19px; }
    .cg-actions { grid-template-columns: 1fr 1fr; }
    .cg-page { padding-top: 18px; }
}
/* Place photo at the top of the card. */
.cg-photo { position: relative; margin: -18px -18px 12px; aspect-ratio: 16 / 9; overflow: hidden; background: #e8e2d8; }
.cg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 10px 5px; font-size: 10.5px; line-height: 1.3; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.cg-card .cg-close { z-index: 2; }
@media (max-width: 640px) { .cg-photo { margin: -22px -16px 12px; aspect-ratio: 16 / 8; } }
