/* Instruct-Online: brings every old page and CGI screen onto the main site's colour scheme.
   Injected by Apache (apache/iol-theme.conf) into every old .htm page and every CGI response.

   v1.8 change of policy (Nate): every page uses the main scheme, so the lesson and test screens
   no longer show their per-course colours (IOL-1 kept them; that is reversed on purpose).

   How it works without breaking old layouts:
   - One reset with zero specificity (:where) sets text and background colours everywhere; any
     more specific rule below wins over it.
   - Old colour attributes (bgcolor, text, link, <font color>) and FrontPage theme images are overridden.
   - Widths, heights, positions and line-height are never changed: many screens use fixed tables. */

@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap");

:root {
  --iol-ink: #16324a;        /* headings, header text */
  --iol-text: #24384a;       /* body copy */
  --iol-muted: #4d6275;
  --iol-link: #1d5a8c;
  --iol-brand: #3b82f6;      /* buttons, header rule */
  --iol-brand-dark: #2563eb;
  --iol-sky: #78afd8;
  --iol-sky-wash: #e8f1f8;   /* side panels */
  --iol-canvas: #f4f6f8;     /* page background */
  --iol-paper: #ffffff;      /* panels */
  --iol-line: #d5dee6;
  --iol-field-line: #8fa3b5;
  --iol-alert: #b91c1c;      /* warnings that were red */
  --iol-font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

/* ---------- 1. Colour reset (zero specificity, so everything below overrides it) ---------- */
:where(body, body *:not(img, input, select, textarea, button, option, svg, svg *)) {
  color: var(--iol-text) !important;
  background-color: transparent !important;
  background-image: none !important;
}
html, body {
  background-color: var(--iol-canvas) !important;
  background-image: none !important;
}
body { color: var(--iol-text) !important; }

/* Areas that had their own colour become white panels on the grey page. */
table[bgcolor], tr[bgcolor], td[bgcolor], th[bgcolor] { background-color: var(--iol-paper) !important; }

/* Headings, links, rules */
h1, h2, h3, h4, h5, h6 { color: var(--iol-ink) !important; }
a, a:visited { color: var(--iol-link) !important; }
a:hover { color: var(--iol-ink) !important; }
a font, a span, a strong, a b { color: inherit !important; }
hr { border: 0 !important; border-top: 1px solid var(--iol-line) !important; color: var(--iol-line) !important; background: var(--iol-line) !important; height: 1px; }

/* Text that was red is a warning: keep it as one, in the scheme's red. */
font[color="#ff0000" i], font[color="red" i], font[color="#f00" i], font[color="#cc0000" i],
[style*="color: #ff0000" i], [style*="color:#ff0000" i], [style*="color: red" i], [style*="color:red" i] {
  color: var(--iol-alert) !important;
}

/* ---------- 2. Typeface ---------- */
body, font[face], p, td, th, li, dd, dt, label, legend, h1, h2, h3, h4, h5, h6, div, span {
  font-family: var(--iol-font) !important;
}

/* ---------- 3. The shared page frame of the old static pages and the catalog/calendar screens ---------- */
#container {
  margin-left: auto !important; margin-right: auto !important;
  background-color: var(--iol-paper) !important;
  border: 0 !important;
  box-shadow: 0 0 0 1px var(--iol-line);
}
/* Header: white, the logo, the phone number, the blue rule under it. */
#masthead {
  height: auto !important; min-height: 104px;
  background-color: var(--iol-paper) !important;
  border-bottom: 4px solid var(--iol-brand) !important;
  box-sizing: border-box; padding: 6px 16px !important;
}
#masthead p {
  height: auto !important; width: auto !important; margin: 0 !important;
  display: flex; align-items: center; justify-content: space-between; min-height: 92px;
}
#masthead p::before {
  content: ""; display: block; flex: none;
  width: 155px; height: 92px;
  background: url("/assets/logo.svg") no-repeat left center / contain !important;
}
#masthead img { display: none !important; }
#masthead span, #masthead .style9 { color: var(--iol-ink) !important; font-weight: 700; font-size: 15px !important; }
/* Navigation: dark text on white, like the main site. */
#navigation, #navigation ul, #navigation li, #navigation a {
  background-color: var(--iol-paper) !important; background-image: none !important;
}
#navigation { border-bottom: 1px solid var(--iol-line) !important; }
#navigation li { width: auto !important; }
#navigation a {
  color: var(--iol-ink) !important; border: 0 !important;
  border-bottom: 2px solid transparent !important;
  padding: 10px 12px !important; width: auto !important;
  font-weight: 700; font-size: 15px !important;
}
#navigation a:hover { border-bottom-color: var(--iol-brand) !important; text-decoration: none !important; }
#column_l { background-color: var(--iol-paper) !important; }
#column_r { background-color: var(--iol-sky-wash) !important; }
#column_r hr { margin-left: 12px; margin-right: 12px; }
/* Footer: dark blue band, like the main site. */
#footer, #footer p, #footer span { background-color: var(--iol-ink) !important; color: #cfdbe6 !important; }
#footer { padding: 10px 0 !important; }
#footer a, #footer a span { color: #ffffff !important; }


