/*
 * TV menu styles.
 *
 * The look is the telia.mokslininku.lt TV screen as it was before the move
 * off Tailwind (commit d4cce6d, its 1920px "2xl" sizes), rebuilt without the
 * CSS that old TV browsers can't handle:
 *  - no CSS variables, calc(), grid, flexbox, @layer, :is()/:where()
 *  - layout is absolute positioning, floats, inline-blocks and (for the two
 *    lunch columns) prefixed CSS multi-column, which old WebKit supports
 *  - the screen is a 1920px-wide canvas; tv.js scales it to the viewport
 *  - linked only from the TV route (routes/home.tsx) and served as-is from
 *    public/, so it never goes through Tailwind/PostCSS
 *  - everything inside .menu is sized in em, so tv.js can shrink a long menu
 *    by changing one font-size
 *
 * Fonts, as in the old version: Barlow for dish names, prices, descriptions
 * and headings; the device's system font for the rest.
 */

/*
 * Barlow: current Google Fonts release (what the old version loaded), served
 * locally. Browsers without woff2 fall back to the full-charset woff, which
 * also covers Lithuanian letters.
 */
@font-face {
  font-family: "Barlow";
  font-weight: 400;
  font-style: normal;
  src: url("/fonts/barlow-400-latin-ext.woff2") format("woff2"),
    url("/fonts/barlow-400.woff") format("woff");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-weight: 400;
  font-style: normal;
  src: url("/fonts/barlow-400-latin.woff2") format("woff2"),
    url("/fonts/barlow-400.woff") format("woff");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-weight: 500;
  font-style: normal;
  src: url("/fonts/barlow-500-latin-ext.woff2") format("woff2"),
    url("/fonts/barlow-500.woff") format("woff");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-weight: 500;
  font-style: normal;
  src: url("/fonts/barlow-500-latin.woff2") format("woff2"),
    url("/fonts/barlow-500.woff") format("woff");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-weight: 600;
  font-style: normal;
  src: url("/fonts/barlow-600-latin-ext.woff2") format("woff2"),
    url("/fonts/barlow-600.woff") format("woff");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-weight: 600;
  font-style: normal;
  src: url("/fonts/barlow-600-latin.woff2") format("woff2"),
    url("/fonts/barlow-600.woff") format("woff");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f3f4f6;
}

/* system font (Tailwind's default stack, which the old version used) */
body {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: #000;
}

img {
  border: 0;
}

/* undo Tailwind preflight (img { display: block; max-width: 100% }) inside the TV canvas */
#screen img {
  display: inline;
  max-width: none;
}

/* box sizes include padding and border (Tailwind's base styles also do this,
   but old WebKit only understands the prefixed form) */
#screen,
#screen * {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

#screen {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: #f3f4f6;
  -webkit-transform-origin: 0 0;
  -ms-transform-origin: 0 0;
  transform-origin: 0 0;
}

/* ---------- header ---------- */

.header {
  position: absolute;
  left: 32px;
  right: 32px;
  top: 0;
  height: 128px;
}

