/* SolarByPostcode - Main Stylesheet */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f9fafb;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

header.header-hidden {
    transform: translateY(-100%);
}

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

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
}

.tagline {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
    max-width: 600px;
}

/* Main Content */
main {
    padding: 40px 0;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Hero Section */
.hero {
    margin-bottom: 40px;
}

h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.location-context {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 16px;
}

.trust-markers {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.trust-marker {
    font-size: 14px;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

/* Data Display */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.data-item {
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.data-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 500;
}

.data-value {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.data-unit {
    font-size: 14px;
    color: #6b7280;
    margin-left: 4px;
    font-weight: 400;
}

/* List Styles */
.simple-list {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.8;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: #6b7280;
    margin-left: 8px;
}

/* Footer */
footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.footer-content p {
    margin-bottom: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 28px;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .trust-markers {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================
   HOME PAGE STYLES
   ============================================ */

/* Hero Section */
.home-hero {
    max-width: 800px;
    margin: 60px auto 40px;
    text-align: center;
}

.home-headline {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.home-intro {
    font-size: 18px;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 40px;
}

.home-intro p {
    margin-bottom: 16px;
}

/* Trust Bullets */
.home-trust {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.home-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #374151;
}

.trust-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

/* CTA Section */
.home-cta {
    max-width: 600px;
    margin: 0 auto 60px;
}

.postcode-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.postcode-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.postcode-input:focus {
    outline: none;
    border-color: #2563eb;
}

.postcode-submit {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.postcode-submit:hover {
    background: #1d4ed8;
}

.postcode-help {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.example-links {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.example-label {
    margin-right: 4px;
}

.example-link {
    color: #2563eb;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.example-link:hover {
    background: #eff6ff;
}

/* About Section */
.home-about {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .home-hero {
        margin: 40px auto 32px;
    }
    
    .home-headline {
        font-size: 32px;
    }
    
    .home-intro {
        font-size: 16px;
    }
    
    .home-trust {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    
    .postcode-input-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .postcode-input,
    .postcode-submit {
        width: 100%;
        padding: 18px 20px; /* Slightly taller on mobile */
    }
    
    .example-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .example-label {
        display: block;
        margin-bottom: 4px;
    }
}

/* ============================================
   CALCULATOR STYLES (scoped)
   ============================================ */
#solar-calculator .calc-section { margin-bottom: 24px; }

#solar-calculator .calc-section h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #374151;
}

#solar-calculator .calc-buttons {
  display: flex; gap: 8px; flex-wrap: wrap;
}
#solar-calculator .calc-buttons-export { margin-bottom: 0; }

#solar-calculator .calc-btn {
  padding: 12px 20px; font-size: 15px; font-weight: 500;
  background: #f9fafb; color: #374151;
  border: 2px solid #e5e7eb; border-radius: 8px;
  cursor: pointer; transition: all 0.2s; font-family: inherit; min-height: 48px;
}
#solar-calculator .calc-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
#solar-calculator .calc-btn.active {
  background: #dbeafe; color: #1e40af; border-color: #2563eb; font-weight: 600;
}
#solar-calculator .calc-btn:focus { outline: 2px solid #2563eb; outline-offset: 2px; }

#solar-calculator .calc-input {
  padding: 10px 14px; font-size: 15px;
  border: 2px solid #d1d5db; border-radius: 6px; width: 100px;
  font-family: inherit; transition: border-color 0.2s;
}
#solar-calculator .calc-input:focus { outline: none; border-color: #2563eb; }

#solar-calculator .calc-results {
  margin-top: 32px; padding-top: 32px; border-top: 2px solid #e5e7eb;
}
#solar-calculator .calc-result-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
#solar-calculator .calc-result-item {
  padding: 16px; background: #f9fafb; border-radius: 8px; border: 1px solid #e5e7eb;
}
#solar-calculator .calc-result-highlight { background: #fef3c7; border-color: #fbbf24; }
#solar-calculator .calc-result-label {
  font-size: 13px; color: #6b7280; text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px; font-weight: 500;
}
#solar-calculator .calc-result-value {
  font-size: 28px; font-weight: 700; color: #1a1a1a; line-height: 1.2;
}
#solar-calculator .calc-result-breakdown { font-size: 13px; color: #6b7280; margin-top: 6px; }

#solar-calculator .calc-assumptions {
  margin-top: 24px; padding: 16px; background: #f9fafb; border-radius: 6px; font-size: 14px;
}
#solar-calculator .calc-assumptions summary { font-weight: 600; color: #374151; user-select: none; }
#solar-calculator .calc-assumptions p { margin-bottom: 8px; }
#solar-calculator .calc-assumptions p:last-child { margin-bottom: 0; }

/* Mobile Responsive - Compact Layout */
@media (max-width: 768px) {
  /* Card padding reduction */
  #solar-calculator { padding: 16px; }
  
  /* Tight section spacing */
  #solar-calculator .calc-section { margin-bottom: 12px; }
  
  /* Smaller section headings */
  #solar-calculator .calc-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  /* System Size: 2x2 grid */
  #solar-calculator .calc-section:first-of-type .calc-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  
  /* Roof Direction & Battery: 3 columns */
  #solar-calculator .calc-section:nth-of-type(2) .calc-buttons,
  #solar-calculator .calc-section:nth-of-type(3) .calc-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  /* Export Value: 3 columns */
  #solar-calculator .calc-section:nth-of-type(4) .calc-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  /* All buttons: much smaller */
  #solar-calculator .calc-btn { 
    padding: 8px 12px;
    font-size: 13px;
    min-height: 40px;
  }
  
  /* Custom export input: smaller, below buttons */
  #solar-calculator .calc-section:nth-of-type(4) > div:last-child {
    margin-top: 6px;
  }
  
  #solar-calculator .calc-input {
    width: 80px;
    padding: 8px 10px;
    font-size: 13px;
  }
  
  /* Results: minimal top spacing */
  #solar-calculator .calc-results {
    margin-top: 16px;
    padding-top: 16px;
  }
  
  #solar-calculator .calc-results > h3 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  /* Hero card: very compact */
  #solar-calculator .calc-result-hero {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  #solar-calculator .calc-result-hero-label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  
  #solar-calculator .calc-result-hero-value {
    font-size: 22px;
    margin-bottom: 3px;
  }
  
  #solar-calculator .calc-result-hero-note {
    font-size: 12px;
  }
  
  /* Result cards: single column, tight */
  #solar-calculator .calc-result-grid { 
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }
  
  #solar-calculator .calc-result-item {
    padding: 10px;
  }
  
  #solar-calculator .calc-result-label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  
  #solar-calculator .calc-result-value { 
    font-size: 20px;
  }
  
  #solar-calculator .calc-result-note,
  #solar-calculator .calc-result-breakdown {
    font-size: 11px;
    margin-top: 4px;
  }
  
  /* Assumptions: very compact */
  #solar-calculator .calc-assumptions {
    margin-top: 12px;
    padding: 10px;
    font-size: 12px;
  }
  
  #solar-calculator .calc-assumptions summary {
    font-size: 13px;
  }
  
  #solar-calculator .calc-assumptions div {
    margin-top: 8px;
  }
  
  #solar-calculator .calc-assumptions p {
    margin-bottom: 6px;
  }
  
  #solar-calculator .calc-assumptions ul {
    margin: 4px 0 4px 16px;
  }
  
  #solar-calculator .calc-assumptions li {
    margin-bottom: 3px;
  }
}

