/* Corporate style — inspired by large enterprise homepages */
:root {
  --corp-blue: #004a8f;
  --corp-blue-dark: #003366;
  --corp-blue-light: #e8f1f9;
  --corp-accent: #0088cc;
  --corp-text: #222222;
  --corp-text-muted: #666666;
  --corp-border: #e0e0e0;
  --corp-bg: #ffffff;
  --corp-bg-alt: #f5f7fa;
  --font-sans: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --header-height: 72px;
}

body.site-body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--corp-text);
  background: var(--corp-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--corp-blue);
}

a:hover {
  color: var(--corp-accent);
}

/* Top utility bar */
.site-topbar {
  background: var(--corp-blue-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8125rem;
  padding: 0.4rem 0;
}

.site-topbar a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.site-topbar a:hover {
  color: #fff;
}

/* Main navbar */
.site-nav {
  background: #fff !important;
  border-bottom: 3px solid var(--corp-blue);
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 避免 Bootstrap 未載入時導覽跑版（直向圓點列表） */
.site-nav .navbar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav .navbar-toggler {
  display: none;
}

@media (min-width: 992px) {
  .site-nav .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
    align-items: center;
  }

  .site-nav .navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 991.98px) {
  .site-nav .navbar-toggler {
    display: block;
  }

  .site-nav .navbar-collapse:not(.show) {
    display: none !important;
  }

  .site-nav .navbar-collapse.show {
    display: block !important;
    padding-bottom: 1rem;
  }
}

.site-nav .container {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-nav .navbar-brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--corp-blue-dark) !important;
  letter-spacing: 0.02em;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-nav .nav-link {
  color: var(--corp-text) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 1.5rem 1.1rem !important;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  border-radius: 0;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  color: var(--corp-blue) !important;
  background: transparent !important;
  border-bottom-color: var(--corp-blue);
}

.site-nav .btn-corp {
  background: var(--corp-blue);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
  border-radius: 2px;
  border: none;
}

.site-nav .btn-corp:hover {
  background: var(--corp-blue-dark);
  color: #fff;
}

/* Hero carousel — full width */
.hero-carousel {
  position: relative;
}

.hero-carousel .carousel-item {
  min-height: clamp(380px, 52vh, 520px);
  background: linear-gradient(120deg, var(--corp-blue-dark), var(--corp-blue));
}

.hero-carousel .carousel-item.has-image {
  background: #000;
}

.hero-carousel .carousel-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.45;
}

.hero-carousel .carousel-caption-custom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 0;
  z-index: 2;
  color: #fff;
}

.hero-carousel .carousel-caption-custom h2,
.hero-carousel .carousel-caption-custom p {
  color: #fff;
}

.hero-carousel .carousel-caption-custom .container {
  max-width: 1140px;
}

.hero-carousel h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero-carousel p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 36rem;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.hero-carousel .btn-hero {
  background: #fff !important;
  color: var(--corp-blue-dark) !important;
  font-weight: 700;
  padding: 0.65rem 1.75rem;
  border-radius: 2px;
  border: none;
  font-size: 0.9375rem;
}

.hero-carousel .btn-hero:hover {
  background: var(--corp-blue-light) !important;
  color: var(--corp-blue-dark) !important;
}

.hero-carousel .carousel-indicators {
  margin-bottom: 1.25rem;
}

.hero-carousel .carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  opacity: 0.7;
}

.hero-carousel .carousel-indicators .active {
  background: #fff;
  opacity: 1;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
  width: 8%;
  opacity: 0.8;
}

/* Section blocks */
.corp-section {
  padding: 4rem 0;
}

.corp-section-alt {
  background: var(--corp-bg-alt);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--corp-blue);
}

.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--corp-blue-dark);
  margin: 0;
}

.section-head .more-link {
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.section-head .more-link::after {
  content: " →";
}

/* News list — Foxconn row style */
.news-list-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--corp-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.news-list-item:first-child {
  padding-top: 0;
}

.news-list-item:hover {
  background: var(--corp-blue-light);
  color: inherit;
}

.news-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 100px;
  background: var(--corp-blue-light);
  overflow: hidden;
  border-radius: 2px;
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--corp-text-muted);
  background: linear-gradient(135deg, #dce8f4, #c5d9eb);
}

