/* RACE 2.23 (15/10) Cerca nell'app del cliente (templates/profilo_cerca.html, barra in profilo_home.html) e
   «Attività e serate» nella pagina del locale (profilo_locale.html). Solo i colori del tema --p-* di profilo.css. */

/* barra di ricerca in vetro, come quella della Mappa */
.p-searchbar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; border-radius: 999px; color: var(--p-muted);
  border: 1px solid var(--p-glass-border); background: var(--p-glass); box-shadow: var(--p-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
.p-searchbar:focus-within { border-color: color-mix(in srgb, var(--p-accent) 55%, transparent); box-shadow: 0 0 0 4px var(--p-accent-soft), var(--p-shadow); }
.p-searchbar input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--p-ink); font: 500 16px Inter, system-ui, sans-serif; outline: none; }
.p-searchbar input::placeholder { color: var(--p-muted); opacity: 1; }
.p-searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.p-searchbar-x { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--p-bg2); color: var(--p-ink); }
.p-homesearch { margin-top: -4px; position: relative; z-index: 1; }

/* scorciatoie: le serate che fanno i locali */
.p-qchips { display: flex; gap: 8px; margin: -4px -16px 0; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.p-qchips::-webkit-scrollbar { display: none; }
.p-qchip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 15px 0 12px; border-radius: 999px;
  background: var(--p-card); box-shadow: inset 0 0 0 1px var(--p-line); color: var(--p-ink); font: 700 14px Inter, sans-serif; text-decoration: none; white-space: nowrap; }
