/*
Theme Name: ChargePointSA
Theme URI: https://chargepointsa.co.za
Author: ChargePointSA Team
Author URI: https://chargepointsa.co.za
Description: Custom WordPress theme for ChargePointSA - South Africa's EV charging experts. Modern, fast, SEO-optimized theme built for EV charging solutions.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chargepointsa
Tags: custom, modern, ev-charging, clean, minimal

ChargePointSA is a custom WordPress theme designed for an EV charging solutions company.
*/

/* ============================================================================
   SELF-HOSTED INTER (latin) — replaces render-blocking Google Fonts link.
   font-display:swap so text paints immediately in the system fallback and
   never goes invisible on a slow/load-shedding mobile connection.
   ========================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/inter-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/inter-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/inter-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/inter-latin-700.woff2') format('woff2'); }

/* ============================================================================
   COLOR PALETTE - CLEAN PREMIUM DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Grayscale */
  --black: #000;
  --gray-950: #0a0a0a;
  --gray-900: #111;
  --gray-800: #1a1a1a;
  --gray-700: #333;
  --gray-600: #555;
  --gray-500: #777;
  --gray-400: #999;
  --gray-300: #bbb;
  --gray-200: #e5e5e5;
  --gray-100: #f5f5f5;
  --gray-50: #fafafa;
  --white: #fff;

  /* Brand Colors */
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-glow: rgba(220, 38, 38, 0.08);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --container-max-width: 1120px;
  --container-padding: 32px;
  --section-padding-desktop: 100px 0;
  --section-padding-tablet: 80px 0;
  --section-padding-mobile: 64px 0;

  /* Transitions */
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* ============================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--white);
  text-rendering: optimizeLegibility;
}

/* ============================================================================
   TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h1 {
  font-size: 42px;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 36px;
  letter-spacing: -0.035em;
  font-weight: 700;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h5 {
  font-size: 14px;
  font-weight: 600;
}

h6 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--gray-900);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--red);
}

/* ============================================================================
   CONTAINER & GRID
   ========================================================================== */

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

/* ============================================================================
   SECTIONS
   ========================================================================== */

section {
  padding: var(--section-padding-desktop);
}

.section-title {
  text-align: center;
  margin-bottom: 64px;
}

.section-title h1,
.section-title h2 {
  margin-bottom: 16px;
}

.section-title p {
  font-size: 18px;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

/* Button Sizes */
.btn-sm {
  padding: 8px 20px;
  font-size: 13px;
}

.btn-md {
  padding: 12px 28px;
  font-size: 14px;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 16px;
}

/* Button Variants */
.btn-red {
  background-color: var(--red);
  color: var(--white);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.15);
}

.btn-red:hover {
  background-color: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(220, 38, 38, 0.25);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-900);
}

.btn-outline:hover {
  border-color: var(--gray-400);
  background-color: var(--gray-50);
}

.btn-outline-red {
  background-color: transparent;
  border: 1px solid var(--red);
  color: var(--red);
}

.btn-outline-red:hover {
  background-color: var(--red-glow);
}

.btn-white {
  background-color: var(--white);
  color: var(--gray-900);
}

.btn-white:hover {
  background-color: var(--gray-100);
}

.btn-ghost {
  background-color: transparent;
  color: var(--white);
  border: 1px solid var(--white);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* WhatsApp brand button — works on ANY background (high contrast green + white text).
   Used in the city-hub hero as the secondary CTA next to btn-red. Page templates
   that override this (e.g. template-charger-installation.php) still win on cascade. */
.btn-whatsapp {
  background-color: #25D366;
  color: var(--white);
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.15);
}

.btn-whatsapp:hover {
  background-color: #1ebd5b;
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.3);
}

/* ============================================================================
   CARDS
   ========================================================================== */

.card {
  background-color: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--red-glow);
}

/* ============================================================================
   TAGS & LABELS
   ========================================================================== */

