/**
 * 엔스타일투어 리뉴얼 - 여행정보 (/info/)
 * base.css 다음에 로드
 * 테마: body[data-region="info"] (앤티크 골드 + 파치먼트, base.css 토큰)
 * 블로그 카드(.blog-grid) / 필터 탭(.filter-tabs) / 버튼은 base.css 공통 컴포넌트 사용
 */

/* ==========================================================
   1. 소개 + 지역 필터
   ========================================================== */
.info-hero { background: var(--region-sub); }

.info-hero .container { padding-top: 3.5rem; padding-bottom: 2.5rem; }

.info-eyebrow {
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 500;
  color: var(--region);
}

.info-heading { font-size: 2rem; font-weight: 800; letter-spacing: -1px; line-height: 1.3; }
.info-lead { max-width: 680px; margin-top: 0.9rem; font-size: 0.98rem; line-height: 1.8; color: var(--text-secondary); }

.info-filter { display: flex; align-items: center; gap: 1rem; margin-top: 2.25rem; }
.info-filter .filter-tabs { position: relative; flex: 1; min-width: 0; }
.info-filter-label { flex: none; font-size: 0.82rem; font-weight: 700; letter-spacing: 1px; color: var(--text-tertiary); }

/* ==========================================================
   2. 목록 공통 (섹션 / 더 보기)
   ========================================================== */
.info-section + .info-section { padding-top: 0; }
.info-more { display: flex; justify-content: center; margin-top: 2.5rem; }
.info-more[hidden] { display: none; }
.info-empty { grid-column: 1 / -1; padding: 4rem 0; color: var(--text-tertiary); text-align: center; }

/* ==========================================================
   3. Travel Spot (이미지에 제목이 들어간 480 x 200 배너 → 자르지 않고 원본 비율)
   ========================================================== */
.spot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem var(--grid-gap);
}

.ts-card { display: flex; flex-direction: column; } /* 같은 줄 카드의 제목 배경 높이 맞춤 */

.ts-thumb {
  overflow: hidden;
  aspect-ratio: 12 / 5;
  background: var(--ivory-2);
}

/* 이미지에 글자가 들어간 배너라 마우스 오버 확대 효과 없음 (제목 밑줄만) */
.ts-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 제목 영역: 테마 서브색 배경으로 이미지와 한 덩어리로 묶음 */
.ts-body { flex: 1; padding: 0.85rem 1.1rem 1rem; background: var(--region-sub); }
.ts-region { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.5px; color: var(--region); }

.ts-title {
  display: -webkit-box;
  margin-top: 0.25rem;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-primary);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ts-card:hover .ts-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ==========================================================
   4. Travel Spot 내용 보기 (본문 + 오른쪽 정보 영역)
   ========================================================== */
.ts-view { background: var(--white); }

/* 본문 칸은 이미지 폭(최대 980px)까지만, '본문 + 정보 영역' 묶음을 화면 가운데 배치 (좌우 여백 동일)
   화면이 좁으면 본문 칸이 줄어듦 (이미지는 확대하지 않음) */
.ts-layout {
  display: grid;
  grid-template-columns: minmax(0, 980px) 340px;
  justify-content: center;
  align-items: start;
  gap: 3rem;
}

.ts-main { min-width: 0; }

/* 관리자 등록 내용: 표 안에 이미지를 쌓은 구조 (한 줄에 이미지 여러 장을 나란히 놓은 표도 있음)
   - 표 구조와 이미지 배치는 그대로 유지 (운영 화면과 동일), 표는 가운데 정렬
   - 표 / 이미지는 확대하지 않고, 칸보다 넓으면 칸 폭에 맞춰 함께 축소
   - 넓은 영상·블록도 칸 폭을 넘지 않게 */
