/*
 * Main stylesheet for the Kawakhaŋ EV Technician Training Program website.
 * This file defines a clean, modern aesthetic using a palette inspired by
 * renewable energy.  Sections are clearly delineated, the typography is
 * spacious, and responsive design ensures the site looks great on both
 * desktop and mobile devices.
 */

/* Root variables for easy colour and spacing adjustments */
:root {
  --primary-color: #00796B;     /* deep teal for highlights */
  --secondary-color: #00BFA6;   /* vibrant turquoise accent */
  --light-bg: #F5F9F7;          /* light background for contrast */
  --dark-bg: #003D33;           /* dark teal for footer */
  --text-color: #333333;        /* default text colour */
  --max-width: 1200px;          /* maximum content width */
  --transition-speed: 0.3s;     /* base transition timing */
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: white;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Containers */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-speed);
}

.nav-links a:hover {
  color: var(--secondary-color);
}

/* Hamburger button for mobile */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  display: block;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: transform var(--transition-speed);
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  background: url('../images/image-set(url('../images/hero-bg.webp') type('image/webp'), url('../images/hero-bg.png') type('image/png'))') no-repeat center center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 0 20px;
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.btn-primary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-color);
}

/* Sections */
.section {
  padding: 80px 0;
}

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

.section-title {
  text-align: center;
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 50px;
}

.section-intro {
  max-width: 750px;
  margin: 0 auto 40px auto;
  text-align: center;
  font-size: 1.05rem;
  color: #555;
}

/* Grid utilities */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/* Cards */
.card {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  text-align: left;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.card h3 {
  margin-top: 15px;
  margin-bottom: 10px;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.card p {
  font-size: 0.95rem;
  color: #555;
}

.icon {
  font-size: 1.8rem;
  color: var(--secondary-color);
}

/* Curriculum */
.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.curriculum-block h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
  color: var(--primary-color);
}

.curriculum-block p {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: #555;
}

.curriculum-list {
  margin-left: 20px;
  margin-bottom: 15px;
}

.curriculum-list li {
  margin-bottom: 8px;
  list-style-type: decimal;
  color: #555;
}

/* Finance */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.finance-item h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
  color: var(--primary-color);
}

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

.budget-table th,
.budget-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.budget-table thead {
  background-color: var(--primary-color);
  color: white;
}

.funding-list {
  list-style: none;
}

.funding-list li {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #555;
}

.funding-list li strong {
  color: var(--primary-color);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-info p {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.contact-form {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.contact-form button {
  width: 100%;
  margin-top: 10px;
}

/* Footer */
.footer {
  background-color: var(--dark-bg);
  color: #f1f1f1;
  padding: 40px 0;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
}

.social-links a {
  margin: 0 8px;
  font-size: 1.2rem;
  color: #f1f1f1;
  transition: color var(--transition-speed);
}

.social-links a:hover {
  color: var(--secondary-color);
}

/* Responsive styles */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 200px;
    padding: 10px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform var(--transition-speed);
  }

  .nav-links a {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .hamburger {
    display: flex;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .finance-grid,
  .curriculum-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
/* Skip link for accessibility */
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus{position:static;width:auto;height:auto;padding:8px;background:#003D33;color:#fff}

@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}

section{scroll-margin-top:80px}

:focus-visible{outline:3px solid var(--secondary-color);outline-offset:2px}

#nav-links a[aria-current="page"]{color:var(--secondary-color)}


/* Homepage background (scoped) */
html, body {
  height: 100%;
}
body.has-home-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../assets/homepage-bg.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.9;
  z-index: -1;
}
body.has-home-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.35));
  z-index: -1;
}




/* Homepage hero text on background (scoped, non-global) */
body.has-home-bg .hero,
body.has-home-bg .hero * {
  color: #ffffff;
}
body.has-home-bg .hero a {
  color: #ffffff;
  text-decoration-color: rgba(255,255,255,0.7);
}
body.has-home-bg .hero a:hover,
body.has-home-bg .hero a:focus {
  color: #f5f5f5;
  text-decoration-color: rgba(255,255,255,0.85);
}
/* optional readability */
body.has-home-bg .hero h1,
body.has-home-bg .hero h2,
body.has-home-bg .hero .btn,
body.has-home-bg .hero p {
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}


/* Text color for non-light sections when homepage background is active */
body.has-home-bg .section:not(.light-bg),
body.has-home-bg .section:not(.light-bg) * {
  color: #ffffff;
}
body.has-home-bg .section:not(.light-bg) a {
  color: #ffffff;
  text-decoration-color: rgba(255,255,255,0.7);
}
body.has-home-bg .section:not(.light-bg) a:hover,
body.has-home-bg .section:not(.light-bg) a:focus {
  color: #f5f5f5;
  text-decoration-color: rgba(255,255,255,0.85);
}
body.has-home-bg .section:not(.light-bg) h1,
body.has-home-bg .section:not(.light-bg) h2,
body.has-home-bg .section:not(.light-bg) h3,
body.has-home-bg .section:not(.light-bg) .btn,
body.has-home-bg .section:not(.light-bg) p {
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}


/* Fix: ensure readable dark text on light components inside non-light sections */
body.has-home-bg .section:not(.light-bg) .card,
body.has-home-bg .section:not(.light-bg) .card * {
  color: var(--text-color, #1a1a1a) !important;
  text-shadow: none !important;
}
body.has-home-bg .section:not(.light-bg) .budget-table,
body.has-home-bg .section:not(.light-bg) .budget-table * {
  color: var(--text-color, #1a1a1a) !important;
  text-shadow: none !important;
}
/* Buttons inside light components should keep their normal styles */
body.has-home-bg .section:not(.light-bg) .card .btn,
body.has-home-bg .section:not(.light-bg) .budget-table .btn {
  color: inherit !important;
  text-shadow: none !important;
}


/* Finance table on homepage background: white text & lighter borders */
body.has-home-bg #finance .budget-table,
body.has-home-bg #finance .budget-table * {
  color: #ffffff !important;
  text-shadow: none !important;
}
body.has-home-bg #finance .budget-table th,
body.has-home-bg #finance .budget-table td {
  border-color: rgba(255,255,255,0.45) !important;
}
body.has-home-bg #finance .budget-table thead th {
  color: #ffffff !important;
  background: none !important;
  border-bottom: 2px solid rgba(255,255,255,0.6) !important;
}

/* Card headings & icons on non-light sections over homepage background */
body.has-home-bg .section:not(.light-bg) .card h3,
body.has-home-bg .section:not(.light-bg) .card .icon,
body.has-home-bg .section:not(.light-bg) .card i {
  color: #00796B !important;
}
