/* The client space is a Boca Studio product — Louis, 13 Oct: « mets la DA boca studio,
   ça va être hébergé chez nous et on le déclinera pour d'autres clients ».
   Tokens copied from boca_studio_revival/src/styles/global.css: bone ground, ink, Boca
   red, Bricolage for display, Hanken for text, 2.5px ink frames with a hard offset shadow,
   pill buttons. The restaurant's own look appears in one place only: the preview of its
   website (.sitebox), because that box shows what its site will print. */
@font-face { font-family: 'Bric'; src: url('/static/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Hanken'; src: url('/static/hanken.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Bungee'; src: url('/static/bungee.woff2') format('woff2'); font-display: swap; }

:root {
  --bone: #EEECE4; --ink: #141210; --ink-2: #5C554D;
  --red: #e52421; --red-text: #C21A12; --cream: #FBF7F0; --line: #DBD6CB;
  --ok: #1d6b3f; --warn: #8a5a00;
  --disp: 'Bric', system-ui, sans-serif; --body: 'Hanken', system-ui, sans-serif;
  /* the restaurant's own palette, only for the preview of its site */
  --sa-fondo: #0a3b2b; --sa-crema: #f2e4c4; --sa-rojo: #c33526; --sa-tinta: #0d0f0c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bone); color: var(--ink); font: 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
main { max-width: 68rem; margin: 0 auto; padding: 0 16px 5rem; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

h1, h2 { font-family: var(--disp); font-weight: 800; letter-spacing: -.03em; line-height: .95; margin: 0 0 .7rem; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
h3 { font-family: var(--disp); font-weight: 700; letter-spacing: -.01em; font-size: 1.2rem; margin: 1.4rem 0 .5rem; }
.kick { display: block; font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red-text); margin-bottom: .6rem; }

/* header */
.bar { display: flex; align-items: center; gap: 1rem; max-width: 68rem; margin: 0 auto; padding: 1.2rem 16px 1rem; }
.brand { display: inline-flex; flex-direction: column; align-items: center; gap: .1rem; line-height: 1; text-decoration: none; }
.brand img { width: 64px; height: auto; display: block; }
.brand b { font-weight: 800; font-size: .7rem; color: var(--red-text); letter-spacing: .06em; }
.product { font-family: var(--disp); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; padding-left: 1rem; border-left: 2.5px solid var(--ink); }
.tenant { margin-left: auto; font-weight: 700; color: var(--ink-2); }
.link { background: none; border: 0; color: var(--ink); font: 700 .95rem var(--body); border-bottom: 3px solid var(--red); padding: 0 0 2px; cursor: pointer; }
.bar-rule { max-width: 68rem; margin: 0 auto; padding: 0 16px; }
.rule { border: 0; border-top: 2.5px solid var(--ink); margin: 0 0 2rem; }

/* frames */
.card { background: var(--cream); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 8px 10px 0 var(--ink); padding: clamp(1.1rem, 3vw, 1.8rem); margin: 0 0 2.2rem; }
.card.red { box-shadow: 8px 10px 0 var(--red); }
.narrow { max-width: 26rem; margin: 3rem auto; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--ink-2); max-width: 44ch; margin: 0 0 1.4rem; }
.muted { color: var(--ink-2); font-size: .95rem; }
.stack { display: grid; gap: 1.1rem; }

/* fields */
label { display: grid; gap: .35rem; font-weight: 700; font-size: .95rem; }
input, textarea { font: 500 1rem var(--body); color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: .6rem .75rem; width: 100%; }
textarea { line-height: 1.5; font-size: .95rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; font: 700 1.02rem var(--body); background: var(--red); color: #fff; border: 0; border-radius: 100px; padding: .85rem 1.5rem; cursor: pointer; justify-self: start; transition: transform .18s, filter .18s; }
.btn:hover { filter: brightness(.94); transform: translateY(-2px); }
.btn[disabled] { background: var(--line); color: var(--ink-2); cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); padding: .7rem 1.25rem; }
.btn.ghost:hover { background: var(--ink); color: var(--cream); }
.btn.small { padding: .35rem .85rem; font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.3rem 0 0; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* upload */
.kinds { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.kinds legend { font-weight: 700; font-size: .95rem; margin-bottom: .5rem; }
.kind { display: flex; align-items: center; gap: .5rem; border: 2px solid var(--ink); border-radius: 100px; padding: .5rem 1.1rem; font-weight: 700; cursor: pointer; background: #fff; }
.kind:has(input:checked) { background: var(--ink); color: var(--cream); }
.kind input { width: auto; accent-color: var(--red); }
.special { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .9rem; }
.special[hidden] { display: none; }
.drop { position: relative; display: grid; justify-items: center; align-content: center; gap: .35rem; min-height: 15rem; padding: 2rem 1.2rem; text-align: center; border: 3px dashed var(--ink); border-radius: 14px; background: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.drop:hover, .drop.over { background: #fde3e1; border-color: var(--red); }
.drop:focus-within { outline: 3px solid var(--red); outline-offset: 3px; }
.drop-icon { font: 800 2.6rem/1 var(--disp); color: var(--red-text); }
.drop-title { font: 800 clamp(1.4rem, 3vw, 1.9rem)/1.05 var(--disp); letter-spacing: -.02em; }
.drop-or { font-weight: 500; }
.drop-or u { text-decoration-color: var(--red); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.drop-file:not(:empty) { margin-top: .4rem; padding: .3rem .9rem; border-radius: 100px; background: var(--ink); color: var(--cream); font-weight: 700; }
.drop.has-file { border-style: solid; }
.drop small { font-weight: 500; color: var(--ink-2); }

/* messages */
.msg { padding: .7rem .9rem; border-radius: 10px; font-weight: 600; }
.msg.err { background: #fde3e1; color: var(--red-text); }
.msg.ok { background: #e1f0e6; color: var(--ok); }
li.err { color: var(--red-text); font-weight: 600; }
li.warn { color: var(--warn); }

/* history */
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; border-top: 2px solid var(--line); }
.history a { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "what status" "when status"; column-gap: 1rem; padding: .8rem 0; text-decoration: none; font-weight: 700; }
.history .what { grid-area: what; font-size: 1.05rem; }
.history .when { grid-area: when; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 500; font-size: .88rem; }
.history .status { grid-area: status; align-self: center; }
.history a:hover .what { color: var(--red-text); }
.del { margin: 0; }
.s-published { color: var(--ok); }
.status { font-size: .85rem; font-weight: 800; white-space: nowrap; }
.s-ready { color: var(--ok); } .s-needs_review { color: var(--warn); } .s-failed { color: var(--red-text); }

/* waiting while the card is read */
.reading { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.4rem, 4vw, 2.8rem); align-items: center; }
.sheet { position: relative; width: 9.5rem; aspect-ratio: 3 / 4; padding: 1.1rem 1rem; background: #fff; border: 2.5px solid var(--ink); border-radius: 8px; display: grid; align-content: start; gap: .55rem; overflow: hidden; }
.sheet i { display: block; height: .42rem; border-radius: 100px; background: var(--line); }
.sheet i.gap { height: .2rem; background: none; }
.sheet .w1 { width: 85%; } .sheet .w2 { width: 60%; } .sheet .w3 { width: 72%; }
.sheet .scan { position: absolute; left: 0; right: 0; top: 0; height: 2.2rem; background: linear-gradient(to bottom, transparent, rgba(229, 36, 33, .16) 75%, var(--red) 75%, var(--red) calc(75% + 3px), transparent calc(75% + 3px)); animation: scan 1.8s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
@keyframes scan { from { transform: translateY(-1.6rem); } to { transform: translateY(12rem); } }
.steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .8rem; }
.steps li { position: relative; padding-left: 2.2rem; font-weight: 700; font-size: 1.1rem; color: var(--ink-2); }
.steps li::before { content: ""; position: absolute; left: 0; top: .15rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2.5px solid var(--line); }
.steps li.now { color: var(--ink); }
.steps li.now::before { border-color: var(--red); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: "✓"; display: grid; place-content: center; font-size: .8rem; color: var(--cream); background: var(--ok); border-color: var(--ok); }
@keyframes spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .sheet .scan, .steps li.now::before { animation: none; } .sheet .scan { transform: translateY(5rem); } }

/* the preview */
.crumbs { margin: 0 0 1rem; } .crumbs a { font-weight: 700; border-bottom: 3px solid var(--red); text-decoration: none; padding-bottom: 2px; }
.op-head { margin: 0 0 1.8rem; }
.op-head .period { display: block; font-family: var(--body); font-weight: 700; font-size: 1.1rem; letter-spacing: 0; color: var(--red-text); margin-top: .5rem; }
.meta { margin: .5rem 0 0; font-weight: 600; }
.meta a { border-bottom: 3px solid var(--red); text-decoration: none; }
.alerts ul { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.missing .row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .35rem 0; }
.missing code { background: #fff; border: 2px solid var(--line); padding: .15rem .5rem; border-radius: 6px; font-size: .9rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .9rem; align-items: end; }
.facts .muted { grid-column: 1 / -1; margin: 0; }
.course { color: var(--red-text); }
.dishes { display: grid; }
.dish { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem .7rem; padding: .9rem 0; border-top: 2px solid var(--line); }
.dish .cell:first-child { grid-column: 1 / -1; }
.dish .cell:first-child input { font-weight: 700; font-size: 1.05rem; border-color: var(--ink); }
.lg { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.dish.head { border: 0; padding: 0 0 .2rem; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.cell { font-weight: 500; align-content: start; }
.cell input { border-width: 1.5px; border-color: var(--line); }
.cell small { font-size: .74rem; font-weight: 800; }
.src-catalan small, .src-translated small { color: var(--warn); }
.src-edited small { color: var(--ok); }
.src-catalan input { border-color: var(--warn); }
.chips { grid-column: 1 / -1; margin: 0; display: flex; gap: .4rem; }
.chips span { font-size: .8rem; font-weight: 700; background: var(--ink); color: var(--cream); border-radius: 100px; padding: .1rem .65rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 1.1rem; }
.tabs a { text-decoration: none; padding: .4rem .95rem; border-radius: 100px; border: 2px solid var(--ink); font-weight: 700; font-size: .92rem; background: #fff; }
.tabs a[aria-current] { background: var(--ink); color: var(--cream); }

/* the restaurant's site, in its own colours */
.sitebox { background: var(--sa-crema); color: var(--sa-tinta); border-radius: 10px; padding: 1.3rem 1.5rem; border: 2px solid var(--line); }
.sitebox h3 { font-family: 'Bungee', var(--disp); font-weight: 400; letter-spacing: 0; font-size: 1.3rem; margin: 0; color: var(--sa-fondo); }
.sitebox .when { margin: .1rem 0 .8rem; font-weight: 700; }
.sitebox h4 { font-family: 'Bungee', var(--disp); font-weight: 400; color: var(--sa-rojo); margin: 1rem 0 .3rem; }
.sitebox ul { margin: 0; padding-left: 1.1rem; }
.sitebox small { font-size: .72rem; font-weight: 800; color: #7c4a22; }
.sitebox .price { font-family: 'Bungee', var(--disp); font-size: 1.6rem; margin: 1rem 0 .2rem; color: var(--sa-fondo); }
.sitebox .inc { margin: 0; }

.gpost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.2rem; }
.photos { display: grid; gap: .7rem; align-content: start; }
.shot { margin: 0; display: grid; gap: .45rem; }
.shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 2.5px solid var(--ink); border-radius: 14px; }
.shot.chosen img { border-color: var(--red); box-shadow: 5px 6px 0 var(--red); }
.shot figcaption { display: grid; gap: .3rem; font-size: .9rem; }
.shot-dish { font-weight: 700; }
.shot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.shot-actions a { font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--red); }
.pick { font: 700 .88rem var(--body); border: 2px solid var(--ink); border-radius: 100px; padding: .25rem .8rem; background: #fff; color: var(--ink); cursor: pointer; }
.pick:hover { background: var(--ink); color: var(--cream); }
.pick.on { background: var(--red); border-color: var(--red); color: #fff; cursor: default; }
.ph.loading { gap: .5rem; border-style: solid; background: linear-gradient(100deg, #fff 40%, var(--cream) 50%, #fff 60%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
.spin { justify-self: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .ph.loading, .spin { animation: none; } }
.retry { display: grid; gap: .35rem; }
.retry small { color: var(--ink-2); font-size: .85rem; }
.lightbox { padding: 0; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--ink); max-width: min(92vw, 1400px); }
.lightbox::backdrop { background: rgba(20, 18, 16, .82); }
.lightbox img { display: block; max-width: 100%; max-height: 82vh; }
.lightbox form { padding: .7rem; display: flex; justify-content: flex-end; }
.ph { aspect-ratio: 4 / 3; border: 2.5px dashed var(--ink); border-radius: 14px; display: grid; place-content: center; text-align: center; color: var(--ink-2); font-weight: 700; background: #fff; }
.ph small { font-size: .8rem; font-weight: 500; }
.post small.err { color: var(--red-text); }
.publish { box-shadow: 8px 10px 0 var(--red); }

@media (max-width: 720px) {
  .bar { flex-wrap: wrap; }
  .tenant { margin-left: 0; order: 3; width: 100%; }
  .dish { grid-template-columns: 1fr; }
  .gpost { grid-template-columns: 1fr; }
  .special { grid-template-columns: 1fr 1fr; }
  .reading { grid-template-columns: 1fr; justify-items: start; }
  .sheet { width: 7rem; }
  .special label:first-child { grid-column: 1 / -1; }
  .photos { grid-template-columns: 1fr; }
  .card { box-shadow: 5px 6px 0 var(--ink); }
}
.history .s-ready, .history .s-needs_review { color: var(--ink-2); }

/* publish result */
.pub-ok { color: var(--ok); font-weight: 600; }
.pub-err { color: var(--red-text); font-weight: 600; }
