/*
Theme Name: Meepitydoodle
Author: Paul McAlenan
Author URI: http://paulmcalenan.co.uk
Version: 0.0.2
*/

@import url('./assets/css/reset.css');

/*--------------------------------------------------------------
# GENERAL
--------------------------------------------------------------*/

@font-face {
	font-family: 'Roboto';
	font-weight: 500;
	src: url('./assets/fonts/Roboto-Medium-webfont.woff') format('woff2');
}

@font-face {
	font-family: 'Roboto';
	font-weight: 400;
	src: url('./assets/fonts/Roboto-Regular-webfont.woff') format('woff2');
}

@font-face {
	font-family: 'Roboto';
	font-weight: 300;
	src: url('./assets/fonts/Roboto-Light-webfont.woff') format('woff2');
}


/*--------------------------------------------------------------
# Colours
--------------------------------------------------------------*/
:root {
	--black: #000000;
	--charcoal: #36454f;
	--dimgrey: #696969;
	--grey: #808080;
	--darkgrey: #a9a9a9;
	--silver: #c0c0c0;
	--lightgrey: #d3d3d3;
	/* --blue: #409cfe; */
	--blue: #4898EE;
	--white: #ffffff;
	--pink: #ff00ff;
	--tomato: #FE4340;

	--background-color: #363636;
	/* --clr-card-bg: hsl(0 0% 100%);  */
	--text-color: #ffffff;
	/* --text-color: #36454f; charcoal */
	--clr-heading: hsl(0 0% 25%);
	--clr-hover: rgb(211, 211, 211);
	--darkmode-hover: 0, 0, 0;

	--lightbox-bg: rgba(0, 0, 0, .8);
}


/*--------------------------------------------------------------
# Typography
--------------------------------------------------------------*/

h1 {
	font-size: 2rem;
}

h2 {
	font-size: 2rem;
}

h3 {
	font-size: 2rem;
	margin-top: 3rem;
}
  
h4 {
	font-size: 1.44rem;
}
  
h5 {
	font-size: 1.15rem;
}
  
h6 {
	font-size: 0.96rem;
}

footer p { font-size: 12px; }

/*--------------------------------------------------------------
# MAIN LAYOUT
--------------------------------------------------------------*/

html {
	/* height: 100%; */
	overflow: auto;
	font-family: 'Roboto', sans-serif;
	font-weight: 300;
	scroll-behavior: smooth;
	scroll-padding-top: 12rem;
}

body {
	--hover-padding: 20px;
	--content-max-width: 70ch;
	container: body / inline-size;
	display: grid;
	grid-template-columns: 
		[full-width-start] minmax(var(--hover-padding), 1fr)
		[content-start] min(300px, 100%) [padding-start] 1fr [padding-end] 7fr [content-end]
		minmax(var(--hover-padding), 1fr) [full-width-end];

	margin: 0;
	color: var(--text-color);
	background-color: var(--background-color);
	font-size: 1.25rem;
	/* font-weight: 200; */
	line-height: 1.5;
}

@media (max-width: 768px) {
	body {
		/* display: block; */
		grid-template-columns:
		[padding-start] var(--hover-padding)
		[content-start] 1fr [content-end]
		var(--hover-padding) [padding-end];
	}
}

body > header {
	display: grid;
	grid-column: content-start / padding-start;
	row-gap: 0.5rem;
	/* width: min(300px, 100%); */
	/* grid-auto-rows: max-content; */
	position: sticky;
	top: 0;
	left: 0;
	align-self: start;
	background-color: var(--background-color);
	padding-top: 2rem;
}

/* Display:none for H1 outside of Header */
body > h1 {
	display: none;
}

body > header > img { 
	width: 125px;
}

button[aria-controls="menu"] {
	display: none;
}

body > main {
	display: grid;
	grid-auto-rows: max-content;
	row-gap: 2rem;
	grid-column: padding-end / content-end;
	padding-top: 2rem;
}

footer {
	grid-column: content;
	align-self: end;
	padding: 2rem 0;
}

