/* 포털 사이트 전용 스타일 (묶음7 M4, L1 — 헤더/푸터/홈).
 * IS_PORTAL_SITE 일 때만 로드되고(siteHeader.jsp), body 에 portal-site 클래스가 붙는다
 * (siteLayout.jsp/siteMainLayout.jsp). 캠프 사이트는 이 파일 자체를 안 받으므로 선택자가
 * 전역을 오염시킬 일은 없지만, 그래도 전 선택자를 body.portal-site 접두로 고정한다
 * (PortalCssScopeRatchetTest). 색은 assets/ds/tokens.css 의 --ds-* 변수만 쓴다.
 */

/* ---- 공통 버튼(헤더/히어로/카드/B2B 공용) ---- */
body.portal-site .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
body.portal-site .btn-l { height: 52px; padding: 0 24px; font-size: var(--ds-font-body-m-size); }
body.portal-site .btn-m { height: 44px; padding: 0 16px; font-size: 15px; }
body.portal-site .btn-primary { background: var(--ds-primary); color: var(--ds-on-primary); }
body.portal-site .btn-secondary { background: var(--ds-surface); border: 1px solid var(--ds-border); color: var(--ds-text-strong); }
body.portal-site .btn-ghost { background: transparent; color: var(--ds-primary); }
body.portal-site .btn-accent { background: var(--ds-accent); color: var(--ds-on-primary); }

/* ---- Header ---- */
body.portal-site .portal-header {
  background: var(--ds-bg);
  border-bottom: 1px solid var(--ds-border);
}
body.portal-site .portal-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
body.portal-site .portal-logo { margin: 0; font-size: var(--ds-font-h3-size); font-weight: 700; }
body.portal-site .portal-logo a { color: var(--ds-text-strong); text-decoration: none; }
body.portal-site .portal-logo img { height: 26px; width: auto; display: block; }
body.portal-site .portal-nav { flex: 0 1 auto; }
body.portal-site .portal-nav-list {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}
body.portal-site .portal-nav-lnk {
  color: var(--ds-text-strong);
  text-decoration: none;
  font-size: var(--ds-font-body-m-size);
  font-weight: 500;
}
body.portal-site .portal-nav-lnk:hover { color: var(--ds-text-strong); }
body.portal-site .portal-header-account {
  display: flex;
  align-items: center;
  gap: 20px;
}
body.portal-site .portal-login-lnk {
  color: var(--ds-text);
  text-decoration: none;
  font-size: var(--ds-font-body-s-size);
}

/* ---- Hero(compact-search) ---- */
body.portal-site .portal-hero {
  background: var(--ds-dark);
  min-height: 440px;
  padding: 72px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
body.portal-site .portal-hero-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}
body.portal-site .portal-hero-title {
  color: var(--ds-on-primary);
  font-size: 44px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  font-weight: var(--ds-font-h1-weight);
  margin: 0 0 24px;
}
body.portal-site .portal-booking-bar {
  background: var(--ds-surface);
  border-radius: 16px;
  box-shadow: 0 8px 14px rgba(20, 23, 28, .14);
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 8px;
  box-sizing: border-box;
}
body.portal-site .portal-booking-form {
  display: flex;
  align-items: center;
}
/* Figma Booking Bar field: 라벨(12 muted) 위 · 값(16 bold) 아래, 필드 사이 1px 구분선 */
body.portal-site .portal-booking-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 16px;
  text-align: left;
}
body.portal-site .portal-booking-field + .portal-booking-field { border-left: 1px solid var(--ds-border); }
body.portal-site .portal-booking-form label {
  color: var(--ds-text-muted);
  font-size: 12px;
  font-weight: 500;
}
body.portal-site .portal-booking-form input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: var(--ds-font-body-m-size);
  font-weight: 700;
  color: var(--ds-text-strong);
}
body.portal-site .portal-booking-form .btn { flex: none; }

