/*
Theme Name: Ridge Park Report Card
Theme URI: https://ridgeparkboardscore.org
Author: Ridge Park BoardScore
Description: A report-card style WordPress theme for HOA board-member scorecards.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
Text Domain: ridgepark-reportcard
*/

:root {
  --paper: #fbf7ef;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d6cbb9;
  --red: #b42318;
  --gold: #c58a19;
  --green: #1f7a4d;
  --blue: #2f5f8f;
  --card: #fffdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(31, 41, 51, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 28px;
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: var(--blue);
}

.site-header {
  border-bottom: 3px double var(--line);
  background: rgba(251, 247, 239, 0.92);
}

.site-header__inner,
.site-main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
}

.site-title {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.25rem, 2.6vw, 2.1rem);
  letter-spacing: 0;
  text-transform: uppercase;
}

.site-title a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.94rem;
}

.site-main {
  padding: 34px 0 52px;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.report-hero__stamp {
  transform: rotate(-5deg);
  border: 4px solid var(--red);
  color: var(--red);
  padding: 10px 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 780px;
  margin: 16px 0 0;
  color: #405161;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.rpbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.rpbs-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(31, 41, 51, 0.08);
}

.rpbs-card::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--blue);
}

.rpbs-card.grade-A::before {
  background: var(--green);
}

.rpbs-card.grade-B::before,
.rpbs-card.grade-C::before {
  background: var(--gold);
}

.rpbs-card.grade-D::before,
.rpbs-card.grade-F::before {
  background: var(--red);
}

.rpbs-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px 18px 10px;
}

.rpbs-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rpbs-card h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.08;
}

.rpbs-card h2 a {
  color: inherit;
  text-decoration: none;
}

.rpbs-card h2 a:hover,
.rpbs-card h2 a:focus {
  color: var(--blue);
  text-decoration: underline;
}

.rpbs-term {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.rpbs-grade {
  min-width: 82px;
  padding: 8px 10px;
  border: 2px solid currentColor;
  color: var(--red);
  text-align: center;
  transform: rotate(2deg);
}

.grade-A .rpbs-grade {
  color: var(--green);
}

.grade-B .rpbs-grade,
.grade-C .rpbs-grade {
  color: var(--gold);
}

.rpbs-grade span,
.rpbs-grade strong {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
}

.rpbs-grade span {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.rpbs-grade strong {
  margin-top: 4px;
  font-size: 0.9rem;
}

.rpbs-bars {
  display: grid;
  gap: 10px;
  padding: 8px 18px 20px;
}

.rpbs-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
}

.rpbs-track {
  height: 9px;
  overflow: hidden;
  background: #eadfcc;
  border-radius: 99px;
}

.rpbs-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  border-radius: inherit;
}

.rpbs-methods,
.rpbs-community,
.page-content {
  max-width: 860px;
  margin-top: 28px;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  line-height: 1.65;
}

.rpbs-community h2,
.rpbs-methods h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.community-grid div {
  min-height: 120px;
  padding: 16px;
  background: #f6eddf;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.community-grid strong,
.community-grid span {
  display: block;
}

.community-grid strong {
  margin-bottom: 6px;
  font-family: Arial, Helvetica, sans-serif;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.method-grid div {
  min-height: 120px;
  padding: 16px;
  background: #f6eddf;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.method-grid strong {
  display: block;
  margin-bottom: 6px;
  font-family: Arial, Helvetica, sans-serif;
}

.method-grid ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.method-grid li {
  margin: 4px 0;
}

.formula-link,
.formula-modal__close {
  appearance: none;
  border: 2px solid var(--blue);
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.94rem;
  font-weight: 800;
}

.formula-link {
  margin-top: 10px;
  padding: 9px 12px;
}

.formula-link:hover,
.formula-modal__close:hover {
  background: var(--blue);
  color: var(--card);
}

.formula-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 20px;
}

.formula-modal.is-open {
  display: grid;
  place-items: center;
}

.formula-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 51, 0.58);
}

.formula-modal__panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(31, 41, 51, 0.28);
}

.formula-modal__panel h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.formula-modal__close {
  float: right;
  padding: 7px 10px;
}

.formula-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.formula-list div {
  padding: 14px;
  background: #f6eddf;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.formula-list strong {
  display: block;
  margin-bottom: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

.formula-list code {
  display: block;
  overflow-x: auto;
  color: #344054;
  font-size: 0.88rem;
  white-space: nowrap;
}

.site-footer {
  padding: 28px 0 44px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .site-header__inner,
  .report-hero {
    display: block;
  }

  .site-nav {
    margin-top: 12px;
  }

  .report-hero__stamp {
    display: inline-block;
    margin-top: 18px;
  }
}