.tag,
.label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  padding: 4px 12px;
  background-color: var(--red-glow);
  border-radius: 999px;
}

/* ============================================================================
   UTILITIES
   ========================================================================== */

/* Background Colors */
.bg-light {
  background-color: var(--gray-50);
}

.bg-dark {
  background-color: var(--gray-950);
}

.bg-white {
  background-color: var(--white);
}

/* Text Colors */
.text-red {
  color: var(--red);
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* Margins Top */
.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mt-4 {
  margin-top: 32px;
}

/* Margins Bottom */
.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.mb-4 {
  margin-bottom: 32px;
}

/* Margins Top & Bottom */
.my-1 {
  margin-top: 8px;
  margin-bottom: 8px;
}

.my-2 {
  margin-top: 16px;
  margin-bottom: 16px;
}

.my-3 {
  margin-top: 24px;
  margin-bottom: 24px;
}

.my-4 {
  margin-top: 32px;
  margin-bottom: 32px;
}

/* Display Utilities */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

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

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

/* ============================================================================
   FORMS
   ========================================================================== */

input,
textarea,
select {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-900);
}

input[type='text'],
input[type='email'],
input[type='phone'],
input[type='url'],
input[type='password'],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background-color: var(--white);
  transition: var(--transition);
}

input[type='text']:focus,
input[type='email']:focus,
input[type='phone']:focus,
input[type='url']:focus,
input[type='password']:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

.form-group {
  margin-bottom: 24px;
}

/* ============================================================================
   IMAGES & MEDIA
   ========================================================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-responsive {
  width: 100%;
  height: auto;
}

/* WordPress Image Alignment Classes */
.alignleft {
  float: left;
  margin-right: 24px;
  margin-bottom: 12px;
}

.alignright {
  float: right;
  margin-left: 24px;
  margin-bottom: 12px;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 12px;
}

.alignnone {
  display: block;
  margin-bottom: 12px;
}

.wp-caption {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 24px;
}

.wp-caption img {
  margin-bottom: 8px;
}

.wp-caption-text {
  font-size: 12px;
  color: var(--gray-600);
  font-style: italic;
}

/* WordPress Gallery */
.wp-block-gallery {
  margin-bottom: 24px;
}

.wp-block-gallery figcaption {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 8px;
}

/* ============================================================================
   ARTICLE & BLOG CONTENT
   ========================================================================== */

.article-content {
  max-width: 720px;
  margin: 0 auto;
}

.article-content p {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 24px;
  color: var(--gray-900);
}

.article-content h2,
.article-content h3 {
  margin-top: 40px;
  margin-bottom: 20px;
}

.article-content h2 {
  font-size: 32px;
}

.article-content h3 {
  font-size: 20px;
}

.article-content ul,
.article-content ol {
  margin-left: 24px;
  margin-bottom: 24px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.8;
}

.article-content blockquote {
  border-left: 4px solid var(--red);
  padding-left: 24px;
  margin: 32px 0;
  color: var(--gray-600);
  font-style: italic;
  font-size: 17px;
  line-height: 1.8;
}

.article-content code {
  background-color: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: var(--gray-800);
}

.article-content pre {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--gray-900);
}

/* ============================================================================
   ARCHIVE & POST GRIDS
   ========================================================================== */

.archive-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.post-card {
  background-color: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition);
}

.post-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--red-glow);
}