@container body (inline-size < 768px)  {

	body > :is(main, footer) {
		grid-column: content;
	}

	body > header {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		grid-column: padding;
		grid-template-columns: [start] 1fr [middle] 1fr [end];
		padding: 2rem  20px 1.5rem 20px;
		border-bottom: 0 solid grey; /*start with no border*/
		box-shadow:0px 0px 0px grey;
		transition: border-bottom 0.3s;
	}

	header.header-border {
		border-bottom: 1px solid grey;
		/* box-shadow: 0px 1px 3px grey; */
	}

	body > header > h1 {
		display: none;
	}
	
	body > header + h1 {
		display: block;
		grid-column: content;
	}
	
	body > header > img {
		/* order: 1; */
		/* grid-column: start / middle; */
		width: 75px;
		height: auto;
	}

	/* body > header > nav {
		order: 2;
		grid-column: middle / end;
		justify-self: end;
		width: 100%;
	} */
		
	button[aria-controls="menu"] {
		/* width: fit-content;
		overflow: hidden; */
		display: block;
		padding: .5rem;
		border: 2px solid var(--darkgrey);
		border-radius: 2px;
		cursor: pointer;
		justify-self: end;
		align-self: center;
	}
	
	nav {
		display: none;
		text-align: center;
		opacity: 0;
		transition: opacity .3s ease, display .3s ease allow-discrete; /* <-- check this line */
		width: 100%;
		order: 1;
		grid-column: start / end;
		width: 100%;
	}
	
	.menu-open nav  {
		opacity: 1;
		/*  display: block; */
		display: grid;
		order: 1;
		grid-column: start / end;
		width: 100%;
	}

	/* https://dev.to/kevinbism/css-animation-with-display-none-4pan */
	@starting-style { /* <-- and this line */
		.menu-open nav  {
			opacity: 0;
		}
	}
	
	/* Diasble image lightbox */
	a:has(img) {
		pointer-events: none;
	}
	
}

/*--------------------------------------------------------------
# Content
--------------------------------------------------------------*/
section {
	display: grid;
}

main > section {
	display: grid;
	row-gap: 2rem;
}

main > section > section {
	display: grid;
	row-gap: 2rem;
}

section > div {
	display: flex;
	flex-wrap: wrap;
	row-gap: 1rem;
	column-gap: 1rem;
}

@container body (inline-size < 768px)  {
	section > div {
		display: grid !important;
		row-gap: 2rem;
	}
}

section > div > div {  
	display: flex;
	flex-wrap: wrap;
	row-gap: 1rem;
}

/* section:target {
	background-color: #fff;
} */

/* #region ART PANELS */
section#guardians-of-the-water > div >*:nth-child(1) {
	flex: 1;
}

section#guardians-of-the-water > div >*:nth-child(2) {
	flex: 0.52;
}

section#guardians-of-the-water > div >*:nth-child(3) {
	flex: 0.46;
}

section#lone-survivor > div >*:nth-child(1) {
	flex: 1;
}

section#lone-survivor > div >*:nth-child(2) {
	flex: 1.73;
	flex: 3.2;
}

section#lone-survivor > div >*:nth-child(3) {
	flex: 2.3;
}

section#lone-survivor > div >*:nth-child(4) {
	flex: 1.33;
}

section#illustrations > div {
	column-gap: 1rem;
}

section#illustrations > div > div {
	row-gap: 0.5rem;
}

section#illustrations > div >*:nth-child(1) {
	flex: 1;
}

section#illustrations > div >*:nth-child(2) {
	flex: 0.67;
}

section#illustrations > div >*:nth-child(3) {
	flex: 0.66;
}

section#illustrations > div >*:nth-child(4) {
	flex: 1.03;
} */

section#illustrations > div >*:nth-child(5) {
	flex: 1;
}

section#sketchbook-work > div > div {
	column-gap: 1rem;
}

section#sketchbook-work > div:first-of-type >*:nth-child(1) {
	flex: 1;
}

section#sketchbook-work > div:first-of-type >*:nth-child(2) {
	flex: 1.44;
}

