/* ==========================================================================
  THEME VARIABLES & OVERRIDES (Blue / Gold / White)
   ========================================================================== */
:root {
  /* Web Awesome CSS Variable Overrides */
  --wa-color-brand-600: #1d4ed8;
  --wa-color-brand-700: #061735;
  --wa-color-brand-500: #2563eb;

  /* Layout Palette */
  --color-navy-dark: #061735;
  --color-navy: #0d2b63;
  --color-blue: #2563eb;
  --color-gold: #d4a017;
  --color-gold-light: #fff4c2;
  --color-gray-100: #f8fafc;
  --color-gray-200: #e2e8f0;
  --color-gray-600: #475569;
  --color-gray-900: #0f172a;
  --color-white: #ffffff;

  --nav-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--wa-font-sans, system-ui, -apple-system, sans-serif);
  background-color: var(--color-white);
  color: var(--color-gray-900);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.bg-light {
  background-color: var(--color-gray-100);
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.navbar-header {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  background-color: var(--color-navy-dark);
  color: var(--color-white);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-white);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-menu {
  display: flex;
  gap: 1.75rem;
}

.nav-link {
  color: var(--color-gray-200);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-white);
}

.nav-link-events {
  padding: 0.42rem 0.7rem;
  color: #fff;
  background: rgba(212, 160, 23, 0.22);
  border: 1px solid rgba(255, 221, 130, 0.55);
  border-radius: 6px;
  font-weight: 700;
}

.nav-link-events:hover,
.nav-link-events.active {
  color: #fff;
  background: rgba(212, 160, 23, 0.34);
}

.nav-actions {
  display: flex;
  align-items: center;
}

@media (max-width: 900px) {
  .navbar-header {
    height: auto;
  }

  .nav-container {
    height: auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1rem;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .stories-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .nav-brand {
    font-size: 1rem;
  }

  .nav-link {
    font-size: 0.86rem;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .story-card-img,
  wa-card img[slot="media"] {
    height: 180px;
  }
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-title {
  font-size: 2.5rem;
  color: var(--color-navy-dark);
  line-height: 1.25;
  margin: 1rem 0;
}

.hero-description {
  color: var(--color-gray-600);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.hero-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-navy);
}

/* ==========================================================================
   CHAPTER STORIES SECTION & GRID
   ========================================================================== */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  color: var(--color-navy-dark);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--color-gray-600);
}

.text-center {
  text-align: center;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  align-items: stretch; /* Forces equal height across all grid cells */
}

/* Web Awesome Card Shadow DOM & Styling Overrides */
wa-card.story-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--wa-border-radius-medium, 12px);
}

wa-card.story-card::part(base) {
  height: 100%;
  display: flex;
  flex-direction: column;
}

wa-card.story-card::part(body) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

wa-card.story-card::part(footer) {
  margin-top: auto;
  border-top: none;
  padding-top: 0;
}

.story-card-img,
wa-card img[slot="media"] {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.story-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

.story-date {
  font-size: 0.8rem;
  color: var(--color-gray-600);
}

.story-card-title {
  font-size: 1.25rem;
  color: var(--color-navy-dark);
  margin: 0.5rem 0;
  line-height: 1.3;
}

.story-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.story-card-title a:hover {
  color: var(--wa-color-brand-500, #3b82f6);
}

.story-card-excerpt {
  color: var(--color-gray-600);
  font-size: 0.95rem;
  line-height: 1.5;
}

.story-card-footer {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: auto;
  padding-top: 1rem;
}

/* ==========================================================================
   SINGLE STORY DETAIL & ARTICLE STYLING
   ========================================================================== */
.article-container {
  max-width: 760px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-gray-600);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--color-navy);
}

.article-header {
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.meta-date {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.article-title {
  font-size: 2.5rem;
  color: var(--color-navy-dark);
  line-height: 1.2;
}

.article-hero-image {
  width: 100%;
  border-radius: var(--wa-border-radius-medium, 8px);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.article-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.article-body,
.story-body-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-gray-900);
}

.article-body p,
.story-body-content p {
  margin-bottom: 1.5rem;
  color: var(--color-gray-900);
}

.lead-paragraph {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-navy-dark);
}

