/*
 * Balance of Power — Website Stylesheet
 *
 * Public analysis platform. Shares the academic aesthetic with the
 * Model Portal via shared/tokens.css.
 */

@import '/shared/tokens.css';

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: var(--line-height);
}

a { color: var(--navy); }
a:hover { color: var(--navy-light); }

/* ── Layout ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-header nav a {
  color: var(--navy-wash);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

.site-header nav a:hover {
  color: var(--white);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 4rem;
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  border-bottom: 1px solid var(--border);
}

.hero h2 {
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-mid);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Section Cards ──────────────────────────────────────────────── */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.section-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.section-card:hover {
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.1);
}

.section-card h3 {
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.section-card p {
  color: var(--text-mid);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  margin-top: 0.75rem;
}

.badge--coming { background: var(--amber-wash); color: var(--amber); }
.badge--live   { background: var(--green-wash); color: var(--green); }

.section-card--coming {
  opacity: 0.72;
  background: transparent;
}
.section-card--coming:hover { opacity: 1; }

/* ── Hero stat strip (Model Portal teaser) ──────────────────────── */
.stat-strip {
  list-style: none;
  margin: 2.25rem auto 0;
  padding: 1rem 1.25rem;
  max-width: 640px;
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-strip li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-strip strong {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.stat-strip span {
  font-size: 0.78rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

@media (max-width: 480px) {
  .stat-strip { gap: 0.5rem; padding: 0.85rem 0.5rem; }
  .stat-strip strong { font-size: 1.2rem; }
  .stat-strip span { font-size: 0.7rem; }
}

/* ── Article List ───────────────────────────────────────────────── */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.article-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.article-card:hover {
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.1);
  border-color: var(--navy-light);
}

.article-card h3 {
  color: var(--navy);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.article-card p {
  color: var(--text-mid);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.article-card-date {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--navy-wash);
  color: var(--navy);
}

.word-count {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ── Article Detail ────────────────────────────────────────────── */
.article-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.back-link {
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}

.back-link:hover { color: var(--navy); }

.article-title {
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-mid);
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.article-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.article-theories {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.article-theories h3 {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 0.75rem;
}

.theory-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.theory-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  background: var(--navy-wash);
  color: var(--navy);
  text-decoration: none;
  border: 1px solid var(--border);
}

.theory-link:hover {
  background: var(--navy);
  color: var(--white);
}

/* ── Empty State ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.empty-state h3 {
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .site-header { padding: 0.75rem 1rem; }
  .site-header nav a { margin-left: 1rem; font-size: 0.8rem; }
  .container { padding: 1.5rem 1rem; }
  .hero { padding: 2.5rem 1rem; }
  .hero h2 { font-size: 1.5rem; }
}

/* ── Subscribe Form ─────────────────────────────────────────────── */
.subscribe-form {
  max-width: 520px;
  margin: 2rem auto 0;
  text-align: left;
}

.subscribe-form__label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
  text-align: center;
}

.subscribe-form__row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.subscribe-form__input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}

.subscribe-form__input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-wash);
}

.subscribe-form__button {
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.subscribe-form__button:hover:not(:disabled) {
  background: var(--navy-light);
}

.subscribe-form__button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.subscribe-form__message {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
  color: var(--text-mid);
}

.subscribe-form__message[data-state="success"] { color: var(--green); }
.subscribe-form__message[data-state="error"]   { color: var(--burgundy); }
.subscribe-form__message[data-state="pending"] { color: var(--text-mid); }

.subscribe-form__fineprint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
}

.subscribe-form--compact {
  max-width: 420px;
  margin-bottom: 1.5rem;
}

.subscribe-form--compact .subscribe-form__label {
  font-size: 0.85rem;
}

/* Honeypot: visually and accessibly hidden, but still tabbable by bots that
   ignore tabindex/aria-hidden. Real users never see or fill this. */
.subscribe-form__hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

@media (max-width: 480px) {
  .subscribe-form__row { flex-direction: column; }
  .subscribe-form__button { width: 100%; }
}

/* ── Coming Soon placeholder page ──────────────────────────────── */
.coming-soon-wrap {
  max-width: 720px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* ── Paywall: pricing grid + cards ─────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.pricing-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.pricing-card--featured { border-color: var(--navy); border-width: 2px; }
.pricing-card--founding { background: var(--navy-wash); border-color: var(--navy); }

.pricing-card h3 { color: var(--navy); margin: 0 0 0.5rem; }
.pricing-card__price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0.5rem 0;
}
.pricing-card__price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-mid);
}
.pricing-card__savings { font-size: 0.85rem; color: var(--text-mid); margin: 0.25rem 0 1rem; }
.pricing-card__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-mid);
}
.pricing-card__list li { padding: 0.25rem 0; }
.pricing-card__button {
  margin-top: auto;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.pricing-card__button:hover { background: var(--navy-light); }
.pricing-fineprint { text-align: center; color: var(--text-mid); font-size: 0.9rem; margin: 1rem 0 2rem; }

/* ── Paywall cutoff on article_detail_paywalled ────────────────── */
.article__body--preview { position: relative; }
.paywall-cutoff {
  position: relative;
  margin-top: -3rem;
  padding-top: 3rem;
}
.paywall-cutoff__fade {
  position: absolute;
  top: 0; left: 0; right: 0; height: 4rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--white));
  pointer-events: none;
}
.paywall-cutoff__cta {
  background: var(--navy-wash);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
}
.paywall-cutoff__cta h3 { color: var(--navy); margin: 0 0 0.5rem; }
.paywall-cutoff__buttons { margin-top: 1.5rem; }
.paywall-cutoff__button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  margin-right: 1rem;
}
.paywall-cutoff__button:hover { background: var(--navy-light); }
.paywall-cutoff__link {
  color: var(--navy);
  font-size: 0.9rem;
  text-decoration: underline;
}

/* ── Auth + account narrow card ────────────────────────────────── */
.card-narrow {
  max-width: 480px;
  margin: 3rem auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 1.75rem;
}
.card-narrow h2 { color: var(--navy); margin-top: 0; }
.auth-form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.auth-form__label { font-size: 0.9rem; color: var(--text-mid); }
.auth-form__input {
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
}
.auth-form__input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-wash); outline: none; }
.auth-form__button {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.auth-form__button:hover { background: var(--navy-light); }
.auth-form__fineprint { font-size: 0.85rem; color: var(--text-mid); margin-top: 1rem; text-align: center; }

.account__email { color: var(--text-mid); font-size: 0.95rem; margin-top: 0; }
.account__details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; margin: 1.5rem 0; font-size: 0.95rem; }
.account__details dt { color: var(--text-mid); font-weight: 500; }
.account__details dd { color: var(--text); margin: 0; }
.account__signout { margin-top: 2rem; font-size: 0.85rem; text-align: center; }
.coming-soon {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 2rem;
}
.coming-soon h2 {
  margin: 0.75rem 0 1rem;
  color: var(--navy);
  font-size: 1.75rem;
  font-weight: 700;
}
.coming-soon__lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 1rem;
}
.coming-soon__body {
  color: var(--text-mid);
  line-height: 1.55;
  margin: 0 0 0.75rem;
}
.coming-soon__body a {
  color: var(--navy);
  font-weight: 600;
}
