/* ===================== SKIP LINK ===================== */

.skip-link {
	position: absolute;
	top: -100%;
	left: 0;
	background: var(--green);
	color: #fff;
	padding: 10px 20px;
	text-decoration: none;
	font-size: 16px;
	z-index: 9999;
	border-radius: 0 0 6px 0;
}

.skip-link:focus {
	top: 0;
}

/* ===================== FOCUS VISIBLE ===================== */

body.web a:focus-visible,
body.web button:focus-visible {
	outline: 3px solid var(--green);
	outline-offset: 3px;
	border-radius: 3px;
}

/* ===================== SCROLL BEHAVIOUR ===================== */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* ===================== VISIBILITY UTILITIES ===================== */

.hide-for-small-only {
	display: block;
}

.show-for-small-only {
	display: none;
}

.show-for-large-only {
	display: block;
}

/* ===================== LANGUAGE NAV ===================== */

nav.languages {
	position: fixed;
	top: 30px;
	right: 30px;
	z-index: 100;
}

nav.languages ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
}

nav.languages li {
	margin-right: 5px;
	font-size: 16px;
}

nav.languages li.active a {
	color: #FFF;
	background: var(--green);
	border: 1px solid #FFF;
}

nav.languages a {
	text-decoration: none;
	white-space: normal;
	background: #FFF;
	text-align: center;
	line-height: 1.2;
	border-radius: 20px;
	padding: 5px 10px;
	display: block;
	width: 20px;
	border: 1px solid var(--green);
	transition: background 0.2s ease, color 0.2s ease;
}

/* ===================== BASE ===================== */

body.web {
	font-size: 22px;
}

body.web img {
	display: block;
}

body.web .layout {
	display: flex;
	margin-top: 20px;
}

body.home a::after, body.web a::after {
	content: none;
}

/* ===================== SIDEBAR ===================== */

body.web header {
	padding: 10px 10px 10px 20px;
	margin-bottom: 50px;
	width: 18%;
	min-width: 200px;
	position: sticky;
	left: 0;
	top: 20px;
	height: calc(100vh - 40px);
	overflow-y: auto;
}

body.web header h1 {
	font-size: 1.1em;
	letter-spacing: 0.03em;
	line-height: 1.3;
}

.dl-pdf {
	margin-top: 30px;
	margin-bottom: 40px;
}

.dl-pdf a {
	background: var(--green);
	color: #FFF;
	text-decoration: none;
	padding: 8px 20px;
	border-radius: 30px;
	display: inline-block;
	transition: opacity 0.2s ease;
}

.dl-pdf a:hover {
	opacity: 0.8;
}

/* ===================== TOC ===================== */

body.web #toc {
	font-size: 1em;
	margin-top: 20px;
}

body.web #toc #toc-heading {
	border-bottom: 1px solid var(--green);
	color: var(--green);
	margin-bottom: 20px;
	font-size: 1em;
	margin-top: 0;
	letter-spacing: 0.05em;
	padding-bottom: 2px;
	text-transform: none;
	font-family: var(--textfont);
}

body.web #toc li {
	list-style: none;
	margin-bottom: 10px;
	text-align: left;
	font-size: 15px;
	hyphens: none;
	text-transform: none;
}

body.web #toc li a {
	color: var(--green);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

body.web #toc li a:hover {
	text-decoration: underline;
}

body.web #toc li a.active {
	text-decoration: underline;
}

body.web #toc ul {
	list-style: none;
	padding-left: 0;
}

body.web #toc .toc-sublist {
	padding-left: 1.2em;
	margin-top: 0.5em;
}

body.web #toc .toc-part > a {
	font-weight: bold;
}

body.web #toc .toc-chapter > a {
	font-weight: normal;
}

body.web #toc a.active {
	color: var(--green, #000);
}

/* ===================== COVER ===================== */

body.web .cover {
	position: relative;
	height: 48vh;
	min-height: 300px;
	width: 100%;
	top: -21px;
	overflow: hidden;
	text-align: center;
}

body.web .cover figure {
	position: absolute;
	width: 100%;
	height: 48vh;
	min-height: 300px;
	top: 0;
	left: 0;
	overflow: hidden;
}

body.web .cover h2 {
	top: 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	position: relative;
	background: #FFF;
	border-radius: 18px;
	padding: 5px 20px;
	display: inline-block;
	text-align: center;
}

body.web .cover h2 span {
	position: relative;
	left: 0 !important;
}

body.web .cover h1 {
	position: relative;
	transform: none;
	width: 70%;
	min-width: min(500px, 92%);
	margin: auto;
	top: 50%;
	transform: translateY(-50%);
	left: 0;
	font-size: clamp(1.5em, 6vw, 50px);
}