/* Hero result card (break-even) - Green positive story */
#solar-calculator .calc-result-hero {
  padding: 24px;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-radius: 12px;
  border: 2px solid #10b981;
  margin-bottom: 24px;
  text-align: center;
}

#solar-calculator .calc-result-hero-label {
  font-size: 14px;
  color: #065f46;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

#solar-calculator .calc-result-hero-value {
  font-size: 36px;
  font-weight: 800;
  color: #047857;
  line-height: 1.2;
  margin-bottom: 8px;
}

#solar-calculator .calc-result-hero-note {
  font-size: 14px;
  color: #065f46;
  font-weight: 500;
}

#solar-calculator .calc-result-note {
  font-size: 13px;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.4;
}

/* Positive story: subtle green accents */
#solar-calculator .calc-result-item:nth-child(2),
#solar-calculator .calc-result-item:nth-child(3) {
  border-left: 3px solid #10b981;
}

/* ============================================
   CTA STYLES (Primary Card + Sticky Mobile)
   ============================================ */

/* Primary CTA Card */
.cta-primary {
  margin-top: 32px;
  padding: 28px 24px;
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border-radius: 12px;
  border: 1px solid #fbbf24;
  text-align: center;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
}

.cta-button {
  display: inline-block;
  padding: 18px 40px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  min-height: 56px;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  letter-spacing: 0.3px;
}

