/* 
  Wabasha Area Community Resource Center
  Author: Gemini AI
  Version: 2.0
*/

/* --- VARIABLES --- */
:root {
  --font-primary: 'Poppins', sans-serif;
  --font-secondary: 'Open Sans', sans-serif;
  
  --color-primary: #4A90E2; /* Professional Blue */
  --color-primary-dark: #3a7ac8;
  --color-secondary: #50E3C2; /* Teal Accent */
  --color-secondary-dark: #40bba0;
  --color-dark: #333333;
  --color-light: #FDFDFF;
  --color-gray: #777777;
  --color-light-gray: #F7F8FA;
  --color-border: #EAEBEE;
  
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 15px rgba(0,0,0,0.08);
  --shadow-lg: 0 15px 30px rgba(0,0,0,0.1);

  --border-radius: 12px;
  --transition: all 0.3s ease-in-out;
}

/* --- BASE & RESET --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-secondary);
  color: var(--color-dark);
  background-color: var(--color-light);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-dark);
}

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: var(--transition);
}
a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

/* --- REUSABLE COMPONENTS --- */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-secondary:hover {
  background-color: var(--color-primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-subtitle {
  display: block;
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.section-description {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-gray);
}


/* --- HEADER & NAVIGATION --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: var(--transition);
  box-shadow: none;
}
.header.scrolled {
  box-shadow: var(--shadow-sm);
  background-color: rgba(255,255,255,0.98);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.nav-brand {
  display: flex;
  align-items: center;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-dark);
}
.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-primary);
  font-weight: 500;
  color: var(--color-dark);
  padding-bottom: 5px;
  position: relative;
}
.nav-link:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: var(--transition);
}
.nav-link:not(.btn):hover::after {
  width: 100%;
}
.nav-link.btn {
  padding: 8px 24px;
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-dark);
}

/* --- HERO SECTION --- */
.hero {
  padding-top: 160px;
  padding-bottom: 80px;
  background-color: var(--color-light-gray);
  overflow: hidden;
}
.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.hero-description {
  font-size: 1.1rem;
  color: var(--color-gray);
  margin-bottom: 2rem;
  max-width: 500px;
}
.hero-buttons {
  display: flex;
  gap: 1rem;
}
.hero-image-container {
  position: relative;
}
.hero-image {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* --- SERVICES SECTION --- */
.services {
  padding: 80px 0;
  background-color: var(--color-light);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .service-card {
    padding: 2.5rem 2rem;
  }
}

@media (max-width: 600px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .service-card {
    padding: 2rem 1.5rem;
  }
}
.service-card {
  background-color: #fff;
  padding: 2.5rem 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-md);
}
.service-icon {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}
.service-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.service-description {
  color: var(--color-gray);
  font-size: 0.95rem;
}

/* --- STORIES SECTION --- */
.stories {
  padding: 80px 0;
  background-color: var(--color-light-gray);
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}
.story-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}
.story-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
}
.story-content {
  padding: 2rem;
}
.story-content blockquote {
  font-size: 1.1rem;
  font-style: italic;
  border-left: 4px solid var(--color-primary);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-gray);
}
.story-content cite {
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--color-dark);
}

/* --- GET INVOLVED SECTION --- */
.get-involved {
  padding: 80px 0;
  background-color: var(--color-primary);
  color: #fff;
}
.get-involved .section-header .section-subtitle {
  color: rgba(255,255,255,0.8);
}
.get-involved .section-header .section-title,
.get-involved .section-header .section-description {
  color: #fff;
}
.involvement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}
.involvement-card {
  background-color: rgba(255,255,255,0.1);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.2);
}
.involvement-card h3 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 1rem;
}
.involvement-card p {
  margin-bottom: 2rem;
  opacity: 0.9;
}
.involvement-card .btn-primary {
  background-color: #fff;
  color: var(--color-primary);
  border-color: #fff;
}
.involvement-card .btn-primary:hover {
  background-color: transparent;
  color: #fff;
}
.involvement-card .btn-secondary {
  background-color: transparent;
  color: #fff;
  border-color: #fff;
}
.involvement-card .btn-secondary:hover {
  background-color: #fff;
  color: var(--color-primary);
}


/* --- CONTACT SECTION --- */
.contact {
  padding: 80px 0;
}
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  background-color: #fff;
  padding: 4rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}
.contact-info .section-title {
  font-size: 2rem;
}
.contact-details {
  margin: 2rem 0;
}
.contact-details li {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--color-gray);
}
.contact-details li i {
  color: var(--color-primary);
  font-size: 1.2rem;
}

