/* Roamendi v3 — 관광공사 방문 정보·축제 상세 화면. "바다 아침" 색(v2) 위에 얹는 마지막 층.
   하나의 인상: 축제 '입장권' — 날짜를 표 쪼가리(절취선)로 보여준다. 나머지는 조용하게. */
:root {
  --lantern: #d9472b;          /* 축제 표시에만 쓰는 등불색 */
  --lantern-soft: #fbe9e4;
  --mist: #e6f0f2;
  --tr-radius: 18px;
  --tr-ink-2: #3b4a5a;
}
:root[data-theme=dark] {
  --lantern: #ff7a5c;
  --lantern-soft: #3a1f1a;
  --mist: #13232e;
  --tr-ink-2: #b9c6d2;
}

/* ── 공통 ─────────────────────────── */
.tr-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--green); letter-spacing: -.01em; }
.tr-kicker .icon { width: 16px; height: 16px; }
.tr-muted { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0; }
.tr-source { margin: 28px 0 0; font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 72ch; }
.tr-source a, .tr-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tr-credit { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.tr-img { display: block; width: 100%; height: 100%; }
.tr-img.is-croppable { object-fit: cover; }
.tr-img.is-whole { object-fit: contain; }   /* 공공누리 제3유형: 자르지 않음 */
.tr-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.tr-link .icon { width: 15px; height: 15px; }
.tr-link:hover { border-color: var(--ink); }
.tr-link.is-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tr-link:focus-visible, .tr-directions a:focus-visible, .tr-fcard-link:focus-visible, .tr-near a:focus-visible, .tr-shot a:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.tr-directions { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--mist); }
.tr-directions > span { padding: 0 10px 0 12px; font-size: 14px; font-weight: 700; color: var(--green); }
.tr-directions a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.tr-directions a:hover { background: var(--ink); color: var(--paper); }
.tr-actions, .tr-fhero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }

/* 상태 표시: 진행 중은 등불색, 예정은 바다색, 종료는 회색 */
.tr-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: -.01em; background: var(--mist); color: var(--green); }
.tr-badge.is-ongoing { background: var(--lantern); color: #fff; }
.tr-badge.is-ended { background: var(--line); color: var(--muted); }
.tr-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--tr-ink-2); border: 1px solid var(--line); }

