/* DESE theme for MRBS 1.13. Tokens are copied from src/styles/global.css of the department site
   (design/tokens.md); keep them in step. Colours that MRBS itself draws come from styling.inc. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --color-primary: #003E87;
  --color-accent: #004EC4;
  --color-bg: #FFFFFF;
  --color-text: #1F2937;
  --color-text-muted: #5A6472;
  --color-brand-navy: #002450;
  --color-surface: #F5F7FA;
  --color-surface-tint: #E3F2FB;
  --color-border: #D8DEE6;
  --color-footer: #0B0B0C;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --shadow-card: 0 1px 3px rgba(0, 20, 50, 0.08);
}

body { font-family: var(--font-body); color: var(--color-text); background: var(--color-surface); line-height: 1.5; }

/* Strip of links to the department site, above the MRBS banner */
.dese-sitebar {
  background: var(--color-brand-navy);
  display: none; /* hidden until the old site on 1.2 is retired and these links exist on www; then use: flex */
  flex-wrap: wrap; gap: var(--space-2) var(--space-5);
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
}
.dese-sitebar a { color: #FFFFFF; text-decoration: none; opacity: 0.85; }
.dese-sitebar a:hover, .dese-sitebar a:focus { opacity: 1; text-decoration: underline; }

/* MRBS banner: navy band, white text, like the department's inner-page header */
header.banner { background: var(--color-primary); color: #FFFFFF; }
header.banner a { color: #FFFFFF; }
header.banner .company a:last-child { font-weight: 600; }

a { color: var(--color-accent); }
header.banner a, .dese-sitebar a, .dese-footer a { color: #FFFFFF; }

h1, h2, h3 { font-family: var(--font-body); color: var(--color-primary); font-weight: 600; }

/* Buttons and inputs */
input[type="submit"], input[type="button"], button, .button {
  font-family: var(--font-body); border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  color: var(--color-text); cursor: pointer;
}
input[type="submit"]:hover, input[type="button"]:hover, button:hover { border-color: var(--color-accent); }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="number"],
select, textarea {
  font-family: var(--font-body); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg); color: var(--color-text);
}
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Calendar tables sit on a white card */
div.contents { background: var(--color-bg); }
table.dwm_main td.new:hover, table.dwm_main td.new_hover { outline: 1px solid var(--color-accent); }

/* Footer, like the department site's near-black one */
.dese-footer {
  background: var(--color-footer); color: #FFFFFF; font-size: 0.875rem;
  padding: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
}
.dese-footer a { text-decoration: underline; }
.dese-footer a { display: none; } /* same reason as the strip above */

/* Small screens: keep the banner and page inside the viewport (the title used to run past the
   banner edge and leave a grey strip beside it) */
html, body { max-width: 100%; overflow-x: hidden; }
header.banner, header.banner > *, header.banner .company, header.banner .company a {
  box-sizing: border-box; max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}
header.banner form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
div.contents { box-sizing: border-box; max-width: 100%; overflow-x: auto; }
/* Shadow at the edge of the calendar box shows there is more to scroll to */
div.contents {
  background:
    linear-gradient(to right, var(--color-bg) 30%, rgba(255, 255, 255, 0)) left center / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--color-bg) 30%, rgba(255, 255, 255, 0)) right center / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 20, 50, 0.25), rgba(0, 20, 50, 0)) left center / 0.6rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 20, 50, 0.25), rgba(0, 20, 50, 0)) right center / 0.6rem 100% no-repeat scroll,
    var(--color-bg);
}
@media (max-width: 600px) {
  header.banner nav, header.banner .logon_box, header.banner .banner_nav { justify-content: flex-start; text-align: left; }
  header.banner .company { font-size: 1.05rem; line-height: 1.3; }
  header.banner nav { flex-wrap: wrap; }
}

@media print { .dese-sitebar, .dese-footer { display: none; } }
