/* diysolar.uk - Main Stylesheet */

:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --amber: #f59e0b;
  --bg: #fafcf9;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 8px;
  --max-width: 800px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
}
.site-title span { color: var(--amber); }
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--green); }

/* Hero */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--green-dark);
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}
.hero .cta {
  display: inline-block;
  background: var(--green);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
}
.hero .cta:hover { background: var(--green-dark); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.15s;
}
.card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--green-dark);
}
.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}
.card a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Content */
.content {
  padding: 2rem 0 3rem;
}
.content h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
  color: var(--green-dark);
}
.content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
}
.content p { margin-bottom: 1rem; }
.content ul, .content ol { margin: 0 0 1rem 1.5rem; }
.content li { margin-bottom: 0.4rem; }
.content a { color: var(--green); }
.content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.content blockquote {
  border-left: 4px solid var(--green);
  padding-left: 1rem;
  color: var(--text-muted);
  margin: 1.5rem 0;
}

/* Tool card */
.tool-card {
  background: var(--surface);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}
.tool-card h2 { margin-top: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.site-footer a {
  color: var(--green);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1.05rem; }
  .site-nav a { margin-left: 0.75rem; font-size: 0.85rem; }
  .card-grid { grid-template-columns: 1fr; }
}

/* Article metadata */
.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Table styles */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.content th, .content td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.content th {
  background: var(--green);
  color: white;
  font-weight: 600;
}
.content tr:nth-child(even) { background: #f9fafb; }

/* Base CTA button (works outside the hero too) */
.cta {
  display: inline-block;
  background: var(--green);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  border: none;
  cursor: pointer;
}
.cta:hover { background: var(--green-dark); }

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs span[aria-current] { color: var(--text); }

/* Related guides */
.related-guides {
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.related-guides h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--green-dark);
}

/* FAQ */
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.75rem;
  padding: 0 1rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.9rem 0;
  list-style: none;
  color: var(--green-dark);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--text-muted);
  font-weight: 700;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details p { margin: 0.9rem 0; }

/* Affiliate / lead-gen callout box */
.cta-box {
  background: #f0fdf4;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.cta-box h3 { margin: 0 0 0.4rem; color: var(--green-dark); }
.cta-box p { margin: 0.4rem 0 0.75rem; }
.cta-box .cta {
  display: inline-block;
  background: var(--green);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.cta-box .cta:hover { background: var(--green-dark); }

/* Sortable comparison table */
.sortable-table { overflow-x: auto; margin: 1.5rem 0; }
.sortable-table table { min-width: 560px; margin: 0; }
.sortable-table th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sortable-table th::after {
  content: "\2195";
  font-size: 0.75em;
  opacity: 0.5;
  margin-left: 0.35rem;
}
.sortable-table th.sort-asc::after { content: "\2191"; opacity: 1; }
.sortable-table th.sort-desc::after { content: "\2193"; opacity: 1; }
.sortable-table .pick td:first-child::before {
  content: "\2b50 ";
}
.sort-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

/* Calculator */
.calc-input {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  margin: 1rem 0;
}
.calc-input label {
  font-weight: 600;
  font-size: 0.95rem;
}
.calc-input input {
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}
.calc-result {
  background: #f0fdf4;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
  font-weight: 600;
}