section#sketchbook-work > div:first-of-type >*:nth-child(3) {
	flex: 1.45;
}

section#sketchbook-work > div:first-of-type >*:nth-child(4) {
	flex: 1.46;
}

section#sketchbook-work > div:last-of-type >*:nth-child(1) {
	flex: 1;
}

section#sketchbook-work > div:last-of-type >*:nth-child(2) {
	flex: 0.58;
}

section#sketchbook-work > div:last-of-type >*:nth-child(3) {
	flex: 0.85;
}

section#sketchbook-work > div:last-of-type >*:nth-child(4) {
	flex: 0.85;
}

section#sketchbook-work > div:last-of-type >*:nth-child(5) {
	flex: 1.71;
}

section#sylvia > div >*:nth-child(1) {
	flex: 1;
}

section#sylvia > div >*:nth-child(2) {
	flex: 1
}

section#sylvia > div >*:nth-child(3) {
	flex: 0.51;
}

section#sylvia > div >*:nth-child(4) {
	flex: 0.51;
}

section#armour-etchings > div >*:nth-child(1) {
	flex: 1;
}

section#armour-etchings > div >*:nth-child(2) {
	flex: 0.99;
}

section#armour-etchings > div >*:nth-child(3) {
	flex: 0.96;
}

section#tree-etchings > div >*:nth-child(1) {
	flex: 1;
}

section#tree-etchings > div >*:nth-child(2) {
	flex: 0.98;
}

section#tree-etchings > div >*:nth-child(3) {
	flex: 0.94;
}

section#tree-etchings > div >*:nth-child(4) {
	flex: 0.96;
}

section#tree-etchings > div >*:nth-child(5) {
	flex: 1.01;
}

section#epq-medieval-manuscript > div >*:nth-child(1) {
	flex: 1;
}

section#epq-medieval-manuscript > div >*:nth-child(2) {
	flex: 2.11;
}

section#epq-medieval-manuscript > div >*:nth-child(3) {
	flex: 1.01;
}

section#life-drawing > div >*:nth-child(1) {
	flex: 1;
}

section#life-drawing > div >*:nth-child(2) {
	flex: 1.29;
}

section#life-drawing > div >*:nth-child(3) {
	flex: 2.28;
}

section#observational-drawing > div >*:nth-child(1) {
	flex: 1;
}

section#observational-drawing > div >*:nth-child(2) {
	flex: 0.993;
}

section#observational-drawing > div >*:nth-child(3) {
	flex: 0.996;
}

section#blender-work > div >*:nth-child(1) {
	flex: 1;
}

section#blender-work > div >*:nth-child(2) {
	flex: 1.035;
}

section#blender-work > div >*:nth-child(3) {
	flex: 4.207;
}

section#miniature-room > div >*:nth-child(1) {
	flex: 1;
}

section#miniature-room > div >*:nth-child(2) {
	flex: 1.06;
}

section#miniature-room > div >*:nth-child(3) {
	flex: 0.51;
}

section#zelda-master-sword > div >*:nth-child(1) {
	flex: 1;
}

section#zelda-master-sword > div >*:nth-child(2) {
	flex: 0.894;
}

section#zelda-master-sword > div >*:nth-child(3) {
	flex: 3.21;
}

section#stop-motion-puppet > div >*:nth-child(1) {
	flex: 1;
}

section#stop-motion-puppet > div >*:nth-child(1) {
	flex: 1;
}

section#stop-motion-puppet > div >*:nth-child(2) {
	flex: 0.87;
}

section#stop-motion-puppet > div >*:nth-child(3) {
	flex: 0.84;
}

section#stop-motion-puppet > div >*:nth-child(4) {
	flex: 0.95;
}

section#spotify-canvas > div >*:nth-child(1) {
	flex: 1;
}

section#spotify-canvas > div >*:nth-child(2) {
	flex: 1.12;
}

section#spotify-canvas > div >*:nth-child(3) {
	flex: 1.14;
}

/* #endregion */

