/* The Golden Guild typefaces, served from this site (public/fonts/). Words &
   look cannot load an outside font (wording/css.py strips @import and any
   outside url()), so the three faces the brand site uses ship in the app:
   Lora for reading, Playfair Display for headings, Yeseva One for the one big
   title. Each is a SIL Open Font License font (OFL.txt beside it), Latin
   subset only, and each of Lora and Playfair Display is one variable file that
   covers every weight the pages ask for. font-display: swap paints the text at
   once in the fallback stack and swaps when the file arrives, so a slow phone
   never waits on a font. The stylesheet is loaded on the desk, the family pages
   and the sign-in pages, so this is the only place they are declared; login.css
   and the Serif choice in Look And Feel name them ahead of Georgia. */
@font-face {
	font-family: "Lora";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora/lora-latin.woff2") format("woff2");
	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: "Lora";
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora/lora-italic-latin.woff2") format("woff2");
	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: "Playfair Display";
	font-style: normal;
	font-weight: 400 900;
	font-display: swap;
	src: url("../fonts/playfair-display/playfair-display-latin.woff2") format("woff2");
	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: "Yeseva One";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/yeseva-one/yeseva-one-latin.woff2") format("woff2");
	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;
}

/* Page titles take the operator's heading typeface (Look And Feel, "Typeface
   for headings") when one is chosen. --display is only defined then, so on the
   shipped look the fallback is inherit and nothing changes. The help documents
   set --display for themselves and are not in this list. Nor is the sign-up
   page: login.css draws its titles in the brand's own Yeseva One and Playfair
   Display, as it drew them in its own serif before, at a specificity this
   rule would never beat. */
.fs h1, .fs h2, .wz h1, .wz h2,
.kt h1, .kt h2, .ks h1, .ks h2 {
	font-family: var(--display, inherit);
}

/* Desk styling this app needs on top of the stock theme. Only what a fix
   needed.

   The till is the one screen the business runs on an iPad, and ERPNext's point of
   sale pins `overflow: hidden; white-space: nowrap` on the dish name in both
   the grid tile and the cart row. At 1024x768 that cuts names mid-word with no
   ellipsis, so "Side of Chipotle Mayo" and "Side of Chipotle Ranch" look the
   same on the ticket. Those rules are written as six-deep child chains, so
   these say !important rather than trying to out-specify them. */

.point-of-sale-app > .items-selector > .items-container > .item-wrapper > .item-detail > .item-name,
.point-of-sale-app > .customer-cart-container > .cart-container > .abs-cart-container > .cart-items-section > .cart-item-wrapper > .item-name-desc,
.point-of-sale-app > .customer-cart-container > .cart-container > .abs-cart-container > .cart-items-section > .cart-item-wrapper > .item-name-desc > .item-name,
.point-of-sale-app > .past-order-summary > .invoice-summary-wrapper > .abs-container > .summary-container > .item-row-wrapper > .item-row-data > .item-name {
	white-space: normal !important;
	overflow: visible !important;
	overflow-wrap: anywhere;
	text-overflow: clip;
	line-height: 1.25;
	/* A flex item's default min-width is its content, so letting the name wrap
	   was not enough: at 1024x768 a two-line dish name still pushed the row's
	   Quantity and Amount past the edge of the cart panel, with no scrollbar to
	   say so. Zero lets the name column shrink inside the row instead. */
	min-width: 0;
}

/* a wrapped name needs somewhere to wrap into */
.point-of-sale-app > .items-selector > .items-container > .item-wrapper > .item-detail {
	height: auto;
	min-height: 0;
}

.point-of-sale-app > .customer-cart-container > .cart-container > .abs-cart-container > .cart-items-section > .cart-item-wrapper {
	height: auto;
	min-height: 2.5rem;
	padding-top: 0.35rem;
	padding-bottom: 0.35rem;
	align-items: flex-start;
}

