/* Support your local solar farm – postcode lookup */

:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e6edf3;
  --text-muted: #8b9cb3;
  --accent: #3fb950;
  --accent-hover: #56d364;
  --error: #f85149;
  --radius: 12px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.main-panel {
  flex: 1 1 0;
}

.image-panel {
  flex: 0 0 280px;
}

.image-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
}

.image-caption {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .main-panel {
    flex: 3 1 0;
  }

  .image-panel {
    flex: 2 1 0;
  }
}

/* Header */
.header {
  margin-bottom: 2rem;
}

.title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Lookup form */
.lookup-section {
  margin-bottom: 2rem;
}

.lookup-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.postcode-input {
  flex: 1;
  min-width: 10rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.postcode-input::placeholder {
  color: var(--text-muted);
}

.postcode-input:hover {
  border-color: #3d4d66;
}

.postcode-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.2);
}

.postcode-input.invalid {
  border-color: var(--error);
}

.btn {
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: var(--bg);
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.error {
  margin: 0;
  font-size: 0.875rem;
  color: var(--error);
}

.error[hidden] {
  display: none;
}

/* Results */
.results-section {
  margin-top: 1.5rem;
}

.results-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.results-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.results-list {
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.result-row {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.result-row dt {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
}

.result-row dd {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

.councillor-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.councillors-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.councillors-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.councillor-card {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.councillor-name {
  font-size: 1rem;
  color: var(--text);
}

.councillor-party {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.councillor-email,
.councillor-link {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.councillor-email:hover,
.councillor-link:hover {
  text-decoration: underline;
}

.councillor-email-missing {
  color: var(--text-muted);
  font-style: italic;
}

.councillor-link {
  margin-right: 0.75rem;
}

.email-template-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.email-template-block .btn-primary {
  margin-top: 0.75rem;
}

.whatsapp-share {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.whatsapp-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.whatsapp-logo {
  display: inline-flex;
}

.whatsapp-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: #3d4d66;
  border: 1px solid var(--border);
}

.btn-whatsapp:hover {
  background: #4a5d78;
  border-color: #4a5d78;
}

.btn-whatsapp:active {
  transform: scale(0.98);
}

.email-forward-note {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.email-forward-note a {
  color: var(--accent);
  text-decoration: none;
}

.email-forward-note a:hover {
  text-decoration: underline;
}

.email-template {
  width: 100%;
  min-height: 9rem;
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  resize: vertical;
}

.councillors-credit {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.councillors-credit a {
  color: var(--text-muted);
  text-decoration: underline;
}

.councillors-credit a:hover {
  color: var(--text);
}

.results-note {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.results-note a {
  color: var(--accent);
  text-decoration: none;
}

.results-note a:hover {
  text-decoration: underline;
}

/* Loading */
.loading {
  margin-top: 1.5rem;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.loading[hidden],
.results-section[hidden] {
  display: none;
}

.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;
}

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.site-footer-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.site-footer-list {
  margin: 0 0 0.75rem;
  padding-left: 1.125rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.site-footer-list li {
  margin-bottom: 0.35rem;
}

.site-footer-list li:last-child {
  margin-bottom: 0;
}

.site-footer-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}