.post-card-image {
  width: 100%;
  height: 240px;
  overflow: hidden;
  background-color: var(--gray-100);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.post-card-content {
  padding: 24px;
}

.post-card-meta {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
}

.post-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.post-card-excerpt {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 16px;
}

.post-card-link {
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.post-card-link:hover {
  gap: 12px;
}

/* ============================================================================
   NAVIGATION & HEADER
   ========================================================================== */

header {
  border-bottom: 1px solid var(--gray-200);
}

nav a {
  color: var(--gray-900);
  font-weight: 500;
  padding: 8px 16px;
  transition: var(--transition);
}

nav a:hover {
  color: var(--red);
}

/* ============================================================================
   FOOTER
   ========================================================================== */

footer {
  background-color: var(--gray-950);
  color: var(--gray-200);
  padding: 64px 0 32px;
}

footer h4 {
  color: var(--white);
  margin-bottom: 20px;
}

footer a {
  color: var(--gray-300);
  font-size: 14px;
  line-height: 1.8;
}

footer a:hover {
  color: var(--red);
}

.footer-column {
  margin-bottom: 32px;
}

.footer-column ul {
  list-style: none;
}

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

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet: 768px and below */
@media (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  section {
    padding: var(--section-padding-tablet);
  }

  .archive-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title {
    margin-bottom: 48px;
  }
}

/* Mobile: 640px and below */
@media (max-width: 640px) {
  :root {
    --container-padding: 20px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  section {
    padding: var(--section-padding-mobile);
  }

  .archive-posts-grid {
    grid-template-columns: 1fr;
  }

  .btn-sm {
    padding: 10px 20px;
    font-size: 13px;
  }

  .btn-md {
    padding: 12px 24px;
    font-size: 14px;
  }

  .btn-lg {
    padding: 14px 28px;
    font-size: 15px;
  }
}

/* Small Mobile: 480px and below */
@media (max-width: 480px) {
  h1 {
    font-size: 24px;
    letter-spacing: -0.03em;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 14px;
  }

  p {
    font-size: 15px;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .section-title p {
    font-size: 15px;
  }

  .card {
    padding: 16px;
  }

  .alignleft,
  .alignright {
    float: none;
    margin-right: 0;
    margin-left: 0;
    margin-bottom: 16px;
  }

  .post-card-image {
    height: 200px;
  }
}

/* ============================================================================
   WORDPRESS BLOCK EDITOR STYLES
   ========================================================================== */

.wp-block-button .wp-block-button__link {
  background-color: var(--red);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.wp-block-button .wp-block-button__link:hover {
  background-color: var(--red-dark);
  transform: translateY(-1px);
}

.wp-block-quote {
  border-left: 4px solid var(--red);
  padding-left: 24px;
  margin: 32px 0;
  font-size: 17px;
  line-height: 1.8;
  color: var(--gray-600);
  font-style: italic;
}

.wp-block-separator {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 40px 0;
}

.wp-block-image {
  margin-bottom: 24px;
}

.wp-block-pullquote {
  border-left: 4px solid var(--red);
  padding-left: 24px;
  padding-right: 24px;
  margin: 32px 0;
}

.wp-block-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.wp-block-table th,
.wp-block-table td {
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  text-align: left;
}

.wp-block-table th {
  background-color: var(--gray-50);
  font-weight: 600;
}

.wp-block-table tbody tr:hover {
  background-color: var(--gray-50);
}

.wp-block-columns {
  display: grid;
  gap: 32px;
}

.wp-block-column {
  flex: 1;
}

/* ============================================================================
   UTILITY DISPLAY CLASSES
   ========================================================================== */

.clear {
  clear: both;
}

.float-left {
  float: left;
}

.float-right {
  float: right;
}

/* ============================================================================
   DARK MODE SUPPORT (Optional Enhancement)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--gray-950);
    color: var(--gray-100);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--white);
  }

  input[type='text'],
  input[type='email'],
  input[type='phone'],
  input[type='url'],
  input[type='password'],
  textarea,
  select {
    background-color: var(--gray-900);
    border-color: var(--gray-700);
    color: var(--gray-100);
  }

  .card {
    background-color: var(--gray-900);
    border-color: var(--gray-800);
  }

  .post-card {
    background-color: var(--gray-900);
    border-color: var(--gray-800);
  }
}

/* ============================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  body {
    background-color: var(--white);
    color: var(--black);
  }

  a {
    color: var(--black);
    text-decoration: underline;
  }

  .no-print {
    display: none !important;
  }
}
