/* =========================================================
   aircondition.com Knowledge Base — mockup styles v3
   Three-column layout: narrow sidebar | binding | main content
   ========================================================= */

:root {
  /* Cool white palette — like a clean service manual */
  --paper:        #ffffff;
  --paper-tint:   #f5f8fb;
  --paper-edge:   #e3eaf2;
  --rule:         #d6dde6;
  --rule-soft:    #e6ebf1;

  /* Ink and text */
  --ink:          #14181d;
  --ink-soft:     #3a4250;
  --ink-mute:     #6b7585;
  --ink-faint:    #97a0ad;

  /* Brand — sampled directly from original assets */
  --brand-red:    #c60000;     /* from knowledge.gif */
  --brand-red-br: #ff0000;
  --brand-blue:   #000084;     /* from logo.gif */

  /* Links */
  --link:         #1340a8;
  --link-hover:   #c60000;
  --link-visited: #4d3a8c;

  /* Highlight + accents */
  --highlight:    #fff7b8;
  --new-yellow:   #ffd84d;
  --green-pos:    #2d7a3a;

  /* Typography */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --content-max:  1180px;
  --sidebar-w:    160px;
  --binding-w:    56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  background-image: linear-gradient(180deg, #f8fbfe 0%, #ffffff 220px);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(19, 64, 168, 0.35);
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
a:visited { color: var(--link-visited); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

/* =========================================================
   Site header — original brand image assets
   ========================================================= */
.site-header {
  background: linear-gradient(to bottom, #ffffff 0%, #f5f8fb 100%);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0 0;
}
.site-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.brand-mark img {
  display: block;
  width: 162px;
  height: 22px;
  image-rendering: -webkit-optimize-contrast;
}
.brand-mark__sub {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
/* Logo without mascot, displayed larger for prominence */
.site-wordmark img {
  display: block;
  height: 56px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* =========================================================
   Tab nav
   ========================================================= */
.site-nav {
  max-width: var(--content-max);
  margin: 18px auto 0;
  padding: 0 24px;
}
.site-nav__inner {
  display: inline-flex;
  flex-wrap: wrap;
  background: #000062;
  border-radius: 0 8px 0 0;
  box-shadow: 4px 4px 6px rgba(0, 0, 50, 0.18);
  gap: 0;
}
.site-nav .site-nav__tab,
.site-nav .site-nav__tab:link,
.site-nav .site-nav__tab:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav .site-nav__tab:hover {
  color: #ff6600;
  background: rgba(255, 102, 0, 0.08);
}
.site-nav .site-nav__tab--active,
.site-nav .site-nav__tab--active:link,
.site-nav .site-nav__tab--active:visited,
.site-nav .site-nav__tab--active:hover {
  background: #ff6600;
  color: #ffffff;
}
.site-nav .site-nav__tab--external::after {
  content: "↗";
  font-size: 12px;
  opacity: 0.75;
  margin-left: 2px;
  color: #ff6600;
}

/* Hamburger toggle — hidden on desktop, shown on mobile */
.site-nav__toggle {
  display: none;
}

/* =========================================================
   Page layout: 3 columns — sidebar | binding | content
   ========================================================= */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 24px 60px;
  position: relative;
}
.page__subtitle {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 0 0 8px 4px;
  margin-bottom: 20px;
}
.page__layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--binding-w) 1fr;
  gap: 0 16px;
  align-items: stretch;
  min-height: 600px;
}
.page__sidebar {
  /* Narrow column on the LEFT, just like the original */
}
.page__binding {
  background-image: url('../img/binding.png');
  background-repeat: repeat-y;
  background-position: center top;
  align-self: stretch;
  min-height: 100%;
}
.page__content {
  min-width: 0; /* prevent grid blowout from long words/URLs */
}

/* =========================================================
   Sidebar cards (left column)
   ========================================================= */
.sidebar-card {
  background: linear-gradient(to bottom, #ffffff 0%, #eef3f9 100%);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.sidebar-card__title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.sidebar-actions { list-style: none; padding: 0; margin: 0; }
.sidebar-actions li { margin-bottom: 6px; }
.sidebar-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  text-decoration: none;
  color: var(--link);
  line-height: 1.3;
}
.sidebar-actions a:hover { color: var(--brand-red); }
.sidebar-actions svg {
  width: 14px;
  height: 14px;
  color: var(--ink-mute);
  flex-shrink: 0;
}

/* Sidebar search — fits the narrow column */
.sidebar-search input {
  width: 100%;
  padding: 7px 10px;
  font-family: var(--font-serif);
  font-size: 14px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: white;
  color: var(--ink);
  outline: none;
  margin-bottom: 6px;
  box-sizing: border-box;
}
.sidebar-search input:focus { border-color: var(--brand-blue); }
.sidebar-search button {
  width: 100%;
  padding: 7px 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  background: linear-gradient(to bottom, var(--brand-blue) 0%, #00005a 100%);
  color: white;
  border: 1px solid #00005a;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.sidebar-search button:hover {
  background: linear-gradient(to bottom, #1a1aa0 0%, var(--brand-blue) 100%);
}
.sidebar-search__advanced {
  font-size: 12px;
  margin-top: 4px;
  display: inline-block;
}

/* Quick Browse list */
.quick-browse {
  list-style: none;
  padding: 0;
  margin: 0;
}
.quick-browse li {
  border-bottom: 1px dotted var(--rule);
}
.quick-browse li:last-child { border-bottom: none; }
.quick-browse a {
  display: block;
  padding: 5px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  text-decoration: none;
  color: var(--link);
}
.quick-browse a:hover { color: var(--brand-red); text-decoration: underline; }
.quick-browse__count {
  color: var(--ink-mute);
  font-size: 11px;
  margin-left: 4px;
}

/* Rating widget */
.rating-card .rating-stats {
  display: flex;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.rating-stats__pos { color: var(--green-pos); font-weight: 700; }
.rating-stats__neg { color: var(--brand-red); font-weight: 700; }
.rating-card__count {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.rating-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.rating-form__label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.rating-form__options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.rating-form__options label {
  font-family: var(--font-sans);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.rating-form button {
  padding: 5px 14px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  background: linear-gradient(to bottom, #ffffff 0%, #e8eef5 100%);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
}
.rating-form button:hover {
  background: linear-gradient(to bottom, var(--brand-red) 0%, #8a0000 100%);
  color: white;
  border-color: #8a0000;
}

/* =========================================================
   Main content sections
   ========================================================= */
.welcome-strip {
  background: #f0fbf2;
  border: 1px solid #b8dec0;
  border-radius: 4px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.welcome-strip__icon {
  width: 20px;
  height: 20px;
  background: #2d7a3a;
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.section { margin-bottom: 24px; }
.section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(to right, #e8eef5 0%, #f0f5fa 100%);
  border: 1px solid var(--rule);
  border-radius: 4px 4px 0 0;
  border-bottom: none;
}
.section__head h2 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.section__head-icon {
  width: 16px;
  height: 16px;
  color: var(--brand-blue);
}
.section__body {
  background: #fbfcfe;
  border: 1px solid var(--rule);
  border-top: 1px solid var(--rule-soft);
  border-radius: 0 0 4px 4px;
  padding: 16px 18px;
}

/* =========================================================
   Category grid (3 columns in the main content area)
   ========================================================= */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 24px;
}
.category-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
}
.category-item__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--brand-blue);
  margin-top: 2px;
}
.category-item__body { flex: 1; min-width: 0; }
.category-item__name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(19, 64, 168, 0.3);
}
.category-item__name:hover { color: var(--brand-red); }
.category-item__count {
  color: var(--ink-mute);
  font-size: 13px;
  margin-left: 3px;
}
.category-item__desc {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 1px;
  font-style: italic;
}

/* =========================================================
   Question lists
   ========================================================= */
.q-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: qcount;
}
.q-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  counter-increment: qcount;
}
.q-list li::before {
  content: counter(qcount) ".";
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-mute);
  min-width: 20px;
  text-align: right;
  margin-top: 1px;
}
.q-list__icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--brand-blue);
  margin-top: 4px;
}
.q-list__link { font-size: 14px; line-height: 1.5; }

.q-list--featured li {
  background: linear-gradient(to right, rgba(255, 247, 184, 0.4) 0%, transparent 100%);
  padding: 6px 10px 6px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
}

.new-badge {
  display: inline-block;
  background: linear-gradient(to bottom, #fff5a8 0%, #ffd84d 100%);
  border: 1px solid #c79d2a;
  color: #6b4d00;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: 1px;
  text-transform: uppercase;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-cloud a {
  display: inline-block;
  padding: 3px 10px;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  text-decoration: none;
  color: var(--link);
}
.tag-cloud a:hover {
  background: var(--brand-red);
  color: white;
  border-color: var(--brand-red);
}

/* =========================================================
   Article (question) page
   ========================================================= */
.breadcrumb {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-soft);
}
.breadcrumb a { color: var(--link); }
.breadcrumb__sep { margin: 0 8px; color: var(--ink-mute); }

.q-article h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.q-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.q-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.q-body h2 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 5px;
}
.q-body h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--ink);
}
.q-body p { margin: 0 0 14px; }
.q-body strong { color: var(--ink); }
.q-body figure { margin: 22px 0; text-align: center; }
.q-body figure img,
.q-body figure svg {
  margin: 0 auto;
  border: 1px solid var(--rule);
  background: white;
  padding: 8px;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 30, 90, 0.06);
}
.q-body figcaption {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 8px;
}

