/*!
 * RTI Wiki — site-wide chrome (header + footer + design tokens).
 * Loaded by static pages (/ask.html, /tools/*.html, /login.html, etc.)
 * to give them the same look as the DokuWiki-rendered pages.
 *
 * Pair with /static/rti-shell.js which injects the header + footer DOM.
 */

/* ------------------------------------------------------------------ */
/*  Hide every legacy / page-specific header + footer + tool-shell    */
/*  injection so the new shell is the only chrome visible.            */
/* ------------------------------------------------------------------ */
body > header.hero,
body > .hero,
header.hero,
/* /ask.html has its own .wrap > .header — hide it so the shell is the only header */
body > .wrap > .header,
body > .wrap > div.header,
body > .container > .header,
body > .container > div.header,
body > main > header:not(.rti-site-header),
body > .app-shell > .header,
#rti-shell,
#rti-shell-update,
#rti-tool-header,
#rti-tool-shell,
#rti-tool-chrome,
#rti-tool-nav,
#rti-tool-breadcrumb,
#rti-tool-footer,
#rti-tool-hero,
.rti-tool-header,
.rti-tool-shell,
.rti-tool-nav,
.rti-tool-breadcrumb,
.rti-tool-footer,
.rti-tool-hero,
.rti-shell-flow,
.rti-shell-brand,
.rti-shell-nav,
.rti-tools-footer,
#rti-tools-footer,
#rti-sitewide-footer,
#rti-tools-aside,
.rti-site-footer:not(.rti-footer),
.rti-footer-featured,
.rti-footer-featured-nav,
.rti-page-chrome,
nav#tool-nav, nav.tool-nav,
[data-rti-old-header],
[data-rti-tool-shell],
.rti-lnv4-hero,
.rti-lnv4-grid,
.rti-lnv4-back,
.rti-lnv4-bar {
  display: none !important;
}

/* Some legacy tool pages put their dark hero ABOVE the body. The shell
   pushes its own header to body's first child; that line above hides their
   hero element directly. */

:root {
  --rti-ink:        #172033;
  --rti-muted:      #5f6b7a;
  --rti-line:       rgba(23, 32, 51, 0.08);
  --rti-line-solid: #dce3ec;
  --rti-paper:      #fbfcf8;
  --rti-surface:    #ffffff;
  --rti-glass:      rgba(255, 255, 255, 0.62);
  --rti-glass-strong: rgba(255, 255, 255, 0.82);
  --rti-accent:     #0b6b58;
  --rti-accent-2:   #c94f28;
  --rti-soft:       #eef7f2;
  --rti-shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
  --rti-shadow-md:  0 4px 14px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.06);
  --rti-shadow-lg:  0 24px 48px rgba(15, 23, 42, 0.10), 0 8px 24px rgba(15, 23, 42, 0.06);
  --rti-shadow:     var(--rti-shadow-md);
  --rti-radius-sm:  10px;
  --rti-radius-md:  14px;
  --rti-radius-lg:  20px;
  --rti-blur:       saturate(180%) blur(22px);
}