.article-body h2,
.story-body-content h3 {
  color: var(--color-navy-dark);
  font-size: 1.75rem;
  margin: 2rem 0 1rem;
}

/* ==========================================================================
   BLOCKQUOTE & QUOTE CARD FIX (Light Background + Dark Text)
   ========================================================================== */

/* Standard HTML Blockquotes */
.article-body blockquote,
.story-body-content blockquote,
blockquote.story-block-quote {
  background-color: #f8fafc !important; /* Soft light slate background */
  color: #0f172a !important;            /* High-contrast dark navy text */
  border-left: 4px solid var(--color-blue) !important;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.6;
  border-radius: 0 8px 8px 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* If you are using a Web Awesome Card (<wa-card class="quote-card">) for quotes */
wa-card.quote-card,
wa-card.story-quote-card {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-left: 4px solid var(--color-blue) !important;
}

wa-card.quote-card::part(base),
wa-card.quote-card::part(body),
wa-card.story-quote-card::part(base),
wa-card.story-quote-card::part(body) {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}
/* ==========================================================================
   LEADERBOARD PAGE STYLES
   ========================================================================== */
.leaderboard-container {
  max-width: 800px;
}

.leaderboard-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.leaderboard-header,
.leaderboard-card-header {
  padding: 1.25rem 1.5rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-navy-dark);
}

.leaderboard-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Individual Leaderboard Item Styling */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background-color: var(--color-gray-100);
  border: 1px solid var(--color-gray-200);
  will-change: transform;
}

/* Highlight styling for top 3 positions */
.leaderboard-item[data-rank="1"],
.top-rank-row.rank-1 {
  background-color: #fefce8;
  border-color: #fef08a;
}
.leaderboard-item[data-rank="2"],
.top-rank-row.rank-2 {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}
.leaderboard-item[data-rank="3"],
.top-rank-row.rank-3 {
  background-color: #fff7ed;
  border-color: #ffedd5;
}

.rank-number {
  font-weight: 700;
  font-size: 1.1rem;
  width: 1.75rem;
  text-align: center;
  color: var(--color-gray-600);
  padding-left: 0.5rem;
}

.student-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-grow: 1;
}

.student-name {
  font-weight: 600;
  color: var(--color-navy-dark);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
}