/* ---------- 3b. The main site's header and footer (added to every old page by iol-theme.conf) ---------- */
/* Shown only on pages built on the old site template (#container); hidden in lesson/test windows and frames. */
.iol-hdr, .iol-ftr { display: none !important; }
body:has(#container) > .iol-hdr, body:has(#container) > .iol-ftr { display: block !important; }
body:has(> .iol-hdr) #masthead, body:has(> .iol-hdr) #navigation, body:has(> .iol-ftr) #footer { display: none !important; }
body:has(> .iol-hdr) { margin: 0 !important; }
body:has(> .iol-hdr) #container { margin-top: 2rem !important; margin-bottom: 2.5rem !important; display: flow-root !important; }
#page_content { display: flow-root; }   /* contain the floated side panel, so the footer starts below it */
.iol-ftr { clear: both; }

.iol-hdr { background-color: var(--iol-paper) !important; border-bottom: 4px solid var(--iol-brand) !important; font-family: var(--iol-font) !important; }
.iol-wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.iol-hdr .iol-wrap { padding-block: .6rem; }
.iol-brand { display: block; line-height: 0; }
.iol-brand img { height: 92px !important; width: auto !important; content: normal !important; }
.iol-nav { margin-left: auto; }
.iol-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.iol-nav li { margin: 0; padding: 0; }
.iol-nav a, .iol-nav a:visited {
  display: block; color: var(--iol-ink) !important; text-decoration: none !important;
  font: 700 .98rem/1.6 var(--iol-font) !important; padding: .3rem 0; border-bottom: 2px solid transparent;
}
.iol-nav a:hover { border-bottom-color: var(--iol-brand); }
.iol-phone { margin: 0 !important; padding: .3rem 0; border-bottom: 2px solid transparent; color: var(--iol-muted) !important; font: .98rem/1.6 var(--iol-font) !important; white-space: nowrap; }
.iol-phone a, .iol-phone a:visited { color: var(--iol-ink) !important; font-weight: 700; text-decoration: none !important; }

.iol-ftr { background-color: var(--iol-ink) !important; padding-block: 2rem; font: .95rem/1.6 var(--iol-font) !important; }
.iol-ftr * { color: #cfdbe6 !important; }
.iol-ftr .iol-wrap { gap: 1rem 2rem; }
.iol-ftr ul { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.iol-ftr a, .iol-ftr a:visited { color: #ffffff !important; text-decoration: none !important; }
.iol-ftr a:hover { text-decoration: underline !important; }
.iol-ftr p { margin: 0; }
@media (max-width: 560px) {
  .iol-hdr .iol-wrap { flex-direction: column; align-items: flex-start; }
  .iol-nav { margin-left: 0; }
  .iol-brand img { height: 68px !important; }
}

/* ---------- 4. The old apple logo images elsewhere: show the redrawn logo instead ---------- */
/* Supported by Chrome, Edge and Safari; other browsers keep the old image, which is the same logo. */
img[src*="smappleiol" i], img[src*="appleinstruct" i], img[src*="iol-noapple" i] {
  content: url("/assets/logo.svg");
  object-fit: contain;
  object-position: left center;
}

/* ---------- 5. Form fields and buttons ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input:not([type]), select, textarea {
  font-family: var(--iol-font);
  font-size: 1rem;
  color: var(--iol-text) !important;
  background-color: #fff !important;
  border: 1px solid var(--iol-field-line);
  border-radius: 5px;
  padding: .35em .5em;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="number"]:focus, input:not([type]):focus, select:focus, textarea:focus {
  outline: 3px solid var(--iol-sky);
  outline-offset: 1px;
  border-color: var(--iol-ink);
}
input[type="radio"], input[type="checkbox"] {
  width: 1.15em; height: 1.15em;
  accent-color: var(--iol-brand);
  vertical-align: middle;
}
input[type="submit"], input[type="button"], button {
  font: 700 1.1875rem/1.2 var(--iol-font);   /* 19px bold: white on the brand blue needs large text for AA contrast */
  padding: .5em 1.1em;
  margin: 2px;
  border-radius: 5px;
  border: 2px solid var(--iol-brand);
  background-color: var(--iol-brand) !important;
  color: #fff !important;
  cursor: pointer;
}
input[type="submit"]:hover, input[type="button"]:hover, button:hover {
  background-color: var(--iol-brand-dark) !important;
  border-color: var(--iol-brand-dark);
}
input[type="reset"] {
  font: 700 1rem/1.2 var(--iol-font);
  padding: .5em 1.1em;
  margin: 2px;
  border-radius: 5px;
  border: 2px solid var(--iol-field-line);
  background-color: #fff !important;
  color: var(--iol-ink) !important;
  cursor: pointer;
}
input:focus-visible, button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--iol-sky);
  outline-offset: 2px;
}
