@charset "utf-8";

/* ========================================
   Tokens
   ======================================== */
:root {
  --color-primary: #00559d;      /* OSG 品牌藍 */
  --color-primary-dark: #0b2545; /* 主視覺深海軍藍 */
  --color-text: #1a1a1a;
  --color-muted: #475569;        /* 白底對比 7.6:1 */
  --color-line: #dbe3ec;
  --color-card-head: #e8eef6;    /* 參照原稿營業所標題底色 */
  --color-bg: #f5f7fa;
  --color-white: #ffffff;
  --font-body: 'Noto Sans TC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-en: 'Poppins', 'Noto Sans TC', sans-serif;
  --radius-base: 0.5rem;
  --shadow-card: 0 1px 2px rgba(11, 37, 69, 0.06), 0 8px 24px rgba(11, 37, 69, 0.06);
  --shadow-card-hover: 0 2px 4px rgba(11, 37, 69, 0.08), 0 16px 32px rgba(11, 37, 69, 0.12);
  --transition: 0.2s ease;
}

/* ========================================
   Base
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
}

h1, h2, h3, h4, p, ul, address {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

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

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.125rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon-sprite {
  display: none;
}

/* ========================================
   Header
   ======================================== */
.site-header {
  position: relative;
  z-index: 10; /* 疊在主視覺齒輪裝飾之上 */
  background: var(--color-white);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.site-header__logo {
  width: 140px;
}

/* 維護狀態標籤：圓點 + 文字，不只靠顏色傳遞狀態 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.875rem;
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #d97706;
  animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   Hero 維護公告
   ======================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 0 4.5rem;
  color: var(--color-white);
  text-align: center;
  background-color: var(--color-primary-dark);
  /* 藍圖格線 + 品牌藍漸層，呼應工具設計圖的意象 */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
}

.hero__inner {
  position: relative;
  z-index: 1; /* 疊在齒輪裝飾之上 */
}

.hero__gear {
  position: absolute;
  color: rgba(255, 255, 255, 0.12);
  animation: gear-spin 40s linear infinite;
}

.hero__gear--lg {
  top: -40%;
  right: -12%;
  width: 22rem;
  height: 22rem;
}

.hero__gear--sm {
  bottom: -30%;
  left: -8%;
  width: 13rem;
  height: 13rem;
  animation-direction: reverse;
  animation-duration: 28s;
}

.hero__eyebrow {
  margin-bottom: 0.75rem;
  font-family: var(--font-en);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: #bcd6ee; /* 深藍底對比 ≥ 4.5:1 */
}

.hero__title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
}

.hero__title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  margin: 1.25rem auto;
  background: var(--color-white);
}

.hero__lead {
  font-size: 1.0625rem;
  color: #e6eef7;
}

/* ========================================
   營業據點
   ======================================== */
.offices {
  padding: 3rem 0 4rem;
}

.region + .region {
  margin-top: 3rem;
}

.region__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: var(--color-primary);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* 標題左側品牌色短線 + 右側延伸細線 */
.region__title::before {
  content: '';
  width: 4px;
  height: 1.25em;
  border-radius: 2px;
  background: var(--color-primary);
}

.region__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-line);
}

.office-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.office-card {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-base);
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.office-card:hover {
  border-color: #b9c9db;
  box-shadow: var(--shadow-card-hover);
}

.office-card__name {
  padding: 0.875rem 1.25rem;
  background: var(--color-card-head);
  border-bottom: 1px solid var(--color-line);
  color: var(--color-primary-dark);
  font-size: 1.0625rem;
  font-weight: 700;
}

.office-card__list {
  display: grid;
  gap: 0.625rem;
  padding: 1.125rem 1.25rem 1.375rem;
}

.office-card__item {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.625rem;
  align-items: start;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.office-card__item address {
  color: var(--color-text);
}

.office-card__icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem; /* 對齊第一行文字中線 */
  color: var(--color-primary);
}

.office-card__tel {
  display: inline-block;
  padding: 0.125rem 0;
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.office-card__tel:hover {
  color: var(--color-primary-dark);
}

.office-card__tel:active {
  color: #003a6b;
}

.office-card__tel:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  padding: 1.5rem 0;
  background: var(--color-primary-dark);
  color: #c9d6e5;
  text-align: center;
}

.site-footer__copy {
  font-family: var(--font-en);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* ========================================
   Animation
   ======================================== */
@keyframes gear-spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__gear,
  .status-badge__dot {
    animation: none;
  }

  .office-card,
  .office-card__tel {
    transition: none;
  }
}

/* ========================================
   Responsive
   ======================================== */
@media (min-width: 768px) {
  .site-header__inner {
    min-height: 5rem;
  }

  .site-header__logo {
    width: 170px;
  }

  .hero {
    padding: 6rem 0 6.5rem;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__lead {
    font-size: 1.1875rem;
  }

  .offices {
    padding: 4.5rem 0 5.5rem;
  }

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

@media (min-width: 1024px) {
  .hero {
    padding: 7.5rem 0 8rem;
  }

  .hero__title {
    font-size: 3.5rem;
  }

  .hero__gear--lg {
    top: -45%;
    right: 4%;
    width: 30rem;
    height: 30rem;
  }

  .hero__gear--sm {
    left: 6%;
    width: 16rem;
    height: 16rem;
  }

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