/* ---- 추천 캠핑장 카드 ---- */
body.portal-site .portal-camp-section { padding: 90px 20px; }
/* 연속 섹션은 사이 간격 90 하나(Figma: 두 번째 섹션은 pb 만) */
body.portal-site .portal-camp-section + .portal-camp-section { padding-top: 0; }
body.portal-site .portal-camp-section-inner { max-width: 1120px; margin: 0 auto; }
body.portal-site .portal-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 40px;
}
body.portal-site .portal-section-titles { display: flex; flex-direction: column; gap: 8px; }
body.portal-site .portal-section-title {
  font-size: 28px;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-weight: var(--ds-font-h2-weight);
  color: var(--ds-text-strong);
  margin: 0;
}
body.portal-site .portal-section-sub { margin: 0; font-size: var(--ds-font-body-m-size); color: var(--ds-text-muted); }
body.portal-site .portal-camp-card-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
body.portal-site .portal-camp-card a { color: inherit; text-decoration: none; display: block; }
body.portal-site .portal-camp-card-img {
  border-radius: var(--ds-radius-card-portal);
  overflow: hidden;
  aspect-ratio: 17 / 10;
}
body.portal-site .portal-camp-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.portal-site .portal-camp-card-body { padding: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
body.portal-site .portal-camp-card-name {
  font-size: var(--ds-font-title-size);
  font-weight: var(--ds-font-title-weight);
  letter-spacing: -0.01em;
  color: var(--ds-text-strong);
}
body.portal-site .portal-camp-card-desc { font-size: var(--ds-font-body-s-size); color: var(--ds-text); }
body.portal-site .portal-camp-card-price { font-size: 18px; font-weight: 700; color: var(--ds-text-strong); }
/* 실시간 인기 = 오른쪽 넘침 가로 스크롤(Figma Section/Content Layout=slide, 카드 340) */
body.portal-site .portal-popular .portal-camp-card-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 340px; overflow-x: auto; padding-bottom: 4px; }
body.portal-site .portal-view-more { text-align: center; }

/* ---- B2B 유치 ---- */
body.portal-site .portal-b2b {
  background: var(--ds-dark);
  padding: 72px 20px;
}
body.portal-site .portal-b2b-inner { max-width: 1120px; margin: 0 auto; }
body.portal-site .portal-b2b-title {
  color: var(--ds-on-primary);
  font-size: 30px;
  line-height: 1.35;
  font-weight: var(--ds-font-h2-weight);
  margin: 0 0 16px;
}
body.portal-site .portal-b2b-desc {
  color: var(--ds-on-primary);
  font-size: var(--ds-font-body-s-size);
  margin: 0 0 28px;
}

/* ---- Footer ---- */
body.portal-site .portal-footer {
  background: var(--ds-dark);
  color: var(--ds-on-primary);
}
body.portal-site .portal-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 40px;
}
body.portal-site .portal-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; margin-bottom: 24px; }
body.portal-site .portal-footer-logo { display: block; width: 112px; height: auto; }
body.portal-site .portal-footer-lnk { color: var(--ds-on-primary); text-decoration: none; font-size: var(--ds-font-body-s-size); }
body.portal-site .portal-footer-lnk.point { font-weight: 700; }
body.portal-site .portal-footer-legal {
  font-style: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--ds-on-primary);
  font-size: 13px;
}
body.portal-site .portal-footer-intermediary,
body.portal-site .portal-footer-copyright {
  flex-basis: 100%;
  margin: 20px 0 0;
  font-size: var(--ds-font-caption-size);
}

/* ---- Mobile (375) ---- */
@media (max-width: 480px) {
  body.portal-site .portal-header-inner { flex-wrap: wrap; gap: 12px; min-height: 56px; padding: 8px 16px; }
  body.portal-site .portal-logo img { height: 22px; }
  body.portal-site .portal-nav { order: 3; flex-basis: 100%; }
  body.portal-site .portal-nav-list { gap: 16px; overflow-x: auto; }
  body.portal-site .portal-hero { min-height: 0; padding: 40px 16px; }
  body.portal-site .portal-hero-title { font-size: 28px; margin-bottom: 20px; }
  body.portal-site .portal-booking-form { flex-direction: column; align-items: stretch; }
  body.portal-site .portal-booking-field + .portal-booking-field { border-left: 0; border-top: 1px solid var(--ds-border); }
  body.portal-site .portal-camp-section { padding: 40px 16px; }
  body.portal-site .portal-camp-section + .portal-camp-section { padding-top: 0; }
  body.portal-site .portal-section-head { margin-bottom: 20px; }
  body.portal-site .portal-section-title { font-size: 22px; }
  /* Figma 모바일: 카드 줄은 오른쪽 넘침 가로 스크롤(카드 240) */
  body.portal-site .portal-camp-card-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 240px; gap: 12px; overflow-x: auto; }
  body.portal-site .portal-hero-inner { text-align: left; }
  body.portal-site .portal-popular .portal-camp-card-list { grid-auto-columns: 240px; }
  body.portal-site .portal-b2b { padding: 40px 16px; }
  body.portal-site .portal-footer-inner { padding: 40px 16px; }
}

