@import url('reset.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
        --font-family: 'Inter', sans-serif;
        --base-font-size: 18px;
        --base-line-height: 1.5em;

	--header-line-height: 1.3em;

        --link-colour: #2f96ea;
        --link-hover-colour: #227dc8;

        --radius: 10px;
        --shadow: 0 0 30px 0 rgba(0,0,0,.2);

        --padding: 2rem;
        --edge-margin: 1rem; /** Margin for UI elements at the edges of the viewport **/

        /* Enable automatic theme settings */
        color-scheme: light;

        /** Map Background **/
        --background: #D5F2E3;
        --border-colour: #999;



	/**
	* To add more variables here; brand fonts, colours, etc
	**/

        /** Map Colours - also see mapdata.js **/
        --default: #c3c1c1;
        --sworn-translation: #3e90a3;
        --certified-translation: #59a64e;
        --notarised-translation: #F6B23C;
        --default-dark: #8b898a;
        --sworn-translation-dark: #2d687a;
        --certified-translation-dark: #417a39;
        --notarised-translation-dark: #c48a2e;
}
html, body {
	scroll-behavior: smooth !important;
}
html, body {
	margin: 0;
	padding: 0;

	font-size: var(--base-font-size);
	line-height: var(--base-line-height);
        font-family: var(--font-family);
        color: #111e51;
        background: #FFFFFF;
	overflow: clip; /* Prevent scrollbars */
}
p, ul, ol, li {
	margin-bottom: 0;
	&:not(:last-child) {
		margin-bottom: 1rem;
	}
}
h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-weight: 600;
	color: #111e51;
  	line-height: 1.4;
	&:not(:last-child) {
		margin-bottom: 1.25rem;
	}
}

h1, .h1 {
	font-size: 2rem; /* reduced from 2.5rem */
}
h2, .h2 {
  font-size: 2rem;
}
h3, .h3 {
  font-size: 1.75rem;
}
h4, .h4 {
  font-size: 1.5rem;
}
h5, .h5 {
  font-size: 1.25rem;
}
h6, .h6 {
  font-size: 1rem;
}
@media(max-width: 991px) {
	html {
		font-size: calc(var(--base-font-size) - 1px);
	}
	h1, .h1 {
		font-size: 1.75rem; /* reduced */
	}
	h2, .h2 {
		font-size: 1.75rem;
	}
	h3, .h3 {
		font-size: 1.5rem;
	}
	h4, .h4 {
		font-size: 1.25rem;
	}
	h5, .h5 {
		font-size: 1rem;
	}
	h6, .h6 {
		font-size: 0.875rem;
	}
}
@media(max-width: 767px) {
	html {
		font-size: calc(var(--base-font-size) - 2px);
	}
	h1, .h1 {
		font-size: 1.5rem; /* reduced */
	}
	h2, .h2 {
		font-size: 1.5rem;
	}
	h3, .h3 {
		font-size: 1.25rem;
	}
	h4, .h4 {
		font-size: 1rem;
	}
	h5, .h5 {
		font-size: 0.875rem;
	}
	h6, .h6 {
		font-size: 0.75rem;
	}
}

a:not(.btn) {
  color: var(--link-colour);
  text-decoration: none;
  &:hover {
    color: var(--link-hover-colour);
    text-decoration: underline;
    text-underline-offset: 0.1em;
    text-decoration-line: currentColor;
    text-decoration-thickness: 2px;
  }
}

#map {
	width: 100%;
	height: 100vh;
	position: relative;
	overflow: hidden;
	z-index: 1;
	& #map_holder {
		height: 100vh !important;
	}
	& #map_inner {
		height: 100% !important;

		& > svg {
			display: block;
			width: 100%;
			height: 100%;

			shape-rendering: geometricPrecision;
			text-rendering: geometricPrecision;
			image-rendering: optimizeQuality;
		}
	}
}

/* (removed) Custom cursor-following tooltip styles */

/* .ui-position {
	isolation: isolate;
	position: fixed;
	z-index: 909;
	--edge-margin: 1rem;
	&.top-right {
		top: var(--edge-margin);
		right: var(--edge-margin);
	}
	&.top-left {
		top: var(--edge-margin);
		left: var(--edge-margin);
	}
	&.bottom-right {
		bottom: var(--edge-margin);
		right: var(--edge-margin);
	}
	&.bottom-left {
		bottom: var(--edge-margin);
		left: var(--edge-margin);
	}
	&.center-center {
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}
	&.top-center {
		z-index: 99;
		top: var(--edge-margin);
		left: 50%;
		transform: translateX(-50%);
	}
	&.bottom-center {
		bottom: var(--edge-margin);
		left: 50%;
		transform: translateX(-50%);
	}
} */

/** Tiles are elements of the UI that are fixed to the viewport, not the map **/
.tile {
	position: fixed;
	padding: 1rem;
	border-radius: var(--radius);

        background: #FFFFFF;
	box-shadow: var(--shadow);
}

.split-screen {
	display: flex;
	flex-direction: row;
	height: 100vh;
	width: 100%;

	& > .split {
		position: relative;

		&.closed {
			flex: 0;
			overflow: hidden;
			width: 0;
		}
		&.open {
			overflow: auto;
		}
	}
	& .map-view {
		flex: 2;
		z-index: 1;
		box-shadow: var(--shadow);
		& #map {
			width: 100% !important;
			height: 100% !important;
			& #map_holder {
				width: 100% !important;
				height: 100% !important;
				& #map_inner {
					height: 100% !important;
				}
			}
		}
	}
