:root {
  --bg: #f7f3e9;
  --ink: #050505;
  --river: #ffd000;
  --river-hot: #fff200;
  --river-dark: #d28f00;
  --blue: #2132f6;
  --lake-a: #fff46d;
  --lake-b: #ffd63a;
  --cyan: #00bfd6;
  --panel: rgba(255, 250, 226, 0.96);
}

@font-face {
  font-family: 'UTM Cooper Black';
  src: url('./fonts/COOPBL.TTF') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'UTM Cooper Black';
  src: url('./fonts/COOPBL.TTF') format('truetype');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cooper Black';
  src: url('./fonts/COOPBL.TTF') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cooper Black';
  src: url('./fonts/COOPBL.TTF') format('truetype');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Edwardian Script ITC';
  src: url('./fonts/ITCEDSCR.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Edwardian Script';
  src: url('./fonts/ITCEDSCR.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
}
button { font: inherit; }

.brand,
.node text,
.topic text,
.time text,
.timeline text,
.info-panel h2,
.connections-wrap h3,
.connection-badge {
  font-family: 'UTM Cooper Black', 'UTM Cooper', 'Cooper Black', 'Fraunces', serif;
}
.site {
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  background:
    radial-gradient(circle at 52% 50%, rgba(255, 211, 57, 0.12), transparent 24%),
    linear-gradient(180deg, #fbf8ef 0%, #f4efe5 100%);
  will-change: filter;
}
.map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
#riverMap {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

body.intro-pending .timeline,
body.intro-pending .river,
body.intro-pending .river-ribbon,
body.intro-pending .endpoints circle,
body.intro-pending .node,
body.intro-pending .branch-title,
body.intro-pending .topic,
body.intro-pending .time,
body.intro-pending .lake,
body.intro-pending .lake-mountain,
body.intro-pending .mountain,
body.intro-pending .river-points,
body.intro-pending .bg-v-icon,
body.intro-pending .brand-protect {
  opacity: 0 !important;
  animation: none !important;
  pointer-events: none !important;
}

body.intro-pending .river {
  stroke-dashoffset: var(--length, 2000px) !important;
}

body.intro-pending .brand-logo-gif {
  animation: popIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
  pointer-events: auto !important;
}

/* ─── Timeline ─── */
.timeline {
  opacity: 0;
  transform-origin: center top;
  animation: timelineIntro 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}
.timeline-main-line {
  stroke: var(--blue);
  stroke-width: 2;
}
.timeline-divider {
  stroke: var(--blue);
  stroke-width: 1.2;
}
.timeline .timeline-label {
  font-family: Arial, Helvetica, sans-serif !important;
  fill: var(--blue);
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
}
.label-right {
  font-size: 14px;
  line-height: 1.2;
}
.feather-path {
  fill: var(--blue);
}
#scroll-left path,
#scroll-right path {
  fill: var(--blue);
}

.time {
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
  transform-box: fill-box;
}
.time:hover {
  transform: scale(1.04);
}
.ticket-bg {
  fill: #ffff00;
  stroke: none;
  transition: stroke 0.2s ease, filter 0.2s ease;
}
.time:hover .ticket-bg {
  filter: brightness(1.05) drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}
.time.is-active .ticket-bg {
  stroke: none;
}
.time text {
  font-family: Impact, Haettenschweiler, 'Arial Black', sans-serif;
  fill: var(--ink);
  letter-spacing: 0;
  pointer-events: none;
  transition: fill 0.2s ease;
}
.time[data-era="present"] text {
  font-size: 40px;
}
.time[data-era="past"] text,
.time[data-era="future"] text {
  font-size: 30px;
}
.draft-note {
  fill: var(--cyan);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 3px;
}

/* ─── Rivers — clean vector strokes ─── */
.river-ribbons {
  display: none;
}
.river {
  fill: none;
  stroke: url(#lake);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  stroke-dasharray: var(--length, 2000px);
  stroke-dashoffset: var(--length, 2000px);
}
.river.flow-in {
  opacity: 1;
  stroke-dashoffset: 0;
}
.river.main.flow-in {
  transition: stroke-dashoffset 1.65s cubic-bezier(0.34, 1, 0.68, 1), opacity 0.2s ease;
}
.river.sub.flow-in {
  opacity: 0.98;
  transition: stroke-dashoffset 1.28s cubic-bezier(0.34, 1, 0.68, 1), opacity 0.2s ease;
}
.river.connector.flow-in {
  opacity: 0.46;
  transition: stroke-dashoffset 1.35s cubic-bezier(0.34, 1, 0.68, 1), opacity 0.2s ease;
}

.river.main { stroke-width: 24px; }
.river.sub { stroke-width: 14px; }
.river.connector { stroke-width: 10px; }
.river.sub[data-topic="vinav"] { stroke-width: 9px; }

/* ─── Endpoints ─── */
.endpoints circle {
  fill: var(--blue);
  stroke: #ffffff;
  stroke-width: 1.5;
  transform-origin: center;
  transform-box: fill-box;
  opacity: 0;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 4.8s forwards;
  transition: fill 0.3s ease, stroke 0.3s ease, transform 0.3s ease;
}
.endpoints circle:hover,
.endpoints circle.is-hovered {
  fill: #ff0000 !important;
  stroke: #ffffff !important;
  transform: scale(1.2);
}

/* ─── Lake ─── */
.lake {
  fill: url(#lake);
  stroke: none;
  transform-origin: 800px 455px;
  animation: lakeIntro 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards;
}
.brand {
  font-family: 'Outfit', sans-serif;
  fill: var(--ink);
  font-size: 58px;
  font-weight: 900;
  letter-spacing: -3px;
  pointer-events: none;
  opacity: 0;
  transform-origin: 800px 455px;
  animation: popIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s forwards;
}
.brand-protect {
  fill: transparent;
  pointer-events: none;
}
.brand-logo-gif {
  cursor: default;
  pointer-events: auto;
  transform-origin: 800px 440px;
  transform-box: view-box;
  outline: none !important;
  stroke: none !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-focus-ring-color: transparent;
}
.brand-logo-gif:focus,
.brand-logo-gif:focus-visible,
.brand-logo-gif.playing-music,
.brand-logo-gif.playing-music:focus,
.brand-logo-gif.playing-music:focus-visible {
  outline: none !important;
  stroke: none !important;
  filter: none !important;
}

/* ─── Mountains ─── */
.mountains,
.river-points {
  pointer-events: none;
}
.river-points {
  opacity: 0;
}
.mountain {
  opacity: 0;
  animation: mountainFadeIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
}
.lake-mountain {
  opacity: 0;
  animation: mountainFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.3s;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* ─── Nodes ─── */
.node {
  cursor: pointer;
  outline: none;
  transition: transform 160ms ease;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.node[data-branch="1"] { animation-delay: 3.1s; }
.node[data-branch="2"] { animation-delay: 3.4s; }
.node[data-branch="3"] { animation-delay: 3.2s; }
.node[data-branch="4"] { animation-delay: 3.3s; }
.node[data-branch="5"] { animation-delay: 3.0s; }
.node circle {
  fill: var(--blue);
  stroke: none;
  transition: fill 0.2s ease;
}
.node text {
  fill: #fff;
  font-size: 36px;
  font-weight: 800;
  pointer-events: none;
  dominant-baseline: central;
  transition: fill 0.2s ease;
}
.node:hover,
.node.is-active {
  transform: scale(1.12);
}
.node:hover circle,
.node.is-active circle {
  fill: #ff0000;
}
.node:hover text,
.node.is-active text {
  fill: #ffffff;
}

/* ─── Branch titles at endpoints ─── */
.branch-title {
  fill: var(--ink);
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0;
  animation: textFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 3.8s forwards;
}

/* ─── Topics ─── */
.topic {
  cursor: pointer;
  outline: none;
  opacity: 0;
  animation: textFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 5.0s forwards;
}
.topic text {
  fill: var(--ink);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  paint-order: stroke fill;
  stroke: var(--bg);
  stroke-width: 5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topic text.topic-script {
  font-family: 'Edwardian Script ITC', 'Edwardian Script', 'Great Vibes', 'Herr Von Muellerhoff', 'Pinyon Script', cursive;
  font-size: 31px;
  font-weight: normal;
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 0.2px;
  letter-spacing: 0.5px;
  pointer-events: none;
  transform: translate(0px, -2px);
  paint-order: fill stroke;
}
.topic rect {
  fill: rgba(255, 211, 57, 0.28);
}
.topic:hover text,
.topic.is-active text,
.topic.is-hovered text { fill: #ff0000; }
.topic:hover text.topic-script,
.topic.is-active text.topic-script,
.topic.is-hovered text.topic-script {
  fill: #ffffff !important;
  stroke: #000000 !important;
}
.topic.is-faded { opacity: 0.22; }

/* ─── Focus and Zoom States ─── */
#riverMap.has-focus .river,
#riverMap.has-focus .river-ribbon,
#riverMap.has-focus .endpoints circle,
#riverMap.has-focus .topic,
#riverMap.has-focus .node,
#riverMap.has-focus .mountain {
  opacity: 0.15;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river.connector {
  opacity: 0.08;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river-ribbon.connector {
  opacity: 0.08;
}
#riverMap.has-focus .river.is-active,
#riverMap.has-focus .river.is-connected,
#riverMap.has-focus .river-ribbon.is-active,
#riverMap.has-focus .river-ribbon.is-connected,
#riverMap.has-focus .endpoints circle.is-active,
#riverMap.has-focus .endpoints circle.is-connected,
#riverMap.has-focus .topic.is-active,
#riverMap.has-focus .topic.is-connected,
#riverMap.has-focus .node.is-active,
#riverMap.has-focus .node.is-connected {
  opacity: 1 !important;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river.connector.is-connected {
  opacity: 0.8 !important;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river-ribbon.connector.is-connected {
  opacity: 0.68 !important;
}
#riverMap.has-focus .endpoints circle.is-active {
  fill: #ff0000 !important;
  stroke: #ffffff !important;
}
#riverMap.has-focus .endpoints circle.is-connected {
  fill: var(--blue) !important;
  stroke: #ffffff !important;
}

/* ─── Map Backdrop Overlay ─── */
.map-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.3s ease;
}
.map-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Info Popup Modal ─── */
.info-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  width: min(1040px, 70vw);
  min-width: min(720px, calc(100vw - 32px));
  aspect-ratio: 16 / 10;
  min-height: 52vh;
  min-height: 52dvh;
  background: transparent;
  border: none;
  z-index: 1000;
  box-shadow: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(33, 50, 246, 0.2) transparent;
}
.info-panel::-webkit-scrollbar {
  width: 6px;
}
.info-panel::-webkit-scrollbar-track {
  background: transparent;
}
.info-panel::-webkit-scrollbar-thumb {
  background: rgba(33, 50, 246, 0.2);
  border-radius: 3px;
}
.info-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header Section */
.modal-main-box {
  border: 3px solid var(--blue);
  background: #fff;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  margin-bottom: clamp(10px, 1.4vh, 16px);
  min-height: 0;
  overflow: hidden;
}
.modal-header {
  background: #ff0000;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--blue);
}
.modal-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  margin-right: 24px;
}
.modal-num-circle {
  background: var(--blue);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'UTM Cooper Black', 'Cooper Black', 'Fraunces', serif !important;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
  padding-bottom: 2px;
}
.modal-home-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease;
}
.modal-home-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2.5px;
  background-color: #000;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
  z-index: 3;
}
.modal-home-wrap:hover {
  transform: scale(1.03);
}
.modal-home-wrap:hover::after {
  transform: scaleX(1);
}
.modal-home-title {
  color: #000;
  font-family: 'UTM Cooper Black', 'Cooper Black', serif;
  font-size: 24px;
}
.topic rect {
  fill: rgba(255, 211, 57, 0.28);
}
.topic:hover text,
.topic.is-active text,
.topic.is-hovered text { fill: #ff0000; }
.topic:hover text.topic-script,
.topic.is-active text.topic-script,
.topic.is-hovered text.topic-script {
  fill: #ffffff !important;
  stroke: #000000 !important;
}
.topic.is-faded { opacity: 0.22; }

/* ─── Focus and Zoom States ─── */
#riverMap.has-focus .river,
#riverMap.has-focus .river-ribbon,
#riverMap.has-focus .endpoints circle,
#riverMap.has-focus .topic,
#riverMap.has-focus .node,
#riverMap.has-focus .mountain {
  opacity: 0.15;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river.connector {
  opacity: 0.08;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river-ribbon.connector {
  opacity: 0.08;
}
#riverMap.has-focus .river.is-active,
#riverMap.has-focus .river.is-connected,
#riverMap.has-focus .river-ribbon.is-active,
#riverMap.has-focus .river-ribbon.is-connected,
#riverMap.has-focus .endpoints circle.is-active,
#riverMap.has-focus .endpoints circle.is-connected,
#riverMap.has-focus .topic.is-active,
#riverMap.has-focus .topic.is-connected,
#riverMap.has-focus .node.is-active,
#riverMap.has-focus .node.is-connected {
  opacity: 1 !important;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river.connector.is-connected {
  opacity: 0.8 !important;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
#riverMap.has-focus .river-ribbon.connector.is-connected {
  opacity: 0.68 !important;
}
#riverMap.has-focus .endpoints circle.is-active {
  fill: #ff0000 !important;
  stroke: #ffffff !important;
}
#riverMap.has-focus .endpoints circle.is-connected {
  fill: var(--blue) !important;
  stroke: #ffffff !important;
}

/* ─── Map Backdrop Overlay ─── */
.map-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.3s ease;
}
.map-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Info Popup Modal ─── */
.info-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  width: min(1040px, 70vw);
  min-width: min(720px, calc(100vw - 32px));
  aspect-ratio: 16 / 10;
  min-height: 52vh;
  min-height: 52dvh;
  background: transparent;
  border: none;
  z-index: 1000;
  box-shadow: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(33, 50, 246, 0.2) transparent;
}
.info-panel::-webkit-scrollbar {
  width: 6px;
}
.info-panel::-webkit-scrollbar-track {
  background: transparent;
}
.info-panel::-webkit-scrollbar-thumb {
  background: rgba(33, 50, 246, 0.2);
  border-radius: 3px;
}
.info-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.info-panel.no-slider {
  aspect-ratio: auto !important;
  min-height: auto !important;
  height: auto !important;
}
.info-panel.no-slider .modal-main-box {
  margin-bottom: 0 !important;
  flex: 0 0 auto !important;
}


/* Header Section */
.modal-main-box {
  border: 3px solid var(--blue);
  background: #fff;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  margin-bottom: clamp(10px, 1.4vh, 16px);
  min-height: 0;
  overflow: hidden;
}
.modal-header {
  background: #ff0000;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--blue);
}
.modal-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  margin-right: 24px;
}
.modal-num-circle {
  background: var(--blue);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'UTM Cooper Black', 'Cooper Black', 'Fraunces', serif !important;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
  padding-bottom: 2px;
}
.modal-home-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease;
}
.modal-home-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2.5px;
  background-color: #000;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
  z-index: 3;
}
.modal-home-wrap:hover {
  transform: scale(1.03);
}
.modal-home-wrap:hover::after {
  transform: scaleX(1);
}
.modal-title-separator {
  color: #000;
  font-family: 'UTM Cooper Black', 'Cooper Black', serif;
  font-size: 24px;
  font-weight: bold;
  opacity: 0.6;
  pointer-events: none;
}
.modal-title-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}
.modal-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.btn-back {
  background: transparent;
  color: #fff;
  border: 3px solid #fff;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: background 0.15s ease;
}
#btnModalWorks {
  display: none !important;
}
.btn-lang {
  background: transparent;
  color: var(--blue);
  border: 3px solid var(--blue);
  height: 24px;
  padding: 0 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-lang.active {
  background: var(--blue);
  color: #fff;
  border: 3px solid var(--blue);
}
.btn-lang:hover {
  background: rgba(33, 50, 246, 0.15);
  color: var(--blue);
}
.btn-lang.active:hover {
  background: var(--blue);
  color: #fff;
}
.btn-close {
  background: transparent;
  color: var(--blue);
  border: 3px solid var(--blue);
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: background 0.15s ease;
}
.btn-close:hover {
  background: rgba(33, 50, 246, 0.18);
}

/* Content Box */
.modal-content-box {
  background: #fff;
  padding: 24px;
  color: var(--blue);
  font-family: 'Arial', sans-serif;
  font-size: 16.5px;
  line-height: 1.55;
  font-weight: normal;
  text-align: left;
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
}
.lang-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(33, 50, 246, 0.46);
  margin-top: 14px;
  margin-bottom: 4px;
  font-weight: bold;
}
.lang-label:first-of-type {
  margin-top: 0;
}
#modalBodyVie,
#topicBodyVie {
  display: block;
}
#modalBodyEn,
#modalBodyVie,
#topicBodyEn,
#topicBodyVie {
  white-space: pre-wrap;
}