/* Subtle ambient gradient on body so glass surfaces have something to refract */
body {
  background:
    radial-gradient(circle at 0% 0%, rgba(11, 107, 88, 0.06) 0, transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(201, 79, 40, 0.04) 0, transparent 35%),
    var(--rti-paper) !important;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 20px !important;
  line-height: 1.7 !important;
  color: var(--rti-ink) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Cascade base size to ALL content elements with high specificity so page-CSS
   that sets 13-14 px on labels/inputs cannot win. Multiple comma-separated
   rules with body prefix → specificity (0,1,1) which beats most legacy
   `.form label { font-size: 13px }` selectors. */
body p,
body li,
body dd, body dt,
body label,
body td, body th,
body blockquote,
body figcaption,
body .hint, body .help-text, body .meta-line,
body span, body div, body a, body em, body strong {
  font-size: 19px !important;
  line-height: 1.65 !important;
}
/* Inputs / controls — bigger so users actually see what they type, but still
   ≥ 16 px so iOS Safari doesn't auto-zoom on focus. */
body input, body textarea, body select, body button {
  font-size: 18px !important;
  line-height: 1.5 !important;
}
body input::placeholder, body textarea::placeholder {
  font-size: 18px !important;
  opacity: 0.55;
}
/* Buttons / pills get a comfortable size */
body button, body .btn, body .button, body input[type="submit"], body input[type="button"] {
  font-size: 17px !important;
  font-weight: 700;
  padding-top: 12px; padding-bottom: 12px;
}
/* Genuinely-small things stay small (footnotes, ad labels, tags) */
body small, body sub, body sup, body .rti-ad-label, body .tag, body .badge,
body code:not(pre code) {
  font-size: 14px !important;
}
/* Headings — clear, generous hierarchy */
body h1 { font-size: 2.4rem !important; line-height: 1.15 !important; font-weight: 800; }
body h2 { font-size: 1.85rem !important; line-height: 1.22 !important; font-weight: 800; }
body h3 { font-size: 1.45rem !important; line-height: 1.3 !important;  font-weight: 700; }
body h4 { font-size: 1.22rem !important; font-weight: 700; }
body h5 { font-size: 1.08rem !important; font-weight: 700; }

/* Chrome that should NOT scale up — restore original sizes after the
   global cascade above (selectors with !important and equal specificity →
   later-declared wins). */
body .rti-nav-link { font-size: 0.96rem !important; }
body .rti-brand    { font-size: 1.1rem !important; }
body .rti-auth-pill { font-size: 0.86rem !important; }
body .rti-auth-avatar { font-size: 0.78rem !important; }
body .rti-dd-panel a strong { font-size: 0.94rem !important; }
body .rti-dd-panel a em     { font-size: 0.8rem !important;  }
body .rti-dd-section, body .rti-dd-more { font-size: 0.78rem !important; }
body .rti-footer h4 { font-size: 0.78rem !important; }
body .rti-footer a, body .rti-footer p, body .rti-footer span, body .rti-footer li { font-size: 0.94rem !important; }
body .rti-footer-bottom, body .rti-footer-bottom span { font-size: 0.8rem !important; }
body .rti-shell-related-card h3 { font-size: 0.78rem !important; }
body .rti-shell-related-card p, body .rti-shell-related-card a, body .rti-shell-related-card li { font-size: 0.96rem !important; }
body .rti-shell-cta { font-size: 0.95rem !important; }
body .rti-shell-ad-label { font-size: 0.7rem !important; }

/* ------------------------------------------------------------------ */
/*  Top + bottom AdSense banners + an after-content "related" strip   */
/* ------------------------------------------------------------------ */
.rti-shell-ad {
  display: block;
  max-width: 1180px;
  margin: 22px auto;
  padding: 10px;
  background: #fafbfd;
  border: 1px dashed #d9e1ec;
  border-radius: 10px;
  text-align: center;
  min-height: 100px;
  overflow: hidden;
}
.rti-shell-ad-label {
  display: block;
  font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}
.rti-shell-ad ins.adsbygoogle {
  display: block !important;
  min-height: 90px; max-height: 280px;
  margin: 0 auto;
}

/* Collapse unfilled ad slots — no white space, no orphan "Advertisement" label */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.rti-ad:has(ins[data-ad-status="unfilled"]),
.rti-shell-ad:has(ins[data-ad-status="unfilled"]),
.rti-shell-related-ad:has(ins[data-ad-status="unfilled"]),
.ad-slot:has(ins[data-ad-status="unfilled"]),
.rti-ad-slot:has(ins[data-ad-status="unfilled"]) {
  display: none !important;
}

.rti-shell-related {
  max-width: 1180px;
  margin: 36px auto 0;
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.rti-shell-related-card {
  background: var(--rti-glass-strong);
  backdrop-filter: var(--rti-blur);
  -webkit-backdrop-filter: var(--rti-blur);
  border: 1px solid var(--rti-line);
  border-radius: var(--rti-radius-md);
  padding: 22px 24px;
  box-shadow: var(--rti-shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}
.rti-shell-related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--rti-shadow-lg);
}
.rti-shell-related-card h3 {
  margin: 0 0 12px;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--rti-accent-2);
}
.rti-shell-related-card p {
  margin: 0 0 14px;
  font-size: 0.92rem; line-height: 1.55;
  color: var(--rti-muted);
}
.rti-shell-related-card .rti-shell-cta {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 44px;
  padding: 0 18px;
  background: linear-gradient(180deg, #0e7c66 0%, #0a5d4c 100%);
  color: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 6px 16px rgba(11, 107, 88, 0.28);
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}
.rti-shell-related-card .rti-shell-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 10px 22px rgba(11, 107, 88, 0.36);
}
.rti-shell-related-card .rti-shell-cta:active { transform: translateY(0); }
.rti-shell-related-card ul {
  list-style: none; padding: 0; margin: 0;
}
.rti-shell-related-card li { margin: 0; }
.rti-shell-related-card li a {
  display: block; padding: 8px 0;
  color: var(--rti-ink); font-size: 0.9rem; font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid #eef2ee;
}
.rti-shell-related-card li:last-child a { border-bottom: 0; }
.rti-shell-related-card li a:hover { color: var(--rti-accent); }
@media (max-width: 880px) {
  .rti-shell-related { grid-template-columns: 1fr; gap: 14px; }
}

