/*
Theme Name: Zero Ticket
Theme URI: https://zeroticket.world
Description: App-like theme for Zero Ticket, the community database of free places to visit. Requires the Zero Ticket Places plugin.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
Author: Zero Ticket
License: GPL-2.0-or-later
Text Domain: zeroticket-theme
*/

:root {
	--ink: #14213D;
	--ink-soft: #3E4A5C;
	--park: #1F6F4A;
	--ticket: #FFC857;
	--fog: #EEF2EF;
	--line: #D5DDD8;
	--paper: #FFFFFF;
	--display: 'Bricolage Grotesque', 'Atkinson Hyperlegible', system-ui, sans-serif;
	--body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--gutter: 20px;
	--header-h: 64px;
	--tab-h: 76px;
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--zt-display: var(--display);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
	margin: 0; background: var(--paper); color: var(--ink);
	font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--park); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.only-wide { display: none !important; }
.only-narrow { display: block; }
a.only-narrow, span.only-narrow { display: inline-flex; }
h1 .only-narrow { display: inline; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--fog); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.site-logo:hover { color: var(--ink); }
.site-logo .zt-mark { display: block; flex: none; }
.site-logo__word { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.035em; line-height: 1; }
.site-nav { display: none; }
.site-header__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn, .avatar-btn {
	width: 44px; height: 44px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center;
	background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 700; font-size: 1rem; flex: none;
}
.avatar-btn { background: var(--ink); color: #fff; }
.avatar-btn:hover { color: #fff; background: var(--park); }
.avatar-btn--out { background: var(--paper); color: var(--ink); }
.avatar-btn--out:hover { color: var(--ink); background: #fff; }
.icon-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
.header-search { padding: 0 0 16px; }
.header-search[hidden] { display: none; }

/* ---------- Search ---------- */
.search-form {
	display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 4px 4px 4px 16px;
	background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; max-width: 640px;
}
.search-form__icon { display: flex; color: var(--ink); }
.search-form input[type=search] {
	flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
	font: inherit; font-size: 1.0625rem; padding: 10px 4px; -webkit-appearance: none; appearance: none;
}
.search-form input[type=search]:focus { outline: none; }
.search-form:focus-within { box-shadow: 0 0 0 3px rgba(31, 111, 74, .3); }
.search-form__btn {
	min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff;
	font: inherit; font-weight: 700; cursor: pointer;
}
.search-form__btn:hover { background: var(--park); }
@media (max-width: 420px) {
	.search-form__btn { padding: 0 14px; }
	.search-form input[type=search] { font-size: 1rem; }
}

/* ---------- Mobile tab bar ---------- */
.tab-bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
	height: calc(var(--tab-h) + var(--safe-bottom)); padding: 6px 8px calc(10px + var(--safe-bottom));
	background: var(--paper); border-top: 1px solid var(--line);
	display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
}
.tab-bar a {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
	color: var(--ink-soft); text-decoration: none; font-size: .75rem; font-weight: 700;
}
.tab-bar a[aria-current="page"] { color: var(--park); }
.tab-bar__plus {
	width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; border: 4px solid var(--paper);
	background: var(--park); color: #fff; display: flex; align-items: center; justify-content: center;
}
.tab-bar__plus .icon { stroke-width: 2.6; }
.tab-bar a.tab-bar__add { color: var(--ink); }
body { padding-bottom: calc(var(--tab-h) + var(--safe-bottom)); }

/* ---------- Shared bits ---------- */
.zt-btn--ticket { background: var(--ticket); border-color: var(--ticket); color: var(--ink); }
.zt-btn--ticket:hover { background: #fff; border-color: #fff; color: var(--ink); }
.zt-chip--paper { background: var(--paper); }
.zt-chip--large { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
.chip-row--scroll::-webkit-scrollbar { display: none; }
.section { padding: 36px 0; }
.section--tight { padding-top: 8px; }
.section--flush { padding: 0 0 32px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section__head h2 { margin: 0; }
.section__head a { font-weight: 700; white-space: nowrap; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .95rem; margin-bottom: 10px; }
.breadcrumbs a { font-weight: 700; text-decoration: none; }
.breadcrumbs span { color: var(--ink-soft); }
.prose { max-width: 68ch; }
.prose--wide { max-width: 760px; }
.prose > :first-child { margin-top: 0; }
.link-list { padding-left: 1.2em; }

/* ---------- Home ---------- */
.home-hero { background: var(--fog); padding: 8px 0 28px; }
.home-hero__inner { display: flex; align-items: center; gap: 56px; }
.home-hero__text { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-hero__title { font-size: clamp(2.1rem, 1.3rem + 4vw, 4.4rem); line-height: 1; letter-spacing: -0.04em; margin: 0; }
.home-hero__lede { font-size: 1.25rem; line-height: 1.55; max-width: 34em; margin: 0; }
.home-hero__near { align-self: stretch; }
.home-hero__popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.home-hero__popular > span { color: var(--ink-soft); margin-right: 4px; }

.hero-ticket {
	--notch: var(--fog);
	position: relative; flex: none; width: 440px; min-height: 230px; display: flex;
	background: var(--ticket); color: var(--ink); text-decoration: none; border-radius: 18px;
	transform: rotate(-4deg); transition: transform .25s ease;
}
.hero-ticket:hover { color: var(--ink); transform: rotate(-2deg) translateY(-3px); }
.hero-ticket::before, .hero-ticket::after {
	content: ''; position: absolute; right: 104px; width: 28px; height: 28px; border-radius: 50%; background: var(--notch);
}
.hero-ticket::before { top: -14px; }
.hero-ticket::after { bottom: -14px; }
.hero-ticket__main { flex: 1; padding: 26px 26px 22px 30px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.hero-ticket__label { font-weight: 700; }
.hero-ticket__price { font-family: var(--display); font-weight: 800; font-size: 6.5rem; line-height: .9; letter-spacing: -0.05em; }
.hero-ticket__name { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.hero-ticket__stub {
	width: 118px; flex: none; padding: 26px 18px; border-left: 3px dashed var(--ink);
	display: flex; flex-direction: column; justify-content: space-between; gap: 12px; font-size: .9rem; line-height: 1.35;
}

.city-row {
	display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 12px; overflow-x: auto;
	margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.city-row::-webkit-scrollbar { display: none; }
.city-row .zt-city { scroll-snap-align: start; }
.city-row .zt-city__name { font-size: 1.1rem; }

.contribute { background: var(--ink); color: #fff; padding: 40px 0; margin-top: 24px; }
.contribute__inner { display: flex; flex-direction: column; gap: 18px; }
.contribute h2 { color: #fff; margin-bottom: .3em; }
.contribute p { margin: 0; color: #DCE2EA; max-width: 40em; }
.contribute .zt-btn { align-self: flex-start; }

/* ---------- Listing pages ---------- */
.page-hero { background: var(--fog); padding: 22px 0 28px; }
.page-hero__title { font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.02; margin: 0 0 8px; }
.page-hero__meta { color: var(--ink-soft); margin: 0; }
.page-hero__desc { margin-top: 14px; }
.page-hero .search-form { margin-top: 18px; }
.listing { padding-top: 20px; padding-bottom: 40px; }
.listing__bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.listing__bar .chip-row--scroll { flex: 1; min-width: 0; }
.listing__map-btn { flex: none; min-height: 40px; padding: 0 14px; }
.listing__map { height: 420px; margin-bottom: 28px; }
.add-band {
	margin-top: 48px; padding: 22px; border-radius: 18px; background: var(--fog);
	display: flex; flex-direction: column; gap: 12px;
}
.add-band p { margin: 0; font-weight: 700; font-size: 1.1rem; }
.add-band .zt-btn { align-self: flex-start; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.nav-links .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 999px; background: var(--fog); color: var(--ink); text-decoration: none; font-weight: 700; }
.nav-links .page-numbers.current { background: var(--ink); color: #fff; }

/* ---------- Place page ---------- */
.place { --zt-notch: var(--paper); }
.place-gallery { position: relative; background: var(--ink); }
.place-gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: 300px; }
.place-gallery__track::-webkit-scrollbar { display: none; }
.place-gallery__slide { position: relative; flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.place-gallery__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place-gallery__slide figcaption { position: absolute; left: 12px; bottom: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(20, 33, 61, .75); color: #fff; font-size: .8rem; }
.place-gallery__placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--park); }
.place-gallery__placeholder a { color: #fff; font-weight: 700; }
.place-gallery__count { position: absolute; right: 14px; bottom: 14px; padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; font-size: .85rem; }
.place-gallery__actions { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; pointer-events: none; }
.place-gallery__actions > * { pointer-events: auto; }
.place-gallery__right { display: flex; gap: 8px; }
.round-btn {
	width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: var(--ink);
	display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
	box-shadow: 0 1px 3px rgba(20, 33, 61, .25);
}
.round-btn:hover { color: var(--ink); background: var(--ticket); }
.round-btn[aria-pressed="true"] { background: var(--park); color: #fff; }
.round-btn[aria-pressed="true"] path { fill: currentColor; }

.place__layout { display: flex; flex-direction: column; gap: 24px; padding-top: 22px; padding-bottom: 20px; }
.place__main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.place__header .chip-row { margin-top: 12px; }
.place__title { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.8rem); line-height: 1; letter-spacing: -0.04em; margin: 0; }
.place__ticket--wide { display: none; }
.place__content { font-size: 1.125rem; line-height: 1.65; }
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts__row { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { width: 110px; flex: none; color: var(--ink-soft); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts dd a { font-weight: 700; }
.place__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.place__map { height: 220px; }
.suggest { border-top: 1px solid var(--line); padding-top: 12px; }
.suggest summary { cursor: pointer; font-weight: 700; color: var(--park); min-height: 32px; display: flex; align-items: center; }
.suggest[open] summary { margin-bottom: 14px; }

/* ---------- Profile ---------- */
.profile__inner { display: flex; align-items: center; gap: 20px; }
.profile__avatar {
	width: 84px; height: 84px; flex: none; border-radius: 50%; background: var(--ink); color: #fff;
	display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 2.2rem;
}
.page-body { padding-top: 28px; padding-bottom: 48px; }
.entry { padding: 20px 0; border-bottom: 1px solid var(--line); }
.entry__title a { color: var(--ink); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--fog); padding: 36px 0 28px; margin-top: 40px; }
.contribute + .site-footer, .site-main:has(> .contribute:last-child) + .site-footer { margin-top: 0; }
.site-footer__inner { display: flex; flex-direction: column; gap: 18px; }
.site-footer__brand p { margin: 10px 0 0; color: var(--ink-soft); max-width: 30em; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer__links a { color: var(--ink); font-weight: 700; text-decoration: none; }
.site-footer__links a:hover { color: var(--park); }
.site-footer__small { margin: 0; color: var(--ink-soft); font-size: .9rem; }

/* ---------- Larger screens ---------- */
@media (min-width: 700px) {
	:root { --gutter: 32px; }
	.city-row { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; gap: 20px; }
	.city-row .zt-city__name { font-size: 1.3rem; }
	.contribute__inner, .add-band { flex-direction: row; align-items: center; justify-content: space-between; }
	.contribute .zt-btn, .add-band .zt-btn { align-self: center; flex: none; }
	.place-gallery__track { height: 440px; }
	.site-footer__inner { display: grid; grid-template-columns: 1fr auto; align-items: start; }
	.site-footer__small { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
	:root { --header-h: 76px; --gutter: 48px; }
	body { padding-bottom: 0; }
	.tab-bar { display: none; }
	.only-wide { display: block !important; }
	h1 .only-wide { display: inline !important; }
	a.only-wide { display: flex !important; }
	.only-narrow { display: none !important; }
	.site-logo__word { font-size: 1.6rem; }
	.site-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
	.site-nav a:not(.zt-btn) { color: var(--ink); font-weight: 700; text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; }
	.site-nav a:not(.zt-btn):hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--park); }
	.site-nav__add { min-height: 44px; }
	.home-hero { padding: 56px 0 76px; }
	.home-hero__text { gap: 22px; max-width: 660px; }
	.home-hero .search-form { margin-top: 6px; }
	.section { padding: 52px 0; }
	.page-hero { padding: 40px 0 44px; }
	.place-gallery { max-width: 1240px; margin: 24px auto 0; padding: 0 var(--gutter); background: none; }
	.place-gallery__track { height: 500px; border-radius: 22px; }
	.place-gallery__actions { left: calc(var(--gutter) + 16px); right: calc(var(--gutter) + 16px); top: 16px; }
	.place-gallery__count { right: calc(var(--gutter) + 16px); }
	.place-gallery__actions > .round-btn:first-child { visibility: hidden; }
	.place__layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: start; padding-top: 36px; }
	.place__ticket--narrow { display: none; }
	.place__ticket--wide { display: block; }
	.place__side { position: sticky; top: calc(var(--header-h) + 20px); }
}

@media (prefers-reduced-motion: reduce) {
	.hero-ticket, .hero-ticket:hover { transition: none; transform: rotate(-4deg); }
	html { scroll-behavior: auto; }
}
