@import url('skin.css');

:host(.mainHeader) {
	grid-area: header;
}

:host(.mainFooter) {
	grid-area: footer;
}

/** HEADER **/
#header {
	grid-area: header;
	display: flex;
	align-items: center;
	gap: 0.9rem;
	background: var(--header-bgcolor);
	color: var(--header-color);
	border-bottom: 1px solid var(--header-bdcolor);
	font-family: var(--text-font-family), sans-serif;
	font-size: var(--header-font-size);
	font-weight: 500;
	line-height: 1.4;
	position: sticky;
	top: 0;
	height: 3rem;
	padding-inline: 1rem;
	z-index: 99;
}

#header > span.logo > img {
	max-height: 2.5rem;
	width: auto;
	vertical-align: middle;
}

#header > h1 {
	font-family: var(--title-font-family), sans-serif;
	color:var(--header-color);
	margin: 0;
	font-size: 1em;
	font-weight: 500;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

#navigation {
	flex: 1 1;
	display: flex;
	align-self: stretch;
}

home-barburger {
	flex: 1;
}

home-barburger[state="burger"] {
	padding-block: 5px;
}

home-barburger::part(bar) {
	display: flex;
	gap: 0.9rem;
}

home-barburger::part(burger) {
	display: flex;
	border: 1px solid;
	border-radius: 5px;
	padding-inline: 5px 30px;
	position: relative;
}

home-barburger::part(dialog) {
	display: flex;
	flex-direction: column;
}

home-barburger[state="burger"] a,
#barburger a[slot="burger"] {
	border: 0;
}

home-barburger > button.burger {
	border: 0;
	background: none;
	cursor: pointer;
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

home-barburger > button.burger::after {
	font-family: "homeFontello";
	content: "\E815";
	display: inline-block;
}

home-barburger > .defaultMenuName {
	color: var(--p-color);
	display: flex;
	align-items: center;
	text-wrap: nowrap;
}

home-barburger > dialog.burger {
	border: 0;
	border-radius: 0.5rem;
	padding: 0.6rem 1.2rem;
	box-shadow: 2px 2px 3px rgb(0 0 0 / 20%);
}

home-barburger > dialog.burger::backdrop {
	background: transparent;
}

home-barburger > dialog.burger a.selected {
	border-bottom: 0;
}

home-barburger > dialog.burger a {
	margin-block: 0.4rem;
}

#navigation a {
	text-decoration: none;
	color: var(--header-link-color);
	display: flex;
	align-items: center;
	gap: 0.2rem;
	border-bottom: 2px solid transparent;
}

#navigation a, #toolbar ul li a {
	white-space: nowrap;
}

#navigation a:hover,
#toolbar ul li a:hover {
	opacity: 0.7;
}

span.tabLnkLbl {
	display: flex;
	align-items: center;
	gap: 0.2rem;
}

span.tabLnkLbl.noIcon::before,
.urlBtn.urlLink span.tabLnkLbl::after {
	font-family: "homeFontello";
	display: inline-block;
	font-weight: normal;
}

span.tabLnkLbl > .icon > img {
	max-height: 1.2em;
	width: auto;
	vertical-align: middle;
}

.show-home #navigation a.homeBtn,
.show-library #navigation a.libraryBtn.active,
.show-courses #navigation a.coursesBtn,
.show-resources #navigation a.resourcesBtn,
.sessions #navigation a.sessionsBtn {
	border-bottom-color: var(--header-active-bdcolor);
	color: var(--header-active-color);
	font-weight: 900;
	pointer-events: none;
}

.homeBtn span.tabLnkLbl.noIcon::before {
	content: "\E80D";
}

.libraryBtn span.tabLnkLbl.noIcon::before {
	content: "\E80F";
}

.resourcesBtn span.tabLnkLbl.noIcon::before {
	content: "\E817";
}

.sessionsBtn span.tabLnkLbl.noIcon::before {
	content: "\E803";
}

.coursesBtn span.tabLnkLbl.noIcon::before {
	content: "\E805";
}

.urlBtn.urlLink span.tabLnkLbl::after {
	content: "\E811";
	font-size: 70%;
	align-self: flex-start;
}

#header .desk {
	display: flex;
	gap: 0.5em;
	padding: 0.2em 0.5em;
	border: 1px solid var(--header-bdcolor);
	border-radius: 6px;
}

