/* Design tokens -- the canonical CSS-side source for the ministry charte
   graphique. These values mirror the defaults in backend/app/config.py
   (Settings.primary_color / .font_heading / .font_body). Stylesheets and
   templates must reference the custom properties below, never literal
   colours or font names. */

/* Font files are supplied by a later branding task; the fallback stacks in
   --font-heading / --font-body keep the layout usable until then. */
@font-face {
  font-family: "Marianne";
  src: url("/static/fonts/Marianne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Marianne";
  src: url("/static/fonts/Marianne-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Spectral";
  src: url("/static/fonts/Spectral-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #1B3A6B;
  --color-text: #1e1e1e;
  --color-bg: #ffffff;
  --color-border: #dddddd;

  --font-heading: "Marianne", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Spectral", Georgia, "Times New Roman", Times, serif;

  --space: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.5;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* Wide data tables (admin panels, applications list) scroll horizontally
   inside their own box on narrow screens instead of forcing the whole page
   to a wider fixed width. */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
}

a {
  color: var(--color-primary);
}

.site-header {
  display: flex;
  align-items: center;
  gap: var(--space);
  padding: var(--space);
  border-bottom: 1px solid var(--color-border);
}

.block-mark {
  display: block;
  height: 3.5rem;
  width: auto;
}

.site-header__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.site-header__logout {
  margin-left: auto;
}

.site-header__login {
  margin-left: auto;
  font: inherit;
  color: var(--color-primary);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 4px);
  padding: 0.4em 0.8em;
  text-decoration: none;
  cursor: pointer;
}

.site-header__login:hover {
  background-color: var(--color-bg-secondary, #f9f9f9);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
  padding: calc(var(--space) * 0.5) var(--space);
  background-color: var(--color-bg-secondary, #f9f9f9);
  border-bottom: 1px solid var(--color-border);
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
}

.site-nav a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.site-header__logout button {
  font: inherit;
  color: var(--color-primary);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 4px);
  padding: 0.4em 0.8em;
  cursor: pointer;
}

.site-main {
  padding: var(--space);
}

.site-footer {
  padding: var(--space);
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.site-footer__name {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--color-primary);
}
