/* ==========================================================================
   Riley for RI House District 41 — Core Stylesheet
   Brand: Pine / Limestone / Barn Red — Lora (display) + Poppins (body/UI)
   ========================================================================== */

/* -------------------- Design Tokens -------------------- */
:root {
  /* Brand colors */
  --pine: #1C2E2B;
  --pine-light: #2C4540;
  --limestone: #F7F4ED;
  --limestone-dark: #EDE7D9;
  --barn-red: #A8392F;
  --barn-red-dark: #872E26;
  --white: #FFFFFF;
  --ink: #1A1A18;
  --ink-soft: #4A4A46;
  --line: #D9D3C4;
  --success: #3A6B4E;

  /* Typography */
  --font-display: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  /* Spacing scale */
  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.2rem;
  --space-4: 1.6rem;
  --space-5: 2.4rem;
  --space-6: 3.2rem;
  --space-7: 4.8rem;
  --space-8: 6.4rem;

  /* Layout */
  --content-max: 1140px;
  --content-narrow: 760px;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(28, 46, 43, 0.10);
  --shadow-md: 0 4px 16px rgba(28, 46, 43, 0.12);
  --border-thin: 1px solid var(--line);
}

/* -------------------- Reset -------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--limestone);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
ul, ol { padding-left: 1.2em; }
button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  color: var(--pine);
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { margin: 0 0 var(--space-3); }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.container-narrow {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Visually-hidden utility for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--barn-red);
  color: var(--white);
  padding: var(--space-2) var(--space-3);
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* -------------------- "Plat Rule" motif --------------------
   A recurring surveyor's-plat device: corner tick marks + a thin
   rule, echoing property boundary lines. Used sparingly as section
   dividers and card accents. */
.plat-rule {
  position: relative;
  height: 1px;
  background: var(--line);
  margin: var(--space-6) 0;
}
.plat-rule::before, .plat-rule::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--barn-red);
}
.plat-rule::before { left: 0; }
.plat-rule::after { right: 0; }

.plat-corner {
  position: relative;
}
.plat-corner::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-top: 2px solid var(--barn-red);
  border-left: 2px solid var(--barn-red);
}
.plat-corner::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid var(--barn-red);
  border-right: 2px solid var(--barn-red);
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.85em 1.7em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--barn-red);
  color: var(--white);
  border-color: var(--barn-red);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--barn-red-dark);
  border-color: var(--barn-red-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--pine);
  border-color: var(--pine);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--pine);
  color: var(--white);
}

.btn-light {
  background: var(--limestone);
  color: var(--pine);
  border-color: var(--limestone);
}
.btn-light:hover, .btn-light:focus-visible {
  background: var(--white);
}

.btn-block { display: block; width: 100%; }
.btn-lg { padding: 1em 2.2em; font-size: 1.05rem; }

:focus-visible {
  outline: 3px solid var(--barn-red);
  outline-offset: 2px;
}

/* -------------------- Header / Nav -------------------- */
.site-header {
  background: var(--pine);
  color: var(--limestone);
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  max-width: var(--content-max);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--limestone);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: 0.01em;
}
.brand-sub {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--limestone-dark);
  opacity: 0.85;
  margin-top: 2px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--limestone-dark);
  border-radius: var(--radius);
  color: var(--limestone);
  padding: 0.4em 0.6em;
  cursor: pointer;
}
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--limestone);
  margin: 4px 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  text-decoration: none;
  color: var(--limestone);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4em 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, opacity .15s ease;
}
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a[aria-current="page"] {
  border-bottom-color: var(--barn-red);
}
.nav-donate {
  background: var(--barn-red);
  color: var(--white) !important;
  padding: 0.5em 1.2em !important;
  border-radius: var(--radius);
  border-bottom: none !important;
}
.nav-donate:hover, .nav-donate:focus-visible {
  background: var(--barn-red-dark) !important;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pine);
    border-top: 1px solid rgba(247,244,237,0.15);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) var(--space-4) var(--space-4);
  }
  .main-nav li { border-bottom: 1px solid rgba(247,244,237,0.1); }
  .main-nav a { display: block; padding: var(--space-3) 0; }
  .nav-donate { display: inline-block; margin-top: var(--space-3); text-align: center; }
}