/* ---- 단계4 포털 홈 섹션(H1~) — 콘솔 [홈 구성]이 순서·노출·문구를 정한다 ---- */
body.portal-site .portal-hero { position: relative; overflow: hidden; }
body.portal-site .portal-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .65; }
body.portal-site .portal-hero-inner { position: relative; }
/* Figma Public camps: surface 타일(p24·r12), 이름 22 bold, 캠핑장 수는 camping-text */
body.portal-site .portal-region-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
body.portal-site .portal-region-tile a { display: flex; flex-direction: column; gap: 10px; height: 100%; box-sizing: border-box; padding: 24px; overflow: hidden; border-radius: var(--ds-radius-card-portal); background: var(--ds-surface); color: var(--ds-text-strong); text-decoration: none; }
body.portal-site .portal-region-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; }
body.portal-site .portal-region-name { font-size: 22px; font-weight: 700; color: var(--ds-text-strong); }
body.portal-site .portal-region-cnt { font-size: var(--ds-font-body-s-size); font-weight: 700; color: var(--ds-camping-text); }
@media (max-width: 480px) {
  body.portal-site .portal-region-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  body.portal-site .portal-region-tile a { padding: 16px; }
}
body.portal-site .portal-review-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }
body.portal-site .portal-review-card { display: flex; flex-direction: column; gap: 10px; }
body.portal-site .portal-review-img { aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--ds-radius-card-portal); }
body.portal-site .portal-review-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.portal-site .portal-review-text { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--ds-font-body-m-size); font-weight: 700; color: var(--ds-text-strong); }
body.portal-site .portal-review-meta { font-size: 13px; color: var(--ds-text-muted); }
@media (max-width: 480px) {
  body.portal-site .portal-review-list { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
/* Figma Event: surface 배경 섹션(60), 배너 사진 720x300 왼쪽 + 문구 오른쪽 */
body.portal-site .portal-camp-section.portal-event { background: var(--ds-surface); padding: 60px 20px; }
body.portal-site .portal-event + .portal-camp-section { padding-top: 90px; }
body.portal-site .portal-event .portal-section-head { margin-bottom: 32px; }
body.portal-site .portal-event-list { display: flex; flex-direction: column; gap: 24px; margin: 0; padding: 0; list-style: none; }
body.portal-site .portal-event-card > a { display: grid; grid-template-columns: minmax(0, 720px) 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 48px; row-gap: 12px; color: var(--ds-text-strong); text-decoration: none; }
body.portal-site .portal-event-card img { grid-row: 1 / span 2; width: 100%; aspect-ratio: 12 / 5; object-fit: cover; border-radius: var(--ds-radius-card-portal); display: block; }
body.portal-site .portal-event-title { align-self: end; font-size: 26px; line-height: 1.35; font-weight: 700; color: var(--ds-text-strong); }
body.portal-site .portal-event-period { align-self: start; font-size: 15px; color: var(--ds-text-muted); }
@media (max-width: 480px) {
  body.portal-site .portal-camp-section.portal-event { padding: 40px 16px; }
  body.portal-site .portal-event + .portal-camp-section { padding-top: 40px; }
  body.portal-site .portal-event-card > a { grid-template-columns: 1fr; }
  body.portal-site .portal-event-card img { grid-row: auto; }
  body.portal-site .portal-event-title { font-size: 20px; }
}
