/*
 * Global typography for every WhiteFirms layout (frontend, auth, admin and owner panels).
 * Load it after the theme stylesheets so the variables below win.
 * Fonts come from the single Google Fonts link in each layout head:
 *   https://fonts.googleapis.com/css2?family=Sora:wght@300..800&family=Manrope:wght@300..800&display=swap
 * Sora has no Cyrillic glyphs, so Russian text falls back to Manrope; scripts neither covers
 * (Arabic, CJK, Devanagari) use system-ui.
 */
:root {
    --wf-font: 'Sora', 'Manrope', system-ui, sans-serif;

    /* Theme variables used by Bootstrap, the Sneat admin core and the old frontend theme */
    --bs-font-sans-serif: var(--wf-font);
    --bs-body-font-family: var(--wf-font);
    --font-family-base: var(--wf-font);
    --it-ff-body: var(--wf-font);
    --it-ff-heading: var(--wf-font);

    --wf-fw-body: 400;
    --wf-fw-medium: 500;
    --wf-fw-semibold: 600;
    --wf-fw-heading: 700;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--wf-font);
    font-weight: var(--wf-fw-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Form controls do not inherit the font by default in every browser */
button, input, select, textarea, optgroup {
    font-family: inherit;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--wf-font);
    font-weight: var(--wf-fw-heading);
    letter-spacing: -0.015em;
    line-height: 1.25;
}

/* Bootstrap components that set their own font stack */
.tooltip, .popover, .toast, .modal, .dropdown-menu, .table, .alert, .badge,
.form-label, .form-control, .form-select, .input-group-text, .btn, .nav-link, .navbar {
    font-family: var(--wf-font);
}

.btn, .nav-link, .form-label, .dropdown-item {
    font-weight: var(--wf-fw-medium);
}

.table thead th {
    font-weight: var(--wf-fw-semibold);
}

code, kbd, pre, samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- Shared brand button (replaces the legacy inline dark-green buttons) ---- */
.btn-wf-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #172554;
    --bs-btn-border-color: #172554;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0f1a3a;
    --bs-btn-hover-border-color: #0f1a3a;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0b1229;
    --bs-btn-active-border-color: #0b1229;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #172554;
    --bs-btn-disabled-border-color: #172554;
    --bs-btn-focus-shadow-rgb: 30, 58, 138;
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
    color: var(--bs-btn-color);
}
.btn-wf-primary:hover, .btn-wf-primary:focus-visible { background-color: var(--bs-btn-hover-bg); border-color: var(--bs-btn-hover-border-color); color: var(--bs-btn-hover-color); }
.btn-wf-primary:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* ---- Spacing system (frontend) ----
 * One gutter scale for every page instead of the flat 12px container padding, so content
 * no longer runs to the screen edge on large screens and keeps room on phones.
 * The admin/owner panel (html.layout-menu-fixed) keeps its own Sneat layout.
 */
:root {
    --wf-space-1: 4px;
    --wf-space-2: 8px;
    --wf-space-3: 12px;
    --wf-space-4: 16px;
    --wf-space-5: 24px;
    --wf-space-6: 32px;
    --wf-gutter: 16px;
    --wf-card-radius: 16px;
    --wf-card-shadow-hover: 0 10px 24px rgba(23, 37, 84, .10);
}
@media (min-width: 768px) { :root { --wf-gutter: 24px; } }
@media (min-width: 1200px) { :root { --wf-gutter: 32px; } }

html:not(.layout-menu-fixed) .container,
html:not(.layout-menu-fixed) .container-fluid {
    padding-left: var(--wf-gutter);
    padding-right: var(--wf-gutter);
}

/* ---- Keyboard focus (frontend) ---- */
html:not(.layout-menu-fixed) a:focus-visible,
html:not(.layout-menu-fixed) button:focus-visible,
html:not(.layout-menu-fixed) [role="button"]:focus-visible,
html:not(.layout-menu-fixed) summary:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---- Motion: respect the reduced-motion preference ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* The header's single row (links, search, account buttons) needs the full width at
   1200-1440px, so it keeps a narrower gutter than page content. */
html:not(.layout-menu-fixed) .wf-hdr .container { padding-left: 16px; padding-right: 16px; }