/* 사실 목록(주소·시간·요금·주차…): 표처럼 읽히게, 줄로만 구분 */
.tr-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; margin: 0; }
.tr-fact { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.tr-fact dt { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.6; }
.tr-fact dt .icon { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--green); }
.tr-fact dd { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.tr-facts.is-compact .tr-fact { grid-template-columns: 120px minmax(0, 1fr); padding: 12px 0; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tr-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 999px; background: var(--soft); font-size: 14px; color: var(--tr-ink-2); }
.tr-chip b { font-weight: 800; color: var(--ink); }
.tr-chip.is-yes { background: var(--mist); }
.tr-chip.is-no { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.tr-chip.is-heritage { background: var(--lantern-soft); }
.tr-prose { max-width: 70ch; }
.tr-prose p { margin: 0 0 12px; font-size: 16px; line-height: 1.85; color: var(--tr-ink-2); word-break: keep-all; }
.tr-prose.is-list p { position: relative; margin: 0; padding: 10px 0 10px 20px; border-bottom: 1px solid var(--line); line-height: 1.6; }
.tr-prose.is-list p::before { content: ""; position: absolute; left: 2px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--lantern); }
.tr-block { margin-top: 40px; }
.tr-block h2, .tr-block h3 { margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.tr-block h3 { font-size: 17px; }
.tr-more, .tr-overview { margin-top: 22px; border-top: 1px solid var(--line); }
.tr-more > summary, .tr-overview > summary { cursor: pointer; padding: 16px 0; font-weight: 800; font-size: 16px; color: var(--ink); list-style-position: inside; }
.tr-more > summary:focus-visible, .tr-overview > summary:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* 사진 모음: 가로로 넘기는 띠. 원본 비율 유지 */
.tr-gallery { margin-top: 34px; }
.tr-gallery-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.tr-shot { flex: 0 0 auto; margin: 0; height: 230px; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: var(--soft); scroll-snap-align: start; }
.tr-shot a { display: block; width: 100%; height: 100%; }

/* ── 여행지 상세: 방문 정보 ───────────── */
.tr-visit { margin: 36px 0; padding: 40px 44px 34px; border-radius: 28px; background: var(--paper); border: 1px solid var(--line); }
.tr-visit-head { margin-bottom: 18px; }
.tr-visit-head h2 { margin: 8px 0 0; font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.tr-visit.is-pending { padding: 28px 32px; background: transparent; border-style: dashed; }
.tr-visit.is-pending .tr-visit-head h2 { font-size: 22px; }

/* ── 축제 상세 ───────────────────────── */
.tr-festival { max-width: 1200px; margin: 0 auto; }
.tr-crumb { margin: 8px 0 22px; }
.tr-fhero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0; border-radius: 32px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.tr-fhero-media { position: relative; min-height: 420px; max-height: 620px; background: var(--soft); display: flex; flex-direction: column; }
.tr-fhero-media .tr-img { flex: 1; min-height: 0; }
.tr-fhero-media .tr-credit { margin: 0; padding: 10px 16px 12px; background: var(--soft); }
.tr-fhero-blank { flex: 1; display: grid; place-items: center; color: var(--green); }
.tr-fhero-blank .icon { width: 84px; height: 84px; opacity: .25; }
/* 입장권의 절취선: 사진과 글 사이 점선 + 위아래 반원 홈 */
.tr-fhero-copy { position: relative; padding: 46px 52px 44px 56px; border-left: 2px dashed var(--line); }
.tr-fhero-copy::before, .tr-fhero-copy::after { content: ""; position: absolute; left: -15px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.tr-fhero-copy::before { top: -15px; }
.tr-fhero-copy::after { bottom: -15px; }
.tr-fhero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-fhero h1 { margin: 18px 0 26px; font-size: clamp(32px, 4vw, 52px); line-height: 1.12; font-weight: 800; letter-spacing: -.05em; color: var(--ink); word-break: keep-all; }
.tr-stub { display: inline-flex; align-items: stretch; gap: 0; border-radius: 16px; background: var(--lantern-soft); color: var(--ink); position: relative; padding: 14px 22px 14px 22px; }
.tr-stub-day { display: flex; flex-direction: column; min-width: 92px; }
.tr-stub-day small { font-size: 13px; font-weight: 700; color: var(--lantern); }
.tr-stub-day strong { font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 4px 0 4px; }
.tr-stub-day em { font-style: normal; font-size: 14px; color: var(--tr-ink-2); }
.tr-stub-arrow { align-self: center; width: 34px; height: 2px; margin: 0 18px 0 6px; background: var(--lantern); position: relative; }
.tr-stub-arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--lantern); border-right: 0; }
.tr-stub-year { position: absolute; right: 14px; top: 10px; font-size: 12px; font-weight: 700; color: var(--lantern); opacity: .8; }
.tr-fperiod, .tr-fplace { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--tr-ink-2); }
.tr-fperiod { font-size: 14px; color: var(--muted); }
.tr-fperiod .icon, .tr-fplace .icon { width: 17px; height: 17px; margin-top: 3px; flex: none; color: var(--green); }
.tr-fplace { font-weight: 700; color: var(--ink); font-size: 17px; }
.tr-fgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; margin-top: 44px; align-items: start; }
.tr-fmain > .tr-facts { margin-top: 0; }
.tr-fside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.tr-mapcard, .tr-near { padding: 24px; border-radius: 24px; background: var(--paper); border: 1px solid var(--line); }
.tr-mapcard h2, .tr-near h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 18px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.tr-mapcard h2 .icon, .tr-near h2 .icon { width: 18px; height: 18px; color: var(--green); }
.tr-map { height: 240px; border-radius: 16px; overflow: hidden; background: var(--mist); z-index: 0; }
.tr-mapaddr { margin: 12px 0 0; font-size: 15px; font-weight: 700; line-height: 1.55; color: var(--ink); }
.tr-howto { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tr-howto h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 15px; font-weight: 800; color: var(--ink); }
.tr-howto h3 .icon { width: 16px; height: 16px; color: var(--green); }
.tr-howto .tr-prose p { font-size: 14.5px; line-height: 1.7; margin-bottom: 6px; }
.tr-near ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tr-near ul a { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.tr-near ul a:hover { background: var(--soft); }
.tr-near ul img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--soft); }
.tr-near strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.35; }
.tr-near small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.tr-empty, .tr-loading { max-width: 640px; margin: 60px auto; text-align: center; }
.tr-empty h1, .tr-loading h1 { font-size: 30px; letter-spacing: -.04em; margin: 10px 0 12px; }
.tr-empty .tr-link { margin-top: 18px; }

