/*
  Riviera Café — stile delle pagine pubbliche. Impianto «bancone».

  La foto (o il video) della Riviera riempie lo schermo, come nei servizi di
  invio più noti: serve a dare atmosfera, con una didascalia minima. Tutto
  quello che serve sta in una scheda compatta a sinistra, «il bancone»: bianca,
  con il profilo color sole in cima.
  Il calendario degli eventi per ora non è in pagina (03/12/2026, Ferdi ha
  preferito dare più spazio alla foto); l'import nel Worker resta attivo.

  I colori vengono dal marchio (palette «Azzurro mare», brand/README.md): scheda
  bianca, blu notte per il testo, azzurro per pulsanti, link e tazzina, sole per
  il profilo e il focus. Angoli arrotondati. Titoli in un bastoni stretto e maiuscolo, come le insegne dei bar;
  testo nel carattere di sistema. Non scarichiamo font: se un giorno si vuole un
  bastoni stretto uguale ovunque (Windows non ha Avenir Next Condensed), va
  messo un font OFL in /fonts e aggiunto in testa a --insegna.
*/
:root {
  /* Palette «Azzurro mare» del marchio (brand/README.md). */
  --azzurro: #0096d6;
  --azzurro-scuro: #0079ad;
  --azzurro-chiaro: #f1f8fd;
  --azzurro-velo: #dceef9;
  --notte: #0b2545;
  --notte-2: #1d3b63;
  --sole: #ffc81a;
  --sole-chiaro: #ffd84a;
  --carta: #ffffff;
  --grigio: #4f6278;
  --linea: #d5e3ee;
  --terracotta: #c8553d;
  --errore-chiaro: #fbe5df;
  --ok: #1d6b4c;
  --ok-chiaro: #e1f2ea;
  --insegna: 'Avenir Next Condensed', 'Roboto Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Colori della scheda: per cambiare tinta al bancone basta ridefinire questi. */
  --btn: #0096d6;
  --btn-ink: #fff;
  --btn-hover: #0079ad;
  --field: #f1f8fd;
  --field-ink: #0b2545;
  --drop: #f1f8fd;
  --drop-line: #7cc3e6;
  --cup: #0096d6;
  /* Angoli: morbidi ovunque, più ampi sulla scheda. */
  --r: 10px;
  --r-card: 18px;
  --gutter: 56px;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; overflow: hidden;
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  color: var(--notte); background: var(--notte);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--azzurro-scuro); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sole); outline-offset: 2px; }