/* -------------------- Hero -------------------- */
.hero {
  background: linear-gradient(180deg, var(--pine) 0%, var(--pine-light) 100%);
  color: var(--limestone);
  padding: var(--space-8) 0 var(--space-7);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--barn-red);
  font-weight: 700;
  margin-bottom: var(--space-2);
  display: inline-block;
}
.hero h1 {
  color: var(--white);
  margin-bottom: var(--space-3);
}
.hero-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--limestone-dark);
  margin-bottom: var(--space-4);
}
.hero-lede {
  font-size: 1.1rem;
  color: var(--limestone-dark);
  max-width: 46ch;
  margin-bottom: var(--space-5);
}
.hero-ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hero-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4/5;
  background: var(--limestone-dark);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 380px; margin: 0 auto var(--space-4); aspect-ratio: 1/1; }
}

/* -------------------- Page Header (interior pages) -------------------- */
.page-header {
  background: var(--pine);
  color: var(--limestone);
  padding: var(--space-6) 0 var(--space-5);
}
.page-header h1 { color: var(--white); margin-bottom: var(--space-2); }
.page-header .lede {
  color: var(--limestone-dark);
  font-size: 1.05rem;
  max-width: 62ch;
  margin: 0;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--limestone-dark);
  opacity: 0.8;
  margin-bottom: var(--space-3);
}
.breadcrumb a { color: var(--limestone-dark); text-decoration: underline; }

/* -------------------- Sections -------------------- */
.section {
  padding: var(--space-7) 0;
}
.section-alt {
  background: var(--white);
}
.section-pine {
  background: var(--pine);
  color: var(--limestone);
}
.section-pine h2, .section-pine h3 { color: var(--white); }
.section-title {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-6);
}
.section-title .eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--barn-red);
  margin-bottom: var(--space-2);
}

/* -------------------- Cards -------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .card-grid, .card-grid.cols-2, .card-grid.cols-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: var(--border-thin);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.card h3 { margin-bottom: var(--space-2); }
.card p:last-of-type { margin-bottom: var(--space-3); }
.card .card-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--barn-red);
  text-decoration: none;
}
.card .card-link:hover { text-decoration: underline; }
.card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--limestone);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-3);
  color: var(--barn-red);
  font-weight: 700;
  font-family: var(--font-display);
}

/* -------------------- Issue tag / statute box -------------------- */
.issue-tag {
  display: inline-block;
  background: var(--barn-red);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3em 0.7em;
  border-radius: 3px;
  margin-bottom: var(--space-3);
}
.statute-box {
  background: var(--limestone);
  border-left: 4px solid var(--barn-red);
  padding: var(--space-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--space-4) 0;
  font-size: 0.95rem;
}
.statute-box strong { color: var(--pine); }
.verify-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* -------------------- CTA banner -------------------- */
.cta-banner {
  background: var(--barn-red);
  color: var(--white);
  padding: var(--space-6) 0;
  text-align: center;
}
.cta-banner h2 { color: var(--white); margin-bottom: var(--space-2); }
.cta-banner p { color: rgba(255,255,255,0.9); max-width: 60ch; margin: 0 auto var(--space-4); }
.cta-banner .btn-primary { background: var(--pine); border-color: var(--pine); }
.cta-banner .btn-primary:hover { background: var(--pine-light); border-color: var(--pine-light); }
.cta-row { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

/* -------------------- Forms -------------------- */
.form-card {
  background: var(--white);
  border: var(--border-thin);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  max-width: 640px;
  margin: 0 auto;
}
.form-row { margin-bottom: var(--space-4); }
.form-row-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 600px) {
  .form-row-group { grid-template-columns: 1fr; }
}
label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--pine);
  margin-bottom: var(--space-1);
}
.required { color: var(--barn-red); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 0.75em 0.9em;
  border: var(--border-thin);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--limestone);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pine);
  background: var(--white);
}
.checkbox-row { display: flex; align-items: flex-start; gap: var(--space-2); }
.checkbox-row input { width: auto; margin-top: 4px; }
.checkbox-row label { font-weight: 400; color: var(--ink); margin-bottom: 0; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: var(--space-2); }
.form-success, .form-error {
  display: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  font-weight: 600;
}
.form-success { background: #E4EFE8; color: var(--success); border: 1px solid var(--success); }
.form-error { background: #FBEAE8; color: var(--barn-red-dark); border: 1px solid var(--barn-red); }
.form-success.is-visible, .form-error.is-visible { display: block; }

/* -------------------- Donate tiers -------------------- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
@media (max-width: 880px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
.tier-btn {
  display: block;
  text-align: center;
  padding: var(--space-4) var(--space-2);
  background: var(--white);
  border: 2px solid var(--pine);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pine);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.tier-btn:hover, .tier-btn:focus-visible { background: var(--pine); color: var(--white); }
.tier-btn span { display: block; font-family: var(--font-body); font-size: 0.7rem; font-weight: 500; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* -------------------- Timeline / News list -------------------- */
.news-list { display: flex; flex-direction: column; gap: var(--space-5); }
.news-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-4);
  border-bottom: var(--border-thin);
  padding-bottom: var(--space-5);
}
@media (max-width: 600px) { .news-item { grid-template-columns: 1fr; gap: var(--space-2); } }
.news-date {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--barn-red);
  font-size: 0.95rem;
}
.news-item h3 { margin-bottom: var(--space-2); }