.contact-form .form-group {
  margin-bottom: 1.5rem;
}
.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-family: var(--font-primary);
}
.contact-form input, 
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-family: var(--font-secondary);
  font-size: 1rem;
  transition: var(--transition);
}
.contact-form input:focus, 
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}
.btn-full {
  width: 100%;
}

/* --- FOOTER --- */
.footer {
  background-color: var(--color-dark);
  color: var(--color-light-gray);
  padding: 60px 0 20px;
}
.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-gray);
}
.footer h4 {
  font-family: var(--font-primary);
  color: #fff;
  margin-bottom: 1.5rem;
}
.footer p {
  color: var(--color-gray);
  margin-bottom: 0;
}
.footer-links ul li {
  margin-bottom: 0.75rem;
}
.footer-links ul a {
  color: var(--color-gray);
}
.footer-links ul a:hover {
  color: #fff;
}
.social-links a {
  color: var(--color-gray);
  font-size: 1.5rem;
  margin-right: 1.5rem;
}
.social-links a:hover {
  color: var(--color-primary);
}
.footer-bottom {
  text-align: center;
  color: var(--color-gray);
  font-size: 0.9rem;
}

/* --- RESPONSIVE DESIGN --- */

/* Large screens */
@media (max-width: 1400px) {
  .container {
    max-width: 1200px;
    padding: 0 25px;
  }
  .hero-title {
    font-size: 3.2rem;
  }
  .section-title {
    font-size: 2.3rem;
  }
}

@media (max-width: 1200px) {
  .container {
    padding: 0 30px;
  }
  .hero-container {
    gap: 2.5rem;
  }
  .hero-title {
    font-size: 3rem;
  }
  .section-title {
    font-size: 2.2rem;
  }
  /* Services grid handled by main breakpoints */
}

/* Split screen optimization (half screen on desktop) */
@media (max-width: 1024px) and (min-width: 769px) {
  .container {
    padding: 0 25px;
  }
  
  /* Hero section for split screen */
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .hero-content {
    order: 2;
  }
  .hero-image-container {
    order: 1;
    max-width: 500px;
    margin: 0 auto;
  }
  .hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
  }
  .hero-description {
    font-size: 1rem;
    margin: 0 auto 1.5rem;
    max-width: 400px;
  }
  .hero-buttons {
    justify-content: center;
    gap: 0.75rem;
  }
  
  /* Services grid for split screen - handled by main breakpoints */
  .service-card {
    padding: 2rem 1.5rem;
  }
  .service-title {
    font-size: 1.1rem;
  }
  .service-description {
    font-size: 0.9rem;
  }
  
  /* Stories for split screen */
  .story-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .story-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    align-items: center;
  }
  .story-image {
    height: 150px;
    width: 100%;
  }
  .story-content {
    padding: 1rem;
  }
  .story-content blockquote {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  /* Contact for split screen */
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem;
  }
  .contact-info .section-title {
    font-size: 1.75rem;
  }
  
  /* Involvement cards */
  .involvement-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .involvement-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .involvement-card h3 {
    font-size: 1.3rem;
  }
  
  /* Footer for split screen */
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-about {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  /* Navigation adjustments */
  .nav-list {
    gap: 1.5rem;
  }
  .nav-link.btn {
    padding: 6px 20px;
    font-size: 0.9rem;
  }
  
  /* Typography adjustments */
  .section-title {
    font-size: 2rem;
  }
  .section-subtitle {
    font-size: 0.85rem;
  }
  .section-description {
    font-size: 0.95rem;
    max-width: 500px;
  }
}

/* Medium screens and tablets */
@media (max-width: 992px) and (min-width: 769px) {
  /* This range is already handled by split screen optimization above */
}

@media (max-width: 992px) {
  .hero-container, .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .hero-content {
    text-align: center;
    order: 2;
  }
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-image-container {
    order: 1;
  }
  .hero-title {
    font-size: 2.8rem;
  }
  .hero {
    padding-top: 120px;
    padding-bottom: 60px;
  }
  /* Services grid handled by main breakpoints */
  .story-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-social {
    justify-content: center;
  }
}