#header .desk .warning,
#header .desk a.backToDesk {
	display: flex;
	gap: 3px;
	align-items: baseline;
	text-decoration: none;
}

#header .desk .warning::before,
#header .desk a.backToDesk::before {
	font-family: "homeFontello";
	display: inline-block;
}

#header .desk .warning::before {
	content: "\E812";
}

#header .desk a.backToDesk::before {
	content: "\E802";
}

#header .desk a.backToDesk span {
	position: absolute;
	left: -9999px;
}

#header .desk a.backToDesk:hover {
	opacity: 0.7;
}

#toolbar {
	display: flex;
	align-items: center;
}

ul.usermenu {
	list-style: none;
	display: flex;
	gap: 0.8rem;
	margin: 0;
	padding-inline: 0;
	align-items: center;
}

#toolbar ul li {
	display: flex;
}

#toolbar ul li:last-child {
	margin-right: 0;
}

#toolbar ul li a, #toolbar ul li button, #mySessionMenu button.sessions {
	text-decoration: none;
	color: var(--header-link-color);
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
}

#mySessionMenu button.sessions {
    border: 1px solid var(--header-bdcolor);
    border-radius: 6px;
    background-color: transparent;
    font-size: var(--header-font-size);
    cursor: pointer;
    padding: 0.3em 0.5em;
}

#toolbar.connected ul li a, #toolbar.connected ul li button {
	color: var(--header-color);
}

#toolbar ul li a:hover,
#toolbar ul li button:hover {
	opacity: 0.7;
}

#toolbar ul li button.logout {
	background: transparent;
	border: 0;
	font-size: var(--header-font-size);
	padding: 0;
	cursor: pointer;
}

#toolbar ul li button.logout span {
	display: none;
}

#toolbar ul li button.logout::before,
#toolbar ul li a.myaccount::before,
#mySessionMenu button.sessions::before,
#mySessionMenu button.sessions::after {
	font-family: "homeFontello";
	display: inline-block;
}

#toolbar ul li button.logout::before {
	content: "\E810";
}

#toolbar ul li a.myaccount::before {
	content: "\E812";
}

#mySessionMenu button.sessions::before {
	content: "\E803";
}
#mySessionMenu button.sessions::after {
	content: "\E815";
	font-size: 0.8rem;
	margin-inline-start: 0.2rem;
}

#toolbar.anonymous > button.userMenuButton {
	display: none;
}

#toolbar button.userMenuButton {
	display: none;
}

#toolbar button.userMenuButton:before {
	font-family: "homeFontello";
	content: "\E812";
	display: inline-block;
}

#toolbar button.userMenuButton.closed:before {
	content: "\E812";
}

#toolbar button.userMenuButton.opened:before {
	content: "\E804";
}

#toolbar button.userMenuButton span {
	display: none;
}

dialog.popupSessions[open] {
	border:0;
	box-shadow: 0px 3px 5px -1px rgb(0 0 0 / 55%);
	border-radius: 0.8rem;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	max-width: 35rem;
    max-height: 80vh;
    overflow-y: auto;
	z-index: 2;
}
dialog.popupSessions .content span {
    white-space: normal;
}
dialog.popupSessions a.sessionLink .keywords {
    display: none;
}
dialog.popupSessions a.sessionLink .title {
    font-size: 1em;
    font-family: var(--title-font-family);
}
dialog.popupSessions a.sessionLink .content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
dialog.popupSessions a.sessionLink div.cover {
    align-self: flex-start;
}
dialog.popupSessions a.sessionLink div.cover img {
    max-height: 2lh;
}
dialog.popupSessions .content .sessionCode,
dialog.popupSessions a.sessionLink .content .openedDates {
    font-weight: 500;
    font-size: var(--secondaryText-font-size);
    color: var(--dt-color);
}
dialog.popupSessions div.session {
    margin-block: 0.2rem;
}