.related-box {
  margin-top: 32px;
  background: #fbfcfe;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 18px;
}
.related-box h3 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
  color: var(--ink);
}
.related-box ul { list-style: none; padding: 0; margin: 0; }
.related-box li { padding: 3px 0; font-size: 14px; }

.comments-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--rule);
}
.comments-box h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
.comment-empty { color: var(--ink-mute); font-style: italic; margin-bottom: 16px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0;
  margin-top: 40px;
  background: linear-gradient(to bottom, transparent 0%, #f0f5fa 100%);
}
.site-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-mute);
}
.site-footer a { color: var(--ink-soft); margin-left: 14px; }

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 880px) {
  .site-header__inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 8px;
  }
  /* Mobile: hide the red "Knowledge Base" image; show only the tagline.
     The blue Aircondition.Com logo (.site-wordmark) takes the top spot. */
  .brand-mark { align-items: center; order: 2; }
  .brand-mark img { display: none; }
  .site-wordmark { order: 1; }
  .site-wordmark img { height: 42px; }

  /* Nav becomes a full-width hamburger drawer */
  .site-nav {
    max-width: 100%;
    margin: 18px 0 0;
    padding: 0;
    position: relative;
  }
  .site-nav__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: #000062;
    color: #ffffff;
    border: none;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 50, 0.15);
    text-align: left;
  }
  .site-nav__toggle:hover { color: #ff6600; }
  .site-nav__toggle svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }
  .site-nav.is-open .site-nav__toggle svg { transform: rotate(90deg); }
  .site-nav__toggle-label-open { display: inline; }
  .site-nav__toggle-label-close { display: none; }
  .site-nav.is-open .site-nav__toggle-label-open { display: none; }
  .site-nav.is-open .site-nav__toggle-label-close { display: inline; }

  .site-nav__inner {
    display: none;
    flex-direction: column;
    width: 100%;
    border-radius: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 50, 0.18);
    background: #000062;
  }
  .site-nav.is-open .site-nav__inner { display: flex; }

  .site-nav .site-nav__tab,
  .site-nav .site-nav__tab:link,
  .site-nav .site-nav__tab:visited {
    width: 100%;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: flex-start;
    font-size: 14px;
  }
  .site-nav .site-nav__tab:last-child { border-bottom: none; }

  .page__layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .page__binding { display: none; }
  /* Push sidebar to bottom on mobile so the main content (article body,
     category list, home page banner) appears first. Applied per-template
     by adding the .page--content-first class. */
  .page--content-first .page__sidebar { order: 2; }
  .page--content-first .page__content { order: 1; }

  .two-col { grid-template-columns: 1fr; gap: 16px; }
  .category-grid { grid-template-columns: 1fr 1fr; gap: 4px 16px; }

  .q-article h1 { font-size: 26px; }
  .q-body h2 { font-size: 20px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-wordmark img { height: 32px; }
  .category-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Additional rules for live phase 1 pages
   ========================================================= */

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-mute);
  background: #fbfcfe;
  border: 1px dashed var(--rule);
  border-radius: 4px;
}

