/* Global Styles */
:root {
  --primary: #234A78;
  --secondary: #347BB7;
  --background: #F4F7FB;
  --text: #1A1A1A;
  --white: #FFFFFF;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3 {
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--primary);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.section {
  padding: var(--spacing-lg) 0;
}

.btn {
  display: inline-block;
  background-color: var(--secondary);
  color: var(--white) !important; /* Force white text */
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background-color 0.2s;
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  background-color: var(--primary);
}

/* Header */
header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* Hero */
.hero {
  background-image: linear-gradient(rgba(35, 74, 120, 0.8), rgba(35, 74, 120, 0.8)), url('/assets/hero.jpg');
  background-size: cover;
  background-position: center;
  color: var(--white);
  text-align: center;
  padding: 6rem 0;
}

.hero h1 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Grid Section */
.county-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.county-card {
  background: var(--white);
  padding: var(--spacing-md);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s;
}

.county-card:hover {
  transform: translateY(-5px);
}

.county-card h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Ensure links inside cards that AREN'T buttons have the secondary color */
.county-card a:not(.btn) {
  color: var(--secondary);
  font-weight: 600;
}

/* How It Works */
.how-it-works {
  background-color: var(--white);
  text-align: center;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.step {
  padding: var(--spacing-md);
}

.step-number {
  background-color: var(--secondary);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-weight: bold;
  font-size: 1.2rem;
}

/* County Page Specifics */
.county-header {
  background-color: var(--white);
  padding: var(--spacing-lg) 0;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.county-header p {
  max-width: 700px;
  margin: 1rem auto 0;
  color: #4b5563;
}

.featured-provider {
  background-color: #fff;
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.featured-tag {
  background-color: var(--secondary);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Featured Provider Extras */
.featured-logo-placeholder {
  width: 100px;
  height: 100px;
  background-color: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 50%;
  margin: 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.featured-benefits {
  list-style: none;
  padding: 0;
  margin: 1rem auto 1.5rem;
  display: inline-block;
  text-align: left;
}

.featured-benefits li {
  margin-bottom: 0.5rem;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.featured-benefits li::before {
  content: "✓";
  color: var(--secondary);
  font-weight: bold;
}

.listings-section h2, .service-topics h2, .towns-covered h2 {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.listings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.listing-item {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.listing-info h3 {
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.listing-town {
  color: #64748b;
  font-size: 0.9rem;
}

.topics-grid, .towns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.topic-item, .town-item {
  background: var(--white);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Footer */
footer {
  background-color: var(--primary);
  color: var(--white);
  text-align: center;
  padding: var(--spacing-md) 0;
  margin-top: auto;
}

footer p {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Modal Styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.5); 
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto; 
  padding: 2rem;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius);
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 1.5rem;
  top: 1rem;
}

.close-modal:hover,
.close-modal:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(52, 123, 183, 0.2);
}

.submit-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 0.5rem;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background-color: var(--secondary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .listing-item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}