/* ------------------------------------------------------------------ */
/*  Header + dropdown nav                                             */
/* ------------------------------------------------------------------ */
.rti-site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--rti-glass);
  backdrop-filter: var(--rti-blur);
  -webkit-backdrop-filter: var(--rti-blur);
  border-bottom: 1px solid var(--rti-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 8px 24px rgba(15, 23, 42, 0.04);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.rti-nav {
  max-width: 1180px; margin: 0 auto;
  padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
}
.rti-brand {
  color: var(--rti-ink); font-weight: 800; font-size: 1.08rem;
  text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.rti-brand-mark {
  display: inline-block; width: 10px; height: 10px;
  background: var(--rti-accent-2); border-radius: 50%;
}
.rti-nav-links {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 4px; align-items: center;
}
.rti-nav-links > li { position: relative; }
.rti-nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: 8px;
  color: var(--rti-ink); font-size: 0.94rem; font-weight: 700;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.rti-nav-link:hover, .rti-dd:hover > .rti-nav-link {
  background: rgba(11, 107, 88, 0.08);
  color: var(--rti-accent);
}
.rti-caret {
  width: 12px; height: 12px; opacity: 0.6;
  transition: transform 0.18s;
}
.rti-dd:hover .rti-caret { transform: rotate(180deg); opacity: 1; }
.rti-dd-panel {
  position: absolute; top: 100%; left: 0;
  min-width: 320px;
  padding: 14px 10px 10px;
  background: var(--rti-glass-strong);
  backdrop-filter: var(--rti-blur);
  -webkit-backdrop-filter: var(--rti-blur);
  border: 1px solid var(--rti-line);
  border-radius: var(--rti-radius-md);
  box-shadow: var(--rti-shadow-lg);
  opacity: 0; pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 70;
}
.rti-dd:hover .rti-dd-panel,
.rti-dd:focus-within .rti-dd-panel {
  opacity: 1; pointer-events: auto;
  transform: translateY(0) scale(1);
}
.rti-dd-panel::before {
  content: ""; position: absolute;
  top: -10px; left: 0; right: 0; height: 12px;
}
.rti-dd-panel a {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--rti-ink); text-decoration: none;
  transition: background 0.12s;
}
.rti-dd-panel a:hover { background: var(--rti-soft); }
.rti-dd-panel a svg {
  flex: 0 0 22px; width: 22px; height: 22px;
  color: var(--rti-accent); margin-top: 1px;
}
.rti-dd-panel a span {
  display: flex; flex-direction: column; gap: 2px;
  line-height: 1.35;
}
.rti-dd-panel a strong { font-size: 0.92rem; font-weight: 700; color: var(--rti-ink); }
.rti-dd-panel a em    { font-size: 0.78rem; color: var(--rti-muted); font-style: normal; }
.rti-dd-more {
  justify-content: flex-end !important;
  color: var(--rti-accent) !important;
  font-weight: 700; font-size: 0.85rem;
  border-top: 1px solid var(--rti-line);
  margin-top: 4px; padding-top: 10px !important;
}
.rti-dd-section {
  display: block;
  font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--rti-accent-2);
  padding: 0 12px 6px;
}

.rti-auth-zone { display: flex; align-items: center; gap: 8px; }
.rti-auth-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 0.84rem; font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--rti-line);
  background: #fff; color: var(--rti-ink);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rti-auth-pill:hover { border-color: var(--rti-accent); color: var(--rti-accent); }
.rti-auth-pill.primary {
  background: var(--rti-accent); color: #fff !important;
  border-color: var(--rti-accent);
}
.rti-auth-pill.primary:hover { background: #094e41; border-color: #094e41; color: #fff; }
.rti-auth-pill svg { width: 14px; height: 14px; }
.rti-auth-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rti-accent), var(--rti-accent-2));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
  text-decoration: none;
}
.rti-auth-avatar:hover { transform: scale(1.05); }