.category-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}
.category-description {
  color: var(--ink-mute);
  font-style: italic;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
}

.search-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px;
}
.search-summary {
  color: var(--ink-mute);
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-soft);
}

/* Article list (used on category pages and search results) */
.q-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.q-article-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.q-article-list li:last-child { border-bottom: none; }
.q-article-list__link {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}
.q-article-list__link:hover { color: var(--brand-red); text-decoration: underline; }
.q-article-list__excerpt {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.55;
}

/* =========================================================
   Related Questions display (Phase 2B)
   ========================================================= */

/* End-of-article block (shown on mobile) */
.related-block {
  margin: 36px 0 0;
  padding: 18px 22px;
  background: linear-gradient(to bottom, #f5f8fb 0%, #fbfcfe 100%);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.related-block__head {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.related-block__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-block__list li {
  padding: 6px 0;
  font-size: 15px;
  border-bottom: 1px dotted var(--rule);
}
.related-block__list li:last-child { border-bottom: none; }
.related-block__list a {
  display: block;
  text-decoration: none;
}
.related-block__list a:hover {
  color: var(--brand-red);
  text-decoration: underline;
}

/* Sidebar variant — uses existing .sidebar-card styling */
.sidebar-card--related .quick-browse a { font-weight: 500; }

/* Desktop / mobile visibility helpers */
.desktop-only { display: block; }
.mobile-only  { display: none; }

@media (max-width: 880px) {
  .desktop-only { display: none; }
  .mobile-only  { display: block; }
}

/* =========================================================
   Glossary auto-link in articles (Phase 3)
   ========================================================= */

/* Underline color — adjustable via this single variable */
:root {
  --glossary-underline: #1e8a3a;
}

.glossary-term {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--glossary-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  color: inherit;
  cursor: help;
  transition: background 0.15s ease;
}
.glossary-term:hover,
.glossary-term:focus {
  background: rgba(30, 138, 58, 0.08);
  color: var(--glossary-underline);
  outline: none;
}
.glossary-term:visited { color: inherit; }

/* Real-DOM tooltip created by site.js — viewport-aware positioning */
.glossary-tooltip {
  position: absolute;
  z-index: 1000;
  max-width: 320px;
  width: max-content;
  background: #1a1814;
  color: #fafaf5;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: normal;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.glossary-tooltip.is-visible {
  opacity: 1;
}
.glossary-tooltip__arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}
/* Arrow when tooltip is ABOVE the term */
.glossary-tooltip--above .glossary-tooltip__arrow {
  bottom: -12px;
  border-top-color: #1a1814;
}
/* Arrow when tooltip is BELOW the term */
.glossary-tooltip--below .glossary-tooltip__arrow {
  top: -12px;
  border-bottom-color: #1a1814;
}

