/* Rio Guidebook — identidade "caderno de desenho" */
:root {
  --paper: #F3ECDD; --card: #F8F3E8; --line: #D3C7AD; --green: #1E3A2B; --green-d: #14291E;
  --blue: #2B4C7E; --ochre: #7F5616; --muted: #4F5B50; --sand: #F1E4C6; --sand-line: #D9C08A;
  --side: 24px; --nav: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--green); font-family: 'Jost', system-ui, sans-serif; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
a { color: var(--blue); }
button, input, select { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, .serif { font-family: 'Libre Caslon Display', Georgia, serif; font-weight: 400; letter-spacing: -0.01em; }
.hand { font-family: 'Caveat', cursive; color: var(--blue); }
.kicker { font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ochre); }
.muted { color: var(--muted); }
.wrap { max-width: 720px; margin: 0 auto; }
.pad { padding: 0 var(--side); }
.rule { height: 1px; background: var(--line); margin: 0 var(--side); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar & bottom nav ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); display: flex; align-items: center; justify-content: space-between; padding: 12px var(--side); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Libre Caslon Display', serif; font-size: 21px; color: var(--green); text-decoration: none; }
.back { background: none; border: none; color: var(--green); font-weight: 600; min-height: 44px; padding: 0 4px; }
main { padding-bottom: calc(var(--nav) + 24px + env(safe-area-inset-bottom)); }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; min-height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; }
.nav a svg { width: 22px; height: 22px; }
.nav a[aria-current="page"] { color: var(--green); font-weight: 600; }
.nav a[aria-current="page"]::after { content: ''; width: 18px; height: 2px; background: var(--ochre); margin-top: 1px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 2px; border: 1.5px solid var(--green); background: var(--green); color: #F8F3E8; font-weight: 500; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--green); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: #8A2E1F; border-color: #8A2E1F; }
.link { background: none; border: none; color: var(--blue); font-weight: 500; padding: 0; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; }
.saved { background: var(--sand); color: var(--ochre); border-color: var(--sand-line); }

/* ---------- landing ---------- */
.hero { padding: 32px var(--side) 40px; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { margin: 0; font-size: clamp(38px, 9vw, 56px); line-height: 1.06; letter-spacing: -0.02em; }
.hero .bar { width: 44px; height: 1.5px; background: var(--ochre); }
.hero .lead { margin: 0; font-size: 12px; line-height: 1.8; letter-spacing: 0.1em; text-transform: uppercase; max-width: 340px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.section { padding: 36px var(--side) 12px; display: flex; flex-direction: column; gap: 18px; }
.section h2 { margin: 0; font-size: 29px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.tile b { font-family: 'Libre Caslon Display', serif; font-weight: 400; font-size: 30px; }
.tile span { font-size: 14px; color: var(--muted); line-height: 1.5; }
.price { border: 2px solid var(--green); border-radius: 2px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.price .amount { font-family: 'Libre Caslon Display', serif; font-size: 38px; }
.price ul { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.note-test { background: var(--sand); border: 1px solid var(--sand-line); padding: 12px 14px; font-size: 14px; color: var(--ochre); border-radius: 2px; line-height: 1.5; }

/* ---------- cards ---------- */
.card { display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 18px; color: var(--green); text-decoration: none; }
.card .meta { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ochre); font-weight: 500; }
.card .name { font-family: 'Libre Caslon Display', serif; font-size: 22px; line-height: 1.15; }
.card .ex { font-size: 14px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.list { display: flex; flex-direction: column; gap: 12px; }

/* ---------- explore ---------- */
.explore-head { padding: 18px var(--side) 6px; display: flex; flex-direction: column; gap: 12px; }
.explore-head h1 { margin: 0; font-size: 32px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--card); border-radius: 2px; color: var(--green); font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--green); color: #F8F3E8; border-color: var(--green); }
.search { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); background: var(--card); border-radius: 2px; }
.mapbox { position: relative; margin: 10px var(--side) 0; height: 48vh; min-height: 300px; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: #efe6d2; }
#map, .minimap { width: 100%; height: 100%; }
.map-err { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--muted); font-size: 15px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); padding: 8px var(--side) 0; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1.5px solid #F8F3E8; box-shadow: 0 0 0 1px var(--line); }
.peek { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 16px 16px 12px; box-shadow: 0 6px 22px rgba(30, 58, 43, 0.18); display: flex; flex-direction: column; gap: 6px; max-height: calc(100% - 20px); overflow: auto; }
.peek .x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: none; background: none; font-size: 22px; color: var(--muted); }
.peek .name { font-family: 'Libre Caslon Display', serif; font-size: 22px; line-height: 1.15; padding-right: 34px; }
.peek .ex { font-size: 14px; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.peek .row { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.count { font-size: 14px; color: var(--muted); padding: 14px var(--side) 4px; }
.maplibregl-ctrl-attrib { font-family: 'Jost', sans-serif; font-size: 11px; }

/* ---------- place page ---------- */
.place { padding: 24px var(--side) 12px; display: flex; flex-direction: column; gap: 16px; }
.place h1 { margin: 0; font-size: clamp(34px, 8vw, 46px); line-height: 1.08; }
.place .facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); background: var(--card); border-radius: 2px; }
.prose p { margin: 0 0 14px; font-size: 17px; line-height: 1.7; }
.box { border: 1px solid var(--line); background: var(--card); border-radius: 2px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.box.tip { background: var(--sand); border-color: var(--sand-line); }
.box h2 { margin: 0; font-size: 24px; }
.box .label { font-family: 'Caveat', cursive; font-size: 24px; color: var(--blue); }
.box.tip .label { color: var(--ochre); }
.box p { margin: 0; font-size: 16px; line-height: 1.7; }
.box p + p { margin-top: 10px; }
.minimapbox { height: 220px; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: #efe6d2; position: relative; }
.place-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- My Lists ---------- */
.ml { padding: 22px var(--side) 12px; display: flex; flex-direction: column; gap: 16px; }
.ml h1 { margin: 0; font-size: 34px; }
.empty { border: 1px dashed var(--line); padding: 24px; display: flex; flex-direction: column; gap: 12px; border-radius: 2px; }
.trip-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--green); background: var(--card); border: 1px solid var(--line); padding: 18px; border-radius: 2px; }
.trip-card .name { font-family: 'Libre Caslon Display', serif; font-size: 24px; }
.trip-card .sub { font-size: 14px; color: var(--muted); }
.day { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.day h2 { margin: 0; font-size: 21px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.day h2 small { font-family: 'Jost', sans-serif; font-size: 13px; color: var(--muted); }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.item .top-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item .name { font-family: 'Libre Caslon Display', serif; font-size: 19px; color: var(--green); text-decoration: none; }
.item .meta { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ochre); }
.item .ctrls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item select { min-height: 40px; border: 1px solid var(--line); background: var(--paper); border-radius: 2px; padding: 0 8px; max-width: 100%; }
.icon-btn { min-width: 40px; min-height: 40px; border: 1px solid var(--line); background: var(--paper); border-radius: 2px; color: var(--green); }
.icon-btn:disabled { opacity: 0.35; }
.drop-empty { font-size: 14px; color: var(--muted); border: 1px dashed var(--line); padding: 12px; border-radius: 2px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.form input { min-height: 48px; padding: 0 12px; border: 1px solid var(--line); background: var(--card); border-radius: 2px; }
.err { color: #8A2E1F; font-size: 14px; }
.warn { background: var(--sand); border: 1px solid var(--sand-line); color: var(--ochre); padding: 12px; font-size: 14px; border-radius: 2px; }

/* ---------- sheet, toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 41, 30, 0.35); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; max-height: 88vh; overflow: auto; background: var(--paper); border-top: 2px solid var(--green); padding: 20px var(--side) calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; font-size: 26px; }
.sheet .opt { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; min-height: 56px; display: flex; flex-direction: column; gap: 2px; color: var(--green); }
.sheet .opt small { color: var(--muted); font-size: 13px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav) + 16px + env(safe-area-inset-bottom)); z-index: 60; background: var(--green); color: #F8F3E8; padding: 12px 16px; border-radius: 2px; font-size: 15px; display: flex; gap: 14px; align-items: center; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.toast a { color: #F1E4C6; font-weight: 600; }

/* ---------- talk ---------- */
.offer { border: 1px solid var(--line); background: var(--card); border-radius: 2px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.offer.featured { border: 2px solid var(--green); }
.offer h2 { margin: 0; font-size: 26px; }
.offer .p { font-weight: 600; color: var(--ochre); }
.offer ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }

@media (min-width: 760px) { :root { --side: 32px; } .mapbox { height: 56vh; } }