& .text-view {
	flex: 1;
	z-index: 0;
	background: #ffffff;
	scroll-snap-type: y mandatory; /** Enables snap scrolling as container **/
	overflow-x: clip;
	overflow-y: auto;
	height: 100vh;
}
}
@media(max-width: 991px) {
	.split-screen {
		flex-direction: column;
		height: 100svh;
		& > .split {
			flex: 1;
			width: 100%;
			&.closed {
				flex: 0;
			}
			&.open {
				flex: 1;
			}
		}
	}
}

section {
	padding: var(--padding);
	&.full-screen {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		height: 100vh;
		text-align: left;
	}
}
article {
	scroll-snap-align: start; /** Aligns the start of the article with the top of the viewport **/

	position: relative;
	padding: 3rem 3.5rem;

	display: flex;
	flex-direction: column;
	/* justify-content: center; */
	text-align: left !important;
	height: 100vh; /** Full height for articles **/
	overflow-x: clip;
	overflow-y: auto; /** Allow vertical scrolling **/

	& > :first-child {
		margin-top: 0;
	}
	& > :last-child {
		margin-bottom: 0;
	}
}
@media(max-width: 991px) {
	article {
		height: 50svh; /** 50% of the viewport height on small screens **/
	}
}

/** Used for Scroll-To anchor links **/
article {
	position: relative !important;
	& .waypoint {
		position: absolute;
		top: 0;
	}
}

/** GB EDITS ABOVE THIS LINE **/

#map-title {
  position: absolute;
  top: 50%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.6rem 0.6rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
  z-index: 1000;
  width: 80%;              /* ✅ Set the width */
  max-width: 600px;        /* ✅ Optional: limit max size */
  opacity: 1;
  transition: opacity 0.6s ease-out;
  pointer-events: none; /* allow clicks to pass through */
}




/* Floating legend box with subtle glass effect */
#legend-box {
  position: absolute;
  bottom: var(--edge-margin);
  right: var(--edge-margin);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  font-family: var(--font-family);
  font-size: 14px;
  z-index: 999;
  border-radius: 12px;
  max-width: 220px;
  transition: all 0.3s ease;
}

.legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer; /* ✅ shows it's clickable */
}

.legend-icon {
  font-size: 1.5rem;
  font-weight: 900;
  color: #111e51;
  user-select: none;
}

#legend-toggle {
  position: relative;
  top: -3px;
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: 900;
  color: #111e51;
  cursor: pointer;
  line-height: 1;
  padding: 0px;
  white-space: nowrap;
  flex-shrink: 0;
}

#legend-toggle:hover {
  color: var(--link-hover-colour);
}

#legend-box.collapsed #legend-content {
  display: none;
}

#legend-box.collapsed {
  max-width: none;
  width: auto;
  padding: 10px 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-top: 6px;
}

.legend-color {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 1px solid #FFFFFF;
}


.legend-color.green { background-color: var(--certified-translation); }
.legend-color.blue { background-color: var(--sworn-translation); }
.legend-color.orange { background-color: var(--notarised-translation); }
.legend-color.grey { background-color: var(--default); }

/* Minimalist button style */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: #111e51;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  padding: 0.75em 1.5em;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #0d1438;
  opacity: 0.9;
  outline: none;
}

.btn-icon {
  font-size: 1.3em;
  margin-right: 0.2em;
}

/* Secondary button (used in country articles) */
.btn-outline-secondary {
	display: inline-block;           /* allow vertical margins to apply */
	margin: 0.5rem 0 1rem;           /* add space below the button */
}

/* Table styling: thin divider between rows */
.table {
	width: 100%;
	border-collapse: collapse; /* ensure single borders */
}
.table th,
.table td {
	padding: 0.5rem 0.75rem;
	vertical-align: top;
}
.table-sm th,
.table-sm td {
	padding: 0.35rem 0.5rem; /* compact variant */
}
/* add a thin line only between subsequent rows */
.table tbody tr + tr th,
.table tbody tr + tr td {
	border-top: 1px solid #e6e6e6;
}

#copyright {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(255, 255, 255, 0.95);
	border-top: 1px solid #e0e0e0;
	padding: 0.5rem 0.75rem; /* reduced height */
	text-align: center;
	font-size: 0.75rem; /* smaller text */
	color: #666;
	z-index: 100;
}

#copyright p {
  margin: 0;
  padding: 0;
}

/* Countries list box */
.countries-list-box {
  margin: 2rem 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.countries-list-box.collapsed .countries-list-content {
  display: none;
}

.countries-list-header {
	padding: 0.6rem 0.9rem; /* reduced height */
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  font-weight: 500;
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.2s;
	border: none;           /* button reset */
	width: 100%;            /* full clickable width */
	text-align: left;       /* keep text aligned */
	font: inherit;          /* inherit site font */
}

.countries-list-header:focus {
	outline: 2px solid #111e51;
	outline-offset: 2px;
}

.countries-list-header:hover {
  background: #efefef;
}

.countries-list-icon {
	font-size: 1em; /* slightly smaller */
	display: inline-block; /* allow rotation */
  transition: transform 0.2s;
}

.countries-list-box:not(.collapsed) .countries-list-icon {
	transform: rotate(180deg); /* chevron up when open */
}

.countries-list-content {
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.countries-letter {
  margin-bottom: 1.5rem;
}

.countries-letter-header {
  font-weight: 600;
  font-size: 1.1rem;
  color: #111e51;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.countries-list-content a {
  display: block;
  padding: 0.4rem 0;
  color: #2f96ea;
  text-decoration: none;
  font-size: 0.95rem;
}

.countries-list-content a:hover {
  text-decoration: underline;
  color: #227dc8;
}