.topic-credit {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 0.76em;
  font-style: italic;
  opacity: 0.5;
}

.topic-credit-50 {
  opacity: 0.5;
}

#topicBodyEn a,
#topicBodyVie a,
#modalBodyEn a,
#modalBodyVie a {
  color: var(--blue);
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.15s ease-in-out;
}
#topicBodyEn a:hover,
#topicBodyVie a:hover,
#modalBodyEn a:hover,
#modalBodyVie a:hover {
  color: #ff0000;
}



/* Cards Slider Section */
.cards-slider-wrap {
  --related-card-max-width: clamp(220px, 20vw, 280px);
  --related-card-gap: clamp(10px, 1vw, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 clamp(12px, 1.2vw, 16px) clamp(10px, 1.4vh, 16px);
  position: relative;
  gap: clamp(8px, 1vw, 12px);
  flex: 0 0 auto;
}
.slider-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(33, 50, 246, 0.24);
}
.slider-btn:hover {
  transform: scale(1.1);
}
.cards-container {
  display: flex;
  gap: var(--related-card-gap);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px;
  width: 100%;
  max-width: calc(var(--related-card-max-width) + var(--related-card-max-width) + var(--related-card-gap) + 8px);
  min-width: 0;
  flex: 1 1 calc(var(--related-card-max-width) + var(--related-card-max-width) + var(--related-card-gap) + 8px);
  -ms-overflow-style: none;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding: 4px;
}
.cards-container::-webkit-scrollbar {
  display: none;
}
.topic-card {
  flex: 0 0 calc((100% - var(--related-card-gap)) / 2);
  min-width: 0;
  border: 2.5px solid var(--blue);
  background: #ff0000;
  display: flex;
  flex-direction: column;
  aspect-ratio: 4 / 3;
  height: auto;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: 0;
  overflow: hidden;
  scroll-snap-align: start;
}
.topic-card:hover {
  background: #ffff00;
  transform: scale(1.018);
  box-shadow: 0 6px 16px rgba(33, 50, 246, 0.18);
}
.topic-card:hover .card-image-placeholder {
  background: transparent;
}
.card-header {
  padding: 4px 8px;
  border-bottom: 2.5px solid var(--blue);
  font-family: 'UTM Cooper Black', 'Cooper Black', sans-serif;
  text-align: left;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  background: #ff0000;
  color: #000;
  transition: background 0.2s ease;
  height: clamp(68px, 8vh, 82px);
  justify-content: center;
}
.card-title-main-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.card-title-main {
  font-size: clamp(18px, 2.2vh, 22px);
  font-weight: 900;
  text-transform: none;
  letter-spacing: -0.2px;
  font-style: italic;
  position: relative;
  z-index: 1;
}
.card-title-main-script {
  position: absolute;
  top: 50%;
  left: 5px;
  transform: translateY(-50%) translateY(1px);
  color: #ffffff !important;
  -webkit-text-stroke: 0.2px #000000 !important;
  font-family: 'Edwardian Script ITC', 'Edwardian Script', 'Great Vibes', 'Herr Von Muellerhoff', 'Pinyon Script', cursive;
  font-size: clamp(25px, 3.1vh, 31px);
  font-weight: normal;
  font-style: normal;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.card-title-sub {
  font-size: clamp(8.5px, 1vh, 10px);
  font-weight: normal;
  text-transform: uppercase;
  margin-top: 1px;
  opacity: 0.85;
}
.topic-card:hover .card-header {
  background: #ffff00 !important;
  color: #000000 !important;
}
.topic-card:hover .card-title-main-script {
  color: #ffffff !important;
  -webkit-text-stroke: 0.2px #000000 !important;
}
.card-image-placeholder {
  flex: 1;
  background: transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-image-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 130%;
  height: 130%;
  background: repeating-linear-gradient(45deg, rgba(33, 50, 246, 0.025), rgba(33, 50, 246, 0.025) 8px, transparent 8px, transparent 16px);
  pointer-events: none;
  z-index: 2;
}
.card-image-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  z-index: 1;
}
.card-image-placeholder img[src*="chair6.jpg"] {
  object-position: center;
}
.topic-card:hover .card-image-placeholder img {
  filter: grayscale(0%);
}