/* Mobile: a touch narrower so margins always fit */
@media (max-width: 520px) {
  .glossary-tooltip {
    max-width: calc(100vw - 24px);
    font-size: 14px;
  }
}

/* =========================================================
   Glossary page
   ========================================================= */
.glossary-page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.glossary-intro {
  color: var(--ink-mute);
  font-size: 15px;
  margin: 0 0 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
}

.glossary-az {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.glossary-az a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  color: var(--link);
}
.glossary-az a:hover {
  background: var(--brand-red);
  color: white;
  border-color: var(--brand-red);
}

.glossary-letter {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-blue);
  margin: 32px 0 14px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--brand-blue);
}
.glossary-letter:first-of-type { margin-top: 0; }

.glossary-entry {
  margin: 0 0 22px;
  padding: 16px 18px;
  background: #fbfcfe;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brand-red);
  border-radius: 0 4px 4px 0;
  scroll-margin-top: 100px;
}
.glossary-entry:target {
  background: #fff7b8;
  border-left-color: var(--brand-blue);
}
.glossary-entry__term {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}
.glossary-entry__definition {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}
.glossary-entry__definition img {
  max-width: 200px;
  height: auto;
  margin: 0 12px 8px 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: white;
  padding: 4px;
}
.glossary-entry__definition p:last-child { margin-bottom: 0; }