/* ── 축제 카드(입장권) ───────────────── */
.tr-fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tr-fcard { list-style: none; }
.tr-fcard-link { display: flex; flex-direction: column; height: 100%; border-radius: 22px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.tr-fcard-link:hover { border-color: var(--ink); }
.tr-fcard-media { position: relative; aspect-ratio: 4 / 3; background: var(--soft); }
.tr-fcard-media .tr-badge { position: absolute; left: 12px; top: 12px; }
.tr-fcard-blank { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--green); font-weight: 700; }
.tr-fcard-blank b { display: block; font-size: 54px; line-height: 1; letter-spacing: -.05em; }
.tr-fcard-body { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 14px; row-gap: 4px; padding: 18px 18px 20px; border-top: 2px dashed var(--line); flex: 1; }
.tr-fcard-body::before, .tr-fcard-body::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.tr-fcard-body::before { left: -12px; }
.tr-fcard-body::after { right: -12px; }
.tr-fcard-date { grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-start; padding-right: 14px; border-right: 1px solid var(--line); min-width: 64px; }
.tr-fcard-date b { font-size: 24px; font-weight: 800; letter-spacing: -.04em; color: var(--lantern); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tr-fcard-date i { font-style: normal; font-size: 13px; color: var(--muted); margin-top: 2px; }
.tr-fcard-region { font-size: 13px; font-weight: 700; color: var(--green); }
.tr-fcard-body strong { font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: -.03em; word-break: keep-all; }
.tr-fcard-meta { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.tr-fcard-meta .icon { width: 14px; height: 14px; margin-top: 3px; flex: none; }
.tr-fcard.is-ended .tr-fcard-link { opacity: .65; }
[data-festival-results] > .tr-fcard { margin-bottom: 16px; }
[data-festival-results]:has(> .tr-fcard) { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; align-content: start; }
[data-festival-results]:has(> .tr-fcard) > :not(.tr-fcard) { grid-column: 1 / -1; }
.tr-near-festivals { margin: 0 0 36px; padding: 0; background: none; border: 0; }
.tr-near-festivals h2 { font-size: 22px; }

/* 레일(가로 목록)의 작은 축제 카드에 사진 */
.compact-festival-thumb { width: 72px; height: 72px; flex: none; border-radius: 14px; overflow: hidden; background: var(--soft); margin-left: auto; }

/* ── 반응형 ──────────────────────────── */
@media (max-width: 1080px) {
  .tr-fgrid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .tr-fside { position: static; }
}
@media (max-width: 860px) {
  .tr-fhero { grid-template-columns: minmax(0, 1fr); border-radius: 26px; }
  .tr-fhero-media { min-height: 0; max-height: 72vh; }
  .tr-fhero-media .tr-img { aspect-ratio: 4 / 5; max-height: 64vh; }
  .tr-fhero-copy { padding: 34px 24px 28px; border-left: 0; border-top: 2px dashed var(--line); }
  .tr-fhero-copy::before, .tr-fhero-copy::after { top: -15px; bottom: auto; }
  .tr-fhero-copy::before { left: -15px; }
  .tr-fhero-copy::after { left: auto; right: -15px; }
  .tr-facts { grid-template-columns: minmax(0, 1fr); }
  .tr-visit { padding: 28px 20px 24px; border-radius: 22px; margin: 26px 0; }
}
@media (max-width: 520px) {
  .tr-fact { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 14px 0; }
  .tr-stub { width: 100%; padding: 14px 16px; }
  .tr-stub-day { min-width: 0; flex: 1; }
  .tr-stub-day strong { font-size: 32px; }
  .tr-stub-arrow { margin: 0 12px 0 0; width: 22px; }
  .tr-shot { height: 180px; }
  .tr-directions { flex-wrap: wrap; border-radius: 18px; }
  .tr-fhero h1 { font-size: 30px; margin: 14px 0 20px; }
  .tr-fcards, [data-festival-results]:has(> .tr-fcard) { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .tr-fcard-link { transition: none; } .tr-gallery-track { scroll-behavior: auto; } }
/* 사진을 못 불러왔을 때 안내 문구가 작은 칸을 밀어내지 않게 */
.tr-near ul a > .image-unavailable { display: block; width: 56px; height: 56px; flex: none; border-radius: 12px; background: var(--soft); font-size: 0; }
.tr-fcard-media > .image-unavailable, .tr-shot .image-unavailable, .tr-fhero-media > .image-unavailable { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font-size: 13px; color: var(--muted); background: var(--soft); }
.tr-fhero-media > .image-unavailable { position: static; flex: 1; }

/* 홈 바로가기 3칸: 세 번째(버튼)도 링크와 같은 모양 — 모바일에서 화면 밖으로 밀리던 문제 */
.journey-dock > button { display: flex; align-items: center; gap: 15px; padding: 13px 15px; min-width: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.journey-dock > button > .icon { margin-left: auto; width: 18px; }
@media (max-width: 760px) {
  .journey-dock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .journey-dock > a, .journey-dock > button { flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 14px 4px; gap: 8px; min-width: 0; }
  .journey-dock > button .journey-dock-symbol { flex-basis: 37px; width: 37px; height: 37px; border-radius: 11px; }
  .journey-dock strong { font-size: 14px; white-space: normal; word-break: keep-all; line-height: 1.35; }
  .journey-dock small, .journey-dock > a > .icon, .journey-dock > button > .icon { display: none; }
}