body.web .cover h1 span{
	display: inline-block;
	margin-bottom: 0.2em;
}

/* ===================== MAIN CONTENT ===================== */

body.web main {
	max-width: 900px;
	margin: auto;
	margin-left: 6%;
	margin-top: 9px;
	flex-grow: 1;
	width: 100%;
}

body.web .chapter {
	margin-top: 0;
	margin-bottom: 80px;
	padding-bottom: 80px;
	border-bottom: 1px solid var(--green);
}

body.web .spread-interval-image {
	background: var(--green);
}

body.web main .logbook-content p,
body.web main .story-content p,
body.web .content p,
body.web main .logbook-content li,
body.web main .story-content li,
body.web .content li,
body.web .chapter blockquote,
body.web .chapter blockquote p {
	font-size: var(--textsizeweb);
	text-align: left;
	hyphens: none;
	line-height: 1.65;
	margin-bottom: 1.1em;
	margin-top: 0;
}

body.web .logbook figure {
	width: 100%;
}

body.web figcaption p, body.web figcaption {
	font-size: 15px !important;
	line-height: 1.5;
	margin-top: 5px;
}

/* ===================== HEADINGS ===================== */

body.web .part-title {
	font-size: clamp(1.6em, 3.5vw, 2.2em);
	font-weight: bold;
	margin-bottom: 1em;
	letter-spacing: 0.04em;
}

body.web .chapter .chapter-subsection h2,
body.web .chapter h1 {
	font-size: clamp(1.5em, 4.3vw, 2em);
	line-height: 1.15;
	letter-spacing: 0.02em;
	margin-bottom: 0.5em;
	font-family: var(--textfont);
	text-transform: none;
}

body.web .chapter h2 {
	font-size: clamp(1.1em, 2.5vw, 1.5em);
	letter-spacing: 0.02em;
	font-family: var(--textfont);
	text-transform: none;
}

body.web .logbook h2 {
	font-size: 1.4em;
	margin-top: 40px;
	border-top: 1px dotted #000;
	padding-top: 40px;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: none;
}

/* ===================== CONTENT ===================== */

body.web table {
	font-size: 0.7em;
}

body.web .chapter .content {
	margin-top: 0;
}

body.web h3 + .content {
	margin-top: 2em !important;
}

body.web .chapter .content figure {
	margin-left: auto;
	margin-right: auto;
	margin-top: 2em;
	margin-bottom: 2.5em;
	width: 80%;
}

body.web .chapter blockquote {
	margin-left: 40px;
	margin-right: 40px;
	text-align: left;
	border-left: 2px solid var(--green);
	padding-left: 20px;
	line-height: 1.65;
}

body.web .chapter .content h2:first-child {
	margin-top: 48px;
}

/* ===================== BURGER MENU ===================== */

body.web .burger-menu {
	position: fixed;
	top: 3px;
	left: 0px;
	border: none;
	font-size: 30px;
	padding: 0px 6px 6px;
	background-color: var(--green);
	color: white;
	cursor: pointer;
	z-index: 1100;
	display: none;
}

body.web .chapter-subsection {
	position: relative;
	margin-bottom: 100px;
}

/* ===================== FOOTNOTES ===================== */

body.web .footnote-wrapper {
	display: none;
	position: absolute;
	width: 260px;
	background-color: #fff;
	padding: 12px 15px 10px 15px;
	z-index: 1000;
	border: 1px solid var(--green);
	border-radius: 10px;
	margin-top: 0;
}

body.web .footnote-wrapper.active {
	display: flex;
}

body.web .footnote-wrapper span {
	font-size: 0.7em;
	display: block;
}

body.web .footnote-wrapper .footnote-number {
	margin-right: 5px;
}

body.web .footnote-ref {
	display: inline-block;
	vertical-align: top;
	font-size: 0.5em;
	cursor: pointer;
	text-decoration: none;
	background: #FFF;
	border: 1px solid var(--green);
	padding: 1px 6px 1px;
	border-radius: 15px;
	transition: background 0.2s ease, color 0.2s ease;
}

body.web .footnote-ref:hover {
	color: #FFF;
	background: var(--green);
}

body.web .footnote-ref.active {
	color: #FFF;
	background: var(--green);
}


/* ===================== PRINT OVERRIDES ===================== */

/* style.css applique grayscale sur les figures logbook/story pour le print */
body.web .logbook figure,
body.web .story-content figure {
	filter: none;
}

/* ===================== TOC BACKDROP ===================== */

.toc-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 10;
}

.toc-backdrop.active {
	display: block;
}

/* ===================== BACK TO TOP ===================== */

