/* City Food brand layer: fonts, colour tokens, Bootstrap re-pointing and shared utilities.
   Loaded after Bootstrap and Bootstrap Icons, before site.css (customer) and admin.css (admin). */

/* ---- Fonts (self-hosted woff2, latin + latin-ext, swap) ---- */
@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(/fonts/ubuntu-latin-ext-400-normal.woff2) format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(/fonts/ubuntu-latin-400-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0102-0103, U+0218-021B, U+015E-015F, U+0162-0163;
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url(/fonts/ubuntu-latin-ext-500-normal.woff2) format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url(/fonts/ubuntu-latin-500-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0102-0103, U+0218-021B, U+015E-015F, U+0162-0163;
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url(/fonts/ubuntu-latin-ext-700-normal.woff2) format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url(/fonts/ubuntu-latin-700-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0102-0103, U+0218-021B, U+015E-015F, U+0162-0163;
}

@font-face {
    font-family: 'Berkshire Swash';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(/fonts/berkshire-swash-latin-ext-400-normal.woff2) format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Berkshire Swash';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(/fonts/berkshire-swash-latin-400-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+0102-0103, U+0218-021B, U+015E-015F, U+0162-0163;
}

/* ---- Tokens and Bootstrap re-pointing ---- */
:root {
    --cf-red: #c8102e;
    --cf-red-dark: #9e0c24;
    --cf-orange: #ff9600;
    --cf-orange-dark: #e07f00;
    --cf-cream: #fff4e3;
    --cf-ink: #231f1c;
    --cf-muted: #6b625b;
    --cf-line: #eadfd2;
    --cf-page: #fbf8f4;
    --cf-charcoal: #1d1f24;
    --cf-teal: #0b5c73;
    --cf-green: #146c43;
    --cf-green-glow: rgb(25 135 84 / 0.22);
    --cf-grey: #6c757d;
    --cf-tv-dim: #d9d4ce;
    --cf-tv-open: #90ee90;
    --cf-card-shadow: 0 2px 12px rgba(35, 31, 28, 0.08);

    --bs-primary: var(--cf-red);
    --bs-primary-rgb: 200, 16, 46;
    --bs-link-color: var(--cf-red);
    --bs-link-color-rgb: 200, 16, 46;
    --bs-link-hover-color: var(--cf-red-dark);
    --bs-link-hover-color-rgb: 158, 12, 36;
    --bs-body-bg: var(--cf-page);
    --bs-body-color: var(--cf-ink);
    --bs-body-font-family: 'Ubuntu', system-ui, sans-serif;
    --bs-border-color: var(--cf-line);
    --bs-border-radius: 0.75rem;
    --bs-border-radius-lg: 1rem;
    --bs-focus-ring-color: rgba(200, 16, 46, 0.25);
}

.btn-primary {
    --bs-btn-bg: var(--cf-red);
    --bs-btn-border-color: var(--cf-red);
    --bs-btn-hover-bg: var(--cf-red-dark);
    --bs-btn-hover-border-color: var(--cf-red-dark);
    --bs-btn-active-bg: var(--cf-red-dark);
    --bs-btn-active-border-color: var(--cf-red-dark);
    --bs-btn-disabled-bg: var(--cf-red);
    --bs-btn-disabled-border-color: var(--cf-red);
    --bs-btn-focus-shadow-rgb: 200, 16, 46;
}

.btn-outline-primary {
    --bs-btn-color: var(--cf-red);
    --bs-btn-border-color: var(--cf-red);
    --bs-btn-hover-bg: var(--cf-red);
    --bs-btn-hover-border-color: var(--cf-red);
    --bs-btn-active-bg: var(--cf-red-dark);
    --bs-btn-active-border-color: var(--cf-red-dark);
    --bs-btn-disabled-color: var(--cf-red);
    --bs-btn-disabled-border-color: var(--cf-red);
    --bs-btn-focus-shadow-rgb: 200, 16, 46;
}

.form-check-input:checked {
    background-color: var(--cf-red);
    border-color: var(--cf-red);
}

.form-check-input:focus {
    border-color: var(--cf-red);
    box-shadow: 0 0 0 0.25rem rgba(200, 16, 46, 0.25);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cf-red);
    box-shadow: 0 0 0 0.25rem rgba(200, 16, 46, 0.2);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--cf-red);
    --bs-nav-pills-link-active-color: #fff;
}