/* ─── Animation Keyframes ─── */
@keyframes lakeIntro {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes textFadeIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes timelineIntro {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes mountainFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@media (max-width: 1180px) and (min-width: 769px) {
  .info-panel {
    width: min(980px, calc(100vw - 28px));
    min-width: 0;
  }

  .topic-content-box {
    gap: 18px;
  }
}

/* ─── Redesigned Header Branch Breadcrumbs ─── */
.modal-branch-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal-branch-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2.5px;
  background-color: #000;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
  z-index: 3;
}
.modal-branch-wrap:hover {
  transform: scale(1.03);
  opacity: 0.85;
}
.modal-branch-wrap:hover::after {
  transform: scaleX(1);
}

/* ─── Redesigned Two-Column Topic Layout ─── */
.topic-content-box {
  display: flex;
  flex: 1 1 auto;
  gap: clamp(16px, 2vw, 24px);
  padding: 24px;
  background: #fff;
  color: var(--blue);
  font-family: 'Arial', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-weight: normal;
  text-align: left;
  max-height: none;
  overflow: hidden;
}
.topic-left-col {
  flex: 1.25;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.topic-right-col {
  flex: 0.75;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topic-detail-title-wrap {
  position: relative;
  display: block;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  margin-bottom: 4px;
}
.topic-desc-wrap {
  flex: 1;
  overflow-y: auto;
  max-height: clamp(150px, 35vh, 290px);
  padding-right: 4px;
}
.modal-content-box::-webkit-scrollbar,
.topic-desc-wrap::-webkit-scrollbar {
  width: 6px;
}
.modal-content-box::-webkit-scrollbar-track,
.topic-desc-wrap::-webkit-scrollbar-track {
  background: rgba(33, 50, 246, 0.05);
}
.modal-content-box::-webkit-scrollbar-thumb,
.topic-desc-wrap::-webkit-scrollbar-thumb {
  background: rgba(33, 50, 246, 0.2);
}

/* ─── Interactive Image Slideshow ─── */
.slideshow-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 40vh;
  max-height: 40dvh;
  border: 3px solid var(--blue);
  background: #fbfaf5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slideshow-image-wrap {
  width: 100%;
  height: 100%;
}
.slideshow-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  display: block;
  background: #000;
}
.slideshow-sound-toggle {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 12;
  border: 2px solid var(--blue);
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue);
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slideshow-sound-toggle:hover {
  background: #ffff00;
}
.slideshow-sound-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.slideshow-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(33, 50, 246, 0.82);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.slideshow-nav-btn svg {
  width: 17px;
  height: 17px;
}
.slideshow-nav-btn:hover {
  background: var(--blue);
  transform: translateY(-50%) scale(1.08);
}
.slideshow-nav-btn.prev {
  left: 10px;
}
.slideshow-nav-btn.next {
  right: 10px;
}
.slideshow-enlarge-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
  border: 2px solid var(--blue);
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s ease, transform 0.15s ease;
}
.slideshow-enlarge-btn:hover {
  background: #ffff00;
  transform: scale(1.08);
}
.slideshow-caption {
  font-family: 'Arial', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--blue) !important;
  background: transparent !important;
  border: none !important;
  padding: 2px 0 0 0 !important;
  text-align: left;
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