#back-to-top {
	position: fixed;
	bottom: 30px;
	right: 30px;
	width: 35px;
  height: 35px;
	border-radius: 50%;
	border: 1px solid var(--green);
	background: #fff;
	color: var(--green);
	font-size: 16px;
	cursor: pointer;
	z-index: 500;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

#back-to-top.visible {
	opacity: 1;
	visibility: visible;
}

#back-to-top:hover {
	background: var(--green);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	#back-to-top { transition: none; }
}

/* ===================== LIGHTBOX ===================== */

#lightbox {
	visibility: hidden;
	opacity: 0;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	padding: 40px;
	box-sizing: border-box;
	cursor: zoom-out;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

#lightbox.active {
	visibility: visible;
	opacity: 1;
}

#lightbox img {
	max-width: 100%;
	max-height: 85vh;
	object-fit: contain;
	display: block;
	cursor: default;
	width: auto;
}

#lightbox-caption {
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	margin-top: 16px;
	text-align: center;
	max-width: 700px;
	line-height: 1.5;
}

#lightbox-close {
	position: fixed;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	color: #fff;
	font-size: 40px;
	line-height: 1;
	padding: 4px 10px;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

#lightbox-close:hover {
	opacity: 1;
}

body.web .content figure img,
body.web .story-content figure img,
body.web .logbook-content figure img,
body.web .logbook figure img {
	cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
	#lightbox { transition: none; }
}

/* ===================== RESPONSIVE ===================== */

@media only screen and (max-width: 1080px) {
	.hide-for-small-only {
		display: none;
	}

	.show-for-small-only {
		display: block;
	}

	body.web nav.languages {
		max-width: 40%;
		right: 10px;
		top: 10px;
    z-index: 9999;
	}

	nav.languages li {
		margin-right: 3px;
		font-size: 12px;
	}

	nav.languages a {
		padding: 5px 6px;
		width: 14px;
	}

	body.web .layout {
		display: block;
	}

	body.web .cover {
		top: 48px;
	}

	body.web .cover h1 {
		font-size: clamp(22px, 4vw, 40px);
		width: 97%;
		min-width: 0;
		line-height: 1.8;
	}

	body.web .cover h2 {
		font-size: 20px;
		top: 0px;
	}

	body.web .burger-menu {
		display: block;
	}

	body.web header {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		width: 100% !important;
		height: auto;
		min-height: 30px;
		padding-left: 0;
		padding-right: 0;
		padding-top: 10px;
		background-color: var(--green);
		color: white;
		z-index: 1000;
	}

	body.web header h1 {
		font-size: 15px;
		/*text-align: center;*/
		color: #FFF;
		width: calc(100% - 180px);
		padding-left: 40px;
		padding-right: 40px;
		padding-top: 3px;
	}

	body.web #toc.open {
		transform: translateX(0);
		transition: transform 0.5s ease;
	}

	body.web #toc {
		position: fixed;
		top: 28px;
		left: 0;
		transform: translateX(-100%);
		transition: transform 0.5s ease;
		height: calc(100vh - 80px) !important;
		padding: 20px !important;
		background-color: #FFF;
		z-index: 9999;
		overflow-y: auto;
	}

	body.web main {
		margin-left: 0;
		margin-top: 80px;
		padding: 0px 24px;
		width: calc(100% - 48px);
	}

	body.web .content h2 {
		font-size: 1.3em;
	}

	body.web h3,
	body.web h3 p {
		font-size: 0.9em;
	}

	body.web .chapter blockquote{
		margin-left: 20px;
		margin-right: 0;
	}

	body.web .chapter-subsection {
		margin-bottom: 60px;
	}
}

@media only screen and (max-width: 768px) {

	body.web main .logbook-content p,
	body.web main .story-content p,
	body.web .content p,
	body.web main .logbook-content li,
	body.web main .story-content li,
	body.web .content li, 
	body.web .chapter blockquote,
	body.web .chapter blockquote p {
		font-size: 0.8em;
	}

	body.web figcaption p, body.web figcaption {
		font-size: 12px !important;
	}

	body.web .content li p{
		font-size: 1em;
	}

	body.web nav.languages {
		right: 5px;
	}

	body.web .cover{
		height: 25vh;
	}

	body.web header h1 {
		font-size: 12px;

	}

	body.web .cover h1 {
		font-size: clamp(16px, 5vw, 22px);
		line-height: 1.8;
	}

	.cover h1 span{
		padding: 4px 15px;
	}

	body.web .cover h2 {
		font-size: 13px;
	}

	body.web .chapter .content figure {
		width: 100%;
	}

	tr > th:first-child,
	tr > th:nth-child(2) {
		width: 25%;
	}

	tr > td:first-child,
	tr > td:nth-child(2) {
		width: 25%;
	}
}
