/* ==========================================================================
   HousingAlerts FAQ (faq2) — single stylesheet, edit variables to re-theme
   ========================================================================== */

:root {
  --ha-blue: #144d9a;
  --ha-blue-dark: #0d3a78;
  --ha-blue-tint: #eaf1fb;
  --ha-green: #008800;
  --ha-green-dark: #006e00;
  --ha-bg: #f2f3f5;
  --ha-card-bg: #ffffff;
  --ha-text: #202632;
  --ha-text-muted: #5c6470;
  --ha-border: #e1e4ea;
  --ha-radius: 10px;
  --ha-shadow: 0 1px 3px rgba(20, 30, 50, 0.08), 0 1px 2px rgba(20, 30, 50, 0.06);
  --ha-max-width: 1180px;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-base);
  background: var(--ha-bg);
  color: var(--ha-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ha-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ha-blue); line-height: 1.25; }
img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--ha-border);
}
.site-header__inner {
  max-width: var(--ha-max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ha-text);
}
.brand:hover { text-decoration: none; }
.brand__logo { display: block; width: 160px; height: auto; }
.brand__divider {
  width: 1px; height: 24px; background: var(--ha-border);
}
.brand__label {
  font-weight: 700; color: var(--ha-blue); font-size: 1.1rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.back-link { font-size: 0.85rem; color: var(--ha-text-muted); white-space: nowrap; }

/* ---------- Search ---------- */
.site-search { position: relative; width: 280px; max-width: 60vw; }
.site-search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ha-text-muted); pointer-events: none;
}
.site-search__icon svg { width: 100%; height: 100%; }
.site-search__input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 50px;
  border: 1px solid var(--ha-border);
  background: var(--ha-bg);
  font-size: 0.92rem;
  font-family: inherit;
}
.site-search__input:focus { outline: 2px solid var(--ha-blue); outline-offset: 1px; }
.site-search__results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--ha-border); border-radius: var(--ha-radius);
  box-shadow: var(--ha-shadow); max-height: 420px; overflow-y: auto; z-index: 30;
}
.site-search__result {
  display: block; padding: 10px 14px; border-bottom: 1px solid var(--ha-border);
}
.site-search__result:last-child { border-bottom: none; }
.site-search__result:hover, .site-search__result.is-active { background: var(--ha-blue-tint); text-decoration: none; }
.site-search__result-title { font-weight: 600; color: var(--ha-text); display: block; }
.site-search__result-cat { font-size: 0.78rem; color: var(--ha-text-muted); }
.site-search__empty { padding: 14px; color: var(--ha-text-muted); font-size: 0.9rem; }

/* ---------- Layout shells ---------- */
.page { max-width: var(--ha-max-width); margin: 0 auto; padding: 28px 20px 60px; }
.breadcrumb { font-size: 0.88rem; color: var(--ha-text-muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--ha-text-muted); }
.breadcrumb .crumb-sep { margin: 0 8px; }
.breadcrumb [aria-current="page"] { color: var(--ha-text); font-weight: 600; }

.layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.content-panel {
  background: var(--ha-card-bg);
  border-radius: var(--ha-radius);
  box-shadow: var(--ha-shadow);
  padding: 28px 32px;
}
.content-panel h1 { margin-top: 0; display: flex; align-items: center; gap: 12px; font-size: 1.7rem; }
.content-panel__icon { width: 26px; height: 26px; color: var(--ha-blue); flex: none; }
.content-panel__icon svg { width: 100%; height: 100%; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--ha-card-bg);
  border-radius: var(--ha-radius);
  box-shadow: var(--ha-shadow);
  padding: 10px 0;
  align-self: start;
  position: sticky;
  top: 20px;
}
.sidebar__group { border-bottom: 1px solid var(--ha-border); }
.sidebar__group:last-child { border-bottom: none; }
.sidebar__group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--ha-text);
}
.sidebar__group summary::-webkit-details-marker { display: none; }
.sidebar__icon { width: 18px; height: 18px; color: var(--ha-blue); flex: none; }
.sidebar__icon svg { width: 100%; height: 100%; }
.sidebar__cat-label { flex: 1; font-size: 0.92rem; }
.sidebar__chevron { width: 14px; height: 14px; color: var(--ha-text-muted); transition: transform 0.15s; flex: none; }
.sidebar__chevron svg { width: 100%; height: 100%; }
.sidebar__group[open] > summary .sidebar__chevron { transform: rotate(90deg); }
.sidebar__articles { list-style: none; margin: 0; padding: 0 16px 12px 44px; }
.sidebar__articles li { margin: 0; }
.sidebar__article {
  display: block; padding: 6px 0; font-size: 0.88rem; color: var(--ha-text-muted);
}
.sidebar__article.is-active { color: var(--ha-blue); font-weight: 700; }
.sidebar__article:hover { color: var(--ha-blue); text-decoration: none; }