.news-meta {
  flex: 1;
  min-width: 0;
}

.news-date {
  font-size: 0.8125rem;
  color: var(--corp-text-muted);
  margin-bottom: 0.35rem;
}

.news-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--corp-text);
  margin: 0;
  line-height: 1.45;
}

.news-list-item:hover .news-title {
  color: var(--corp-blue);
}

/* Topic tiles — 研發與技術 style */
.topic-tile {
  display: block;
  position: relative;
  height: 220px;
  overflow: hidden;
  border-radius: 2px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(145deg, var(--corp-blue), var(--corp-blue-dark));
  transition: transform 0.25s, box-shadow 0.25s;
}

.topic-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 58, 112, 0.25);
  color: #fff;
}

.topic-tile-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}

.topic-tile-body {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(transparent 30%, rgba(0, 30, 60, 0.75));
}

.topic-tile h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.topic-tile span {
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0.9;
}

/* Quick link banners */
.quick-banner {
  display: block;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--corp-border);
  border-radius: 2px;
  text-decoration: none;
  color: var(--corp-text);
  height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quick-banner:hover {
  border-color: var(--corp-blue);
  box-shadow: 0 4px 16px rgba(0, 74, 143, 0.12);
  color: var(--corp-blue);
}

.quick-banner-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--corp-blue);
}

.quick-banner h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.quick-banner p {
  font-size: 0.8125rem;
  color: var(--corp-text-muted);
  margin: 0;
}

/* Product row */
.product-row-card {
  background: #fff;
  border: 1px solid var(--corp-border);
  height: 100%;
  transition: box-shadow 0.2s;
}

.product-row-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-row-card .img-wrap {
  height: 180px;
  overflow: hidden;
  background: var(--corp-bg-alt);
}

.product-row-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-row-card .body {
  padding: 1.25rem;
}

.product-row-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Recruitment band */
.recruit-band {
  background: linear-gradient(90deg, var(--corp-blue-dark), var(--corp-blue));
  color: #fff;
  padding: 3.5rem 0;
  text-align: center;
}

.recruit-band h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.recruit-band p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.recruit-band .btn {
  background: #fff;
  color: var(--corp-blue-dark);
  font-weight: 700;
  padding: 0.65rem 2rem;
  border-radius: 2px;
}

/* Inner pages */
.page-header-corp {
  background: var(--corp-blue-dark);
  color: #fff;
  padding: 2.5rem 0;
}

.page-header-corp h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.content-box {
  background: #fff;
  border: 1px solid var(--corp-border);
  padding: 2rem;
}

.contact-info-card,
.contact-form-card {
  border: 1px solid var(--corp-border);
  border-radius: 2px;
  padding: 2rem;
  background: #fff;
}

.contact-info-card {
  background: var(--corp-blue-light);
}

.btn-primary {
  --bs-btn-bg: var(--corp-blue);
  --bs-btn-border-color: var(--corp-blue);
  --bs-btn-hover-bg: var(--corp-blue-dark);
  --bs-btn-hover-border-color: var(--corp-blue-dark);
  border-radius: 2px;
  font-weight: 600;
}

/* Footer — multi column corporate */
.site-footer {
  background: #2d2d2d;
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 0 1.5rem;
  font-size: 0.875rem;
}

.site-footer h6 {
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 2rem;
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--corp-text-muted);
  border: 1px dashed var(--corp-border);
}

@media (max-width: 767.98px) {
  .site-nav .nav-link {
    padding: 0.75rem 1rem !important;
    border-bottom: none;
    border-left: 3px solid transparent;
    margin-bottom: 0;
  }

  .site-nav .nav-link.active,
  .site-nav .nav-link:hover {
    border-left-color: var(--corp-blue);
  }

  .news-list-item {
    flex-direction: column;
  }

  .news-thumb {
    width: 100%;
    height: 140px;
  }

  .hero-carousel .carousel-caption-custom {
    text-align: center;
  }

  .hero-carousel .carousel-caption-custom .container {
    text-align: center;
  }

  .hero-carousel p {
    margin-left: auto;
    margin-right: auto;
  }
}