.cta-button:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.cta-button:focus {
  outline: 3px solid #10b981;
  outline-offset: 2px;
}

.cta-button:active {
  transform: translateY(0);
}

.cta-trust-line {
  margin-top: 16px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.6;
  font-weight: 500;
}

/* Sticky Mobile CTA */
.cta-sticky {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,1) 100%);
  border-top: 2px solid #10b981;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
  padding: 14px 20px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.cta-sticky-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.cta-sticky-info {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  flex: 1;
}

.cta-sticky-button {
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.cta-sticky-button:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Show sticky bar only on mobile */
@media (max-width: 768px) {
  .cta-sticky.visible {
    display: block;
  }
}

/* Mobile: Full-width button, adjust sizing */
@media (max-width: 768px) {
  .cta-primary {
    padding: 24px 20px;
  }
  
  .cta-button {
    width: 100%;
    max-width: 100%;
    padding: 16px 32px;
    font-size: 17px;
  }
  
  .cta-trust-line {
    font-size: 12px;
  }
}

/* Hero result card (break-even) - Rich green gradient */
#solar-calculator .calc-result-hero {
  padding: 28px 24px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-radius: 12px;
  border: none;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

#solar-calculator .calc-result-hero-label {
  font-size: 14px;
  color: #d1fae5;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 700;
}

#solar-calculator .calc-result-hero-value {
  font-size: 42px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#solar-calculator .calc-result-hero-note {
  font-size: 15px;
  color: #d1fae5;
  font-weight: 600;
}

#solar-calculator .calc-result-note {
  font-size: 13px;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.4;
}

/* Accent borders on benefit cards */
#solar-calculator .calc-result-item:nth-child(2),
#solar-calculator .calc-result-item:nth-child(3) {
  border-left: 3px solid #10b981;
}

/* ============================================================================
   REGION HUB PAGES
   ============================================================================ */

/* Hero: Compact version for region hubs */
.hero-compact {
    max-width: 48rem;
    margin: 2rem auto 3rem;
    text-align: center;
}

.hero-compact h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary, #1a1a1a);
}

.hero-lead {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary, #4a4a4a);
}

/* Key numbers grid */
.key-numbers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.key-number-card {
    background: var(--surface, #f8f9fa);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.key-number-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent, #0066cc);
    margin-bottom: 0.5rem;
}

.key-number-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    line-height: 1.4;
}

/* Region CTA blocks */
.cta-region {
    max-width: 36rem;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--surface, #f8f9fa);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 12px;
    text-align: center;
}

.cta-region h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #1a1a1a);
}

.cta-region p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary, #4a4a4a);
}

.postcode-search-form {
    display: flex;
    gap: 0.75rem;
    max-width: 28rem;
    margin: 0 auto;
}

.postcode-search-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border, #ccc);
    border-radius: 6px;
}

.postcode-search-form button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--accent, #0066cc);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.postcode-search-form button:hover {
    background: var(--accent-dark, #0052a3);
}

/* Outcode grid section */
.outcode-grid-section {
    margin: 4rem 0;
}