/* ─── Fullscreen Lightbox Overlay ─── */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lightbox-overlay.open {
  display: flex;
  opacity: 1;
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.lightbox-image-wrap img {
  width: auto !important;
  height: auto !important;
  max-width: 90vw !important;
  max-height: 85vh !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block !important;
}
.lightbox-image-wrap svg {
  max-width: 90vw !important;
  max-height: 85vh !important;
  width: auto !important;
  height: auto !important;
  aspect-ratio: 4 / 3 !important;
  display: block !important;
}
.lightbox-image-wrap iframe {
  max-width: 90vw !important;
  max-height: 85vh !important;
  width: min(800px, 90vw) !important;
  height: min(600px, 67.5vw) !important;
  aspect-ratio: 4 / 3 !important;
  display: block !important;
  border: none !important;
}
.lightbox-image-wrap video {
  width: auto !important;
  height: auto !important;
  max-width: 90vw !important;
  max-height: 85vh !important;
  aspect-ratio: 4 / 3 !important;
  object-fit: contain !important;
  display: block !important;
  background: #000 !important;
}
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(33, 50, 246, 0.82);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2010;
  transition: background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}
.lightbox-nav-btn:hover {
  background: var(--blue);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-nav-btn.prev {
  left: 24px;
}
.lightbox-nav-btn.next {
  right: 24px;
}
.lightbox-close-btn {
  position: absolute;
  top: -45px;
  right: -4px;
  background: transparent;
  color: #fff;
  border: 3px solid #fff;
  width: 36px;
  height: 36px;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
  body {
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: none;
  }

  .site {
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    min-width: unset;
    min-height: unset;
  }

  #riverMap {
    touch-action: none;
    cursor: grab;
  }

  #riverMap.is-dragging {
    cursor: grabbing;
  }

  .info-panel {
    width: min(680px, calc(100vw - 24px));
    min-width: 0;
    aspect-ratio: auto;
  }

  .cards-slider-wrap {
    --related-card-max-width: 230px;
  }

  .topic-content-box {
    flex-direction: column;
    padding: 12px;
    gap: 16px;
    max-height: calc(100vh - 230px);
    max-height: calc(100dvh - 230px);
    overflow-y: auto;
  }

  .topic-desc-wrap {
    max-height: 140px;
  }

  /* Hide timeline feather/scroll decorations on mobile for clarity */
  .timeline use[href="#feather-motif"],
  .timeline use[href="#scroll-left"],


  .timeline use[href="#scroll-right"] {
    opacity: 0.5;
  }

  .lightbox-nav-btn {
    width: 36px;
    height: 36px;
  }
  .lightbox-nav-btn.prev {
    left: 10px;
  }
  .lightbox-nav-btn.next {
    right: 10px;
  }
}

/* Tablet portrait */
@media (min-width: 769px) and (max-width: 1024px) {
  #riverMap {
    touch-action: none;
    cursor: grab;
  }

  #riverMap.is-dragging {
    cursor: grabbing;
  }
}

/* Hide modal header breadcrumb ancestors on screens <= 1024px to prevent overflow */
@media (max-width: 1024px) {
  .is-branch-view #modalHomeBtn,
  .is-branch-view #modalHomeBtn + .modal-title-separator {
    display: none !important;
  }
  
  .is-topic-view #modalHomeBtn,
  .is-topic-view #modalHomeBtn + .modal-title-separator,
  .is-topic-view #modalBranchLink,
  .is-topic-view #modalSecondSeparator {
    display: none !important;
  }
}

/* Narrower, shrink-to-fit info panel on desktop specifically for branch view */
@media (min-width: 1025px) {
  .info-panel {
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
  }
  .info-panel.is-branch-view {
    width: min(1014px, 65vw);
    aspect-ratio: auto;
    min-height: 0;
  }
}

/* ─── Centered Line-by-Line Double-Layered Typography ─── */
.title-row {
  display: block;
  position: relative;
  width: 100%;
}
.title-line-wrapper {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.title-line-base {
  display: inline-block;
  color: inherit;
  font: inherit;
  font-style: inherit;
  font-weight: inherit;
}
.title-line-script {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  color: #ffffff !important;
  -webkit-text-stroke: 0.25px #000000 !important;
  font-family: 'Edwardian Script ITC', 'Edwardian Script', 'Great Vibes', 'Herr Von Muellerhoff', 'Pinyon Script', cursive !important;
  font-size: 1.275em !important;
  font-weight: normal !important;
  font-style: normal !important;
  pointer-events: none;
  z-index: 2;
}

/* Base text overrides for components */
.modal-title-wrap .title-line-base,
.modal-home-wrap .title-line-base,
.modal-branch-wrap .title-line-base {
  color: #000;
  font-family: 'UTM Cooper Black', 'Cooper Black', serif;
  font-size: 24px;
  font-weight: bold;
  font-style: italic;
  letter-spacing: -0.5px;
}
.topic-detail-title-wrap .title-line-base {
  color: #000;
  font-family: 'UTM Cooper Black', 'Cooper Black', serif;
  font-size: 32px;
  font-weight: bold;
  font-style: italic;
  letter-spacing: -0.5px;
  line-height: 36px;
}
.card-title-main-wrap .title-line-base {
  font-family: 'UTM Cooper Black', 'Cooper Black', serif;
  font-size: clamp(18px, 2.2vh, 22px);
  font-weight: 900;
  text-transform: none;
  letter-spacing: -0.2px;
  font-style: italic;
}
.modal-home-wrap, .modal-branch-wrap {
  overflow: visible !important;
}

.info-panel.is-topic-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(273px, 26vw, 325px);
  gap: clamp(21px, 2.3vw, 29px);
  width: min(1480px, calc(100vw - 56px));
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  overflow: visible !important;
  overflow-y: visible !important;
}
.info-panel.is-topic-view.no-slider {
  grid-template-columns: minmax(0, 1fr);
}
.info-panel.is-topic-view .modal-main-box {
  margin: 0;
  min-height: clamp(715px, 82vh, 1060px);
  max-height: clamp(715px, 82vh, 1060px);
  border: 3px solid var(--blue);
  background: #fff;
  overflow: hidden;
  align-self: center;
}
.info-panel.is-topic-view .modal-header {
  position: relative;
  min-height: 54px;
  padding: 6px 10px 6px 14px;
  background: #ff0000;
  border-bottom: 3px solid var(--blue);
}
.info-panel.is-topic-view .modal-header-left {
  flex: 1 1 auto;
  margin-right: 120px;
  gap: clamp(6px, 0.8vw, 10px);
  overflow: visible;
  display: flex;
  align-items: center;
}
.info-panel.is-topic-view .modal-home-wrap,
.info-panel.is-topic-view .modal-title-separator {
  display: none !important;
}
.info-panel.is-topic-view .modal-num-circle,
.info-panel.is-branch-view .modal-num-circle {
  width: clamp(34px, 3.2vw, 42px) !important;
  height: clamp(34px, 3.2vw, 42px) !important;
  font-size: clamp(18px, 1.8vw, 22px) !important;
  padding-bottom: 2px !important;
  flex: 0 0 auto !important;
}
.info-panel.is-topic-view .modal-title-wrap,
.info-panel.is-topic-view .modal-branch-wrap {
  display: inline-flex !important;
  min-width: 0;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
  text-align: left;
  align-items: center;
}
.info-panel.is-topic-view .modal-title-wrap .title-line-base,
.info-panel.is-topic-view .modal-branch-wrap .title-line-base {
  color: #000;
  font-size: clamp(16px, 1.8vw, 20px) !important;
  line-height: 1.15 !important;
  letter-spacing: 0;
}
.info-panel.is-topic-view .modal-title-wrap .title-line-script,
.info-panel.is-topic-view .modal-branch-wrap .title-line-script {
  transform: translate(-50%, -50%) scale(1) !important;
}
.info-panel.is-topic-view #modalSecondSeparator {
  display: inline-flex !important;
  font-size: clamp(14px, 1.6vw, 19px);
  align-items: center;
  justify-content: center;
}
.info-panel.is-topic-view .modal-header-right {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  gap: 8px;
  display: flex;
  align-items: center;
}
.info-panel.is-topic-view .btn-lang {
  display: inline-flex;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}