.rank-badge.gold {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.rank-badge.silver {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.rank-badge.bronze {
  background-color: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

/* Table Layout Fixes */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  box-sizing: border-box;
}

.leaderboard-table th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

.col-rank { width: 12%; text-align: left; }
.col-name { width: 33%; text-align: left; }
.col-grade { width: 15%; text-align: left; }
.col-businesses { width: 22%; text-align: center; }
.col-raised { width: 18%; text-align: right; }

/* ==========================================================================
   LOGIN PAGE STYLES
   ========================================================================== */
.flex-center-main {
  min-height: calc(100vh - var(--nav-height) - 400px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.login-container {
  max-width: 460px;
  width: 100%;
}

.login-card {
  width: 100%;
}

.login-card-header {
  text-align: center;
}

.login-title-group h2 {
  font-size: 1.5rem;
  color: var(--color-navy-dark);
  margin-top: 0.5rem;
}

.login-notice {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy-dark);
}

.submit-btn {
  width: 100%;
  margin-top: 0.5rem;
}

.login-card-footer {
  text-align: center;
}

.footer-help-link {
  font-size: 0.85rem;
  color: var(--color-gray-600);
  text-decoration: none;
}

.footer-help-link:hover {
  text-decoration: underline;
  color: var(--color-navy);
}

/* ==========================================================================
   WEB AWESOME BADGES & OUTLINES
   ========================================================================== */
wa-badge {
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.65rem;
}

wa-badge[variant="neutral"],
wa-badge[outline] {
  border: 2px solid var(--color-navy-dark) !important;
  font-weight: 700;
}

wa-badge[variant="brand"] {
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */
.site-footer {
  background-color: var(--color-navy-dark);
  color: #94a3b8;
  padding-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--color-white);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-gray-300);
}

.footer-heading {
  color: #f8fafc;
  font-size: 1rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.footer-links,
.footer-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.footer-links a,
.footer-contact-list a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover,
.footer-contact-list a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-subtext {
  font-size: 0.85rem;
  color: var(--color-gray-300);
  margin-bottom: 1rem;
}

.footer-bottom {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 1.5rem 0;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-gray-300);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.site-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.site-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-logo-placeholder {
  width: 22px;
  height: 22px;
  display: block;
  border: 2px dashed var(--color-gray-600);
  border-radius: 3px;
}

.hero-banner {
  position: relative;
  min-height: clamp(280px, 48vw, 560px);
  overflow: hidden;
  background: var(--color-navy-dark);
}

.hero-banner img,
.hero-banner-placeholder {
  width: 100%;
  height: 100%;
  min-height: clamp(280px, 48vw, 560px);
  display: block;
  object-fit: cover;
}

.hero-banner-placeholder {
  border: 3px dashed var(--color-gold);
  background: var(--color-navy-dark);
}

.hero-banner-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-gold);
  border-radius: 50%;
  background: rgba(18, 48, 107, 0.85);
  color: var(--color-white);
  cursor: pointer;
}

.hero-banner-control:hover {
  background: var(--color-blue);
}

.hero-banner-control.prev { left: 1.25rem; }
.hero-banner-control.next { right: 1.25rem; }

.hero-banner-copy {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(2rem, 8vw, 6rem) max(1.5rem, 6vw) 2rem;
  background: linear-gradient(transparent, rgba(18, 48, 107, 0.94));
  color: var(--color-white);
}

.hero-banner-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--color-white);
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.05;
}

.hero-banner-media {
  position: absolute;
  inset: 0;
}

.hero-support {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (max-width: 560px) {
  .home-page .navbar-header {
    height: auto;
  }

  .home-page .nav-container {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 0.7rem;
    padding: 0.75rem 1rem;
  }

  .home-page .nav-brand {
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .home-page .nav-brand .site-logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .home-page .nav-brand .brand-title {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-page .nav-brand wa-badge {
    display: none;
  }

  .home-page .nav-menu {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 1.15rem;
    overflow-x: auto;
    padding: 0.15rem 0.25rem 0.35rem;
    scrollbar-width: none;
  }

  .home-page .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .home-page .nav-link {
    flex: 0 0 auto;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .home-page .nav-actions {
    justify-content: stretch;
  }

  .home-page .nav-actions wa-button {
    width: 100%;
  }

  .home-page .hero-banner {
    min-height: 410px;
  }

  .home-page .hero-banner img,
  .home-page .hero-banner-placeholder {
    min-height: 410px;
  }

  .home-page .hero-banner-copy {
    padding: 5.5rem 3rem 2rem 1.25rem;
  }

  .home-page .hero-banner-copy h1 {
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1.05;
  }

  .home-page .hero-banner-control {
    top: 1rem;
    transform: none;
    width: 38px;
    height: 38px;
  }

  .home-page .hero-banner-control.prev {
    left: auto;
    right: 3.75rem;
  }

  .home-page .hero-banner-control.next {
    right: 1rem;
  }

  .home-page .hero-support {
    padding: 2.5rem 0;
  }

  .home-page .hero-grid {
    gap: 1.75rem;
  }

  .home-page .hero-content {
    text-align: center;
  }

  .home-page .hero-content .hero-description {
    margin: 1rem 0 1.5rem;
    font-size: 0.98rem;
  }

  .home-page .hero-buttons {
    gap: 0.75rem;
  }

  .home-page .hero-buttons wa-button {
    width: 100%;
  }

  .home-page .hero-info-card::part(body) {
    padding: 1.25rem;
  }

  .home-page .section.bg-light {
    padding: 3rem 0;
  }

  .home-page .section-header {
    margin-bottom: 1.75rem;
  }

  .home-page .section-header h2 {
    font-size: 1.7rem;
  }

  .home-page .stories-grid {
    gap: 1rem;
  }
}