/* Mobile-first responsive primitives applied SITE-WIDE, including pages whose
   own CSS forgot to set a viewport-aware layout. Forces:
   - no horizontal scroll (overflow-x: hidden + max-width: 100% on media)
   - readable form controls (font-size ≥ 16px to prevent iOS zoom-on-focus)
   - flexible images, tables that overflow inside a scroll container
   - no overflowing ad iframes */
html, body { max-width: 100vw !important; overflow-x: hidden !important; }
body img, body video, body iframe, body embed, body object {
  max-width: 100% !important; height: auto;
}
body table { max-width: 100% !important; display: block; overflow-x: auto; }
body input, body textarea, body select { font-size: 16px !important; max-width: 100%; box-sizing: border-box; }
body pre, body code { max-width: 100%; overflow-x: auto; }

@media (max-width: 880px) {
  .rti-nav {
    flex-direction: row; align-items: center; flex-wrap: wrap;
    padding: 10px 14px; gap: 10px;
  }
  .rti-brand { flex: 1; }
  .rti-nav-links {
    width: 100%; flex-wrap: wrap; gap: 0;
    border-top: 1px solid var(--rti-line);
    padding-top: 8px; margin-top: 4px;
  }
  .rti-nav-links > li { width: 100%; }
  .rti-nav-link { width: 100%; padding: 10px 12px; }
  .rti-dd-panel {
    position: static; min-width: 0; margin-top: 0;
    opacity: 1; pointer-events: auto; transform: none;
    box-shadow: none; border: 0; background: transparent;
    padding: 0 0 0 18px;
  }
  .rti-dd-panel::before { display: none; }
  .rti-dd-panel a { padding: 8px 10px; }
  .rti-dd:hover .rti-caret { transform: none; }
  .rti-auth-zone {
    width: auto; flex-wrap: nowrap; gap: 6px;
    margin-left: auto;
  }
  .rti-auth-pill { padding: 6px 10px; font-size: 0.78rem; }
  .rti-auth-avatar { width: 28px; height: 28px; font-size: 0.72rem; }

  /* Page content inside .rti-shell-* gets phone-friendly padding */
  body { font-size: 16.5px !important; line-height: 1.6 !important; }
  body :where(p, li, label, span, div, a, em, strong, blockquote, td, th):not(.rti-nav-link):not(.rti-brand):not(.rti-brand-mark):not(.rti-caret):not(.rti-auth-pill):not(.rti-auth-avatar):not(.rti-shell-cta):not(.rti-shell-ad-label):not(.rti-dd-section):not(.rti-dd-more):not([class*="rti-footer"]):not(svg *) {
    font-size: 16.5px !important;
  }
  body h1 { font-size: 1.85rem !important; }
  body h2 { font-size: 1.45rem !important; }
  body h3 { font-size: 1.2rem !important; }
}

@media (max-width: 540px) {
  .rti-nav { padding: 10px 12px; }
  .rti-brand { font-size: 1rem; }
  .rti-shell-related { padding: 0 14px; }
  .rti-shell-ad { margin: 14px 6px; }
}

/* ------------------------------------------------------------------ */
/*  Footer — deep forest green                                        */
/* ------------------------------------------------------------------ */
.rti-footer {
  background: linear-gradient(180deg, #0a3a2f 0%, #062c24 100%);
  color: #d6ebe2;
  padding: 56px 22px 28px;
  border-top: 4px solid var(--rti-accent-2);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.rti-footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 36px;
}
.rti-footer-brand strong {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 800; color: #fff;
}
.rti-footer-brand strong::before {
  content: ""; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rti-accent-2);
}
.rti-footer-brand p {
  margin: 12px 0 0; max-width: 320px;
  font-size: 0.88rem; line-height: 1.55; color: #9ec3b3;
}
.rti-footer h4 {
  margin: 0 0 14px;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--rti-accent-2);
}
.rti-footer ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.rti-footer a {
  color: #d6ebe2; text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.12s;
}
.rti-footer a:hover { color: #fff; }
.rti-footer-bottom {
  max-width: 1180px; margin: 36px auto 0; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 0.78rem; color: #82a899;
}
.rti-footer-bottom a { color: #b6d4c7; }
@media (max-width: 720px) {
  .rti-footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .rti-footer-brand { grid-column: 1 / -1; }
}