.pagination {
    --bs-pagination-color: var(--cf-red);
    --bs-pagination-hover-color: var(--cf-red-dark);
    --bs-pagination-focus-color: var(--cf-red-dark);
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(200, 16, 46, 0.2);
    --bs-pagination-active-bg: var(--cf-red);
    --bs-pagination-active-border-color: var(--cf-red);
    --bs-pagination-active-color: #fff;
}

/* ---- Base ---- */
body {
    font-family: var(--bs-body-font-family);
}

/* 16px stops iOS Safari zooming into a focused field. */
.form-control,
.form-select,
.form-control-sm,
.form-select-sm {
    font-size: 1rem;
}

:focus-visible:not([tabindex="-1"]) {
    outline: 2px solid var(--cf-red-dark);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}

/* ---- Shared utilities ---- */
/* Berkshire Swash has no ș ț Ș Ț glyphs: those letters fall back to Ubuntu one by one.
   A title that contains them should use .font-script-plain instead, so the whole title is one face. */
.font-script {
    font-family: 'Berkshire Swash', 'Ubuntu', Georgia, serif;
    font-weight: 400;
    font-synthesis: none;
}

.font-script-plain {
    font-family: 'Ubuntu', system-ui, sans-serif;
    font-weight: 700;
}

.btn-brand {
    --bs-btn-color: var(--cf-ink);
    --bs-btn-bg: var(--cf-orange);
    --bs-btn-border-color: var(--cf-orange);
    --bs-btn-hover-color: var(--cf-ink);
    --bs-btn-hover-bg: var(--cf-orange-dark);
    --bs-btn-hover-border-color: var(--cf-orange-dark);
    --bs-btn-active-color: var(--cf-ink);
    --bs-btn-active-bg: var(--cf-orange-dark);
    --bs-btn-active-border-color: var(--cf-orange-dark);
    --bs-btn-disabled-color: var(--cf-ink);
    --bs-btn-disabled-bg: var(--cf-orange);
    --bs-btn-disabled-border-color: var(--cf-orange);
    --bs-btn-focus-shadow-rgb: 255, 150, 0;
    --bs-btn-border-radius: 50rem;
    --bs-btn-font-weight: 700;
}

.btn-brand:disabled,
.btn-brand.disabled {
    opacity: 0.65;
    pointer-events: none;
}

.text-price {
    font-family: 'Ubuntu', system-ui, sans-serif;
    font-weight: 700;
    color: var(--cf-red);
}

.card-cf {
    background: #fff;
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--cf-card-shadow);
}

/* Wavy bottom edge: the element is masked, so put it on a banner with its own background or photo. */
.wave-bottom {
    --wave-height: 1.25rem;
    padding-bottom: var(--wave-height);
    -webkit-mask:
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--wave-height) + 1px) no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 20' preserveAspectRatio='none'%3E%3Cpath d='M0 0H80V8Q60 20 40 8T0 8Z'/%3E%3C/svg%3E") bottom / 80px var(--wave-height) repeat-x;
    mask:
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--wave-height) + 1px) no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 20' preserveAspectRatio='none'%3E%3Cpath d='M0 0H80V8Q60 20 40 8T0 8Z'/%3E%3C/svg%3E") bottom / 80px var(--wave-height) repeat-x;
}

/* Blazor's FocusOnNavigate focuses headings (tabindex=-1) programmatically; that must not draw a ring. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
    outline: none;
}

/* Drawer close button: Bootstrap's is ~24px; keep a 44 x 44 tap target (icon stays 1rem). */
.offcanvas .btn-close,
[class*="offcanvas"] .offcanvas-header .btn-close {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 0;
    background-size: 1rem;
    opacity: 0.85;
}