/* ----------------------------- Foto ------------------------------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg .slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1.6s ease;
  background-size: cover; background-position: center 40%;
}
.bg .slide.on { opacity: 1; }
.bg .slide.on.ken { animation: ken 20s ease-out forwards; }
.bg video.slide { width: 100%; height: 100%; object-fit: cover; }
@keyframes ken { from { transform: scale(1.06); } to { transform: scale(1); } }
.bg .fallback {
  background:
    radial-gradient(ellipse at 72% 22%, rgba(255, 220, 160, .9) 0, rgba(255, 200, 130, 0) 36%),
    linear-gradient(180deg, #f2b46f 0%, #e4906f 25%, #a96f86 47%, #3f6f8c 66%, #1f4f68 82%, #163a4d 100%);
}
/* In alto per leggere logo e menu, in basso per il piede e la didascalia. */
.bg::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 20, 38, .42) 0, rgba(6, 20, 38, 0) 160px),
    linear-gradient(0deg, rgba(6, 20, 38, .5) 0, rgba(6, 20, 38, 0) 200px);
}

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px var(--gutter); color: #fff;
}
.brand { display: flex; align-items: center; gap: 18px; color: #fff; text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .35)); }
.brand span { font-size: 14px; opacity: .9; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.top nav { display: flex; align-items: center; gap: 2px; }
.top nav a, .top nav button {
  color: #fff; text-decoration: none; background: none; border: 0; cursor: pointer;
  padding: 8px 12px; font-size: 15px; font-weight: 600; border-radius: var(--r);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
.top nav a:hover, .top nav button:hover { background: rgba(255, 255, 255, .16); }

.caption {
  position: fixed; z-index: 2; right: var(--gutter); bottom: 62px; max-width: 560px;
  text-align: right; color: #fff; text-shadow: 0 1px 14px rgba(0, 0, 0, .6); transition: opacity .8s;
}
.caption .place { font-size: 14px; font-weight: 600; }
.caption .title { font-family: var(--insegna); font-weight: 700; font-size: 44px; line-height: 1.02; margin: 2px 0 6px; text-wrap: balance; }
.caption .by { font-size: 12px; opacity: .85; }
.caption a.go { color: #fff; margin-left: 6px; text-underline-offset: 3px; }

/* ----------------------------- Bancone ---------------------------- */
.counter {
  position: fixed; z-index: 4; left: var(--gutter); top: 50%; transform: translateY(-50%);
  width: 400px; max-height: calc(100vh - 170px); overflow: auto; scrollbar-width: thin;
  background: var(--carta); color: var(--notte); border-radius: var(--r-card);
  border-top: 7px solid var(--sole);
  box-shadow: 0 0 0 1px rgba(11, 37, 69, .06), 0 36px 70px -22px rgba(6, 20, 38, .65);
  padding: 24px 28px 24px;
}
/* Il profilo: un filo più chiaro sopra la fascia dorata, come la luce sul bordo d'ottone. */

.panel h1 {
  font-family: var(--insegna); font-weight: 700; font-size: 34px; line-height: .98;
  text-transform: uppercase; letter-spacing: .005em; margin: 0 0 12px; text-wrap: balance;
}
.panel h2 { font-size: 15px; margin: 18px 0 8px; }
.panel p.lead { margin: 0 0 22px; color: var(--grigio); font-size: 16px; line-height: 1.5; max-width: 56ch; }
.muted { color: var(--grigio); }
.small { font-size: 13px; }
.center { text-align: center; }

/* Nella scheda tutto va in colonna; .split e .narrow restano per un eventuale bancone largo. */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }

.field { margin-bottom: 11px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--linea); background: var(--field); color: var(--field-ink); border-radius: var(--r);
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .chips:focus-within { border-color: var(--azzurro-scuro); box-shadow: 0 0 0 3px rgba(0, 150, 214, .2); }
textarea.input { resize: vertical; min-height: 58px; }
.code-input { font-family: var(--insegna); font-weight: 700; font-size: 36px; letter-spacing: 12px; text-align: center; padding: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r); padding: 13px 22px; cursor: pointer;
  background: var(--btn); color: var(--btn-ink);
  font-family: var(--insegna); font-weight: 700; font-size: 20px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1;
  text-decoration: none; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--notte); box-shadow: inset 0 0 0 2px var(--notte); }
.btn.ghost:hover { background: var(--azzurro-velo); }
.btn.danger { background: var(--terracotta); }
.linkbtn { background: none; border: 0; color: var(--azzurro-scuro); cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.tabs { display: flex; gap: 24px; margin: 0 0 12px; border-bottom: 1px solid var(--linea); }
.tabs button {
  border: 0; background: none; padding: 6px 0 9px; margin-bottom: -1px; cursor: pointer;
  font-weight: 600; font-size: 15px; color: var(--grigio); border-bottom: 3px solid transparent;
}
.tabs button.on { color: var(--notte); border-bottom-color: var(--sole); }
.tabs button:hover { color: var(--notte); }

.drop {
  border: 1.5px dashed var(--drop-line); border-radius: var(--r); padding: 16px 14px; text-align: center;
  background: var(--drop); transition: background .15s, border-color .15s; margin-bottom: 14px;
}
.drop.over { background: #fff8db; border-color: var(--sole); }
.drop .big { font-weight: 600; font-size: 18px; line-height: 1.25; }
.drop .actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: nowrap; }
.drop .actions .btn { padding: 8px 12px; font-size: 16px; white-space: nowrap; }

.files { list-style: none; padding: 0; margin: 0 0 10px; max-height: 230px; overflow: auto; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); font-size: 15px; }
.files li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li .s { color: var(--grigio); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.files li button { border: 0; background: none; cursor: pointer; color: var(--grigio); font-size: 19px; line-height: 1; padding: 0 2px; }
.files li button:hover { color: var(--terracotta); }
.files li a {
  text-decoration: none; color: var(--azzurro-scuro); font-weight: 700; font-size: 14px; line-height: 1;
  border: 1.5px solid var(--azzurro-scuro); border-radius: var(--r); padding: 5px 9px;
}
.files li a:hover { background: var(--azzurro-scuro); color: #fff; }
.total { display: flex; justify-content: space-between; font-size: 13px; color: var(--grigio); margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.total.over { color: var(--terracotta); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--linea); background: var(--field); color: var(--field-ink); border-radius: var(--r); padding: 7px; transition: border-color .15s, box-shadow .15s; }
.chips span { background: var(--azzurro-chiaro); color: var(--azzurro-scuro); border-radius: 999px; padding: 4px 4px 4px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.chips span button { border: 0; background: none; cursor: pointer; color: inherit; opacity: .7; }
.chips input { border: 0; outline: none; flex: 1; min-width: 150px; padding: 4px; background: none; }

details.opts { margin: 4px 0 18px; }
details.opts summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--azzurro-scuro); list-style: none; display: inline-flex; gap: 8px; align-items: center; }
details.opts summary::-webkit-details-marker { display: none; }
details.opts summary::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
details.opts[open] summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
details.opts[open] summary { margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { accent-color: var(--azzurro-scuro); width: 16px; height: 16px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.msg { border-radius: var(--r); padding: 11px 14px; font-size: 14px; margin-bottom: 14px; }
.msg.err { background: var(--errore-chiaro); color: #8f3422; }
.msg.ok { background: var(--ok-chiaro); color: var(--ok); }
.msg.info { background: #fff4cc; color: #6b5200; }

.note { border-left: 3px solid var(--sole); padding: 2px 0 2px 14px; font-size: 16px; white-space: pre-wrap; margin: 0 0 20px; line-height: 1.5; max-width: 60ch; }
.meta { font-size: 15px; color: var(--grigio); margin-bottom: 16px; line-height: 1.6; }
.meta b { color: var(--notte); font-weight: 600; }

.copy { display: flex; gap: 8px; margin: 16px 0 12px; }
.copy input { flex: 1; min-width: 0; font-size: 14px; }
.copy .btn { font-size: 17px; padding: 11px 18px; }

/* ----------------------------- Tazzina ---------------------------- */
.cup { color: var(--cup); display: block; width: 150px; height: 132px; }
.cup.sm { width: 64px; height: 56px; margin: 0 0 4px -3px; }
.cup .liquid, .cup .crema { transition: y .45s ease, height .45s ease; }
.cup .steam path { opacity: 0; }
.cup.ready .steam path { animation: steam 2.8s ease-in-out infinite; }
.cup.ready .steam path:nth-child(2) { animation-delay: .55s; }
.cup.ready .steam path:nth-child(3) { animation-delay: 1.1s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(8px); }
  40% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-14px); }
}
/* Avanzamento: tazzina a sinistra, percentuale grande accanto. */
.brew { display: flex; align-items: center; gap: 22px; margin-bottom: 8px; }
.brew .cup { width: 120px; height: 106px; }
.pct { font-family: var(--insegna); font-size: 76px; font-weight: 700; line-height: .9; margin: 0; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.status { color: var(--grigio); font-size: 15px; min-height: 22px; margin: 6px 0 2px; }
.center .cup, .cup.mid { margin: 0 auto 6px; }

/* ----------------------------- Ente sostenitore ------------------- */
/*
  Bustina di zucchero appoggiata sul bancone: carta bianca, estremità
  zigrinate, un po' storta. Un ente per volta, a rotazione. L'ombra sta sul
  contenitore perché la maschera delle estremità taglierebbe quella dell'elemento.
*/
.bustina-wrap { display: flex; margin: 24px 0 6px; filter: drop-shadow(0 6px 10px rgba(11, 37, 69, .16)) drop-shadow(0 1px 1px rgba(11, 37, 69, .14)); }
.bustina {
  --dente: 10px;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; max-width: 280px; padding: 13px 34px 15px;
  color: var(--notte); text-decoration: none; text-align: center;
  transform: rotate(-2.5deg);
  background:
    repeating-linear-gradient(90deg, #e4edf3 0 1px, transparent 1px 3px) left / 18px 100% no-repeat,
    repeating-linear-gradient(90deg, #e4edf3 0 1px, transparent 1px 3px) right / 18px 100% no-repeat,
    linear-gradient(var(--sole), var(--sole)) center top / 100% 4px no-repeat,
    #fff;
  -webkit-mask:
    conic-gradient(from 45deg at left, #0000, #000 1deg 89deg, #0000 90deg) left / 51% var(--dente) repeat-y,
    conic-gradient(from -135deg at right, #0000, #000 1deg 89deg, #0000 90deg) right / 51% var(--dente) repeat-y;
          mask:
    conic-gradient(from 45deg at left, #0000, #000 1deg 89deg, #0000 90deg) left / 51% var(--dente) repeat-y,
    conic-gradient(from -135deg at right, #0000, #000 1deg 89deg, #0000 90deg) right / 51% var(--dente) repeat-y;
  transition: transform .25s ease;
}
a.bustina:hover { transform: rotate(0deg) translateY(-2px); }
.bustina .by { font-size: 12.5px; color: var(--grigio); line-height: 1.2; }
.bustina img { display: block; max-width: 170px; max-height: 46px; width: auto; height: auto; object-fit: contain; }
.bustina .name { font-weight: 700; font-size: 16px; }
.bustina .txt { font-size: 12px; color: var(--grigio); line-height: 1.35; }

/* ----------------------------- Calendario eventi ------------------ */
/*
  La colonna destra del bancone, come la lavagna del bar: gli eventi dei
  prossimi giorni presi dal sito della DMO (e da Savona In Tasca), con la data
  grande a sinistra.
*/
.events { grid-area: events; min-width: 0; padding: 4px 0 30px; border-left: 1px solid var(--linea); padding-left: 28px; }
.events h2 { font-family: var(--insegna); font-weight: 700; font-size: 22px; line-height: 1.05; margin: 0 0 10px; }
.events ul { list-style: none; margin: 0; padding: 0; }
.events li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--linea); }
.events li:first-child { border-top: 0; }
.events li.same { border-top: 0; padding-top: 0; }
.events .day { text-align: center; line-height: 1; padding-top: 2px; }
.events .day b { display: block; font-family: var(--insegna); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.events .day small { display: block; font-size: 11.5px; color: var(--grigio); margin-top: 3px; }
.events .day.now b { color: var(--azzurro-scuro); }
.events a.t, .events span.t { display: block; color: var(--notte); text-decoration: none; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.events a.t:hover { color: var(--azzurro-scuro); text-decoration: underline; text-underline-offset: 3px; }
.events .p { color: var(--grigio); font-size: 13px; margin-top: 2px; }
.events .src { font-size: 12px; color: var(--grigio); margin: 10px 0 0; }
.events .src a { color: inherit; }

/* ----------------------------- Piede ------------------------------ */
.foot {
  position: fixed; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 22px;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; font-size: 12.5px;
}
.foot a, .foot button { color: rgba(255, 255, 255, .9); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; font-size: 12.5px; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.foot a:hover, .foot button:hover { color: #fff; text-decoration: underline; }
.foot button { font-weight: 600; }
.foot .made { margin-left: auto; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.foot .made a { font-weight: 700; color: #fff; }

/* ----------------------------- I miei invii ----------------------- */
.list { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.list li { border-bottom: 1px solid var(--linea); padding: 14px 0; }
.list li:first-child { padding-top: 4px; }
.list li .t { font-weight: 600; font-size: 16px; }
.list li .m { font-size: 13px; color: var(--grigio); margin-top: 3px; }
.list li .a { margin-top: 8px; display: flex; gap: 16px; align-items: center; }
.list li .a a { color: var(--azzurro-scuro); font-weight: 600; }
.badge { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; background: var(--azzurro-velo); color: var(--grigio); margin-left: 4px; }
.badge.ready { background: var(--ok-chiaro); color: var(--ok); }
.badge.blocked { background: var(--errore-chiaro); color: #8f3422; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .bg .slide.on.ken { animation: none; }
  .cup.ready .steam path { animation: none; opacity: .6; }
  .bustina, a.bustina:hover { transition: none; }
}

@media (max-width: 760px), (max-height: 620px) {
  :root { --gutter: 16px; }
  body { overflow: auto; }
  .top { position: absolute; padding: 14px var(--gutter); }
  .brand span { display: none; }
  .brand img { height: 32px; }
  .top nav { flex-wrap: wrap; justify-content: flex-end; }
  .top nav a, .top nav button { padding: 6px 8px; font-size: 14px; white-space: nowrap; }
  .caption { position: absolute; top: 15vh; bottom: auto; left: var(--gutter); right: var(--gutter); text-align: left; }
  .caption .title { font-size: 30px; }
  .counter { position: relative; left: auto; top: auto; transform: none; width: auto; max-height: none; margin: 40vh 12px 0; padding: 24px 20px 22px; }
  .panel h1 { font-size: 34px; }
  .foot { position: relative; left: auto; right: auto; bottom: auto; padding: 18px 20px 26px; }
  .foot .made { margin-left: 0; width: 100%; }
}
/* Sul telefono i link vanno su una riga sotto il logo, invece di accatastarsi a destra. */
@media (max-width: 520px) {
  .top { flex-wrap: wrap; row-gap: 4px; }
  .top nav { width: 100%; flex-wrap: nowrap; justify-content: flex-start; margin-left: -7px; overflow-x: auto; }
  .top nav a, .top nav button { padding: 6px 7px; font-size: 13.5px; }
}