/* the line under a dish is the thing to shorten if anything has to be */
.point-of-sale-app > .customer-cart-container > .cart-container > .abs-cart-container > .cart-items-section > .cart-item-wrapper > .item-name-desc > .item-desc {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* The web footer Frappe renders into every portal page nests a Bootstrap .row
   directly inside a container that has no padding to cancel its negative
   margins, so between about 768 and 875px wide every page scrolls 15px
   sideways with nothing in the overflow (L11-5). The footer has three of them;
   /signup renders the one in .footer-info. */
.footer-logo-extension > .row,
.footer-links > .row,
.footer-info > .row {
	margin-left: 0;
	margin-right: 0;
}

/* The portal account dropdown should offer a family only the way out. "Switch
   To Desk" and "Frappe Suite" are injected into the navbar by JS (not
   post_login items, which foodservice.user.trim_website_context already trims
   to Log out), and both just bounce a parent or teacher back. This stylesheet
   only loads on website/portal pages (web_include_css), never on the desk, so
   staff working in the desk are unaffected. */
.navbar .dropdown-menu a[href="/suite"],
.navbar .dropdown-menu a[href="/desk"],
.navbar .dropdown-menu a[href^="/suite"] { display: none !important; }

/* ------------------------------------------------------------------ appearance
   The light/dark control public/js/theme.js puts in the portal navbar: three
   icons in one pill, sun / auto / moon, with the chosen one raised. It reads
   as a setting with three values without being opened, which the first version
   - a single icon that changed meaning, hiding a menu - did not.

   Colours come from currentColor and two neutral tints rather than from the
   app's tokens, because the navbar sits outside every .fs/.wz/.su scope and
   var(--green) there resolves to Bootstrap's, not ours. */
.navbar .fs-theme { display: flex; align-items: center; margin-left: 4px; }
.navbar .fs-theme-seg {
	display: inline-flex; align-items: center; gap: 2px;
	padding: 3px; border-radius: 999px;
	background: rgba(127, 127, 127, .13);
	border: 1px solid rgba(127, 127, 127, .16);
}
.navbar .fs-theme-opt {
	display: flex; align-items: center; justify-content: center;
	width: 30px; height: 26px; padding: 0;
	border: 0; border-radius: 999px;
	background: transparent; color: inherit; cursor: pointer;
	opacity: .62;
	transition: background-color .12s ease, opacity .12s ease;
}
.navbar .fs-theme-opt:hover { opacity: 1; background: rgba(127, 127, 127, .16); }
.navbar .fs-theme-opt:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.navbar .fs-theme-opt[aria-checked="true"] {
	opacity: 1;
	/* --fs-seg-on is Look And Feel's (theme.py puts it on :root): the card in
	   light, a lifted card in dark. The literal is what it was before, and is
	   what a page with no theme file still gets. */
	background: var(--fs-seg-on, #fff);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.navbar .fs-theme-opt svg {
	width: 16px; height: 16px;
	fill: none; stroke: currentColor; stroke-width: 1.8;
	stroke-linecap: round; stroke-linejoin: round;
}
/* the auto disc is the one icon that carries a filled half */
.navbar .fs-theme-opt svg .fs-th-fill { fill: currentColor; stroke: none; }
.fs-theme-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* the raised segment has to be the page's surface, not white, once the bar is
   dark - otherwise the chosen icon sits in a white blob on a dark navbar.
   --fs-seg-on already says so when the theme file is loaded; the literal is
   only for the page that has none. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .navbar .fs-theme-opt[aria-checked="true"] {
		background: var(--fs-seg-on, #313b35);
		box-shadow: 0 1px 2px rgba(0, 0, 0, .45);
	}
}
:root[data-theme="dark"] .navbar .fs-theme-opt[aria-checked="true"] {
	background: var(--fs-seg-on, #313b35);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

/* /login and /update-password suppress their navbar entirely (context.no_header,
   and each template's own empty `{% block navbar %}`), so theme.js's build()
   has nothing to hang the control off and falls back to this fixed-position
   copy instead (L7-2, L7-4). Not scoped to .navbar, so it cannot use
   currentColor the way that one does - there is no navbar chrome underneath
   it to inherit from - hence its own explicit surface and border.

   These two pages are the trading house's own (login.css), and login.css puts
   that page's colours on :root as --lg-*, one set that already swaps with the
   ground (day, night, in both ways of being dark). The pill reads them, so it
   is the brand's cream and black-gold with the page it sits on rather than a
   green-grey pill on a card that is not. The literals after each comma are what
   the pill was before, for a page that somehow lacks login.css. */
.fs-theme-standalone {
	position: fixed;
	top: max(12px, env(safe-area-inset-top, 0px));
	right: max(12px, env(safe-area-inset-right, 0px));
	z-index: 1000;
}
.fs-theme-standalone .fs-theme-seg {
	display: inline-flex; align-items: center; gap: 2px;
	padding: 3px; border-radius: 999px;
	/* the field colour is translucent at night, so it is laid over the ground
	   to give the pill a solid surface whatever the texture is doing behind */
	background: linear-gradient(var(--lg-input-bg, #fff), var(--lg-input-bg, #fff)), var(--lg-ground, #fff);
	border: 1px solid var(--lg-card-edge, #DDE3D8);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.fs-theme-standalone .fs-theme-opt {
	display: flex; align-items: center; justify-content: center;
	width: 30px; height: 26px; padding: 0;
	border: 0; border-radius: 999px;
	background: transparent; color: var(--lg-ink, #1E2620); cursor: pointer;
	opacity: .62;
	transition: background-color .12s ease, opacity .12s ease;
}
.fs-theme-standalone .fs-theme-opt:hover { opacity: 1; background: var(--lg-alt-hover, rgba(30, 38, 32, .08)); }
.fs-theme-standalone .fs-theme-opt:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.fs-theme-standalone .fs-theme-opt[aria-checked="true"] {
	opacity: 1;
	background: var(--lg-alt-hover, #F4F6F0);
	/* the chosen chip shares its tint with a hovered one, so it also wears the
	   field's edge colour as a thin ring (the rust by day, the gold by night) and
	   stays the chosen one under the pointer; transparent without login.css,
	   where the old tints already told the two apart */
	box-shadow: inset 0 0 0 1px var(--lg-input-edge, transparent), 0 1px 2px rgba(0, 0, 0, .18);
}
.fs-theme-standalone .fs-theme-opt svg {
	width: 16px; height: 16px;
	fill: none; stroke: currentColor; stroke-width: 1.8;
	stroke-linecap: round; stroke-linejoin: round;
}
.fs-theme-standalone .fs-theme-opt svg .fs-th-fill { fill: currentColor; stroke: none; }

/* login.css's --lg-* already change with the ground, so nothing more is needed
   here for dark. These two blocks are only the pill's old dark colours, for
   the page that has no --lg-* (the variable fallbacks above are the light ones). */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .fs-theme-standalone .fs-theme-seg {
		background: linear-gradient(var(--lg-input-bg, #1C221E), var(--lg-input-bg, #1C221E)), var(--lg-ground, #1C221E);
		border-color: var(--lg-card-edge, #2C352F);
	}
	:root:not([data-theme="light"]) .fs-theme-standalone .fs-theme-opt { color: var(--lg-ink, #E9EEE9); }
	:root:not([data-theme="light"]) .fs-theme-standalone .fs-theme-opt:hover { background: var(--lg-alt-hover, rgba(233, 238, 233, .12)); }
	:root:not([data-theme="light"]) .fs-theme-standalone .fs-theme-opt[aria-checked="true"] {
		background: var(--lg-alt-hover, #313b35);
		box-shadow: inset 0 0 0 1px var(--lg-input-edge, transparent), 0 1px 2px rgba(0, 0, 0, .45);
	}
}
:root[data-theme="dark"] .fs-theme-standalone .fs-theme-seg {
	background: linear-gradient(var(--lg-input-bg, #1C221E), var(--lg-input-bg, #1C221E)), var(--lg-ground, #1C221E);
	border-color: var(--lg-card-edge, #2C352F);
}
:root[data-theme="dark"] .fs-theme-standalone .fs-theme-opt { color: var(--lg-ink, #E9EEE9); }
:root[data-theme="dark"] .fs-theme-standalone .fs-theme-opt:hover { background: var(--lg-alt-hover, rgba(233, 238, 233, .12)); }
:root[data-theme="dark"] .fs-theme-standalone .fs-theme-opt[aria-checked="true"] {
	background: var(--lg-alt-hover, #313b35);
	box-shadow: inset 0 0 0 1px var(--lg-input-edge, transparent), 0 1px 2px rgba(0, 0, 0, .45);
}

/* The navbar avatar is Frappe's generated one: initials in a saturated colour
   on a near-white disc, which measures 1.76:1 in BOTH themes - it is not a dark
   mode bug, it has always been unreadable. The palette is picked per user from
   the framework's own list, so this overrides the pair rather than the hue. */
.navbar .avatar-frame.standard-image {
	/* not var(--green): the navbar is outside the app's token scope, so --green
	   there resolves to Bootstrap's #28a745 and white on it is 3.13:1. Look And
	   Feel hands the light palette's green and card over as --fs-avatar-bg and
	   --fs-avatar-on (theme.py, on :root, the same in both modes); the literals
	   are the shipped palette, for a page with no theme file. */
	background-color: var(--fs-avatar-bg, #1F5741) !important;
	color: var(--fs-avatar-on, #fff) !important;
	font-weight: 600;
}

/* The web footer keeps its light background when the rest of the page turns
   dark, so the muted grey Frappe writes there lands at 1.9:1. Give the footer
   the page's own surface in dark mode, both ways of being in it. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .web-footer,
	:root:not([data-theme="light"]) .footer-logo-extension,
	:root:not([data-theme="light"]) .footer-links,
	:root:not([data-theme="light"]) .footer-info { background: transparent !important; }
	:root:not([data-theme="light"]) .footer-col-left,
	:root:not([data-theme="light"]) .web-footer a { color: #B4BFB7 !important; }
}
:root[data-theme="dark"] .web-footer,
:root[data-theme="dark"] .footer-logo-extension,
:root[data-theme="dark"] .footer-links,
:root[data-theme="dark"] .footer-info { background: transparent !important; }
:root[data-theme="dark"] .footer-col-left,
:root[data-theme="dark"] .web-footer a { color: #B4BFB7 !important; }

/* /lunch, /welcome and /signup each darken <body> from inside their own token
   block. The built help pages cannot: every selector build_help.py writes is
   scoped to .fs-help-doc so a document can never restyle the navbar, which also
   means it can never reach <body>. So /help kept a white page behind a dark
   document, and the footer text sat on it at 1.9:1. Set it here, where the
   scoping rule does not apply, for every portal page at once. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) body { background: #141815; }
}
:root[data-theme="dark"] body { background: #141815; }

/* Frappe's own footer grey is #7c7c7c on white - 4.17:1, just under the line,
   in light mode. Same override by selector as login_signup.js makes for the
   login form's labels, and the same colour. */
.footer-col-left, .web-footer .text-muted { color: #4A5550; }

/* The navbar and its account dropdown are Frappe's, painted white by
   .navbar-light regardless of the page under them - so dark mode was a dark
   page with a white band across the top and a white menu hanging off it. The
   text on them stayed legible (dark on white), which is why a contrast sweep
   does not catch this; it is a finish problem, not a readability one.
   Values are the app's own dark palette, so the bar matches the page. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .navbar {
		background-color: #1C221E !important;
		border-bottom: 1px solid #2C352F !important;
	}
	:root:not([data-theme="light"]) .navbar .navbar-brand,
	:root:not([data-theme="light"]) .navbar .nav-link,
	:root:not([data-theme="light"]) .navbar .navbar-brand span {
		color: #E9EEE9 !important;
	}
	:root:not([data-theme="light"]) .navbar .dropdown-menu {
		background-color: #1C221E !important;
		border-color: #2C352F !important;
	}
	:root:not([data-theme="light"]) .navbar .dropdown-menu a,
	:root:not([data-theme="light"]) .navbar .dropdown-menu .dropdown-item {
		color: #E9EEE9 !important;
	}
	:root:not([data-theme="light"]) .navbar .dropdown-menu a:hover,
	:root:not([data-theme="light"]) .navbar .dropdown-menu .dropdown-item:hover {
		background-color: #2C352F !important;
	}
}
:root[data-theme="dark"] .navbar {
	background-color: #1C221E !important;
	border-bottom: 1px solid #2C352F !important;
}
:root[data-theme="dark"] .navbar .navbar-brand,
:root[data-theme="dark"] .navbar .nav-link,
:root[data-theme="dark"] .navbar .navbar-brand span { color: #E9EEE9 !important; }
:root[data-theme="dark"] .navbar .dropdown-menu {
	background-color: #1C221E !important;
	border-color: #2C352F !important;
}
:root[data-theme="dark"] .navbar .dropdown-menu a,
:root[data-theme="dark"] .navbar .dropdown-menu .dropdown-item { color: #E9EEE9 !important; }
:root[data-theme="dark"] .navbar .dropdown-menu a:hover,
:root[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:hover {
	background-color: #2C352F !important;
}

/* Explicitly picking Light still measured 1.9:1 on the footer copyright
   (L7-1): a page-local copy of the dark-mode footer override (see e.g.
   www/lunch.html) forgets the ":not([data-theme=\"light\"])" guard every
   other dark-mode rule in this file carries, so on a browser whose OS prefers
   dark it applies its #B4BFB7 regardless of the reader's own explicit choice.
   That is a bug in each page's own copy, not in this stylesheet - but this
   selector's specificity (:root + an attribute + a class) beats a bare
   ".footer-col-left", so putting the correct colour here as well wins
   outright no matter which stylesheet the browser loaded last, without
   having to fix every page that carries its own copy of the same mistake. */
:root[data-theme="light"] .footer-col-left { color: #4A5550 !important; }

/* /login and /update-password are styled in login.css (loaded beside this
   file from hooks.py's web_include_css). The label, forgot-password link,
   disabled-button and card-surface rules that used to live here were written
   for a page that only borrowed Frappe's white card; that card is the
   trading house's own now, in both grounds, so they went with it. */
