/* ==========================================================================
   Rail Passengers Association - Main Stylesheet
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  --color-primary:      #1b3b7b;   /* Navy blue */
  --color-primary-dark: #122560;   /* Darker navy */
  --color-primary-light:#2a52a0;   /* Lighter navy */
  --color-accent:       #c8102e;   /* Signal red */
  --color-accent-dark:  #a00d24;
  --color-link:         #0066b2;
  --color-text:         #222222;
  --color-text-muted:   #555555;
  --color-bg:           #ffffff;
  --color-bg-light:     #f5f7fa;
  --color-bg-dark:      #1b3b7b;
  --color-border:       #dee2e6;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  --max-width: 1200px;
  --container-pad: 1.25rem;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);

  --transition: 0.2s ease;
}

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

html { font-size: var(--font-size-base); scroll-behavior: smooth; }

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

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { padding-left: 1.5rem; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
  margin-bottom: 0.5em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }

address { font-style: normal; line-height: 1.7; }

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-align: center;
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-accent:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }

.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }

/* Small header buttons */
.btn-outline-sm {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition);
}
.btn-outline-sm:hover { background: rgba(255,255,255,0.2); text-decoration: none; }

.btn-accent-sm {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: var(--color-accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background var(--transition);
}
.btn-accent-sm:hover { background: var(--color-accent-dark); text-decoration: none; }

/* --- Header --- */
.site-header { position: sticky; top: 0; z-index: 100; }

.header-top-bar {
  background: var(--color-primary);
  color: #fff;
}
.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; opacity: 0.9; }
.logo-img {
  height: 48px;
  width: auto;
  display: block;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Main Navigation */
.main-nav {
  background: var(--color-primary-dark);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.nav-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
}
.nav-item { position: relative; }
.nav-link {
  display: block;
  padding: 0.75rem 1.1rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

/* Dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--color-primary);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.has-dropdown:hover .nav-dropdown { display: block; }
.nav-dropdown li a {
  display: block;
  padding: 0.55rem 1.25rem;
  color: rgba(255,255,255,0.88);
  font-size: 0.9rem;
  transition: background var(--transition);
}
.nav-dropdown li a:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }

/* --- Hero Section (Homepage) --- */
.hero {
  position: relative;
  color: #fff;
  padding: 6rem 0;
  text-align: center;
  background-color: var(--color-primary);       /* fallback if image not loaded */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(27, 59, 123, 0.75) 0%,
    rgba(18, 37, 96, 0.85) 100%
  );
  z-index: 0;
}
.hero .container {
  position: relative;
  z-index: 1;
}
.hero-content { position: relative; }
.hero h1 {
  font-size: 2.75rem;
  color: #fff;
  max-width: 800px;
  margin: 0 auto 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto 2rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Page Hero (Inner Pages) --- */
.page-hero {
  background: var(--color-primary);
  color: #fff;
  padding: 3rem 0;
}
.page-hero h1 { color: #fff; margin-bottom: 0.4rem; }
.page-subtitle { color: rgba(255,255,255,0.85); font-size: 1.1rem; }
.page-date { color: rgba(255,255,255,0.7); font-size: 0.9rem; }

/* --- Section Title --- */
.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--color-primary);
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.section-header .section-title { margin-bottom: 0; text-align: left; }
.see-all-link { font-weight: 600; color: var(--color-link); white-space: nowrap; }

/* --- Mission Section --- */
.mission-section {
  padding: 4rem 0;
  background: var(--color-bg-light);
}
.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.mission-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.mission-icon { margin-bottom: 1rem; display: flex; justify-content: center; }
.mission-icon img { width: 80px; height: 80px; object-fit: contain; }
.mission-card h3 { font-size: 1.1rem; color: var(--color-primary); margin-bottom: 0.5rem; }
.mission-card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }

/* --- News Section --- */
.news-section { padding: 4rem 0; }
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.news-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.news-card:hover { box-shadow: var(--shadow-md); }
.news-card-image img { width: 100%; height: 200px; object-fit: cover; }
.news-card-body { padding: 1.25rem; }
.news-date { display: block; font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.news-card-body h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.news-card-body h3 a { color: var(--color-primary); }
.news-card-body h3 a:hover { color: var(--color-link); }
.news-excerpt { color: var(--color-text-muted); font-size: 0.9rem; margin: 0; }

/* --- Survey CTA --- */
.survey-cta {
  background: var(--color-accent);
  color: #fff;
  padding: 3rem 0;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-text h2 { color: #fff; font-size: 1.75rem; }
.cta-text p { color: rgba(255,255,255,0.9); margin: 0; }
.survey-cta .btn-primary { background: #fff; color: var(--color-accent); border-color: #fff; }
.survey-cta .btn-primary:hover { background: rgba(255,255,255,0.9); }

/* --- Membership Section --- */
.membership-section {
  padding: 4rem 0;
  background: var(--color-bg-light);
}
.membership-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.membership-content h2 { font-size: 2rem; margin-bottom: 1rem; }
.membership-benefits {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}
.membership-benefits li {
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--color-text);
}
.membership-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}
.membership-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.stat-block {
  text-align: center;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.stat-number { display: block; font-size: 2.5rem; font-weight: 800; color: var(--color-primary); }
.stat-label { display: block; font-size: 0.9rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* --- Impact Section --- */
.impact-section { padding: 4rem 0; }
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.impact-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  background: #fff;
}
.impact-card h3 { margin-bottom: 0.75rem; }
.impact-card p { color: var(--color-text-muted); margin-bottom: 1rem; }

/* --- Page Layout (inner pages) --- */
.page-content-wrap { padding: 3rem 0; }
.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

/* Article content styles */
.page-main h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.page-main h3 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.page-main ul, .page-main ol { margin-bottom: 1rem; }
.page-main li { margin-bottom: 0.25rem; }
.page-main blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-bg-light);
  color: var(--color-text-muted);
  font-style: italic;
}

/* Sidebar */
.sidebar-widget {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.sidebar-widget h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--color-primary); }
.sidebar-widget ul { list-style: none; padding: 0; }
.sidebar-widget ul li { padding: 0.3rem 0; border-bottom: 1px solid var(--color-border); }
.sidebar-widget ul li:last-child { border-bottom: none; }
.sidebar-widget ul li a { color: var(--color-link); }
.sidebar-cta { background: var(--color-primary); color: #fff; text-align: center; }
.sidebar-cta h3 { color: #fff; font-size: 1.1rem; }
.sidebar-cta p { color: rgba(255,255,255,0.85); font-size: 0.9rem; margin-bottom: 1rem; }

/* --- Section Content (section landing pages) --- */
.section-content-wrap { padding: 3rem 0; }
.section-intro { max-width: 800px; margin-bottom: 2.5rem; font-size: 1.05rem; color: var(--color-text-muted); }

/* Subsection cards */
.subsection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.subsection-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  color: var(--color-text);
}
.subsection-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.subsection-card-image img { width: 100%; height: 180px; object-fit: cover; }
.subsection-card-body { padding: 1.25rem; }
.subsection-card-body h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.subsection-card-body p { color: var(--color-text-muted); font-size: 0.9rem; margin: 0; }

/* Page listing (news, events, etc.) */
.page-listing { display: flex; flex-direction: column; gap: 2rem; }
.listing-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
}
.listing-item-inner { display: flex; gap: 0; }
.listing-thumbnail { flex-shrink: 0; }
.listing-thumbnail img { width: 220px; height: 160px; object-fit: cover; }
.listing-body { padding: 1.25rem; }
.listing-date { display: block; font-size: 0.8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.listing-body h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.listing-body h2 a { color: var(--color-primary); }
.listing-body h2 a:hover { color: var(--color-link); }
.listing-body p { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 0.75rem; }
.read-more { font-weight: 600; color: var(--color-link); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
}
.pagination-info { color: var(--color-text-muted); font-size: 0.9rem; }

.no-content { color: var(--color-text-muted); font-style: italic; }

/* --- Footer --- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.85);
  margin-top: 4rem;
  padding-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.footer-col h3 {
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: rgba(255,255,255,0.75); font-size: 0.9rem; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }
.footer-org address { font-size: 0.9rem; margin-bottom: 0.75rem; }
.footer-org p { font-size: 0.9rem; margin-bottom: 0.75rem; }
.footer-org a { color: rgba(255,255,255,0.8); }
.footer-org a:hover { color: #fff; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.social-links a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
}
.social-links a:hover { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; }

.footer-bottom {
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.footer-bottom p { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin: 0; }
.copyright { }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-org { grid-column: 1 / -1; }
  .membership-inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  .hero { padding: 3rem 0; }
  .hero h1 { font-size: 2rem; }

  .header-top-inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .header-cta { flex-wrap: wrap; }

  .nav-list { flex-wrap: wrap; }
  .nav-link { padding: 0.6rem 0.75rem; font-size: 0.88rem; }

  .page-layout { grid-template-columns: 1fr; }
  .page-sidebar { order: -1; }

  .listing-item-inner { flex-direction: column; }
  .listing-thumbnail img { width: 100%; height: 200px; }

  .membership-stats { grid-template-columns: 1fr 1fr; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-org { grid-column: 1 / -1; }

  .cta-inner { flex-direction: column; align-items: flex-start; }

  .section-header { flex-direction: column; gap: 0.5rem; }
  .section-header .section-title { text-align: center; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .membership-stats { grid-template-columns: 1fr; }
}
