/* Hawaiʻi Energy Regulatory Research Platform — Phase 1
   HL&P brand system (web-templates.md) + the reading-room console layer.   */

@font-face {
  font-family: "BC Sans";
  src: url("/static/fonts/BCSans-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "BC Sans";
  src: url("/static/fonts/BCSans-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --hlp-brand-teal: #13353f;
  --hlp-brand-navy: #16365c;
  --hlp-brand-red: #d01414;
  --hlp-sage-olive: #5F6F5D;
  --hlp-light-sage: #a8b5a3;
  --hlp-warm-gray: #f5f5f5;
  --hlp-dark-gray: #404040;
  --hlp-medium-gray: #808080;
  --hlp-light-gray: #cccccc;
  --hlp-cream: #FBF8EE;
  --hlp-font: "BC Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--hlp-font);
  font-size: 16px; line-height: 1.5;
  color: var(--hlp-dark-gray);
  background: var(--hlp-warm-gray);
  min-height: 100vh;
}

/* ---- masthead ------------------------------------------------------- */
.masthead {
  background: var(--hlp-brand-teal); color: #fff;
  padding: 1.1rem 2rem 0.9rem;
  /* double rule: the table-of-authorities signature */
  border-bottom: 3px double var(--hlp-light-sage);
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.4rem;
}
.masthead .eyebrow {
  display: block; font-size: 0.72rem; letter-spacing: 0.14em;
  color: var(--hlp-light-sage); text-transform: uppercase; margin-bottom: 0.15rem;
}
.masthead h1 { margin: 0; font-size: 1.35rem; font-weight: 700; color: #fff; }
.masthead .who { font-size: 0.85rem; color: var(--hlp-light-sage); }
.masthead .who a { color: #fff; text-decoration: none; border-bottom: 1px solid var(--hlp-light-sage); }
.masthead .who a:hover { border-bottom-color: #fff; }

/* ---- ask console ---------------------------------------------------- */
.console { max-width: 62rem; margin: 0 auto; padding: 1.6rem 2rem 0; }
.ask { display: flex; gap: 0.6rem; }
.ask input[type="text"] {
  flex: 1; font: inherit; color: var(--hlp-dark-gray);
  padding: 0.7rem 0.9rem; border: 1.5px solid var(--hlp-light-sage);
  border-radius: 6px; background: #fff;
}
.ask input[type="text"]:focus {
  outline: 2px solid var(--hlp-sage-olive); outline-offset: 1px; border-color: var(--hlp-sage-olive);
}
.ask button {
  font: inherit; font-weight: 700; color: #fff; background: var(--hlp-brand-teal);
  border: 0; border-radius: 6px; padding: 0.7rem 1.4rem; cursor: pointer;
}
.ask button:hover { background: var(--hlp-sage-olive); }
.ask button:focus-visible { outline: 2px solid var(--hlp-brand-navy); outline-offset: 2px; }
.ask button[disabled] { background: var(--hlp-light-sage); cursor: wait; }

/* brain toggle — three-position segmented control */
.modes { margin: 0.8rem 0 0; display: inline-flex; border: 1.5px solid var(--hlp-light-sage);
         border-radius: 6px; overflow: hidden; background: #fff; }
.modes label { position: relative; }
.modes input { position: absolute; opacity: 0; inset: 0; }
.modes span {
  display: inline-block; padding: 0.42rem 1.0rem; font-size: 0.88rem;
  color: var(--hlp-sage-olive); cursor: pointer; user-select: none;
  border-right: 1px solid var(--hlp-light-sage);
}
.modes label:last-child span { border-right: 0; }
.modes input:checked + span { background: var(--hlp-sage-olive); color: #fff; font-weight: 700; }
.modes input:focus-visible + span { outline: 2px solid var(--hlp-brand-navy); outline-offset: -2px; }
.mode-hint { font-size: 0.8rem; color: var(--hlp-medium-gray); margin-left: 0.75rem; }

/* ---- results: citation cards ---------------------------------------- */
.results { max-width: 62rem; margin: 0 auto; padding: 1.2rem 2rem 3rem; }
.status { color: var(--hlp-medium-gray); font-size: 0.9rem; margin: 0.8rem 0; }
.notice {
  background: var(--hlp-cream); border: 1px solid var(--hlp-light-sage);
  border-radius: 6px; padding: 0.9rem 1.1rem; color: var(--hlp-dark-gray);
}
.error-box {
  background: #fef2f2; border: 1px solid var(--hlp-brand-red);
  border-radius: 6px; padding: 0.9rem 1.1rem;
}
.hit {
  background: #fff; border-left: 4px solid var(--hlp-light-sage);
  border-radius: 0 6px 6px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 1rem 1.3rem; margin-bottom: 1rem;
}
.hit:hover { border-left-color: var(--hlp-sage-olive); }
/* the signature: the Bluebook cite IS the headline, hanging-indent set */
.hit-cite {
  color: var(--hlp-brand-navy); font-weight: 700; font-size: 1.02rem;
  line-height: 1.4; padding-left: 1.4rem; text-indent: -1.4rem; margin: 0 0 0.45rem;
}
.hit-cite a { color: var(--hlp-brand-navy); }
.hit-cite a:hover { color: var(--hlp-sage-olive); }
.hit-meta { font-size: 0.78rem; color: var(--hlp-medium-gray); letter-spacing: 0.02em;
            margin-bottom: 0.55rem; }
.hit-meta b { color: var(--hlp-sage-olive); font-weight: 700; }
.hit-text {
  margin: 0; padding: 0.55rem 0.9rem; border-left: 2px solid var(--hlp-light-gray);
  background: var(--hlp-warm-gray); font-size: 0.9rem; color: var(--hlp-dark-gray);
  white-space: pre-line; overflow-wrap: anywhere;
}

/* ---- footer ---------------------------------------------------------- */
.foot {
  max-width: 62rem; margin: 0 auto; padding: 0 2rem 2rem;
  color: var(--hlp-medium-gray); font-size: 0.8rem;
}

/* ---- login ----------------------------------------------------------- */
body.login-page { background: var(--hlp-brand-teal); display: grid; place-items: center; }
.login-card {
  background: #fff; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  padding: 2.2rem 2.4rem; width: min(24rem, 92vw);
  border-top: 3px double var(--hlp-light-sage);
}
.login-card .eyebrow {
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--hlp-sage-olive); margin: 0 0 0.2rem;
}
.login-card h1 { margin: 0 0 1.4rem; font-size: 1.25rem; color: var(--hlp-brand-teal); }
.login-card label { display: block; font-size: 0.85rem; color: var(--hlp-sage-olive);
                    font-weight: 700; margin: 0.8rem 0 0.25rem; }
.login-card input {
  width: 100%; font: inherit; padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--hlp-light-sage); border-radius: 6px;
}
.login-card input:focus { outline: 2px solid var(--hlp-sage-olive); outline-offset: 1px; }
.login-card button {
  margin-top: 1.3rem; width: 100%; font: inherit; font-weight: 700;
  color: #fff; background: var(--hlp-brand-teal); border: 0; border-radius: 6px;
  padding: 0.7rem; cursor: pointer;
}
.login-card button:hover { background: var(--hlp-sage-olive); }
.login-error { color: var(--hlp-brand-red); font-size: 0.85rem; margin: 0.9rem 0 0; }

/* ---- motion & small screens ------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .hit { animation: rise 0.25s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } }
}
@media (max-width: 40rem) {
  .masthead, .console, .results, .foot { padding-left: 1rem; padding-right: 1rem; }
  .ask { flex-direction: column; }
  .modes span { padding: 0.42rem 0.7rem; }
}
