/* =====================================================================
   ITG Tour Map block — styles ported from medieval_tour.html prototype.
   Scoped under .wp-block-itg-tour-map so nothing leaks into the theme.
   ===================================================================== */
.wp-block-itg-tour-map {
	--navy: #173a52;
	--navy-2: #1f4a66;
	--teal: #1b6d93;
	--teal-dk: #15567a;
	--red: #e5332a;
	--parch: #eaf2f6;
	--parch-dim: #9dbccd;
	--line: rgba(234, 242, 246, 0.14);
	--viking: #2a5298;
	--slavic: #2d6a3f;
	--mixed: #6b3fa0;
	--ink: #3c4a54;
	font-family: 'Lato', system-ui, -apple-system, sans-serif;
	color: var(--ink);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.wp-block-itg-tour-map *,
.wp-block-itg-tour-map *::before,
.wp-block-itg-tour-map *::after { box-sizing: border-box; }
.wp-block-itg-tour-map a { color: inherit; }

/* ---- Tour selector grid ---- */
.wp-block-itg-tour-map .t-tours { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 26px; }
.wp-block-itg-tour-map .t-tour {
	position: relative; text-align: left; cursor: pointer; border: 1px solid #d8e1e8; background: #f7fafb;
	padding: 14px 16px; font-family: 'Lato', sans-serif; font-size: 16px; font-weight: 900;
	color: var(--navy); transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; overflow: hidden;
	border-radius: 0; line-height: 1.4;
}
.wp-block-itg-tour-map .t-tour:hover { transform: translateY(-2px); border-color: var(--teal); }
.wp-block-itg-tour-map .t-tour .t-tour-no { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: #9aa8b1; margin-bottom: 3px; }
.wp-block-itg-tour-map .t-tour.is-active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 12px 26px -14px rgba(23, 58, 82, 0.7); }
.wp-block-itg-tour-map .t-tour.is-active .t-tour-no { color: var(--parch-dim); }
.wp-block-itg-tour-map .t-tour .t-soon {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
	background: rgba(23, 58, 82, 0.92); color: #fff; font-size: 12px; font-weight: 700;
	letter-spacing: 0.08em; text-transform: uppercase; opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.wp-block-itg-tour-map .t-tour.show-soon .t-soon { opacity: 1; }

/* ---- Stage: card + map ---- */
.wp-block-itg-tour-map .t-stage { display: flex; gap: 0; height: 760px; overflow: hidden; border: 1px solid #d8e1e8; box-shadow: 0 24px 60px -34px rgba(23, 58, 82, 0.45); }
.wp-block-itg-tour-map .t-card { flex: 0 0 360px; width: 360px; background: var(--navy); color: var(--parch); display: flex; flex-direction: column; }
.wp-block-itg-tour-map .t-map { flex: 1 1 auto; background: #dce7ef; position: relative; min-width: 0; }
.wp-block-itg-tour-map .t-mapel { position: absolute; inset: 0; }

/* ---- Card header: language tabs ---- */
.wp-block-itg-tour-map .t-card-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wp-block-itg-tour-map .t-brand { font-weight: 900; font-size: 16px; color: #fff; line-height: 1.15; }
.wp-block-itg-tour-map .t-brand small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--parch-dim); }
.wp-block-itg-tour-map .t-langs { display: flex; gap: 4px; }
.wp-block-itg-tour-map .t-lang { cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--parch-dim); font-family: 'Lato', sans-serif; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; padding: 5px 9px; transition: all 0.15s ease; border-radius: 0; }
.wp-block-itg-tour-map .t-lang:hover { color: #fff; }
.wp-block-itg-tour-map .t-lang.is-active { background: #fff; color: var(--navy); border-color: #fff; }

/* ---- Card body ---- */
/* The card body is the scroll container: long descriptions scroll here while
   the nav stays pinned (.t-card-foot below). The bottom padding lives on the
   footer so the sticky footer keeps it while stuck. Scrollbar is styled thin
   and parchment-coloured so it reads as part of the navy card. */
.wp-block-itg-tour-map .t-card-body { padding: 24px 22px 0; flex: 1 1 auto; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
/* Chrome/Safari: a borderless pill thumb on a transparent track. Setting
   scrollbar-width/-color here too would make Chrome ignore these rules and
   fall back to the native (arrow-buttoned) bar, hence the @supports split. */
.wp-block-itg-tour-map .t-card-body::-webkit-scrollbar { width: 10px; }
.wp-block-itg-tour-map .t-card-body::-webkit-scrollbar-track { background: transparent; }
.wp-block-itg-tour-map .t-card-body::-webkit-scrollbar-thumb { background-color: rgba(234, 242, 246, 0.24); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.wp-block-itg-tour-map .t-card-body:hover::-webkit-scrollbar-thumb { background-color: rgba(234, 242, 246, 0.38); }
.wp-block-itg-tour-map .t-card-body::-webkit-scrollbar-thumb:hover { background-color: rgba(234, 242, 246, 0.6); }
/* Firefox (no ::-webkit-scrollbar support): the standard properties. */
@supports not selector(::-webkit-scrollbar) {
	.wp-block-itg-tour-map .t-card-body { scrollbar-width: thin; scrollbar-color: rgba(234, 242, 246, 0.34) transparent; }
}
.wp-block-itg-tour-map .t-coords { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--parch-dim); }
.wp-block-itg-tour-map .t-photo { position: relative; width: 100%; height: 200px; flex: 0 0 auto; margin-top: 14px; overflow: hidden; border: 1px solid rgba(234, 242, 246, 0.16); background-size: cover; background-position: center; }
.wp-block-itg-tour-map .t-photo-cap { position: absolute; left: 0; bottom: 0; z-index: 2; padding: 11px 14px; display: flex; align-items: center; gap: 8px; }
.wp-block-itg-tour-map .t-photo-cap .t-dot { width: 9px; height: 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
.wp-block-itg-tour-map .t-photo-cap span:last-child { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.wp-block-itg-tour-map .t-photo-ph { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.7); text-align: center; padding: 0 16px; }
.wp-block-itg-tour-map .t-stop-title { font-family: 'Lato', sans-serif; font-size: 32px; font-weight: 900; line-height: 1.04; color: #fff; margin: 16px 0 3px; letter-spacing: -0.01em; }
.wp-block-itg-tour-map .t-stop-sub { font-style: italic; font-size: 15px; color: var(--parch-dim); font-weight: 700; }
.wp-block-itg-tour-map .t-desc { font-size: 14.5px; line-height: 1.65; color: rgba(234, 242, 246, 0.86); margin: 16px 0 0; white-space: pre-line; overflow-wrap: break-word; }
.wp-block-itg-tour-map .t-libs { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 18px; }
.wp-block-itg-tour-map .t-libs:empty { display: none; }
.wp-block-itg-tour-map .t-lib { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: #fff; font-size: 14px; font-weight: 900; border-bottom: 2px solid var(--red); padding-bottom: 3px; align-self: flex-start; transition: gap 0.15s ease; }
.wp-block-itg-tour-map .t-lib:hover { gap: 13px; }

/* ---- Card footer: nav ---- */
.wp-block-itg-tour-map .t-card-foot { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 18px 0 24px; background: var(--navy); box-shadow: 0 -16px 20px -8px var(--navy); }
.wp-block-itg-tour-map .t-progress { font-size: 12px; font-weight: 700; letter-spacing: 0.03em; color: var(--parch-dim); }
.wp-block-itg-tour-map .t-cnav { display: flex; gap: 10px; margin-top: 12px; }
.wp-block-itg-tour-map .t-navbtn { flex: 1; cursor: pointer; background: var(--navy-2); border: 1px solid var(--line); color: var(--parch); font-family: 'Lato', sans-serif; font-size: 18px; font-weight: 900; padding: 11px; transition: all 0.15s ease; border-radius: 0; }
.wp-block-itg-tour-map .t-navbtn:hover { background: var(--teal); border-color: var(--teal); }

/* ---- Leaflet marker (rendered outside block scope by Leaflet) ---- */
.t-marker { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
	color: #fff; font-family: 'Lato', sans-serif; font-weight: 900; font-size: 14px; border: 2.5px solid #fff;
	box-shadow: 0 4px 10px rgba(23, 58, 82, 0.45); transition: transform 0.15s ease; }
.t-marker-wrap { background: transparent !important; border: none !important; }
.t-marker-wrap .t-marker.is-active { transform: scale(1.28); z-index: 5; }
.wp-block-itg-tour-map .leaflet-container { font-family: 'Lato', sans-serif; }

/* ---- Link to the tour's own page (under the stage) ---- */
.wp-block-itg-tour-map .t-tourpage { display: flex; margin: 14px 0 0; }
.wp-block-itg-tour-map .t-tourpage[hidden] { display: none; }
.wp-block-itg-tour-map .t-tourpage-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
	background: var(--navy); border: 1px solid var(--navy); color: #fff; text-decoration: none;
	font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 900; letter-spacing: 0.04em;
	text-transform: uppercase; padding: 17px 24px; text-align: center; line-height: 1.3;
	transition: background-color 0.15s ease, border-color 0.15s ease, gap 0.15s ease;
}
.wp-block-itg-tour-map .t-tourpage-btn:hover,
.wp-block-itg-tour-map .t-tourpage-btn:focus-visible { background: var(--teal); border-color: var(--teal); color: #fff; gap: 16px; }
.wp-block-itg-tour-map .t-tourpage-arrow { font-size: 17px; line-height: 1; }

/* ---- Quiz ---- */
.wp-block-itg-tour-map .t-quiz { margin: 26px 0 0; border: 1px solid #d8e1e8; overflow: hidden; background: #f7fafb; }
.wp-block-itg-tour-map .t-quiz-toggle { width: 100%; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px;
	background: var(--navy); color: var(--parch); border: none; padding: 20px 24px; font-family: 'Lato', sans-serif; font-size: 21px; font-weight: 900; text-align: left; border-radius: 0; }
.wp-block-itg-tour-map .t-quiz-toggle .t-chev { font-size: 15px; transition: transform 0.2s ease; }
.wp-block-itg-tour-map .t-quiz.is-open .t-chev { transform: rotate(180deg); }
.wp-block-itg-tour-map .t-quiz-body { display: none; padding: 26px 24px 30px; }
.wp-block-itg-tour-map .t-quiz.is-open .t-quiz-body { display: block; }
.wp-block-itg-tour-map .t-quiz-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.wp-block-itg-tour-map .t-score { font-size: 22px; font-weight: 900; color: var(--navy); }
.wp-block-itg-tour-map .t-score b { color: var(--red); }
.wp-block-itg-tour-map .t-reset { cursor: pointer; background: transparent; border: 1px solid #c2cdd6; color: #5a6172; font-family: 'Lato', sans-serif; font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: 0; }
.wp-block-itg-tour-map .t-reset:hover { border-color: var(--navy); color: var(--navy); }
.wp-block-itg-tour-map .t-q { padding: 20px 0; border-top: 1px solid #e2e9ee; }
.wp-block-itg-tour-map .t-q:first-child { border-top: none; }
.wp-block-itg-tour-map .t-q-num { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; color: var(--red); }
.wp-block-itg-tour-map .t-q-text { font-size: 21px; font-weight: 900; color: var(--navy); margin: 5px 0 14px; line-height: 1.25; letter-spacing: -0.01em; }
.wp-block-itg-tour-map .t-opts { display: grid; gap: 9px; }
.wp-block-itg-tour-map .t-opt { cursor: pointer; text-align: left; background: #fff; border: 1px solid #d8e1e8; padding: 12px 15px;
	font-family: 'Lato', sans-serif; font-size: 14.5px; font-weight: 700; color: #2c3242; transition: all 0.12s ease; border-radius: 0; }
.wp-block-itg-tour-map .t-opt:hover:not(:disabled) { border-color: var(--teal); background: #f2f8fb; }
.wp-block-itg-tour-map .t-opt:disabled { cursor: default; }
.wp-block-itg-tour-map .t-opt.is-correct { background: #e6f2ea; border-color: var(--slavic); color: #1d4e2c; }
.wp-block-itg-tour-map .t-opt.is-wrong { background: #fbe6e4; border-color: var(--red); color: #9a271c; }
.wp-block-itg-tour-map .t-expl { display: none; margin-top: 12px; padding: 13px 16px; background: #eef2f5; border-left: 3px solid var(--red); font-size: 14px; line-height: 1.6; color: #4a5160; }
.wp-block-itg-tour-map .t-expl.show { display: block; }

/* ---- Data payload never visible ---- */
.wp-block-itg-tour-map script.itg-tour-data { display: none; }

/* ---- Responsive (matches medieval_tour_mobile.html breakpoint) ---- */
@media (max-width: 880px) {
	.wp-block-itg-tour-map .t-stage { flex-direction: column; height: auto; }
	.wp-block-itg-tour-map .t-card-body { padding-bottom: 0; }
	.wp-block-itg-tour-map .t-tourpage-btn { font-size: 14px; padding: 15px 18px; }
	.wp-block-itg-tour-map .t-card { flex: none; width: 100%; }
	.wp-block-itg-tour-map .t-map { height: 440px; }
}

/* ==== Tours supplied by a plugin (Tour Pages): richCard, descHtml, imgCredit ====
   The card of such a route carries .is-rich. A site-wide stylesheet on the
   production site resets every link (`a { color: inherit !important }`) and
   removes focus outlines with !important; inside this card the links stay
   visible links with a focus ring, hence !important, scoped here. */

/* Description: HTML with its own <br>, shown whole; the card body scrolls. */
.wp-block-itg-tour-map .t-desc.t-desc--html { white-space: normal; }
.wp-block-itg-tour-map .t-card.is-rich .t-desc a { color: #fff !important; font-weight: 900; text-decoration: none !important; border-bottom: 2px solid var(--red); }
.wp-block-itg-tour-map .t-card.is-rich .t-desc a:hover { color: var(--parch) !important; }

/* Nothing to show, no gap: a stop with no description or sub-line. */
.wp-block-itg-tour-map .t-card.is-rich .t-desc:empty,
.wp-block-itg-tour-map .t-card.is-rich .t-stop-sub:empty { display: none; }
.wp-block-itg-tour-map .t-card.is-rich .t-stop-title:has(~ .t-desc:empty):has(~ .t-libs:empty) { margin-bottom: 24px; }

/* The source link: white like the card text. Air after the description and,
   at the end of the scroll, before the pinned progress line and buttons. */
.wp-block-itg-tour-map .t-card.is-rich .t-lib { color: #fff !important; text-decoration: none !important; }
.wp-block-itg-tour-map .t-card.is-rich .t-libs { margin-top: 22px; margin-bottom: 28px; }
.wp-block-itg-tour-map .t-card.is-rich .t-desc:has(+ .t-libs:empty) { margin-bottom: 28px; }
.wp-block-itg-tour-map .t-card.is-rich a:focus-visible { outline: 2px solid #fff !important; outline-offset: 3px; }

/* The pinned footer keeps its solid card colour but drops the fade it casts
   upwards, which lay over the last lines and the link; a hairline separates
   it from the text scrolling underneath instead. */
.wp-block-itg-tour-map .t-card.is-rich .t-card-foot { box-shadow: none; border-top: 1px solid var(--line); }

/* The picture's credit line, in the photo's top corner. */
.wp-block-itg-tour-map .t-photo-credit { position: absolute; top: 0; right: 0; z-index: 3; max-width: 70%; padding: 4px 8px; font-size: 10.5px; font-weight: 700; line-height: 1.3; letter-spacing: 0.02em; background: rgba(23, 58, 82, 0.78); color: #fff !important; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-block-itg-tour-map a.t-photo-credit:hover { background: var(--navy); }
.wp-block-itg-tour-map a.t-photo-credit:focus-visible { outline: 2px solid #fff !important; outline-offset: -2px; }
.wp-block-itg-tour-map .t-photo-credit[hidden] { display: none; }

/* The button under the map, shown only for a route with its own page:
   compact and centred below the map, colours, type and arrow unchanged. The
   site-wide link reset would turn its label navy on navy; it stays white. */
.wp-block-itg-tour-map .t-tourpage:not([hidden]) { justify-content: center; margin-top: 22px; }
.wp-block-itg-tour-map .t-tourpage .t-tourpage-btn { width: auto; }
.wp-block-itg-tour-map .t-tourpage-btn,
.wp-block-itg-tour-map .t-tourpage-btn:hover,
.wp-block-itg-tour-map .t-tourpage-btn:focus { color: #fff !important; text-decoration: none !important; }
.wp-block-itg-tour-map .t-tourpage-btn:focus-visible { outline: 2px solid var(--navy) !important; outline-offset: 3px; }