.p-qchip svg { color: var(--p-accent); }
.p-qchip[aria-current="true"] { background: var(--p-chip); color: var(--p-on-chip); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.p-qchip[aria-current="true"] svg { color: inherit; }
.p-qchip:active, .p-sres:active, .p-stile:active, .p-vact:active { transform: scale(.97); }

.p-sres-sum { margin: 0; font-size: 14px; color: var(--p-muted); }
.p-sres-sum b { color: var(--p-ink); }

/* eventi in programma, per giorno */
.p-sday { display: flex; flex-direction: column; gap: 8px; }
.p-sday + .p-sday { margin-top: 6px; }
.p-sday-t { margin: 0; font: 800 12.5px Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--p-muted); }
.p-sday-t::first-letter { text-transform: uppercase; }
.p-sres { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border-radius: 22px; color: var(--p-ink); text-decoration: none;
  background: var(--p-card); border: 1px solid var(--p-glass-border); box-shadow: var(--p-shadow); transition: transform .15s ease;
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
.p-sres .p-date { width: 52px; height: 58px; justify-content: center; padding: 0; border-radius: 16px; background: var(--p-accent-soft); color: var(--p-accent); }
.p-sres .p-vtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p-sres .p-vtext b { font-size: 16px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.p-sres .p-vtext small { font-size: 13px; color: var(--p-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-sres-v { display: inline-flex; align-items: center; gap: 6px; color: var(--p-ink) !important; font-weight: 600; }
.p-sres-v .p-vlogo { flex: none; border-radius: 6px; font-size: 9px !important; }
.p-sres-v span { overflow: hidden; text-overflow: ellipsis; }
.p-sres-tag { flex: none; align-self: flex-start; padding: 5px 9px; border-radius: 999px; background: var(--p-accent-soft); color: var(--p-accent); font: 800 11px Inter, sans-serif; white-space: nowrap; }
:root[data-theme="scuro"] .p-sres-tag, :root[data-theme="scuro"] .p-sres .p-date { color: var(--p-link); }

/* locali che lo fanno sempre */
.p-sreg .p-vtext { min-width: 0; }
.p-sreg-what { display: inline-flex; align-items: center; gap: 5px; color: var(--p-accent) !important; font-weight: 700; }
:root[data-theme="scuro"] .p-sreg-what { color: var(--p-link) !important; }
.p-sreg .p-vtext small:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* nessun risultato */
.p-snone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 20px; text-align: center; border-radius: 24px;
  background: var(--p-card); border: 1px solid var(--p-glass-border); box-shadow: var(--p-shadow); }
.p-snone b { font-size: 17px; font-weight: 800; }
.p-snone-ico { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 6px; border-radius: 50%; background: var(--p-accent-soft); color: var(--p-accent); }

/* «Che serata cerchi?»: tessere come Asporto / A domicilio */
.p-stiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.p-stile { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 118px; padding: 14px;
  border-radius: 24px; color: var(--p-ink); text-decoration: none; transition: transform .15s ease;
  background: var(--p-card); border: 1px solid var(--p-glass-border); box-shadow: var(--p-shadow); }
.p-stile.is-a { background: var(--p-tile-a); color: #FFFFFF; border-color: transparent; box-shadow: 0 12px 26px var(--p-glow); }
.p-stile.is-b { background: var(--p-tile-b); color: #FFFFFF; border-color: transparent; }
.p-stile b { margin-top: auto; font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.p-stile small { font-size: 12.5px; opacity: .8; }
.p-stile-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--p-accent-soft); color: var(--p-accent); }
.p-stile.is-a .p-stile-ico, .p-stile.is-b .p-stile-ico { background: rgba(255,255,255,.22); color: #FFFFFF; }
.p-stile-bg { position: absolute; right: -14px; bottom: -16px; color: var(--p-accent); opacity: .08; pointer-events: none; }
.p-stile.is-a .p-stile-bg, .p-stile.is-b .p-stile-bg { color: #FFFFFF; opacity: .16; }
.p-stile-bg svg { stroke-width: 1.4; }

/* pagina del locale: attivita' e serate */
.p-vacts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.p-vact { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 11px; border-radius: 20px; color: var(--p-ink); text-decoration: none;
  background: var(--p-card); border: 1px solid var(--p-glass-border); box-shadow: var(--p-shadow); transition: transform .15s ease; }
.p-vact .p-vtext { flex: 1; min-width: 0; }
.p-vact .p-vtext b { font-size: 15px; font-weight: 800; }
.p-vact .p-vtext small { font-size: 13px; color: var(--p-muted); }
.p-vact-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--p-accent-soft); color: var(--p-accent); }
:root[data-theme="scuro"] .p-vact-ico, :root[data-theme="scuro"] .p-stile-ico, :root[data-theme="scuro"] .p-snone-ico { color: var(--p-link); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="sistema"] .p-sres-tag, :root[data-theme="sistema"] .p-sres .p-date, :root[data-theme="sistema"] .p-sreg-what,
  :root[data-theme="sistema"] .p-vact-ico, :root[data-theme="sistema"] .p-stile-ico, :root[data-theme="sistema"] .p-snone-ico { color: var(--p-link) !important; }
}
@media (prefers-reduced-motion: reduce) { .p-qchip:active, .p-sres:active, .p-stile:active, .p-vact:active { transform: none; } }

/* 2.72 (23/10) il paese cercato per nome (templates/profilo_cerca.html › town_block, services/intorno.town_search).
   Antonio: «se cerco carbone mi deve uscire la città». La scheda del paese, poi i suoi eventi e i posti da scoprire. */
.p-stown-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 18px; border-radius: 26px;
  background: var(--p-card); border: 1px solid var(--p-glass-border); box-shadow: var(--p-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
.p-stown-ico { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--p-accent-soft); color: var(--p-accent); }
.p-stown-ico.is-sm { width: 44px; height: 44px; }
:root[data-theme="scuro"] .p-stown-ico { color: var(--p-link); }
.p-stown-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.p-stown-t small { font: 800 11.5px Inter, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--p-muted); }
.p-stown-t b { font: 800 28px/1.08 var(--p-display, Inter), Inter, sans-serif; letter-spacing: -.03em; color: var(--p-ink); overflow-wrap: anywhere; }
.p-stown-t > span { font-size: 14px; line-height: 1.4; color: var(--p-muted); }
.p-stown-go { grid-column: 1 / -1; margin-top: 4px; }
.p-stown-go svg { margin-left: 2px; }
.p-stown-note { grid-column: 1 / -1; margin-top: -4px; text-align: center; }
.p-stown-more { margin-top: 10px; padding: 0 4px; }
.p-stown-more a { color: var(--p-link); font-weight: 700; text-decoration: none; }
.p-stownrow > svg:last-child { flex: none; color: var(--p-muted); }
.p-stownrow .p-vtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p-stownrow .p-vtext b { font-size: 16px; font-weight: 800; }
.p-stownrow .p-vtext small { font-size: 13px; color: var(--p-muted); }

/* posti da scoprire del paese: foto 4:3 che scorrono col dito; su tablet e computer in griglia */
.p-tplaces { display: grid; grid-auto-flow: column; grid-auto-columns: 64%; gap: 12px; margin: 0 -16px; padding: 2px 16px 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; }
.p-tplaces::-webkit-scrollbar { display: none; }
.p-tplace { scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--p-ink); text-decoration: none; transition: transform .15s ease; }
.p-tplace:active { transform: scale(.97); }
.p-tplace-ph { display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 6px; border-radius: 20px; overflow: hidden; color: #0B6E79;
  background: color-mix(in srgb, currentColor 11%, var(--p-card)); box-shadow: inset 0 0 0 1px var(--p-line); }
.p-tplace-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-tplace-ph.c-sap { color: #D7373D; } .p-tplace-ph.c-nat { color: #3F7D20; } .p-tplace-ph.c-iti { color: #B07A00; } .p-tplace-ph.c-cto { color: #7A3FB0; }
.p-tplace b { font-size: 15.5px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.p-tplace small { font-size: 13px; line-height: 1.35; color: var(--p-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 768px) {
  /* i posti prendono tutta la larghezza sotto la scheda del paese e gli eventi (la pagina e' a due colonne) */
  body.pg-cerca .p-wrap > section.p-sec.p-stown-places { grid-column: 1 / -1; }
  .p-tplaces { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-columns: auto; gap: 18px; margin: 0; padding: 0; overflow: visible; }
  .p-stown-t b { font-size: 32px; }
}
@media (min-width: 1100px) { .p-tplaces { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.p-sres-k { font: 800 12px Inter, sans-serif; letter-spacing: .01em; color: var(--p-accent); }
.p-sres-k.c-sap { color: #D7373D; } .p-sres-k.c-cul { color: #0B6E79; } .p-sres-k.c-nat { color: #3F7D20; }
:root[data-theme="scuro"] .p-sres-k { color: var(--p-link); }
:root[data-theme="scuro"] .p-sres-k.c-sap { color: #FF7A7E; } :root[data-theme="scuro"] .p-sres-k.c-cul { color: #5CC6D0; } :root[data-theme="scuro"] .p-sres-k.c-nat { color: #8FCB68; }

/* 2.79 (23/10) «Posti da scoprire» e «Feste ed eventi» nei risultati (services/cerca_posti.py). Antonio: «perché se cerco
   il bosco vaccarizzo non esce?». Sulla scheda del posto il tipo sopra il nome, sotto il paese e quanto e' lontano. */
.p-sres-k.c-cto { color: #7A3FB0; } .p-sres-k.c-iti { color: #B07A00; }
:root[data-theme="scuro"] .p-sres-k.c-cto { color: #C79BF0; } :root[data-theme="scuro"] .p-sres-k.c-iti { color: #F0C24F; }
.p-tplace > .p-sres-k { margin-bottom: -1px; }
/* nei risultati si vedono tutti: sul telefono due per riga invece di scorrere col dito */
@media (max-width: 767.98px) {
  .p-splaces .p-tplaces { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; gap: 18px 12px;
    margin: 0; padding: 0; overflow: visible; }
  .p-splaces .p-tplace-ph { border-radius: 18px; margin-bottom: 4px; }
  .p-splaces .p-tplace b { font-size: 15px; }
}
/* l'ultima parte di un numero dispari prende tutta la riga (templates/profilo_cerca.html › lone); le feste a tutta
   riga sul computer vanno due per riga, non in righe lunghe e vuote */
@media (min-width: 768px) { body.pg-cerca .p-wrap > section.p-sec.is-lone { grid-column: 1 / -1; } }
@media (min-width: 1100px) {
  body.pg-cerca .p-wrap > section.p-sfeasts:is(.is-lone, :only-of-type) .p-sday { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
}
/* 3.18.2 (28/10) la regione cercata per nome: lo stemma nel cerchio, se c'è */
.p-stown-ico.has-crest { overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--p-line); }
.p-stown-ico.has-crest img { width: 70%; height: 70%; object-fit: contain; }

/* 3.21.2 (29/10) l'associazione trovata per nome: il suo logo (o le iniziali) al posto dell'icona */
.p-sorg-logo { border-radius: 16px; background: #0A0A0B; color: #fff; font: 700 15px/1 var(--p-display, var(--p-font)); letter-spacing: -.02em; overflow: hidden; }
.p-sorg-logo.has-logo { background: #fff; box-shadow: 0 0 0 1px var(--p-line); }
.p-sorg-logo.has-logo img { width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="scuro"] .p-sorg-logo { color: #fff; }