.ts-content { line-height: 1.8; word-break: break-word; overflow-wrap: anywhere; }
.ts-content table { max-width: 100%; height: auto !important; margin: 0 auto; border-collapse: collapse; }
.ts-content td { vertical-align: top; }
/* 이미지는 글자 흐름 그대로 (한 칸에 버튼 이미지 여러 개를 나란히 둔 경우 유지), 위쪽 정렬로 이미지 아래 빈틈 제거 */
.ts-content img { display: inline-block; max-width: 100%; height: auto !important; vertical-align: top; }
.ts-content iframe, .ts-content video, .ts-content div, .ts-content p { max-width: 100%; }
.ts-content iframe, .ts-content video { display: block; margin: 0 auto; }
.ts-content a { color: var(--region); }

.ts-foot { display: none; } /* PC 는 오른쪽 정보 영역의 버튼 사용 */

/* 오른쪽 정보 영역: 화면 높이가 충분하면 스크롤 시 상단 메뉴 아래에 따라옴 */
.ts-side { display: grid; gap: 2rem; }

@media (min-width: 1025px) and (min-height: 760px) {
  .ts-side { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

.ts-head { padding: 1.75rem 1.6rem; background: var(--region-sub); }

.ts-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; }

.ts-tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--region);
  font-size: 0.76rem;
  font-weight: 700;
}

.ts-view-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.5px; line-height: 1.45; }
.ts-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.75rem; font-size: 0.82rem; color: var(--text-tertiary); }
.ts-meta span + span::before { content: ''; display: inline-block; width: 1px; height: 0.8em; margin-right: 1rem; background: var(--line-strong); }

.ts-head-actions { display: grid; gap: 0.5rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--region-sub-deep); }
.ts-head-actions > a { width: 100%; height: 46px; padding: 0 1rem; }

/* 같은 지역 추천 여행지: PC 는 작은 썸네일 + 제목 가로형 (정보 영역이 화면 높이를 넘지 않게) */
.ts-related-title { margin-bottom: 0.9rem; font-size: 0.95rem; font-weight: 800; }
.ts-related-list { display: grid; gap: 0.75rem; }
.ts-related .ts-card { flex-direction: row; align-items: stretch; }
.ts-related .ts-thumb { flex: none; width: 132px; }
.ts-related .ts-body { display: flex; align-items: center; padding: 0.5rem 0.8rem; }
.ts-related .ts-title { margin-top: 0; font-size: 0.82rem; }

/* ==========================================================
   5. 반응형
   ========================================================== */
@media (max-width: 1024px) {
  .spot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 상세: 한 줄 (정보 → 본문 → 같은 지역 추천 여행지) */
  .ts-layout { display: flex; flex-direction: column; align-items: stretch; gap: 2rem; }
  .ts-side { display: contents; }
  .ts-head { order: 1; }
  .ts-main { order: 2; }
  .ts-related { order: 3; padding-top: 2rem; border-top: 1px solid var(--line); }
  .ts-head-actions { display: none; } /* 버튼은 본문 아래 */
  .ts-foot { display: flex; }
  .ts-related-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem var(--grid-gap); }
  .ts-related .ts-card { flex-direction: column; }
  .ts-related .ts-thumb { width: auto; }
  .ts-related .ts-body { display: block; padding: 0.75rem 1rem 0.9rem; }
  .ts-related .ts-title { font-size: 0.9rem; }
}

@media (max-width: 768px) {
  .info-hero .container { padding-top: 2.25rem; padding-bottom: 1.75rem; }
  .info-heading { font-size: 1.5rem; }
  .info-lead { font-size: 0.9rem; }
  .info-filter { flex-direction: column; align-items: stretch; gap: 0.6rem; margin-top: 1.5rem; }

  .spot-grid { grid-template-columns: 1fr; row-gap: 1.25rem; }
  .ts-body { padding: 0.75rem 1rem 0.9rem; }
  .info-more .btn-line { width: 100%; }

  .ts-layout { gap: 1.5rem; }
  .ts-head { padding: 1.25rem 1.1rem; }
  .ts-view-title { font-size: 1.2rem; }
  .ts-related { padding-top: 1.5rem; }
  .ts-related-list { grid-template-columns: 1fr; }
}
