/* EFF-inspired, clean nonprofit layout for CDPA */

:root {
  --red: #cc0000;
  --red-dark: #990000;
  --bg-page: #f5f5f5;
  --bg-light: #ffffff;
  --bg-alt: #f0f0f0;
  --border: #dddddd;
  --border-strong: #c4c4c4;
  --text-main: #222222;
  --text-muted: #666666;
  --link: #0055aa;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius-lg: 12px;
  --radius-md: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px; /* Ensure base font size is readable on mobile */
}

/* Layout */

.container {
  width: min(1140px, 100% - 2rem);
  margin-inline: auto;
}

/* Better mobile spacing */
@media (max-width: 640px) {
  .container {
    width: min(1140px, 100% - 1.5rem);
  }
}

.section {
  padding: 4rem 0;
}

/* Better mobile section spacing */
@media (max-width: 768px) {
  .section {
    padding: 2.5rem 0;
  }
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.9rem;
  margin-bottom: 1.75rem;
}

/* Header & Nav */

.site-header {
  background: var(--red);
  color: #ffffff;
  border-bottom: 3px solid var(--red-dark);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 2px solid #ffffff;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.brand-text {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 0.98rem;
}

.main-nav a {
  margin-left: 1.3rem;
  font-size: 0.9rem;
  color: #ffecec;
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}

/* Better mobile navigation */
@media (max-width: 640px) {
  .main-nav a {
    margin-left: 0;
    margin-right: 1.5rem;
    font-size: 1rem;
    padding: 0.5rem 0;
    min-height: 44px; /* Minimum touch target size */
    display: inline-flex;
    align-items: center;
  }
}

.main-nav a:hover {
  border-bottom-color: #ffffff;
}

.main-nav a.active {
  font-weight: 600;
  border-bottom-color: #ffffff;
}

/* Hero */

.hero {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: 2.4rem 0 2.8rem;
}

/* Mobile hero adjustments */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 0;
  }
}

.hero-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: flex-start;
  }
}

.hero-text h1 {
  font-size: clamp(2rem, 2.8vw + 1.2rem, 2.6rem);
  line-height: 1.15;
  margin-bottom: 0.9rem;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 36rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--red-dark);
  margin-bottom: 0.5rem;
}

.accent {
  color: var(--red-dark);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.5rem 0 0.7rem;
}

/* Mobile hero actions */
@media (max-width: 640px) {
  .hero-actions {
    gap: 1rem;
    margin: 1.5rem 0 1rem;
    flex-direction: column;
    align-items: stretch;
  }
}

.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease-out, color 0.12s ease-out, border-color 0.12s ease-out, box-shadow 0.12s ease-out;
  min-height: 44px; /* Minimum touch target */
}

/* Mobile button improvements */
@media (max-width: 640px) {
  .btn-primary,
  .btn-outline {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
    width: 100%;
    justify-content: center;
  }
}

.btn-primary {
  background: var(--red);
  border: 1px solid var(--red-dark);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: #e00000;
}

.btn-outline {
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  background: #ffffff;
}

.btn-outline:hover {
  border-color: var(--red);
  color: var(--red-dark);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.code-pill {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--border);
  background: #fafafa;
  color: var(--text-muted);
}

/* Hero side box */

.hero-panel {
  max-width: 400px;
  margin-inline: auto;
}

.hero-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.5rem;
}

.hero-box h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.hero-box p {
  margin-top: 0;
  margin-bottom: 0.7rem;
  color: var(--text-muted);
}

.hero-box ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-main);
}

/* Strip */

.strip {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.8rem 0;
}

.strip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  justify-content: space-between;
}

.strip-grid h2 {
  margin-top: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: #ffffff;
}

/* Cards and generic sections */

.card-grid {
  display: grid;
  gap: 2rem;
}

/* Responsive grid - better spacing on all screen sizes */
@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

@media (min-width: 1000px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

/* Mobile card improvements */
@media (max-width: 600px) {
  .card-grid {
    gap: 1.5rem;
  }
}

.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 2rem 2rem;
  min-height: 300px; /* Ensures cards have consistent minimum height */
}

/* Mobile card adjustments */
@media (max-width: 640px) {
  .card {
    padding: 1.5rem;
    min-height: auto;
  }
}

.card h3,
.card h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Badge */

.badge-panel {
  max-width: 320px;
}

.badge-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.badge {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.badge-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.badge-grade {
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--red-dark);
}

.badge-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Page headers */

.page-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 2.4rem 0 1.7rem;
}

/* Mobile page header */
@media (max-width: 768px) {
  .page-header {
    padding: 2rem 0 1.5rem;
  }
}

.page-subtitle {
  max-width: 42rem;
  color: var(--text-muted);
}

/* Utility grids */

.section-flex {
  display: grid;
  gap: 1.7rem;
}

@media (min-width: 900px) {
  .section-flex {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
  }
}

.two-column {
  display: grid;
  gap: 1.8rem;
}

@media (min-width: 860px) {
  .two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile two-column adjustments */
@media (max-width: 640px) {
  .two-column {
    gap: 1.5rem;
  }
}

/* Lists */

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li + li {
  margin-top: 1.2rem;
}

.feature-list h3 {
  margin: 0 0 0.25rem;
}

.feature-list p {
  margin: 0;
  color: var(--text-muted);
}

.bullet-list {
  padding-left: 1.1rem;
  margin: 0.4rem 0 0;
}

.bullet-list li + li {
  margin-top: 0.3rem;
}

/* Steps */

.steps-grid {
  display: grid;
  gap: 1.3rem;
  margin-top: 1.2rem;
}

@media (min-width: 900px) {
  .steps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile steps grid */
@media (max-width: 640px) {
  .steps-grid {
    gap: 1rem;
    margin-top: 1rem;
  }
}

.step-card {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.3rem 1.2rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.step-number {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--red-dark);
  opacity: 0.9;
}

/* Timeline */

.timeline {
  border-left: 3px solid var(--red);
  margin-left: 0.4rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 1.4rem;
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -1.6rem;
  top: 0.4rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--red);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(204, 0, 0, 0.25);
}

.timeline-content {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.timeline-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -0.15rem;
}

/* Events */

.events-grid {
  display: grid;
  gap: 1.4rem;
}

@media (min-width: 860px) {
  .events-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile events grid */
@media (max-width: 640px) {
  .events-grid {
    gap: 1.2rem;
  }
}

.event-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.2rem;
}

/* Services */

.service-intro {
  max-width: 42rem;
  margin-bottom: 2.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.services .service-card ul {
  margin-top: 0.6rem;
}

.service-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Callout */

.callout {
  margin-top: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  padding: 1rem 1.1rem;
  background: #ffffff;
  font-size: 0.9rem;
}

/* Links */

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

a:hover {
  color: #003a78;
}

/* Footer */

.site-footer {
  margin-top: 2rem;
  border-top: 3px solid var(--red);
  background: #ffffff;
  padding-top: 1.5rem;
  padding-bottom: 1.2rem;
  font-size: 0.86rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.4rem;
  align-items: flex-start;
}

/* Mobile footer adjustments */
@media (max-width: 640px) {
  .footer-grid {
    flex-direction: column;
    gap: 1.5rem;
  }
}

.brand-footer {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.footer-text {
  color: var(--text-muted);
  max-width: 22rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--red-dark);
}

.footer-bottom {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

/* Responsiveness */

@media (max-width: 640px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 0;
  }

  .main-nav {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .hero {
    padding-top: 2rem;
  }

  .site-footer {
    text-align: left;
  }

  /* Better mobile typography */
  h1 {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }

  p, li {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }
}
