/* SavePower South Africa - Main Stylesheet */
:root {
  --green: #1a6b1a;
  --green-dark: #124d12;
  --green-light: #e8f5e8;
  --amber: #f5a623;
  --amber-dark: #d4891a;
  --dark: #1a1a1a;
  --text: #333333;
  --text-light: #666666;
  --bg: #f8faf8;
  --white: #ffffff;
  --border: #dde8dd;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.14);
  --radius: 8px;
  --max-width: 1140px;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }

/* ── HEADER ── */
header {
  background: var(--green);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--amber); }

/* CSS-only mobile nav */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: 0.3s;
}
nav ul {
  display: flex;
  list-style: none;
  gap: 4px;
}
nav ul li a {
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}
nav ul li a:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
nav ul li a.active { background: rgba(255,255,255,0.2); }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, #2d8a2d 100%);
  color: var(--white);
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: rgba(245,166,35,0.08);
  border-radius: 50%;
}
.hero-inner { max-width: 780px; margin: 0 auto; position: relative; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
}
.hero h1 span { color: var(--amber); }
.hero p { font-size: 1.15rem; opacity: 0.92; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); margin-top: 32px; box-shadow: var(--shadow-hover); }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}
.btn-primary { background: var(--amber); color: var(--dark); }
.btn-primary:hover { background: var(--amber-dark); color: var(--dark); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,166,35,0.4); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-outline:hover { background: var(--white); color: var(--green); text-decoration: none; }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: var(--green-dark); color: var(--white); text-decoration: none; }

/* ── LAYOUT ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-alt { background: var(--white); }
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 8px;
}
.section-subtitle { color: var(--text-light); margin-bottom: 40px; font-size: 1.05rem; }

/* Two-column: content + sidebar */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
}
.page-content { min-width: 0; }
.sidebar { min-width: 0; }

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-img { width: 100%; height: 180px; object-fit: cover; }
.card-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.card h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: 8px; line-height: 1.4; }
.card p { color: var(--text-light); font-size: 0.9rem; flex: 1; margin-bottom: 16px; }
.card a.read-more { color: var(--green); font-weight: 600; font-size: 0.9rem; }
.card a.read-more:hover { color: var(--green-dark); }

/* ── ARTICLE CONTENT ── */
.article-header { margin-bottom: 32px; }
.article-header h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--green-dark); line-height: 1.3; margin-bottom: 12px; }
.article-meta { color: var(--text-light); font-size: 0.9rem; display: flex; gap: 16px; flex-wrap: wrap; }
.article-img { width: 100%; border-radius: var(--radius); margin: 24px 0; box-shadow: var(--shadow); max-height: 400px; object-fit: cover; }

.page-content h2 { font-size: 1.4rem; color: var(--green-dark); margin: 32px 0 12px; }
.page-content h3 { font-size: 1.15rem; color: var(--dark); margin: 24px 0 8px; }
.page-content p { margin-bottom: 16px; }
.page-content ul, .page-content ol { margin: 0 0 16px 24px; }
.page-content li { margin-bottom: 6px; }
.page-content strong { color: var(--dark); }

/* Tips / Warning boxes */
.tip-box {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
}
.tip-box strong { color: var(--green-dark); }
.warning-box {
  background: #fff8e8;
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
}
.warning-box strong { color: var(--amber-dark); }

/* ── TABLES ── */
table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.95rem; }
thead th { background: var(--green); color: var(--white); padding: 12px 14px; text-align: left; }
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
tbody tr:nth-child(even) { background: var(--green-light); }
tbody tr:hover { background: #d4ead4; }
.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ── BREADCRUMBS ── */
.breadcrumb {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.breadcrumb-inner a { color: var(--green); }
.breadcrumb-inner span { margin: 0 6px; }

/* ── SIDEBAR ── */
.sidebar-widget {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-widget h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green-light);
}
.sidebar-links { list-style: none; }
.sidebar-links li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.sidebar-links li:last-child { border: none; }
.sidebar-links a { font-size: 0.9rem; color: var(--text); }
.sidebar-links a:hover { color: var(--green); }

.ask-cta {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}
.ask-cta h3 { color: var(--white); margin-bottom: 8px; font-size: 1rem; }
.ask-cta p { font-size: 0.88rem; opacity: 0.9; margin-bottom: 16px; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; color: var(--dark); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--green);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin: 32px 0;
}

/* ── Q&A BLOG ── */
.qa-entry {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
}
.qa-question {
  background: var(--green);
  color: var(--white);
  padding: 20px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.qa-question .q-icon { font-size: 1.3rem; flex-shrink: 0; }
.qa-answer { padding: 24px; }
.qa-answer p { margin-bottom: 12px; }
.qa-answer p:last-child { margin-bottom: 0; }
.qa-tags { padding: 12px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 50px;
  font-weight: 600;
}

/* ── STATS STRIP ── */
.stats-strip {
  background: var(--green-dark);
  color: var(--white);
  padding: 40px 20px;
}
.stats-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.stat-number { font-size: 2.2rem; font-weight: 900; color: var(--amber); }
.stat-label { font-size: 0.88rem; opacity: 0.85; margin-top: 4px; }

/* ── CTA SECTION ── */
.cta-section {
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-dark) 100%);
  padding: 60px 20px;
  text-align: center;
}
.cta-section h2 { color: var(--dark); font-size: 1.8rem; margin-bottom: 12px; }
.cta-section p { color: var(--dark); opacity: 0.85; margin-bottom: 28px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border: none; }
.faq-q { font-weight: 700; color: var(--green-dark); margin-bottom: 8px; font-size: 1rem; }
.faq-a { color: var(--text); font-size: 0.95rem; }

/* ── FOOTER ── */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.8);
  padding: 48px 20px 24px;
  margin-top: 60px;
}
.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .logo { font-size: 1.4rem; margin-bottom: 12px; display: block; }
.footer-brand p { font-size: 0.88rem; line-height: 1.6; opacity: 0.75; }
footer h4 { color: var(--white); font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 8px; }
footer ul li a { color: rgba(255,255,255,0.7); font-size: 0.88rem; }
footer ul li a:hover { color: var(--amber); text-decoration: none; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  opacity: 0.6;
}
.disclaimer {
  background: #fff8e8;
  border: 1px solid #f0d080;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.88rem;
  color: #7a5a00;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  .nav-toggle-label { display: flex; }
  nav { position: absolute; top: 64px; left: 0; right: 0; background: var(--green-dark); max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
  .nav-toggle:checked ~ nav { max-height: 400px; }
  nav ul { flex-direction: column; padding: 12px; gap: 4px; }
  nav ul li a { display: block; padding: 12px 16px; border-radius: var(--radius); }
  .header-inner { position: relative; }

  .hero { padding: 48px 20px; }
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  header, footer, .sidebar, .breadcrumb { display: none; }
  .page-layout { display: block; }
  body { font-size: 12pt; }
}