/*--------------------------------------------------------------
# Scroll to top button
--------------------------------------------------------------*/

  .wrapper {
	position: absolute;
	right: 0;
}

.scrollToTopBtn {
	background-color: grey;
	border: none;
	border-radius: 50%;
	color: white;
	cursor: pointer;
	height: 55px;
	width: 55px;
	text-align: center;
	position: fixed;
	bottom: 5.4rem;
	right: 30px;
	z-index: 100;
	opacity: 0;
	transform: translateY(100px);
	transition: all 0.5s ease;
}

.showBtn {
	opacity: 1;
	transform: translateY(0);
}

.scroll-arrow {
	border: solid white;
	border-width: 0 4px 4px 0;
	display: inline-block;
	padding: 6px;
}

.up {
	transform: translateY(5px) rotate(-135deg);
	-webkit-transform: translateY(5px) rotate(-135deg);
}

/*--------------------------------------------------------------
# Font switcher
--------------------------------------------------------------*/
/* Hide the checkbox */
.font-switch {
	display: none;
}

/* Style the label as the switch */
.switch-label {
	cursor: pointer;
	display: inline-block;
	background: #ddd;
	border-radius: 25px;
	width: 60px;
	height: 30px;
	position: relative;
	transition: background-color 0.3s ease;
}

.switch-label::before {
	content: '';
	position: absolute;
	top: 5px;
	left: 5px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.3s ease;
}

/* When checkbox is checked */
.font-switch:checked + .switch-label {
	background: #4caf50;
}

.font-switch:checked + .switch-label::before {
	transform: translateX(30px);
}

  /* Apply the alternate font */
html :has(.font-switch:checked) {
	font-family: 'Lexend', sans-serif;
}

/*--------------------------------------------------------------
# Lightbox
-------------------------------------------------------------- */
.lightbox-container {
	display: none;
	position: fixed;
	width: 100%;
	height: 100%;
	color: var(--text-color);
	background-color: var(--lightbox-bg);
}

.image-container {
	position: fixed;
	width: 100%;
	height: 100%;
}

.lightbox-container.active {
	display: block;
	/* place-items: center; */
}

.image-container {
	display: grid;
	/* max-width: 75%;
	max-height: 75%; */
	object-fit: cover;
	/* place-items: center; */
	transition: translate .3s linear;
}

/* .lightbox-container.active {
	display: grid;
	place-items: center;
	
} */

.image-container > img {
	/* max-width: 75%;
	max-height: 75%; */
	object-fit: cover;
}

.image-transition {
	transition: transform 1s ease-in-out;
}

/* 
.image-container > img {
	transition: translate .3s linear;
	transition: opacity 0.5s ease-in-out;
} */

.slide-in {
	transform: translateX(0);
	transition: opacity 0.5s ease;
}

  /* Fade-out animation for old image */
.fade-out {
	opacity: 0;
	transition: opacity 0.5s ease;
  }
  
 
.fade-in {
	opacity: 1;
	transform: translateX(0); /* Move to the center */
}

.lightbox-container > *:not(figure) {
	position: absolute;
}

.lightbox-container > button {
	/* display: grid; */
	padding: 1rem; /* allow user more margin to click */
	/* user-select: none; */
}

.image-index {
	top: 50px;
	left: 50px;
	font-size: 1.75rem;
	font-weight: 400;
	letter-spacing: 0.1rem;
	cursor: default;
}

.close {
	top: 25px;
	right: 50px;
	font-size: 4rem;
	font-weight: 300;
	cursor: pointer;
}

.arrow {
	top: 50%;
	cursor: pointer;
	user-select: none;
} 
  
#arrow-left {
	left: 50px;
}
  
#arrow-right {
	right: 50px;
}

/*--------------------------------------------------------------
# Accessibility
-------------------------------------------------------------- */
.screen-reader {
	clip: rect(1px,1px,1px,1px);
	width: 1px;
	height: 1px;
	overflow: hidden!important;
	position: fixed!important;
	white-space: nowrap!important;
	word-wrap: normal!important;
}