/*
 * docx4java.org shared site styles (2026-10).
 * Used by the static pages, the "Why docx4j" articles, the phpBB style (plutext) and the blog theme (hope-docx4j).
 *   1. palette tokens (--d4j-*)
 *   2. site header bar (.d4j-sitebar), the same markup on every page
 *   3. content styles for the legacy static pages (body.d4j-page), replacing /trac/trac.css
 * Pages with a dark mode override the --d4j-* tokens themselves.
 */

/* 1. Palette */
:root {
  --d4j-navy: #0f2d52;
  --d4j-blue: #1a5fb4;
  --d4j-blue-dark: #134a8e;
  --d4j-ink: #1d2733;
  --d4j-ink-soft: #4a5768;
  --d4j-ink-faint: #6b7787;
  --d4j-ground: #ffffff;
  --d4j-surface: #f4f7fb;
  --d4j-surface-2: #e8eef6;
  --d4j-rule: #d8e0ea;
  --d4j-code-bg: #f1f4f8;
  --d4j-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --d4j-serif: "Source Serif 4", Georgia, serif;
  --d4j-mono: "Source Code Pro", ui-monospace, Menlo, Consolas, monospace;
}

/* 2. Site header bar */
.d4j-sitebar {
  position: relative;
  z-index: 1000;
  background: var(--d4j-ground);
  border-bottom: 1px solid var(--d4j-rule);
  font-family: var(--d4j-sans);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
}
.d4j-sitebar * { box-sizing: border-box; }
.d4j-sitebar .d4j-sitebar-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.d4j-sitebar a.d4j-brand,
.d4j-sitebar a.d4j-brand:hover {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--d4j-navy);
  background: none;
  border: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.d4j-sitebar a.d4j-brand img { display: block; height: 40px; width: auto; border: 0; }
.d4j-sitebar ul.d4j-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.d4j-sitebar ul.d4j-nav li {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.d4j-sitebar ul.d4j-nav li::before { content: none; }
.d4j-sitebar ul.d4j-nav a {
  display: block;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--d4j-ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.d4j-sitebar ul.d4j-nav a:hover,
.d4j-sitebar ul.d4j-nav a:focus-visible {
  background: var(--d4j-surface);
  color: var(--d4j-blue);
  text-decoration: none;
}
.d4j-sitebar ul.d4j-nav a:focus-visible { outline: 2px solid var(--d4j-blue); outline-offset: 1px; }
.d4j-sitebar ul.d4j-nav > li > a[aria-current="page"] {
  color: var(--d4j-blue);
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 -2px 0 var(--d4j-blue);
}
.d4j-sitebar ul.d4j-sub {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 260px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--d4j-ground);
  border: 1px solid var(--d4j-rule);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 45, 82, 0.14);
  z-index: 10;
}
.d4j-sitebar ul.d4j-nav li:hover > ul.d4j-sub,
.d4j-sitebar ul.d4j-nav li:focus-within > ul.d4j-sub { display: block; }
.d4j-sitebar ul.d4j-sub a { font-weight: 400; }
.d4j-sitebar ul.d4j-sub a[aria-current="page"] { color: var(--d4j-blue); font-weight: 600; }
@media (max-width: 640px) {
  .d4j-sitebar .d4j-sitebar-inner { padding: 8px 16px; }
  .d4j-sitebar ul.d4j-nav a { padding: 6px 9px; }
  .d4j-sitebar ul.d4j-sub { min-width: 230px; }
}

/* 3. Legacy static pages (home, downloads, contact) */
body.d4j-page {
  margin: 0;
  background: var(--d4j-ground);
  color: var(--d4j-ink);
  font-family: var(--d4j-sans);
  font-size: 17px;
  line-height: 1.6;
}
.d4j-page #main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 20px 3.5rem;
}
.d4j-page h1, .d4j-page h2, .d4j-page h3 {
  font-family: var(--d4j-serif);
  color: var(--d4j-navy);
  line-height: 1.25;
}
.d4j-page h1 { font-size: 2.2rem; font-weight: 700; margin: 0.5rem 0 1rem; }
.d4j-page h2 { font-size: 1.55rem; font-weight: 600; margin: 2.25rem 0 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--d4j-rule); }
.d4j-page h3 { font-size: 1.2rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
.d4j-page #main > #content > .wikipage > #wikipage > h2:first-child { margin-top: 0.5rem; }
.d4j-page p, .d4j-page ul, .d4j-page ol { margin: 0 0 1rem; }
.d4j-page ul, .d4j-page ol { padding-left: 1.5rem; }
.d4j-page li { margin-bottom: 0.3rem; }
.d4j-page a { color: var(--d4j-blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.d4j-page a:hover { color: var(--d4j-blue-dark); }
.d4j-page img { border: 0; max-width: 100%; }
.d4j-page code, .d4j-page pre { font-family: var(--d4j-mono); font-size: 0.9em; background: var(--d4j-code-bg); }
.d4j-page code { padding: 0.1em 0.35em; border-radius: 3px; }
.d4j-page pre { padding: 1rem 1.2rem; overflow-x: auto; border: 1px solid var(--d4j-rule); border-radius: 4px; }

/* home page quotes box */
.d4j-page .testimonials {
  float: right;
  width: 270px;
  margin: 0.5rem 0 1.5rem 2rem;
  padding: 0.4rem 1.25rem;
  background: var(--d4j-surface);
  border: 1px solid var(--d4j-rule);
  border-left: 4px solid var(--d4j-blue);
  border-radius: 4px;
  color: var(--d4j-ink-soft);
  font-family: var(--d4j-serif);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.5;
}
.d4j-page .testimonials p { margin: 0.8rem 0; }
@media (max-width: 700px) {
  .d4j-page .testimonials { float: none; width: auto; margin: 0 0 1.5rem; }
}

/* Trac-era external-link icon spans (empty) */
.d4j-page a .icon { display: none; }