/* title line: 48px text on a 48px line at y=40, logo centred on it */
.header-title {
  position: absolute;
  left: 0;
  top: 40px;
  height: 48px;
  line-height: 48px;
  font-size: 48px;
  font-weight: 400;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-title .logo {
  width: 64px;
  height: 64px;
  margin-top: -8px;
  margin-right: 16px;
  vertical-align: top;
}

.header-title .sep {
  margin: 0 16px;
}

/* each part on its own 48px line, like the old flex items, so mixing Barlow
   and the system font (breakfast) doesn't shift the baselines */
.header-title span {
  display: inline-block;
  vertical-align: top;
}

/* right side: QR at y=24, site name centred on it */
.header-right {
  position: absolute;
  right: 0;
  top: 24px;
  height: 80px;
  line-height: 80px;
  white-space: nowrap;
  text-align: right;
}

.header-right .site {
  display: inline-block;
  margin-top: 26px;
  font-size: 20px;
  line-height: 28px;
  vertical-align: top;
}

.header-right .qr {
  width: 80px;
  height: 80px;
  margin-left: 8px;
  vertical-align: top;
}

/* breakfast: Barlow for the first word, 12px gaps */
.tv-breakfast .header-title .logo {
  margin-right: 12px;
}

.tv-breakfast .header-title .sep {
  margin: 0 12px;
}

.tv-breakfast .header-title .main {
  font-family: "Barlow", sans-serif;
}

/* ---------- card ---------- */

.card {
  position: absolute;
  overflow: hidden;
  top: 128px;
  bottom: 32px;
  left: 32px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
}

.card-full {
  right: 32px;
}

.card-half {
  width: 896px;
}

/* .fit is the box the menu must fit in; tv.js shrinks .fit-inner until it does */
.fit {
  position: absolute;
  top: 32px;
  bottom: 32px;
  left: 32px;
  right: 32px;
}

.menu {
  font-size: 20px;
}

/* ---------- lunch: two columns, filled top to bottom like the old version ---------- */

.cols {
  height: 100%;
  -webkit-column-count: 2;
  -moz-column-count: 2;
  column-count: 2;
  -webkit-column-gap: 1.2em;
  -moz-column-gap: 1.2em;
  column-gap: 1.2em;
  -webkit-column-fill: auto;
  -moz-column-fill: auto;
  column-fill: auto;
}

.deal,
.item,
.cat {
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
}

/* a heading never ends up alone at the bottom of a column */
.cat {
  -webkit-column-break-after: avoid;
  page-break-after: avoid;
  break-after: avoid;
}

/* 32px between the deal box and each category */
.section,
.deal {
  margin-top: 1.6em;
}

.cols > :first-child {
  margin-top: 0;
}

/* ---------- menu item (lunch) ---------- */

.item {
  padding: 0.3em 0 1.2em;
}

.cat-items > .item:first-child {
  padding-top: 0;
}

.cat-items > .item:last-child {
  padding-bottom: 0;
}

/* Dot leader without flexbox: price floats right, .row-main takes the rest
   of the line (overflow: hidden puts a block beside a float, not under it),
   the name floats left inside it and .leader fills exactly what's left. */
.row {
  overflow: hidden;
  font-family: "Barlow", sans-serif;
  font-size: 1.4em;
  line-height: 1.25;
  font-weight: 500;
}

.row-main {
  display: block;
  overflow: hidden;
}

.row .name {
  float: left;
  padding-right: 0.4286em;
}

/* the price sits on its own 32px line, 3px below the name (baseline-aligned) */
.row .price {
  float: right;
  margin-top: 0.125em;
  padding-left: 0.5em;
  font-size: 0.857em;
  line-height: 1.3333;
  font-weight: 500;
  white-space: nowrap;
}

/* bottom edge on the name's baseline */
.leader {
  display: block;
  overflow: hidden;
  height: 1em; /* border-box (Tailwind preflight): border bottom on the baseline */
  border-bottom: 2px dotted #6b7280;
}

/* 8px below the top of the line, so a row with a tag is 36px tall: same as
   the old baseline-aligned flex row */
.tag {
  display: inline-block;
  margin-top: 0.5em;
  margin-left: 0.5em;
  padding: 0.125em 0.75em;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 0.5714em;
  line-height: 1.5;
  font-weight: 500;
  white-space: nowrap;
  background: #e5e7eb;
  border-radius: 9999px;
  vertical-align: top;
}

.tag img {
  width: 0.75em;
  height: 0.75em;
  margin-top: 0.375em;
  margin-right: 0.375em;
  vertical-align: top;
}

.tag-text {
  display: inline-block;
  vertical-align: top;
}

.desc {
  margin: 0;
  font-family: "Barlow", sans-serif;
  font-size: 1.2em;
  line-height: 1.5;
  font-weight: 400;
  color: #4b5563;
}

/* ---------- category heading ---------- */

.cat {
  padding-bottom: 0.6667em;
  font-family: "Barlow", sans-serif;
  font-size: 2.4em;
  line-height: 1.15;
  font-weight: 500;
  white-space: nowrap;
}

.cat img {
  height: 0.8333em;
  width: auto;
  margin-right: 0.1667em;
  vertical-align: baseline; /* bottom on the text baseline, like the old flex layout */
}

/* ---------- deal of the day ---------- */

.deal {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  -webkit-box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.deal-head {
  overflow: hidden;
  padding: 0.4em 0.7em;
  background: #000;
  color: #fff;
}

.deal-title {
  font-size: 1.2em;
  line-height: 1.5;
  font-weight: 600;
  text-transform: uppercase;
}

.deal-price {
  float: right;
  font-size: 1.5em;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.deal-body {
  padding: 0.7em;
  background: #e5e7eb;
  font-size: 1em;
  line-height: 1.4;
}

/* ---------- breakfast ---------- */

.breakfast-list .item {
  padding: 0;
}

.breakfast-list .item + .item {
  margin-top: 1.2em;
}

.tv-breakfast .row .name {
  padding-right: 0.1786em;
}

.tv-breakfast .row .price {
  /* the system font's baseline sits 1px higher than Barlow's: nudge the
     text down without making the row taller */
  position: relative;
  top: 0.0417em;
  padding-left: 0.2083em;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-weight: 400;
}

.tv-breakfast .leader {
  border-bottom-color: #d1d5db;
}

.tv-breakfast .desc {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 1em;
  line-height: 1.5;
}

.tv-breakfast .tag {
  padding: 0.25em 0.75em;
}

.tv-breakfast .tag img {
  margin-right: 0.5em;
}

/* right half: logo, QR + caption and carrot, centred on x=1424 like the old
   flex column; the carrot is stretched to 704x950 and runs off the screen,
   exactly as before */
.aside {
  position: absolute;
  top: 128px;
  bottom: 0;
  right: 32px;
  width: 928px;
  overflow: hidden;
}

#screen .aside .brand {
  position: absolute;
  top: 0;
  left: 320px;
  width: 288px;
}

#screen .aside .qr-big {
  position: absolute;
  top: 94.06px;
  left: 352px;
  width: 224px;
  height: 224px;
}

.aside .qr-caption {
  position: absolute;
  top: 334.06px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 18px;
  line-height: 28px;
  font-weight: 500;
}

#screen .aside .morka {
  position: absolute;
  top: 402.06px;
  left: 112px;
  width: 704px;
  height: 950px;
}

/* ---------- fallback screen ---------- */

.empty {
  position: absolute;
  left: 0;
  right: 0;
  top: 45%;
  text-align: center;
  font-size: 48px;
  color: #6b7280;
}