/* -------------------- Endorsement list -------------------- */
.endorsement-list { display: flex; flex-direction: column; gap: var(--space-3); }
.endorsement-item {
  background: var(--white);
  border: var(--border-thin);
  border-left: 4px solid var(--pine);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-4);
}
.endorsement-item .name { font-weight: 700; color: var(--pine); }
.endorsement-item .role { font-size: 0.85rem; color: var(--ink-soft); }

/* -------------------- Quote block -------------------- */
.quote-block {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--pine);
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.5;
}
.quote-block .attribution {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* -------------------- Accordion (issues expandable sections) -------------------- */
.accordion-item {
  border: var(--border-thin);
  border-radius: var(--radius-lg);
  background: var(--white);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--pine);
}
.accordion-trigger .plus {
  font-size: 1.5rem;
  color: var(--barn-red);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.accordion-trigger[aria-expanded="true"] .plus { transform: rotate(45deg); }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding: 0 var(--space-5);
}
.accordion-panel.is-open {
  padding: 0 var(--space-5) var(--space-5);
}
.accordion-panel p:last-child { margin-bottom: 0; }

/* -------------------- Footer -------------------- */
.site-footer {
  background: var(--pine);
  color: var(--limestone-dark);
  padding: var(--space-7) 0 var(--space-4);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand .brand-mark { color: var(--white); }
.footer-tagline { font-family: var(--font-display); font-style: italic; margin-top: var(--space-2); color: var(--limestone-dark); }
.footer-col h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: var(--space-2); }
.footer-col a { color: var(--limestone-dark); text-decoration: none; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-legal {
  border-top: 1px solid rgba(247,244,237,0.15);
  padding-top: var(--space-4);
  font-size: 0.82rem;
  color: rgba(247,244,237,0.7);
  line-height: 1.6;
}
.footer-legal p { margin: 0 0 var(--space-2); }
.footer-bottom-links a { color: rgba(247,244,237,0.7); text-decoration: underline; margin-right: var(--space-3); }

/* -------------------- Placeholder editable marker -------------------- */
.editable-placeholder {
  background: #FFF4CE;
  color: #6B5A00;
  border: 1px dashed #C9A400;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  font-size: 0.9em;
  font-weight: 600;
}

/* -------------------- Misc utility -------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.max-narrow { max-width: var(--content-narrow); margin-left: auto; margin-right: auto; }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

.image-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: var(--border-thin);
}

.badge-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.badge-list span {
  background: var(--limestone);
  border: var(--border-thin);
  color: var(--pine);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35em 0.8em;
  border-radius: 20px;
}
