/* =========================================================
   공통 스타일 (모든 페이지)
   ========================================================= */

/* ---------- 폰트 (경로는 이 CSS 파일 기준: css/ → ../fonts/) ---------- */
@font-face {
  font-family: 'Wanted Sans';
  src: url('../fonts/WantedSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Wanted Sans';
  src: url('../fonts/WantedSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Wanted Sans';
  src: url('../fonts/WantedSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* ---------- 디자인 토큰 ---------- */
:root {
  --ink: #111413;
  --body: #676d69;
  --muted: #898e8b;
  --disabled: #b4b8b5;
  --line: #dde1de;
  --blue: #697deb;
  --lime: #baf20f;
  --paper: #ffffff;
  --soft: #f5f7f5;
  --footer: #22222a;
  --nav-height: 56px;
  --body-copy-size: 16px;
  --section-space: 96px;
  --section-space-mobile: 68px;
}

/* ---------- 기본 ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Wanted Sans', sans-serif;
  font-weight: 400;
  word-break: keep-all;
  overflow-x: clip;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(34px, 5vw, 40px);
  line-height: 1.25;
  font-weight: 700;
}

.page {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.intro {
  margin: 10px 0 0;
  color: var(--body);
  font-size: var(--body-copy-size);
  line-height: 1.7;
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 28px, 1180px);
  }
}

/* 동작 줄이기(OS 접근성 설정)가 켜져 있으면 모든 애니메이션·전환 효과를 끔 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .hero-shrink {
    will-change: auto;
  }
}

/* ---------- 헤더 / 내비게이션 ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: #ffffff;
  border-bottom: 1px solid rgba(17, 20, 19, 0.12);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  height: 100%;
}

.logo img {
  display: block;
  width: auto;
  height: 34px;
  object-fit: contain;
}

nav {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 34px;
  font-size: 16px;
}

nav a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

nav .contact-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  border-radius: 100px;
  font-weight: 700;
  background: var(--ink);
  color: #ffffff;
  transition: background-color 0.25s ease, color 0.25s ease;
}

nav .contact-nav:hover,
nav .contact-nav:focus-visible {
  background: var(--lime);
  color: #000;
}

/* 모바일 메뉴 버튼 — common.js 가 헤더에 넣는다 */
.menu-toggle {
  display: none;
}

@media (max-width: 760px) {
  nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0 11px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .menu-open nav {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 14px 20px;
    background: #fff;
    border-bottom: 1px solid rgba(17, 20, 19, 0.12);
    box-shadow: 0 18px 30px rgba(17, 20, 19, 0.08);
    font-size: 18px;
  }

  .menu-open nav a {
    padding: 16px 4px;
    border-bottom: 1px solid var(--line);
  }

  .menu-open nav .contact-nav {
    height: 52px;
    margin-top: 16px;
    border-bottom: 0;
  }
}

/* ---------- 푸터 ---------- */
.site-footer {
  position: relative;
  left: 50%;
  width: 100vw;
  margin: -1px 0 0 -50vw;
  padding: 16px 0;
  background: var(--footer);
  color: #d2d2d6;
}

.footer-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--lime);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}

.footer-contact > * {
  white-space: nowrap;
}

.footer-contact > * + * {
  border-left: 1px solid #55555d;
  margin-left: 18px;
  padding-left: 18px;
}

.footer-contact .footer-brand {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-socials {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.footer-socials a {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-socials img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
  margin-top: 8px;
  color: #a0a0aa;
  font-size: 11px;
  line-height: 1.4;
}

.footer-bottom p {
  margin: 0;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  min-width: 0;
}

@media (max-width: 760px) {
  .footer-inner {
    width: calc(100% - 28px);
  }

  .footer-top {
    gap: 10px;
  }

  .footer-contact {
    row-gap: 6px;
    font-size: 12px;
  }

  .footer-contact > * + * {
    margin-left: 10px;
    padding-left: 10px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

@media (max-width: 420px) {
  .footer-contact {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 16px;
  }

  .footer-contact > * + * {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
}

/* ---------- 맨 위로 버튼 ---------- */
.back-to-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 100px;
  background: var(--lime);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(17, 20, 19, 0.12);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.back-to-top:hover {
  background: var(--ink);
  color: #ffffff;
}

.back-to-top:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .back-to-top {
    right: 14px;
    bottom: max(16px, env(safe-area-inset-bottom));
    min-height: 44px;
    padding: 0 16px;
  }
}

/* ---------- 버튼 ---------- */
.detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 136px;
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 100px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.detail-btn:hover,
.detail-btn:focus-visible {
  background: var(--lime);
  color: #000;
}

@media (max-width: 760px) {
  .detail-btn {
    justify-self: start;
  }
}

/* ---------- 전체화면 히어로: 스크롤 시 그리드 폭으로 줄어듦 (js/common.js) ---------- */
.hero-shrink {
  position: relative;
  left: 50%;
  width: var(--hero-width, 100vw);
  overflow: hidden;
  border-radius: var(--hero-radius, 0px);
  transform: translateX(-50%);
  will-change: width, border-radius;
}

.hero-shrink .page {
  width: min(1180px, calc(100vw - 48px));
  max-width: calc(100% - 48px);
}

@media (max-width: 760px) {
  .hero-shrink .page {
    width: min(100vw - 28px, 1180px);
    max-width: calc(100% - 28px);
  }
}

/* ---------- 내려서 자세히 보기 ---------- */
.scroll-cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
  animation: scroll-cue-move 1.6s ease-in-out infinite;
}

.scroll-cue:hover {
  color: var(--lime);
}

.scroll-cue-arrow {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

@keyframes scroll-cue-move {
  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, 7px);
  }
}

@media (max-width: 760px) {
  .scroll-cue {
    bottom: 24px;
  }
}

/* ---------- 페이지 배너 (news, vehicles) ---------- */
.page-banner {
  position: relative;
  left: 50%;
  width: 100vw;
  height: 300px;
  margin-top: var(--nav-height);
  margin-left: -50vw;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-banner > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 53%;
}

.page-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 24, 28, 0.32) 0%, rgba(0, 0, 0, 0.44) 35%, rgba(4, 24, 28, 0.62) 100%);
}

.banner-copy {
  position: relative;
  z-index: 1;
  padding: 0 24px;
  text-align: center;
}

.page-banner h1 {
  margin: 0 auto;
  color: #fff;
}

.banner-copy .intro {
  color: #fff;
}

@media (max-width: 760px) {
  .page-banner {
    height: 240px;
  }
}

/* ---------- 브레드크럼 드롭다운 (js/common.js) ---------- */
.about-crumb {
  position: absolute;
  z-index: 2;
  top: 52px;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  color: #fff;
  font-size: 16px;
}

.about-crumb a {
  color: inherit;
  text-decoration: none;
}

.about-crumb > .crumb-label,
.about-crumb > a,
.about-crumb > span[aria-hidden] {
  line-height: 34px;
}

.crumb-dropdown {
  position: relative;
  width: fit-content;
  max-height: 34px;
  overflow: hidden;
  border-radius: 17px;
  background: var(--ink);
  color: #fff;
  transition: max-height 0.35s ease, background-color 0.25s ease, color 0.25s ease;
}

.crumb-dropdown.is-open {
  max-height: 104px;
  background: var(--lime);
  color: #000;
}

.crumb-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 34px;
  padding: 0 18px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.crumb-current svg {
  width: 10px;
  height: 10px;
  flex: none;
  transition: transform 0.25s ease;
}

.crumb-dropdown.is-open .crumb-current svg {
  transform: rotate(180deg);
}

.crumb-menu {
  padding: 6px 18px 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.crumb-dropdown.is-open .crumb-menu {
  opacity: 1;
  transition-delay: 0.08s;
}

.crumb-menu a {
  display: block;
  padding: 8px 0;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.crumb-menu a:hover {
  opacity: 1;
}

@media (max-width: 760px) {
  .about-crumb {
    top: 28px;
  }
}