.info-panel.is-topic-view .btn-close {
  width: 24px;
  height: 24px;
  color: var(--blue);
  border-color: var(--blue);
  font-size: 14px;
}
.info-panel.is-topic-view .topic-content-box {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(18px, 2vw, 24px);
  gap: clamp(24px, 3vw, 34px);
  background: #fff;
  overflow: hidden;
}
.info-panel.is-topic-view .topic-right-col {
  order: 1;
  flex: 0 0 min(52%, 420px);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.info-panel.is-topic-view .topic-left-col {
  order: 2;
  flex: 1 1 auto;
  min-width: 230px;
  min-height: 0;
  gap: 18px;
  padding-top: 2px;
}
.info-panel.is-topic-view .slideshow-container {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  background: #7f7f7b;
}
.info-panel.is-topic-view .slideshow-image-wrap {
  background: #7f7f7b;
}
.info-panel.is-topic-view .slideshow-caption {
  display: block !important;
  margin-top: 8px !important;
}
.info-panel.is-topic-view .topic-detail-title-wrap {
  margin: 0;
  text-align: left;
}
.info-panel.is-topic-view .topic-detail-title-wrap .title-row + .title-row {
  margin-top: 2px;
}
.info-panel.is-topic-view .topic-detail-title-wrap .title-line-base {
  color: #000;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
  font-style: normal;
  white-space: nowrap;
}
.info-panel.is-topic-view .topic-detail-title-wrap .title-line-script {
  display: inline-block;
  transform: translate(-50%, -50%) scale(1) !important;
}
.info-panel.is-topic-view .topic-desc-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 8px;
  color: var(--blue);
  font-family: Arial, sans-serif;
  font-size: clamp(17px, 2.3vh, 22px) !important;
  line-height: 1.35;
}
.info-panel.is-topic-view .cards-slider-wrap {
  --related-card-gap: 18px;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  height: clamp(715px, 82vh, 1060px);
  max-height: clamp(715px, 82vh, 1060px);
  margin: 0;
  gap: 10px;
}
.info-panel.is-topic-view.no-slider .cards-slider-wrap {
  display: none !important;
}
.info-panel.is-topic-view .cards-container {
  flex: 1 1 0;
  height: 100%;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-content: flex-start;
  align-items: center;
  gap: var(--related-card-gap);
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 0 4px;
}
.info-panel.is-topic-view .topic-card {
  flex: 0 0 calc((100% - 2 * var(--related-card-gap)) / 3);
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.info-panel.is-topic-view .topic-card .card-image-placeholder {
  flex: 1 1 auto;
  min-height: 0;
}
.info-panel.is-topic-view .card-header {
  flex-shrink: 0;
  height: auto;
  min-height: clamp(52px, 7vh, 66px) !important;
  padding: 4px 8px !important;
  justify-content: center;
}
.info-panel.is-topic-view .card-title-main-wrap .title-line-base {
  font-size: clamp(16px, 1.8vw, 20px) !important;
  line-height: 1.15 !important;
}

.info-panel.is-topic-view .card-title-sub {
  font-size: clamp(11px, 1.2vw, 14px);
  line-height: 1.1;
  margin-top: 1px;
}
.card-title-sub .title-line-base {
  font-family: 'UTM Cooper Black', 'Cooper Black', serif;
  font-weight: bold;
  text-transform: none;
}
.info-panel.is-topic-view .slider-btn {
  width: 40px;
  height: 40px;
  align-self: center;
}
.info-panel.is-topic-view #sliderPrevBtn svg {
  transform: rotate(90deg) !important;
}
.info-panel.is-topic-view #sliderNextBtn svg {
  transform: rotate(90deg) !important;
}