/* Additional optimization for narrow desktop windows */
@media (max-width: 1100px) and (min-width: 993px) {
  .container {
    padding: 0 25px;
  }
  
  /* Services grid handled by main breakpoints */
  
  .story-grid {
    grid-template-columns: 1fr;
  }
  
  .story-card {
    display: flex;
    flex-direction: row;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .story-image {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
  }
  
  .story-content {
    padding: 1.5rem;
    flex: 1;
  }
  
  .involvement-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .nav-list {
    gap: 1.5rem;
  }
  
  .nav-link {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
  
  /* Mobile Navigation */
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    z-index: 999;
  }
  .nav-menu.active {
    left: 0;
  }
  .nav-list {
    flex-direction: column;
    gap: 2.5rem;
  }
  .nav-link {
    font-size: 1.2rem;
  }
  .nav-toggle {
    display: block;
  }
  .nav-brand span {
    display: none;
  }
  .nav-logo {
    width: 35px;
    height: 35px;
  }

  /* Sections */
  .section-title {
    font-size: 2rem;
  }
  .section-header {
    margin-bottom: 3rem;
  }
  .services, .stories, .get-involved, .contact {
    padding: 60px 0;
  }
  
  /* Hero */
  .hero {
    padding-top: 100px;
    padding-bottom: 50px;
  }
  .hero-container {
    gap: 2rem;
  }
  
  /* Services handled by main breakpoints */
  
  /* Involvement */
  .involvement-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .involvement-card {
    padding: 2rem;
  }
  
  /* Stories */
  .story-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .story-content {
    padding: 1.5rem;
  }
  
  /* Contact */
  .contact-wrapper {
    padding: 2rem;
    gap: 2rem;
  }
  .contact-details li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
  }
  
  /* Buttons */
  .btn {
    padding: 10px 25px;
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 15px;
  }
  
  /* Hero */
  .hero {
    padding-top: 90px;
    padding-bottom: 40px;
  }
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  .hero-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  .hero-buttons .btn {
    width: 100%;
    max-width: 250px;
  }
  
  /* Typography */
  .section-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  .section-subtitle {
    font-size: 0.85rem;
  }
  .section-description {
    font-size: 0.95rem;
  }
  
  /* Cards */
  .service-card, .involvement-card {
    padding: 1.5rem;
  }
  .service-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  .service-title {
    font-size: 1.1rem;
  }
  .involvement-card h3 {
    font-size: 1.25rem;
  }
  
  /* Contact */
  .contact-wrapper {
    padding: 1.5rem;
  }
  .contact-info .section-title {
    font-size: 1.5rem;
  }
  
  /* Form */
  .contact-form input, 
  .contact-form textarea,
  .contact-form select {
    padding: 0.8rem;
    font-size: 0.95rem;
  }
  
  /* Footer */
  .footer {
    padding: 40px 0 15px;
  }
  .footer-content {
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
  }
  .footer h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  .footer p {
    font-size: 0.9rem;
  }
  .social-links a {
    font-size: 1.3rem;
    margin-right: 1rem;
  }
  
  /* Story images */
  .story-image {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    height: 70px;
  }
  .nav-menu {
    top: 70px;
    height: calc(100vh - 70px);
  }
  
  .hero {
    padding-top: 80px;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .contact-wrapper {
    padding: 1rem;
  }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }
  .service-card:hover {
    transform: none;
  }
  .nav-link:hover::after {
    width: 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .nav-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Container queries for modern browsers (progressive enhancement) */
@supports (container-type: inline-size) {
  .hero, .services, .stories, .get-involved, .contact {
    container-type: inline-size;
  }
  
  /* When container is narrow (split screen scenarios) */
  @container (max-width: 600px) {
    .hero-container {
      grid-template-columns: 1fr;
      gap: 1.5rem;
      text-align: center;
    }
    
    .hero-title {
      font-size: 2.2rem;
    }
    
    .services-grid {
      grid-template-columns: 1fr;
    }
    
    .story-card {
      flex-direction: column;
    }
    
    .story-image {
      width: 100%;
      height: 200px;
    }
  }
  
  @container (max-width: 800px) {
    .services-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    
    .involvement-grid {
      grid-template-columns: 1fr;
    }
    
    .contact-wrapper {
      grid-template-columns: 1fr;
    }
  }
}

/* Fallback for very narrow screens (mini split screen) */
@media (max-width: 600px) and (min-height: 600px) {
  .container {
    padding: 0 15px;
  }
  
  .hero {
    padding-top: 90px;
    padding-bottom: 40px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .services, .stories, .get-involved, .contact {
    padding: 50px 0;
  }
  
  .service-card, .involvement-card {
    padding: 1.5rem;
  }
  
  .story-content {
    padding: 1.25rem;
  }
  
  .contact-wrapper {
    padding: 1.5rem;
  }
}

/* Landscape orientation on tablets and small laptops */
@media (max-height: 600px) and (min-width: 768px) and (orientation: landscape) {
  .hero {
    padding-top: 100px;
    padding-bottom: 40px;
  }
  
  .hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
  
  .hero-description {
    margin-bottom: 1.5rem;
  }
  
  .services, .stories, .get-involved, .contact {
    padding: 50px 0;
  }
  
  .section-header {
    margin-bottom: 2.5rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}