div.past,
div.futur {
    order: 5;
    margin-block-start: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--tile-bdcolor);
}
button.toggleSessionsList {
    border: none;
    background-color: transparent;
    padding: 0;
    width: 100%;
    display: flex;
    color: var(--search-second-color);
    text-align: left;
    font-family: var(--title-font-family);
    font-size: var(--secondaryText-font-size);
    cursor: pointer;
    margin-block-end: 0.5rem;
}
button.toggleSessionsList:hover {
    color: color-mix(in oklab, var(--search-second-color), #000 35%);
}
button.toggleSessionsList span {
    flex: 1;
}
button.toggleSessionsList::after {
    font-family: "homeFontello";
}
button.toggleSessionsList.open::after {content: "\E815";}
button.toggleSessionsList.close::after {content: "\E838";}

.label.session {
	text-transform: uppercase;
	font-size: 80%;
	background-color: var(--session-bgcolor);
	color: var(--session-color);
	border-radius: 3px;
	padding: 5px;
	display: inline-flex;
	gap: 3px;
}

/** FOOTER **/
#footer {
	grid-area: footer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	background: var(--footer-bgcolor);
	border-top: 1px solid var(--footer-bdcolor);
	padding: 0.5em 1em;
	font-family: var(--text-font-family), sans-serif;
	font-size: var(--secondaryText-font-size);
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
}

#footer a {
	color: var(--footer-link-color);
	text-decoration: none;
}

span.footLnkLbl {
	display: flex;
	align-items: center;
	gap: 0.8rem;
}

span.footLnkLbl > .icon > img {
	max-height: 2.5rem;
	width: auto;
	vertical-align: middle;
}

#footer a:hover {
	color: var(--footer-hover-color);
}

#footer p {
	margin: 0;
}

nav.about {
	margin: 0 1rem;
}

nav.about ul {
	list-style: none;
	display: flex;
	gap: 0.9rem;
	padding: 0;
	margin: 0;
	align-items: baseline;
}

.copyright {
	display: flex;
	align-items: center;
	gap: 1rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
	:host(.mainFooter) {
		height: 3rem;
	}

	#toolbar.anonymous > button.userMenuButton {
		display: flex;
	}

	#toolbar button.userMenuButton {
		position: absolute;
		top: 0.5rem;
		right: 0.5rem;
		display: flex;
		align-items: center;
		height: min-content;
		padding: .4rem;
		font-size: initial;
		background-color: var(--header-button-bgcolor);
		border: 1px solid var(--header-bdcolor);
		border-radius: 0.3rem;
		cursor: pointer;
	}

	.userMenuButton.closed + ul.usermenu {
		display: none;
	}

	.userMenuButton.opened + ul.usermenu {
		position: fixed !important;
		display: flex;
		flex-direction: column;
		position: absolute;
		top: 3rem;
		right: 0.5rem;
		background: var(--header-bgcolor);
		padding: 0.5rem 1rem;
		border-radius: 0.5rem;
		box-shadow: 2px 2px 3px rgb(0 0 0 / 20%);
		gap: 0;
	}

	#toolbar ul li {
	    width: 100%;
	}

	#toolbar ul li a,
	#toolbar ul li button,
	#mySessionMenu button.sessions {
	    flex: 1;
	    border: none;
	    border-radius: 0;
	    padding: 0;
	    margin-block: 0.5rem;
	}

	ul.usermenu a,
	ul.usermenu button.logout {
	    margin-block: 0.5rem;
	    width: 100%;
	}

	dialog.popupSessions[open] {
        position: fixed;
        left: 0 !important;
        right: 0 !important;
        width: fit-content;
	}

	.welcome > .section {
		border-radius: 0;
	}

	#toolbar ul li button.logout span {
		display: block;
	}

	#header .desk {
		display: none;
	}

	#header > h1 {
		max-width: 40vw;
	}
}

@media (max-width: 550px) {
	:host(.mainFooter) {
		display: none;
	}

	#header {
		width: -webkit-fill-available;
		gap: 0.4rem;
		padding-inline: 0.5rem;
	}

	#navigation {
		height: 3rem;
		overflow: hidden;
	}

	#navigation ul {
		overflow-x: auto;
		overflow-y: hidden;
		box-sizing: content-box;
		padding-bottom: 40px;
		margin-bottom: -40px;
	}

	#navigation li {
		height: 3rem;
	}

	#toolbar button.userMenuButton {
		height: 2rem;
		width: 2rem;
		padding: 0;
		justify-content: center;
	}

	nav.about {
		margin: 0;
	}

	.copyright > div {
		margin: 0.5rem 0 0 0;
	}
}