@media (max-width: 1024px) and (orientation: portrait) {
  /* General rules for all mobile portrait viewports */
  .info-panel {
    width: min(680px, calc(100vw - 24px)) !important;
    min-width: 0 !important;
    aspect-ratio: auto !important;
    min-height: auto !important;
    height: 86vh !important;
    height: 86dvh !important;
    height: 86svh !important;
    max-height: 86vh !important;
    max-height: 86dvh !important;
    max-height: 86svh !important;
    overflow-y: auto !important; /* Always enable outer scroll for mobile layout */
    -webkit-overflow-scrolling: touch !important; /* Force smooth momentum scrolling on iOS Safari */
    display: flex !important;
    flex-direction: column !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }

  .info-panel .modal-main-box {
    flex: none !important;
    min-height: auto !important;
    max-height: none !important;
    margin-bottom: 12px !important;
  }

  .info-panel.is-branch-view .modal-content-box {
    flex: none !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 24px 16px !important;
    overflow-y: visible !important;
  }

  .info-panel.is-branch-view #modalBodyEn,
  .info-panel.is-branch-view #modalBodyVie,
  .info-panel.is-topic-view .topic-desc-wrap {
    font-size: 16px !important;
  }

  .info-panel.is-topic-view {
    display: flex !important;
    flex-direction: column !important;
  }

  .info-panel.is-topic-view .modal-header-left {
    margin-right: 156px;
  }

  .info-panel.is-topic-view .modal-title-wrap .title-line-base,
  .info-panel.is-topic-view .modal-branch-wrap .title-line-base,
  .info-panel.is-topic-view .card-title-main-wrap .title-line-base {
    font-size: clamp(14px, 3.5vw, 18px) !important;
  }



  .info-panel.is-topic-view .topic-content-box {
    flex: none !important;
    min-height: auto !important;
    max-height: none !important;
    flex-direction: column !important;
    padding: 12px !important;
    gap: 16px !important;
    overflow: visible !important;
  }

  .info-panel.is-topic-view .topic-desc-wrap {
    flex: none !important;
    min-height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  .info-panel.is-topic-view .topic-right-col,
  .info-panel.is-topic-view .topic-left-col {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .info-panel.is-topic-view .topic-right-col {
    order: 1 !important;
  }

  .info-panel.is-topic-view .topic-left-col {
    order: 2 !important;
  }

  .info-panel.is-topic-view .slideshow-container {
    height: min(240px, 35vh) !important;
    height: min(240px, 35dvh) !important;
    height: min(240px, 35svh) !important;
  }

  .info-panel.is-topic-view .cards-slider-wrap {
    flex-direction: row !important;
    max-height: none !important;
    height: auto !important;
    margin: 12px 0 0 !important;
  }

  .info-panel.is-topic-view .cards-container {
    flex-direction: row !important;
    max-width: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
  }

  .info-panel.is-topic-view .topic-card {
    flex: 0 0 min(260px, 72vw) !important;
    width: auto !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
    margin: 0 !important;
  }

  .info-panel.is-topic-view #sliderPrevBtn svg,
  .info-panel.is-topic-view #sliderNextBtn svg {
    transform: none !important;
  }
}

/* Base styles to hide the scroll arrow buttons on desktop and portrait */
.modal-scroll-arrow,
.modal-scroll-up-arrow {
  display: none !important;
}

@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  .info-panel {
    --landscape-nav-btn-size: 34px;
    --landscape-nav-icon-size: 17px;
  }

  html.is-mobile-landscape .site,
  html.is-mobile-landscape .map-wrap,
  html.is-mobile-landscape .lake-mountain,
  html.is-mobile-landscape .falling-word,
  html.is-mobile-landscape .falling-v-icon {
    will-change: auto !important;
  }

  html.is-mobile-landscape #riverMap {
    touch-action: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
  }

  html.is-mobile-landscape .river,
  html.is-mobile-landscape .river.flow-in,
  html.is-mobile-landscape .river.main.flow-in,
  html.is-mobile-landscape .river.sub.flow-in,
  html.is-mobile-landscape .river.connector.flow-in {
    transition: none !important;
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }

  html.is-mobile-landscape .lake,
  html.is-mobile-landscape .brand,
  html.is-mobile-landscape .lake-mountain,
  html.is-mobile-landscape .mountain,
  html.is-mobile-landscape .node,
  html.is-mobile-landscape .branch-title,
  html.is-mobile-landscape .topic,
  html.is-mobile-landscape .timeline,
  html.is-mobile-landscape .endpoints circle,
  html.is-mobile-landscape .bg-v-icon {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
  }

  html.is-mobile-landscape #backgroundIcons,
  html.is-mobile-landscape .bg-v-icon {
    display: none !important;
  }

  html.is-mobile-landscape .time:hover .ticket-bg,
  html.is-mobile-landscape .music-skip-btn,
  html.is-mobile-landscape .related-card:hover,
  html.is-mobile-landscape .slideshow-image-wrap img {
    filter: none !important;
    box-shadow: none !important;
  }

  html.is-mobile-landscape .node:hover,
  html.is-mobile-landscape .node.is-active,
  html.is-mobile-landscape .endpoints circle:hover,
  html.is-mobile-landscape .endpoints circle.is-hovered,
  html.is-mobile-landscape .related-card:hover {
    transform: none !important;
  }

  /* Hide the works toggle button since we scroll down instead */
  #btnModalWorks,
  .info-panel.has-works #btnModalWorks {
    display: none !important;
  }

  /* Force info-panel to be a vertical scroll-snapping container */
  .info-panel,
  .info-panel.is-topic-view {
    width: min(820px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    aspect-ratio: auto !important;
    min-height: auto !important;
    height: 94vh !important;
    height: 94svh !important;
    max-height: 94vh !important;
    max-height: 94svh !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translate(-50%, -50%) scale(1) !important;
    overflow-y: scroll !important;
    scroll-snap-type: y mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  .info-panel::-webkit-scrollbar {
    display: none !important;
  }

  /* If there are NO related works, disable vertical scroll snapping */
  .info-panel:not(.has-works) {
    overflow-y: hidden !important;
    scroll-snap-type: none !important;
  }

  /* Branch and Topic views inherit the vertical flex container styles */
  .info-panel.is-branch-view,
  .info-panel.is-topic-view {
    display: flex !important;
    flex-direction: column !important;
    width: min(820px, calc(100vw - 32px)) !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }

  /* Section 1: Main info box takes exactly 100% of the popup height */
  .modal-main-box,
  .info-panel.is-branch-view .modal-main-box,
  .info-panel.is-topic-view .modal-main-box {
    --floating-scroll-gap: 58px;
    flex: 0 0 calc(100% - var(--floating-scroll-gap)) !important;
    height: calc(100% - var(--floating-scroll-gap)) !important;
    min-height: calc(100% - var(--floating-scroll-gap)) !important;
    max-height: calc(100% - var(--floating-scroll-gap)) !important;
    margin: 0 0 var(--floating-scroll-gap) !important;
    scroll-snap-align: start !important;
    box-sizing: border-box !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    border: 3px solid var(--blue) !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  .info-panel.is-branch-view .modal-main-box {
    background: #ff0000 !important;
  }

  .info-panel.is-topic-view .modal-main-box {
    background: #fff !important;
  }

  /* Setup header as fixed flex item */
  .modal-header {
    flex: 0 0 auto !important;
  }

  /* Content boxes take up remaining space with custom scroll */
  .modal-content-box,
  .topic-content-box {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  /* Topic View Specifics in mobile landscape */
  .info-panel.is-topic-view .topic-content-box {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    padding: 12px !important;
    gap: 16px !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  .info-panel.is-topic-view .topic-left-col {
    order: 2 !important;
    flex: 1 1 62% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  .info-panel.is-topic-view .topic-right-col {
    order: 1 !important;
    flex: 0 0 min(38%, 300px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  .info-panel.is-topic-view .slideshow-container {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    width: min(100%, 300px) !important;
    max-width: 300px !important;
    height: auto !important;
    max-height: 100% !important;
    aspect-ratio: 4 / 3 !important;
    align-self: center !important;
  }

  .info-panel.is-topic-view .slideshow-image-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .info-panel.is-topic-view .slideshow-image-wrap img,
  .info-panel.is-topic-view .slideshow-image-wrap iframe,
  .info-panel.is-topic-view .slideshow-image-wrap video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-position: center center !important;
    background: #fbfaf5 !important;
  }

  .info-panel .card-image-placeholder img,
  .info-panel.is-branch-view .card-image-placeholder img,
  .info-panel.is-topic-view .card-image-placeholder img {
    position: absolute !important;
    inset: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }

  .info-panel.is-topic-view .topic-detail-title-wrap {
    flex: 0 0 auto !important;
  }

  .info-panel.is-topic-view .topic-desc-wrap {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .info-panel.is-topic-view .slideshow-caption {
    flex: 0 0 auto !important;
    margin-top: 6px !important;
  }

  /* Bouncing Scroll Down Arrow Button */
  .info-panel.has-works .modal-scroll-arrow {
    display: flex !important;
    position: absolute;
    bottom: -51px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999 !important;
    pointer-events: auto !important;
    background: var(--blue) !important;
    color: #fff !important;
    border: 3px solid var(--blue) !important;
    border-radius: 50% !important;
    width: var(--landscape-nav-btn-size) !important;
    height: var(--landscape-nav-btn-size) !important;
    min-width: var(--landscape-nav-btn-size) !important;
    min-height: var(--landscape-nav-btn-size) !important;
    max-width: var(--landscape-nav-btn-size) !important;
    max-height: var(--landscape-nav-btn-size) !important;
    flex: 0 0 var(--landscape-nav-btn-size) !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(33, 50, 246, 0.4) !important;
    padding: 0 !important;
    margin: 0 !important;
    animation: bounceArrow 2s infinite;
  }

  @keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% {
      transform: translateX(-50%) translateY(0);
    }
    40% {
      transform: translateX(-50%) translateY(-6px);
    }
    60% {
      transform: translateX(-50%) translateY(-3px);
    }
  }

  /* Bouncing Scroll Up Arrow Button */
  .modal-scroll-up-arrow {
    display: none !important;
  }

  .info-panel.has-works .modal-scroll-up-arrow {
    display: flex !important;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999 !important;
    pointer-events: auto !important;
    background: var(--blue) !important;
    color: #fff !important;
    border: 3px solid var(--blue) !important;
    border-radius: 50% !important;
    width: var(--landscape-nav-btn-size) !important;
    height: var(--landscape-nav-btn-size) !important;
    min-width: var(--landscape-nav-btn-size) !important;
    min-height: var(--landscape-nav-btn-size) !important;
    max-width: var(--landscape-nav-btn-size) !important;
    max-height: var(--landscape-nav-btn-size) !important;
    flex: 0 0 var(--landscape-nav-btn-size) !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(33, 50, 246, 0.4) !important;
    padding: 0 !important;
    margin: 0 !important;
    animation: bounceUpArrow 2s infinite;
  }

  @keyframes bounceUpArrow {
    0%, 20%, 50%, 80%, 100% {
      transform: translateX(-50%) translateY(0);
    }
    40% {
      transform: translateX(-50%) translateY(6px);
    }
    60% {
      transform: translateX(-50%) translateY(3px);
    }
  }

  /* Force script titles to be smaller than base Cooper titles and fit inside */
  .title-line-script,
  .topic-detail-title-wrap .title-line-script,
  .branch-detail-title-wrap .title-line-script {
    font-size: 0.85em !important;
  }

  /* Section 2: Related Works Slider Section (floating, 100% height) */
  .info-panel .cards-slider-wrap,
  .info-panel.is-topic-view .cards-slider-wrap {
    flex: 0 0 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    scroll-snap-align: start !important;
    display: none !important; /* hidden by default if not has-works */
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 24px 12px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }

  .info-panel.has-works .cards-slider-wrap {
    display: flex !important;
  }

  /* Horizontal Slider Cards Container */
  .info-panel .cards-container,
  .info-panel.is-topic-view .cards-container {
    flex: 0 1 496px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start;
    gap: 16px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    height: 100% !important;
    width: 496px !important;
    max-width: calc(100% - 96px) !important;
    padding: 0 !important;
    scrollbar-width: none !important;
  }

  .info-panel .cards-container::-webkit-scrollbar {
    display: none !important;
  }

  /* Floating Related Cards (Exactly 2 fit width) */
  .info-panel .topic-card,
  .info-panel.is-branch-view .topic-card,
  .info-panel.is-topic-view .topic-card {
    flex: 0 0 240px !important;
    width: 240px !important;
    max-width: none !important;
    height: 180px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    scroll-snap-align: start !important;
    box-sizing: border-box !important;
  }

  .info-panel .card-image-placeholder,
  .info-panel.is-branch-view .card-image-placeholder,
  .info-panel.is-topic-view .card-image-placeholder {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* Navigation Buttons resets */
  .info-panel .slider-btn,
  .info-panel.is-topic-view .slider-btn {
    flex: 0 0 var(--landscape-nav-btn-size) !important;
    width: var(--landscape-nav-btn-size) !important;
    height: var(--landscape-nav-btn-size) !important;
    min-width: var(--landscape-nav-btn-size) !important;
    min-height: var(--landscape-nav-btn-size) !important;
    max-width: var(--landscape-nav-btn-size) !important;
    max-height: var(--landscape-nav-btn-size) !important;
    z-index: 10 !important;
    border-radius: 50% !important;
    background: var(--blue) !important;
    color: #fff !important;
    border: 3px solid var(--blue) !important;
    box-shadow: 0 2px 8px rgba(33, 50, 246, 0.4) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .info-panel #sliderPrevBtn svg,
  .info-panel #sliderNextBtn svg,
  .info-panel.is-topic-view #sliderPrevBtn svg,
  .info-panel.is-topic-view #sliderNextBtn svg {
    transform: none !important;
    width: var(--landscape-nav-icon-size) !important;
    height: var(--landscape-nav-icon-size) !important;
  }

  .info-panel .modal-scroll-arrow svg,
  .info-panel .modal-scroll-up-arrow svg {
    width: var(--landscape-nav-icon-size) !important;
    height: var(--landscape-nav-icon-size) !important;
  }

  /* Typography size clamping tweaks for landscape */
  .info-panel.is-topic-view .topic-detail-title-wrap .title-line-base {
    font-size: clamp(16px, 2.2vw, 22px) !important;
  }

  .info-panel.is-topic-view .topic-desc-wrap {
    font-size: clamp(12px, 1.3vw, 15px) !important;
    line-height: 1.3 !important;
  }

  .info-panel.is-branch-view #modalBodyEn,
  .info-panel.is-branch-view #modalBodyVie {
    font-size: clamp(15px, 1.8vw, 19px) !important;
    line-height: 1.4 !important;
  }

  .info-panel .card-header,
  .info-panel.is-branch-view .card-header,
  .info-panel.is-topic-view .card-header {
    height: 44px !important;
    min-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 2px 4px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .info-panel.is-topic-view .modal-title-wrap .title-line-base,
  .info-panel.is-topic-view .modal-branch-wrap .title-line-base,
  .info-panel .card-title-main-wrap .title-line-base,
  .info-panel.is-branch-view .card-title-main-wrap .title-line-base,
  .info-panel.is-topic-view .card-title-main-wrap .title-line-base {
    font-size: clamp(12px, 1.5vw, 15px) !important;
  }

  .info-panel .card-title-sub,
  .info-panel.is-branch-view .card-title-sub,
  .info-panel.is-topic-view .card-title-sub {
    font-size: clamp(9px, 1.0vw, 11px) !important;
    margin-top: 0 !important;
  }

  /* Centering branch view body text in mobile landscape */
  .info-panel.is-branch-view .modal-content-box {
    min-height: 0 !important;
    height: 100% !important;
    flex: 1 1 0% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding-bottom: 24px !important;
  }

  .info-panel.is-branch-view .branch-body-wrap {
    margin-top: auto !important;
    margin-bottom: auto !important;
    flex: 0 0 auto !important;
  }
}

/* ─── Branch View Red Modal Layout ─── */
.info-panel.is-branch-view #modalHomeBtn,
.info-panel.is-branch-view #modalHomeBtn + .modal-title-separator,
.info-panel.is-branch-view #modalBranchLink,
.info-panel.is-branch-view #modalSecondSeparator,
.info-panel.is-branch-view .modal-title-wrap {
  display: none !important;
}

.info-panel.is-branch-view .modal-main-box {
  background: #ff0000;
}

.info-panel.is-branch-view .modal-header {
  border-bottom: none;
}

.info-panel.is-branch-view .modal-content-box {
  background: #ff0000;
  color: #ffffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(20px, 3vh, 32px) clamp(16px, 2.5vw, 24px);
  min-height: 325px;
  box-sizing: border-box;
}

.branch-body-wrap {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.info-panel.is-branch-view #modalBodyEn,
.info-panel.is-branch-view #modalBodyVie {
  color: #ffe500;
  font-family: 'Arial', sans-serif;
  font-size: clamp(17px, 2.3vh, 22px);
  line-height: 1.6;
  font-weight: normal;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

/* Large centered title in branch view body */
.branch-detail-title-wrap {
  text-align: center;
  margin-bottom: clamp(16px, 3vh, 28px);
  width: 100%;
}
.branch-detail-title-wrap .title-line-base {
  color: #000;
  font-family: 'UTM Cooper Black', 'Cooper Black', serif;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: bold;
  font-style: italic;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.topic-detail-title-wrap .title-line-script,
.branch-detail-title-wrap .title-line-script {
  font-size: 1.55em !important;
}

@media (max-width: 1024px) and (orientation: landscape) {
  .topic-detail-title-wrap .title-line-script,
  .branch-detail-title-wrap .title-line-script,
  .modal-title-wrap .title-line-script,
  .modal-branch-wrap .title-line-script,
  .card-title-main-wrap .title-line-script {
    font-size: 0.78em !important;
    line-height: 1 !important;
  }

  .topic-detail-title-wrap .title-line-wrapper,
  .branch-detail-title-wrap .title-line-wrapper,
  .modal-title-wrap .title-line-wrapper,
  .modal-branch-wrap .title-line-wrapper,
  .card-title-main-wrap .title-line-wrapper {
    white-space: nowrap !important;
  }
}

/* Card title overrides specifically for branch view related work cards */
.info-panel.is-branch-view .card-header {
  height: auto !important;
  min-height: clamp(80px, 10vh, 95px) !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.info-panel.is-branch-view .card-title-main-wrap .title-line-base {
  font-size: clamp(20px, 2.4vh, 24px) !important;
  line-height: 1.15 !important;
}

/* Era background styles for the card headers */
.card-header.red-bg {
  background: #ff0000 !important;
  color: #000000 !important;
}
.card-header.yellow-bg {
  background: #ffff00 !important;
  color: #000000 !important;
}
.card-header.blue-bg {
  background: #2132f6 !important;
  color: #ffffff !important;
}


/* ─── Background script V icons grid ─── */
.background-icons {
  pointer-events: none;
  opacity: 0;
  animation: bgIconsFadeIn 1.5s ease forwards;
  animation-delay: 5.5s;
}
.bg-v-icon {
  stroke: none;
}
.bg-v-icon .vinalogo-fg {
  fill: #ffffff;
}
.bg-v-icon.past .vinalogo-bg {
  fill: var(--blue);
}
.bg-v-icon.present .vinalogo-bg {
  fill: #39ff14; /* Neon green */
}
.bg-v-icon.future .vinalogo-bg {
  fill: #ff9f00; /* Orange */
}



@keyframes bgIconsFadeIn {
  to {
    opacity: 1;
  }
}

/* Timeline vertical dividers visual update */
.timeline-divider {
  stroke: var(--blue);
  stroke-width: 1.2;
  opacity: 0.35; /* make background dividers subtle */
}

/* ─── Device Rotation Overlay ─── */
.rotation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  background: #f7f3e9;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--blue);
  font-family: 'Outfit', sans-serif;
  padding: 24px;
}

/* Show only on mobile/tablet (<= 1024px) in portrait orientation */
@media (max-width: 1024px) and (orientation: portrait) {
  .rotation-overlay {
    display: flex;
  }
}

.rotation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rotation-icon-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 8px;
}

.rotation-svg {
  width: 100%;
  height: 100%;
}

.phone-group {
  transform-origin: 50px 50px;
  animation: rotateDevice 2s ease-in-out infinite;
}

@keyframes rotateDevice {
  0%, 15% {
    transform: rotate(0deg);
  }
  50%, 65% {
    transform: rotate(90deg);
  }
  90%, 100% {
    transform: rotate(0deg);
  }
}

.rotation-content h2 {
  font-family: 'UTM Cooper Black', 'Cooper Black', 'Fraunces', serif;
  font-size: clamp(20px, 4.5vw, 24px);
  color: #ff0000;
  margin: 0;
  letter-spacing: -0.5px;
}

.rotation-content p {
  font-size: clamp(14px, 3.2vw, 16px);
  color: var(--blue);
  margin: 0;
  opacity: 0.85;
}

/* ─── Responsive Scaling for Short Viewports (Desktop only) ─── */
@media (min-width: 1025px) and (max-height: 820px) {
  .info-panel {
    transform: translate(-50%, -50%) scale(0.81) !important;
  }
  .info-panel.open {
    transform: translate(-50%, -50%) scale(0.9) !important;
  }
}
@media (min-width: 1025px) and (max-height: 720px) {
  .info-panel {
    transform: translate(-50%, -50%) scale(0.72) !important;
  }
  .info-panel.open {
    transform: translate(-50%, -50%) scale(0.8) !important;
  }
}
@media (min-width: 1025px) and (max-height: 620px) {
  .info-panel {
    transform: translate(-50%, -50%) scale(0.63) !important;
  }
  .info-panel.open {
    transform: translate(-50%, -50%) scale(0.7) !important;
  }
}
@media (min-width: 1025px) and (max-height: 520px) {
  .info-panel {
    transform: translate(-50%, -50%) scale(0.54) !important;
  }
  .info-panel.open {
    transform: translate(-50%, -50%) scale(0.6) !important;
  }
}
@media (min-width: 1025px) and (max-height: 420px) {
  .info-panel {
    transform: translate(-50%, -50%) scale(0.45) !important;
  }
  .info-panel.open {
    transform: translate(-50%, -50%) scale(0.5) !important;
  }
}

/* ─── Brand Logo Pointer & Pulse Animations ─── */
.brand {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  pointer-events: auto !important; /* ensure logo is clickable */
}
.brand.playing-music {
  opacity: 1 !important;
  animation: pulseLogo 1s ease-in-out infinite alternate;
}
.brand.event-returned {
  opacity: 1 !important;
  animation: none !important;
  transform: scale(1);
}
@keyframes pulseLogo {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* ─── Music Audio React Rain Effects ─── */
#musicRainContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.music-marquee-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

.music-marquee {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  background: #fff200;
  color: #ff0000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(15px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.music-marquee-top {
  top: 0;
}

.music-marquee-bottom {
  bottom: 0;
}

.music-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: musicMarqueeScroll 9s linear infinite;
}

.music-marquee-bottom .music-marquee-track {
  animation-direction: reverse;
}

.music-marquee-track span {
  display: flex;
  align-items: center;
  padding: 4px 24px;
  transform: translateY(3px);
}

@keyframes musicMarqueeScroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.falling-word {
  position: absolute;
  top: -50px;
  font-family: 'UTM Cooper Black', 'Cooper Black', 'Fraunces', serif;
  font-weight: 900;
  font-style: italic;
  white-space: nowrap;
  animation: fallAnimation linear forwards;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.falling-v-icon {
  position: absolute;
  top: -50px;
  width: 35px;
  height: 35px;
  fill: none;
  stroke-width: 12px;
  animation: fallAnimation linear forwards;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.music-trigger-mountain {
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.music-trigger-mountain:focus,
.music-trigger-mountain:focus-visible {
  outline: none;
}

.falling-vinahouse {
  position: absolute;
  top: -70px;
  width: 70px;
  height: 70px;
  object-fit: contain;
  animation: fallPropellerAnimation linear forwards;
  will-change: transform, filter;
  transform: translate3d(0, 0, 0);
  transform-origin: center center;
  backface-visibility: hidden;
}

@keyframes fallAnimation {
  0% {
    transform: translate3d(0, -50px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 105vh, 0) rotate(360deg);
    opacity: 0;
  }
}

/* ─── Music Skip Button ─── */
.music-skip-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--blue);
  color: var(--blue);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-style: italic;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000; /* above overlay/timeline, below rotation overlay */
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(33, 50, 246, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-30px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, background 0.2s, color 0.2s;
}

.music-skip-btn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.music-skip-btn:hover {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(33, 50, 246, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  html,
  body,
  .site {
    cursor: url('./cursor-small.cur'), auto;
  }

  a,
  button,
  [role="button"],
  .topic,
  .node,
  .time,
  .brand,
  .slider-btn,
  .slideshow-nav-btn,
  .slideshow-enlarge-btn,
  .lightbox-nav-btn,
  .lightbox-close-btn,
  .modal-home-wrap,
  .modal-branch-wrap,
  .connection-card,
  .music-skip-btn {
    cursor: url('./poniter-small.cur'), pointer !important;
  }

  #brandLogo {
    cursor: url('./cursor-small.cur'), auto !important;
  }

  body.intro-pending #brandLogo {
    cursor: url('./poniter-small.cur'), pointer !important;
  }
}

@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  /* Ensure branch view related cards match topic view card header heights and typography sizes in landscape */
  .info-panel.is-branch-view .card-header {
    height: 44px !important;
    min-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 2px 4px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .info-panel.is-branch-view .card-title-main-wrap .title-line-base {
    font-size: clamp(12px, 1.5vw, 15px) !important;
    line-height: 1.15 !important;
  }

  .info-panel.is-branch-view .card-title-sub {
    font-size: clamp(9px, 1.0vw, 11px) !important;
    margin-top: 0 !important;
  }
}

@keyframes fallPropellerAnimation {
  0% {
    transform: translate3d(0, -70px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 105vh, 0) rotate(2160deg);
    opacity: 0;
  }
}



