/* === 1. 全域設定 (Reset, Font, Layout) === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #007bff; /* Primary Blue (can be cresthavenenergy's primary color) */
  --secondary-color: #ff8c00; /* Dark Orange for accents */
  --text-color: #333;
  --light-text-color: #fff;
  --bg-color: #f8f9fa; /* Lighter background */
  --section-bg-light: #ffffff;
  --section-bg-dark: #f0f4f8; /* Slightly darker for alternating sections */
  --border-color: #dee2e6;
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.7;
  font-size: 16px;
}

.container {
  max-width: 1140px; /* Slightly wider for modern screens */
  margin: 0 auto;
  padding: 0 1rem; /* Consistent padding */
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

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

.section-padding {
  padding: 60px 0;
}

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

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

.lead {
  font-size: 1.15rem;
  font-weight: 400;
  color: #555;
  margin-bottom: 1.5rem;
}


/* === 2. 導覽列 (Navbar) === */
.navbar {
  background-color: var(--light-text-color);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.logo {
  font-size: 1.75rem; /* May need adjustment if "cresthavenenergy" is too long */
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 0;
}

.navbar nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0;
}

.navbar nav li a {
  color: var(--text-color);
  padding: 0.5rem 0;
  font-weight: 600;
  position: relative;
}

.navbar nav li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--secondary-color);
  transition: width 0.3s ease;
}

.navbar nav li a:hover::after,
.navbar nav li a.active::after {
  width: 100%;
}

.navbar nav li a.active {
  color: var(--primary-color);
}

/* === 3. Hero 區塊 (about.html) === */
.about-hero {
  position: relative;
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
  color: var(--light-text-color);
  text-align: center;
}

.hero-overlay {
  padding: 2rem 0;
}

.about-hero h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.about-hero p {
  font-size: 1.3rem;
  font-weight: 400;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* === 4. 內容區塊通用 === */
.about-intro h3, .about-values h3, .about-timeline h3, .about-sustainability h3 {
  margin-bottom: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.about-intro p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* 4-2. 企業文化/核心價值 */
.value-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.value-item {
  background: var(--section-bg-light);
  border: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--card-shadow);
}

.value-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

.value-icon {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.value-item h4 {
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  color: var(--primary-color);
}

/* 4-3. 發展歷程 (Timeline) */
.timeline {
  list-style: none;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background-color: var(--border-color);
}

.timeline li {
  margin-bottom: 50px;
  position: relative;
  width: 50%;
  padding: 10px 40px;
}

.timeline li:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline li:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-badge {
  color: #fff;
  width: 70px;
  height: 70px;
  line-height: normal; /* Changed from fixed line-height for flex alignment */
  font-size: 1.2em;
  text-align: center;
  position: absolute;
  top: 16px;
  right: -35px;
  z-index: 100;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px; /* Padding for year text */
}
.timeline li:nth-child(even) .timeline-badge {
  left: -35px;
  right: auto;
}
.timeline-badge.alt-badge {
  background-color: var(--secondary-color);
}
.timeline-badge .year {
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.2; /* Ensure year text is readable */
}

.timeline-panel {
  padding: 20px;
  background-color: var(--section-bg-light);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  position: relative;
}
.timeline li:nth-child(odd) .timeline-panel::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 26px;
  width: 0;
  z-index: 1;
  right: -15px;
  border: medium solid white;
  border-width: 10px 0 10px 15px;
  border-color: transparent transparent transparent var(--section-bg-light);
}
.timeline li:nth-child(even) .timeline-panel::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 26px;
  width: 0;
  z-index: 1;
  left: -15px;
  border: medium solid white;
  border-width: 10px 15px 10px 0;
  border-color: transparent var(--section-bg-light) transparent transparent;
}

.timeline-title {
  margin-top: 0;
  color: inherit;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.timeline-body > p,
.timeline-body > ul {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* 4-4. 永續發展 */
.sustainability-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

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

.highlight-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}
.highlight-item h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* === 5. 頁尾 Footer === */
.footer {
  text-align: center;
  padding: 2.5rem 0;
  background-color: #343a40;
  color: var(--light-text-color);
  margin-top: 3rem;
}

.footer p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.footer a {
  color: var(--secondary-color);
}
.footer a:hover {
  color: var(--light-text-color);
}

.footer-social-links {
    margin-top: 1rem;
}

.footer-social-links a {
    color: var(--light-text-color);
    margin: 0 0.5rem;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}
.footer-social-links a:hover {
    color: var(--secondary-color);
}

/* === 6. RWD 響應式設定 === */
@media (max-width: 991px) {
    .container {
        max-width: 90%;
    }
    .about-hero h2 { font-size: 2.5rem; }
    .about-hero p { font-size: 1.15rem; }

    .timeline::before {
        left: 35px;
    }
    .timeline li {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        text-align: left !important;
    }
    .timeline li:nth-child(even) {
        left: 0%;
    }
    .timeline-badge {
        left: 0 !important;
        top: 0;
        width: 60px;
        height: 60px;
        /* line-height: 60px; */ /* Flex handles alignment */
    }
    .timeline-badge .year { font-size: 1rem; }
    .timeline-panel {
        width: calc(100% - 20px);
    }
    .timeline li .timeline-panel::before {
        border-left-width: 0;
        border-right-width: 15px;
        left: -15px;
        right: auto;
        border-color: transparent var(--section-bg-light) transparent transparent;
    }
     .timeline li:nth-child(even) .timeline-panel::before {
        border-left-width: 0;
        border-right-width: 15px;
        left: -15px;
        right: auto;
    }
}

@media (max-width: 768px) {
  body { font-size: 15px; }
  .section-padding { padding: 40px 0; }

  .navbar-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  .navbar nav ul {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
  }
  .navbar nav li a::after { display: none; }

  .logo { font-size: 1.5rem; } /* Adjust logo size if needed for longer name */
  .about-hero { padding: 60px 0; }
  .about-hero h2 { font-size: 2rem; }
  .about-hero p { font-size: 1rem; }

  h2 { font-size: 1.8rem; }
  h3 { font-size: 1.5rem; }

  .value-items {
    grid-template-columns: 1fr;
  }

  .sustainability-highlights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
    .timeline::before {
        left: 20px;
    }
    .timeline li {
        padding-left: 50px;
    }
    .timeline-badge {
        width: 40px;
        height: 40px;
        /* line-height: 40px; */ /* Flex handles alignment */
    }
    .timeline-badge .year { font-size: 0.8rem; }
}