.outcode-grid-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-intro {
    font-size: 1rem;
    color: var(--text-secondary, #666);
    margin-bottom: 2rem;
}

/* Outcode tiles grid */
.outcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.outcode-tile {
    display: block;
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.outcode-tile:hover {
    border-color: var(--accent, #0066cc);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
    transform: translateY(-2px);
}

.outcode-tile-code {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.25rem;
}

.outcode-tile-place {
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    margin-bottom: 1rem;
}

.outcode-tile-stat {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.outcode-tile-stat strong {
    display: block;
    color: var(--text-secondary, #666);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.125rem;
}

.outcode-tile-stat > * {
    color: var(--text-primary, #1a1a1a);
    font-weight: 600;
    font-size: 0.9375rem;
}

.outcode-tile-stat .stat-positive {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #059669;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

/* Data source note */
.data-note {
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    text-align: center;
    margin: 3rem 0 2rem;
    font-style: italic;
}

/* Visually hidden (for screen readers) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .hero-compact h1 {
        font-size: 1.5rem;
    }
    
    .hero-lead {
        font-size: 1rem;
    }
    
    .key-numbers {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .postcode-search-form {
        flex-direction: column;
    }
    
    .outcode-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   HEADER & FOOTER (Placeholder - will be enhanced later)
   ============================================================================ */

.site-header {
    background: white;
    border-bottom: 1px solid var(--border, #e0e0e0);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

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

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent, #0066cc);
    text-decoration: none;
}

.site-logo:hover {
    color: var(--accent-dark, #0052a3);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--text-primary, #1a1a1a);
}

.site-footer {
    background: var(--surface, #f8f9fa);
    border-top: 1px solid var(--border, #e0e0e0);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.site-footer p {
    color: var(--text-secondary, #666);
    font-size: 0.875rem;
    margin: 0;
}
/* Postcode input wrapper for region pages */
.postcode-input-wrapper {
    display: flex;
    gap: 0.75rem;
    max-width: 28rem;
    margin: 0 auto;
}

.postcode-input-wrapper .postcode-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border, #ccc);
    border-radius: 6px;
}

.postcode-input-wrapper .postcode-submit {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--accent, #0066cc);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.postcode-input-wrapper .postcode-submit:hover {
    background: var(--accent-dark, #0052a3);
}

@media (max-width: 640px) {
    .postcode-input-wrapper {
        flex-direction: column;
    }
}

/* ============================================================================
   REGION HUB ENHANCEMENTS
   ============================================================================ */

/* Hero Card (replaces plain hero-compact) */
.region-hero-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0284c7;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto 3rem;
    max-width: 56rem;
}

.region-hero-card h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #0c4a6e;
    text-align: center;
}

.region-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.region-hero-stat {
    text-align: center;
}

.region-hero-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0284c7;
    margin-bottom: 0.25rem;
}

.region-hero-stat-label {
    display: block;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.3;
}

.region-hero-note {
    text-align: center;
    font-size: 0.8125rem;
    color: #64748b;
    margin: 1rem 0 0;
    line-height: 1.4;
}

/* Region Performers Section */
.region-performers {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: #f0f9ff;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
}

.region-performers h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.75rem;
}

.region-performers h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e40af;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.region-performers-list {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #44403c;
}

.region-performer-link {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.region-performer-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

.region-performer-link strong {
    font-weight: 700;
}

.region-performer-yield {
    color: #57534e;
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .region-hero-card {
        padding: 1.5rem;
        margin: 1.5rem auto 2rem;
    }
    
    .region-hero-card h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .region-hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .region-hero-stat-value {
        font-size: 1.25rem;
    }
    
    .region-hero-stat-label {
        font-size: 0.75rem;
    }
    
    .region-performers {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .region-performers h2 {
        font-size: 1rem;
    }
    
    .region-performers h3 {
        font-size: 0.9375rem;
    }
    
    .region-performers-list {
        font-size: 0.875rem;
    }
}

/* ============================================================================
   LATERAL LINKS (Compare Nearby Areas)
   ============================================================================ */

.lateral-links {
    margin-top: 48px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.lateral-links h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.lateral-links h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lateral-links h3:first-of-type {
    margin-top: 0;
}

.lateral-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lateral-card {
    display: block;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.lateral-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.lateral-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.lateral-card-distance {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.lateral-card-yield {
    font-size: 0.875rem;
    color: #3b82f6;
    font-weight: 600;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Mobile: Stack cards single column */
@media (max-width: 640px) {
    .lateral-grid {
        grid-template-columns: 1fr;
    }
    
    .lateral-links {
        margin-top: 32px;
    }
    
    .lateral-links h2 {
        font-size: 1.25rem;
    }
    
    .lateral-links h3 {
        font-size: 0.9rem;
        margin: 1.5rem 0 0.75rem;
    }
}

/* ============================================================================
   MINI PAGES (Insights)
   ============================================================================ */

.mini-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Hero Section */
.mini-hero {
  margin-bottom: 3rem;
  text-align: center;
}

.mini-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.mini-hero-lead {
  font-size: 1.25rem;
  color: #555;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  line-height: 1.4;
}

.mini-hero-body {
  font-size: 1rem;
  color: #666;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Findings Section */
.mini-findings {
  margin-bottom: 3rem;
}

.mini-findings h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid #2563eb;
  padding-bottom: 0.5rem;
}

.mini-findings-grid {
  display: grid;
  gap: 1.5rem;
}

.mini-finding {
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 4px;
}

.mini-finding-primary {
  border-left: 4px solid #2563eb;
}

.mini-finding-secondary {
  border-left: 4px solid #10b981;
}

.mini-finding-tertiary {
  border-left: 4px solid #f59e0b;
}

.mini-finding h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.mini-finding p {
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* Rankings Section */
.mini-rankings {
  margin-bottom: 3rem;
}

.mini-rankings h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid #2563eb;
  padding-bottom: 0.5rem;
}

.mini-rankings-intro {
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Table */
.mini-table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.mini-table thead tr {
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
}

.mini-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
}

.mini-table th.mini-table-number {
  text-align: right;
}

.mini-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s;
}

.mini-table tbody tr:hover {
  background: #fef3c7;
}

.mini-table td {
  padding: 0.75rem;
}

.mini-table-rank {
  font-weight: 600;
  color: #64748b;
}

.mini-table-postcode {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  font-family: monospace;
}

.mini-table-postcode:hover {
  text-decoration: underline;
}

.mini-table-region {
  color: #64748b;
  font-size: 0.875rem;
}

.mini-table-number {
  text-align: right;
  color: #64748b;
}

.mini-table-highlight {
  font-weight: 600;
  color: #059669;
}

/* Callout Box */
.mini-callout {
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.mini-callout p {
  margin: 0;
  color: #92400e;
  line-height: 1.6;
}

.mini-callout a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.mini-callout a:hover {
  text-decoration: underline;
}

/* Note */
.mini-note {
  color: #666;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Search Section */
.mini-search {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 3rem;
  text-align: center;
}

.mini-search h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.mini-search p {
  color: #666;
  margin-bottom: 1rem;
}

.mini-search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.mini-search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  text-transform: uppercase;
}

.mini-search-button {
  padding: 0.75rem 1.5rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

.mini-search-button:hover {
  background: #1d4ed8;
}

/* Methods (Collapsible) */
.mini-methods {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 3rem;
}

.mini-methods summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 1.125rem;
}

.mini-methods-body {
  margin-top: 1rem;
  color: #555;
  line-height: 1.6;
}

.mini-methods-body p {
  margin-bottom: 1rem;
}

.mini-methods-body p:last-child {
  margin-bottom: 0;
}

.mini-methods-body code {
  background: #e2e8f0;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.875rem;
}

/* Attribution */
.mini-attribution {
  border-top: 2px solid #e2e8f0;
  padding-top: 2rem;
  margin-top: 3rem;
}

.mini-attribution h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.mini-attribution p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.mini-attribution p:last-child {
  margin-bottom: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mini-hero h1 {
    font-size: 2rem;
  }
  
  .mini-hero-lead {
    font-size: 1.125rem;
  }
  
  .mini-table {
    font-size: 0.875rem;
  }
  
  .mini-table th,
  .mini-table td {
    padding: 0.5rem;
  }
  
  .mini-search-form {
    flex-direction: column;
  }
  
  .mini-search-input {
    min-width: 100%;
  }
}

/* Header logo: icon + text alignment (desktop + mobile) */
.logo {
  display: inline-flex;
  align-items: center;
}

/* Responsive logo sizing */
.logo img {
  display: block;
  width: auto;
  margin-right: 8px;
  height: 44px;      /* default (tablets/small laptops) */
  max-height: 12vh;  /* guard so it never overwhelms the header */
}

@media (max-width: 480px) {
  .logo img { height: 52px; }   /* phones */
}

@media (min-width: 1024px) {
  .logo img { height: 96px; }   /* desktops */
}

/* Typeahead dropdown (home/postcode search) */
.ta-wrapper { position: relative; }
.ta-dropdown {
  position: absolute; left: 0; right: 0;
  top: calc(100% + 6px);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  max-height: 240px; overflow-y: auto; z-index: 40;
}
.ta-item { padding: 10px 12px; cursor: pointer; line-height: 1.3; }
.ta-item strong { font-weight: 600; }
.ta-item small { color: #6b7280; margin-left: 6px; }
.ta-item[aria-selected="true"], .ta-item:hover { background: #f3f4f6; }
@media (hover: none) { .ta-item:hover { background: transparent; } }

/* Typeahead — anchor dropdown to input, not the whole wrapper */
.ta-wrapper { display: flex; gap: 10px; align-items: stretch; }
.ta-anchor { position: relative; display: inline-block; } /* shrinks to input width */
.ta-anchor .postcode-input { display: block; }            /* ensure the dropdown width matches input */
.ta-anchor .ta-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  max-height: 240px; overflow-y: auto; z-index: 40;
}

/* Better tap targets & scrolling (desktop + touch) */
.ta-item { padding: 12px 14px; min-height: 44px; cursor: pointer; line-height: 1.3; }
.ta-item strong { font-weight: 600; }
.ta-item small { color: #6b7280; margin-left: 6px; }
.ta-item[aria-selected="true"], .ta-item:hover { background: #f3f4f6; }
@media (hover: none) { .ta-item:hover { background: transparent; } }

/* Ensure input text is left-aligned (desktop) */
.postcode-input { text-align: left; font-size: 16px; } /* 16px avoids iOS zoom */

/* Make postcode input wider on desktop (keeps mobile as-is) */
.ta-anchor { width: 100%; }                 /* safety: lets input expand */
.ta-anchor .postcode-input { width: 100%; } /* input fills anchor */

/* Desktop sizing – tweak numbers to taste */
@media (min-width: 1024px) {                /* large screens */
  .home-hero .ta-anchor { flex: 0 1 560px; }  /* 560px wide input */
}
@media (min-width: 1280px) {                /* extra large */
  .home-hero .ta-anchor { flex-basis: 640px; } /* 640px wide input */
}

/* ============================================================================
   HEADER NAVIGATION (Mobile-First, Exquisitely Responsive)
   ============================================================================ */

/* Header layout: flexible, mobile-first */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 60px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0; /* Allows text truncation if needed */
}

/* Logo: ensure icon + text stay together */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.logo img {
    flex-shrink: 0; /* Icon never squishes */
}

/* Tagline: hidden on mobile by default */
.tagline {
    display: none;
}

/* Desktop navigation: hidden on mobile */
.header-nav {
    display: none;
}

.nav-link {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.nav-link:hover {
    color: #2563eb;
}

.nav-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Dropdown container */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nav-dropdown.is-open .dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 50;
}

.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item:hover {
    background: #f3f4f6;
    color: #2563eb;
}

.nav-dropdown-item:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #eff6ff;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #374151;
    transition: color 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    position: relative;
    z-index: 1001;
    border-radius: 6px;
}

.mobile-menu-toggle:hover {
    color: #2563eb;
    background: #f3f4f6;
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.mobile-menu-toggle .close-icon {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .close-icon {
    display: block;
}

/* Mobile menu overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    
    /* Safe area insets for notched devices */
    padding-top: max(80px, env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    padding: 24px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.mobile-menu-link {
    display: block;
    padding: 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
    transition: color 0.2s ease;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.mobile-menu-link:hover {
    color: #2563eb;
}

.mobile-menu-link:active {
    background: #f3f4f6;
}

.mobile-menu-section {
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 0;
}

.mobile-menu-label {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
}

.mobile-menu-sublink {
    display: block;
    padding: 14px 0 14px 20px;
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    margin-left: 8px;
}

.mobile-menu-sublink:hover {
    color: #2563eb;
    border-left-color: #2563eb;
}

.mobile-menu-sublink:active {
    background: #f3f4f6;
}

/* Tablet (640px - 1023px): Show tagline, keep mobile menu */
@media (min-width: 640px) {
    .tagline {
        display: block;
        font-size: 14px;
        max-width: 500px;
    }
    
    .header-content {
        min-height: 70px;
        gap: 20px;
    }
    
    .mobile-menu-content {
        padding: 32px 40px;
    }
}

/* Desktop (1024px+): Show desktop nav, hide mobile menu toggle */
@media (min-width: 1024px) {
    .header-content {
        gap: 32px;
        min-height: 80px;
    }
    
    .tagline {
        display: block;
        font-size: 14px;
        max-width: 600px;
    }
    
    /* Show desktop nav */
    .header-nav {
        display: flex;
        align-items: center;
        gap: 32px;
    }
    
    /* Hide mobile menu elements */
    .mobile-menu-toggle {
        display: none;
    }
    
    .mobile-menu {
        display: none;
    }
}

/* Large desktop (1280px+): More generous spacing */
@media (min-width: 1280px) {
    .header-content {
        gap: 48px;
    }
    
    .header-nav {
        gap: 40px;
    }
    
    .nav-link {
        font-size: 17px;
    }
}

/* Landscape mobile (small height screens) */
@media (max-height: 600px) and (orientation: landscape) {
    .mobile-menu {
        padding-top: 60px;
    }
    
    .mobile-menu-content {
        padding: 16px 20px;
    }
    
    .mobile-menu-link {
        padding: 12px 0;
        min-height: 44px;
        font-size: 18px;
    }
    
    .mobile-menu-sublink {
        padding: 10px 0 10px 20px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .mobile-menu-section {
        padding: 16px 0;
    }
    
    .mobile-menu-label {
        margin-bottom: 12px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .nav-dropdown-menu,
    .mobile-menu,
    .dropdown-icon,
    .mobile-menu-toggle {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link,
    .mobile-menu-link,
    .mobile-menu-sublink {
        border: 1px solid transparent;
    }
    
    .nav-link:focus-visible,
    .mobile-menu-link:focus-visible,
    .mobile-menu-sublink:focus-visible {
        border-color: currentColor;
    }
}

/* ============================================================================
   AUXILIARY PAGES (About, Privacy, Terms, Contact, Methodology)
   ============================================================================ */

/* Container for all aux pages */
.aux-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.aux-content {
    background: white;
    padding: 48px 40px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Typography */
.aux-content h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 32px;
    line-height: 1.2;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 16px;
}

.aux-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    margin-top: 0;
    line-height: 1.3;
}

.aux-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    margin-top: 24px;
    line-height: 1.4;
}

/* Sections */
.aux-section {
    margin-bottom: 40px;
}

.aux-section:last-of-type {
    margin-bottom: 0;
}

/* Prose */
.aux-content p {
    font-size: 17px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 16px;
}

.aux-content p:last-child {
    margin-bottom: 0;
}

.aux-content strong {
    font-weight: 600;
    color: #1a1a1a;
}

/* Links */
.aux-content a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.aux-content a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.aux-content a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Lists */
.aux-list {
    margin: 16px 0 16px 24px;
    font-size: 17px;
    line-height: 1.7;
    color: #374151;
}

.aux-list li {
    margin-bottom: 12px;
    padding-left: 8px;
}

.aux-list li:last-child {
    margin-bottom: 0;
}

.aux-list strong {
    font-weight: 600;
    color: #1a1a1a;
}

/* CTA Button (for "Find my postcode" style links) */
.aux-cta {
    margin-top: 24px;
    margin-bottom: 0;
}

.aux-button {
    display: inline-block;
    padding: 14px 28px;
    font-size: 17px;
    font-weight: 600;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white !important;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.aux-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.aux-button:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* Footer metadata */
.aux-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.aux-footer p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.aux-footer p:last-child {
    margin-bottom: 0;
}

/* Callout boxes (for important notices) */
.aux-callout {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
}

.aux-callout p {
    margin-bottom: 12px;
    color: #92400e;
}

.aux-callout p:last-child {
    margin-bottom: 0;
}

.aux-callout strong {
    color: #78350f;
}

/* Info boxes (for helpful context) */
.aux-info {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
}

.aux-info p {
    margin-bottom: 12px;
    color: #1e40af;
}

.aux-info p:last-child {
    margin-bottom: 0;
}

.aux-info strong {
    color: #1e3a8a;
}

/* Mobile responsive - app-like edge-to-edge */
@media (max-width: 768px) {
    .aux-page {
        padding: 0; /* Remove outer padding */
    }
    
    .aux-content {
        padding: 32px 20px; /* Edge-to-edge with comfortable reading margins */
        border-radius: 0; /* No rounded corners on mobile */
        border: none; /* No borders on mobile */
        box-shadow: none; /* No shadow on mobile */
    }
    
    .aux-content h1 {
        font-size: 28px;
        margin-bottom: 24px;
    }
    
    .aux-content h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }
    
    .aux-content h3 {
        font-size: 18px;
        margin-bottom: 10px;
        margin-top: 20px;
    }
    
    .aux-content p,
    .aux-list {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .aux-list {
        margin-left: 20px;
    }
    
    .aux-section {
        margin-bottom: 32px;
    }
    
    .aux-button {
        display: block;
        text-align: center;
        width: 100%;
        padding: 16px 24px;
    }
    
    .aux-footer {
        margin-top: 40px;
        padding-top: 20px;
    }
}

/* Print styles */
@media print {
    .aux-content {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .aux-button {
        display: none;
    }
}

/* ============================================================================
   SITE FOOTER (Comprehensive)
   ============================================================================ */

.site-footer {
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    padding: 56px 0 32px;
    margin-top: 80px;
}

/* Footer grid layout */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e5e7eb;
}

.footer-section {
    min-width: 0; /* Allows text truncation if needed */
}

.footer-heading {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links li:last-child {
    margin-bottom: 0;
}

.footer-links a {
    font-size: 15px;
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: #2563eb;
}

.footer-links a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Data sources section */
.footer-sources {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.footer-sources .footer-heading {
    margin-bottom: 12px;
}

.footer-sources-text {
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 12px;
}

.footer-sources-text a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-sources-text a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.footer-sources-text a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 2px;
}

.footer-licence {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.footer-licence a {
    color: #6b7280;
    text-decoration: underline;
    transition: color 0.2s;
}

.footer-licence a:hover {
    color: #2563eb;
}

/* Footer bottom */
.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.footer-bottom p:last-child {
    margin-bottom: 0;
}

.footer-update {
    font-size: 13px;
    color: #9ca3af;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .site-footer {
        padding: 40px 0 24px;
        margin-top: 60px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 32px;
        padding-bottom: 32px;
    }
    
    .footer-heading {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .footer-links a {
        font-size: 14px;
    }
    
    .footer-sources {
        margin-bottom: 24px;
        padding-bottom: 24px;
    }
    
    .footer-sources-text {
        font-size: 13px;
        line-height: 1.7;
    }
    
    .footer-licence {
        font-size: 12px;
    }
    
    .footer-bottom p {
        font-size: 13px;
    }
    
    .footer-update {
        font-size: 12px;
    }
}

/* Tablet (640px - 1023px): 2-column layout */
@media (min-width: 640px) and (max-width: 1023px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .footer-section:last-child {
        grid-column: 1 / -1; /* Legal section spans full width */
    }
}

/* ──────────────────────────────────────────────────────────
   REGION CARDS GRID (replaces numbered lists)
   ────────────────────────────────────────────────────────── */

.region-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.region-card {
  display: block;
  padding: 1.25rem 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.region-card:hover,
.region-card:focus {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.region-card-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #111827;
}

.region-card-yield {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2563eb;
}

.region-card-benefit {
  font-size: 0.875rem;
  font-weight: 600;
  color: #059669;
  margin-top: 0.5rem;
}

.region-card-yield-small {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.region-card-savings .region-card-name {
  margin-bottom: 0.75rem;
}

/* ──────────────────────────────────────────────────────────
   FEATURE CARDS (replaces "What you'll see" bullet list)
   ────────────────────────────────────────────────────────── */

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.feature-card {
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.feature-card h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #4b5563;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .region-cards-grid {
    grid-template-columns: 1fr;
  }
  .feature-cards {
    grid-template-columns: 1fr;
  }
}

/* Calculator: negative net highlight */
#result-net.is-negative { color: #c62828; } /* accessible red */

/* ============================================================
   SolarByPostcode — Regions cards: positive-stat styling
   Purpose: colour the “Annual net benefit (median)” £ value green
   Scope: used on Regions index cards and Region hero
   Safe to remove with no layout impact (only colour changes)
   ============================================================ */
.stat-positive {
  color: #0c8a3e; /* accessible green */
}