/* ---------- Home page ---------- */
.hero { text-align: center; padding: 10px 0 34px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 8px; }
.hero p { color: var(--ha-text-muted); max-width: 640px; margin: 0 auto; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.cat-card {
  background: var(--ha-card-bg);
  border-radius: var(--ha-radius);
  box-shadow: var(--ha-shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}
.cat-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cat-card__icon { width: 22px; height: 22px; color: var(--ha-green); flex: none; }
.cat-card__icon svg { width: 100%; height: 100%; }
.cat-card__head h2 { font-size: 1.05rem; margin: 0; flex: 1; }
.cat-card__head h2 a { color: var(--ha-text); }
.cat-card__count {
  background: var(--ha-blue); color: #fff; font-size: 0.78rem; font-weight: 700;
  border-radius: 999px; min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; padding: 0 6px;
}
.cat-card__list { list-style: none; margin: 0 0 12px; padding: 0; flex: 1; }
.cat-card__list li { border-top: 1px dashed var(--ha-border); padding: 7px 0; font-size: 0.92rem; }
.cat-card__list li:first-child { border-top: none; }
.cat-card__more {
  align-self: flex-start; color: var(--ha-green); font-weight: 700; font-size: 0.85rem;
}

/* ---------- Category listing ---------- */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { border-top: 1px solid var(--ha-border); }
.article-list li:first-child { border-top: none; }
.article-list a { display: block; padding: 13px 4px; font-size: 1rem; }

/* ---------- Article body ---------- */
.article__body h2 { font-size: 1.3rem; margin-top: 1.8em; }
.article__body h3 { font-size: 1.1rem; margin-top: 1.6em; }
.article__body p { margin: 1em 0; }
.article__body ul, .article__body ol { padding-left: 1.4em; }
.article__body li { margin: 0.35em 0; }
.article__body blockquote {
  margin: 1.2em 0; padding: 10px 18px; border-left: 4px solid var(--ha-blue);
  background: var(--ha-blue-tint); border-radius: 0 6px 6px 0; color: var(--ha-text);
}
.article__body table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.94rem; }
.article__body th, .article__body td { border: 1px solid var(--ha-border); padding: 8px 12px; text-align: left; }
.article__body th { background: var(--ha-blue-tint); }
.article-figure { margin: 1.6em 0; text-align: center; }
.article-figure img {
  border: 1px solid var(--ha-border); border-radius: 8px; box-shadow: var(--ha-shadow);
}
.article-figure figcaption { font-size: 0.85rem; color: var(--ha-text-muted); margin-top: 8px; }

.article-pager {
  display: flex; justify-content: space-between; gap: 20px; margin-top: 32px;
  padding-top: 18px; border-top: 1px solid var(--ha-border); font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ha-blue); color: #d8e3f5; margin-top: 50px; }
.site-footer__inner {
  max-width: var(--ha-max-width); margin: 0 auto; padding: 32px 20px 12px;
  display: flex; flex-wrap: wrap; gap: 30px;
}
.site-footer__col { font-size: 0.88rem; }
.site-footer__col a { color: #fff; }
.site-footer__logo { width: 140px; margin-bottom: 10px; filter: brightness(0) invert(1); opacity: 0.9; }
.site-footer__legal {
  text-align: center; font-size: 0.78rem; padding: 12px 20px 22px; color: #b9caea;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .content-panel { padding: 22px 18px; }
  .site-search { width: 100%; order: 3; }
  .header-actions { width: 100%; justify-content: space-between; }
}

/* Dark mode via prefers-color-scheme intentionally disabled: site is authored for light only. */
