
:root {
	--color-1-font: #FFFFFF;
	--color-1-background: #FFFFFF;

    --color-2-font: #FFFFFF;
	--color-2-background: #FFFFFF;

    --color-3-font: #FFFFFF;
	--color-3-background: #FFFFFF;

    --color-4-font: #FFFFFF;
	--color-4-background: #FFFFFF;

    --color-5-font: #FFFFFF;
	--color-5-background: #FFFFFF;

	--body-font-family: Arial, sans-serif;
	--body-font-color: #333;
	--body-background-color: #fff;

	--content-font-color: #333;
	--content-background-color: #FFFFFF;

	--title-font-color: #333;
    --title-font-size: 1.5rem;
	
	--site-padding-top: 20px;
	--site-padding-bottom: 20px;
	--site-padding-left: 1rem;
	--site-padding-right: 1rem;

	--content-margin-top-bottom: 0px;
	--content-margin-left-right: 0px;

	--content-padding-top: 15px;
	--content-padding-bottom: 15px;
	--content-padding-left: max(30px, 2vw);
	--content-padding-right: max(30px, 2vw);
	--content-padding-bottom-last-item: minmax(30px, 2vw);

	--content-font-size: 1rem;
	--content-line-height: 1.4;
	--content-max-width: 980px;
	--content-width: calc(100% - var(--content-margin-left-right) - var(--content-margin-left-right) - var(--content-padding-left) - var(--content-padding-right));

	--content-box-shadow: 0px 2px 5px -1px rgba(0,0,0,0.05);

	--featured-image-figcaption-font-size: 0.9rem;

	--header-title-font-size: 2rem;
	--header-tagline-font-size: 0.9rem;
	--header-height: 3.125rem;
	--header-width: 320px;

	--search-input-width: calc(1ch * 60);

	--aside-wrapper-width: 260px;
	--aside-font-size: max(0.6vw, 1.2rem);

    --title: "title title title" auto;
}

html, body {
    height: 100%; /* "height: 100%" required for scroll lock of main when responsive menu is open. */
}

body {
	font-family: var(--body-font-family);
	color: var(--body-font-color);
	background: var(--body-background-color);	
	font-size: 1rem;
}

/* Still required? */
input[type=text],
input[type=search] {
	border: none;
}

/*
 * Set second last row to 1fr to avoid content getting streched when sidebar is longer than article.
  * Other fix: include 2 rows for "main" and set 2nd "main" row to "1fr" height 
 */

.error404 #gridify-wrapper {
	display: grid;
	grid-template:
	"burger header header" var(--header-height)
    var(--title)
	"main  main  main" auto
	"footer footer footer" auto
	/ 50px auto 1fr;
    gap: 5px; /* gap can cause white space gap when a element is not available */
}

#gridify-wrapper {
	display: grid;
	grid-template:
	"burger header header" var(--header-height)
    var(--title)
	"date date date" auto
	"author author author" auto
	"category category category" auto
	"tag tag tag" auto
	"main  main  main" auto
	"comments comments comments" auto
	"comments-n comments-n comments-n" auto
	"image image image" auto
	"footer footer footer" auto
	/ 50px auto 1fr;
    gap: 5px; /* gap can cause white space gap when a element is not available */
}

#gridify-wrapper > * {
    background: #364963;
    color:#FFFFFF;
}

#gridify-burger-label {
    grid-area: burger;
    user-select: none; /* Prevents being highlighted when clicked multiple times */
    display: block;

    height: var(--header-height);
    position: -webkit-sticky;
    position: sticky;
	top: 0;
	z-index: 9999;
}

#gridify-aside-wrapper {
	grid-area: aside-wrapper;
    display: block;

    color: #333;
	background: #fff;
	font-size: var(--aside-font-size);
	position: fixed;
    top: calc(var(--header-height) + var(--header-height)); /* Offset: header-height plus search-menu height */
	left: calc(0px - var(--aside-wrapper-width));
	transition: left 0.3s;
    height: calc(100% - var(--header-height));
	width: var(--aside-wrapper-width);
	z-index: 9999;
}

#gridify-burger:checked ~ #gridify-wrapper > #gridify-aside-wrapper {
	left: 0;
	transition: left 0.3s;
	white-space: normal;
	overflow: scroll;
	-webkit-overflow-scrolling: touch;
}

#gridify-aside-wrapper > aside {
    color: #333;
	background: #fff;
}

#gridify-aside-wrapper h4 {
    padding-left: var(--site-padding-left);
    padding-right: var(--site-padding-right);
    margin-top: 30px;
    margin-bottom: 5px;
}

#gridify-aside-wrapper ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
}

#gridify-aside-wrapper ul li {
	padding-top: 10px;
	padding-bottom: 10px;
	padding-left: var(--site-padding-left);
	padding-right: var(--site-padding-right);
}

#gridify-aside-wrapper > aside ul li a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f3f3f3;
    padding: 5px 5px;
    display: block;
}

.gridify-title {
	grid-area: title;
    display: block;
}

.gridify-main {
	grid-area: main;
    display: block;
    color: var(--body-font-color);
}

.gridify-featured-image {
	grid-area: image;
    display: block;

    margin: 0;
}

.gridify-featured-image img {
	width: 100%;
	height: auto;
}

.gridify-category {
	grid-area: category;
    display: block;
}

.gridify-tag {
	grid-area: tag;
    display: block;
}

.gridify-date {
	grid-area: date;
    display: block;

    font-size: 0.875rem;
}

.gridify-author {
	grid-area: author;
    display: block;
}

.gridify-comments-number {
	grid-area: comments-n;
    display: block;
}

.gridify-comments {
	grid-area: comments;
    display: block;
}

.gridify-comments textarea {
    max-width: 100%;
}

#gridify-aside1 {
	grid-area: aside1;
}

#gridify-header {
    grid-area: header;
    display: flex;
    justify-self: center;

    height: var(--header-height);
    position: -webkit-sticky;
    position: sticky;
	top: 0;
	z-index: 9999;
    /* margin-left: calc(0rem - var(--header-height)); */
	width: calc(100% + var(--header-height)); /* Adjusting for logo margin-right to keep content centered */
    width: 100%;
	flex-wrap: wrap;
	flex-direction: column;
	justify-content: space-evenly;
	align-content: center;
	overflow: hidden;
	white-space: nowrap;
}

#gridify-header img {
	margin-right: 15px;
	width: auto;
	height: 70%;
}

#gridify-header-title {
	font-size: var(--header-title-font-size);
    margin: 0;
    padding: 0;
}

#gridify-header-tagline {
	font-size: var(--header-tagline-font-size);
    margin: 0;
    padding: 0;
    display: none;
}

/* Search */
#gridify-search {
	grid-area: search;
	display: flex;
	justify-content: center;
	align-items: center;

    position: fixed;
    top: var(--header-height);
	left: calc(0px - var(--aside-wrapper-width));
	transition: left 0.3s;
    height: var(--header-height);
	width: var(--aside-wrapper-width);
	z-index: 9999;
}

#gridify-burger:checked ~ #gridify-wrapper > #gridify-search {
	/* top: var(--header-height); */
	left: 0;
	transition: left 0.3s;
	white-space: normal;
	/* overflow: scroll; */
	-webkit-overflow-scrolling: touch;
}

#gridify-search-input {
	width: calc(100% - var(--header-height));
	height: 60%;
	max-width: var(--search-input-width);
	padding: 10px;
	border: none;
	border-radius: 0;
	-webkit-appearance: none;
}

#gridify-search-submit-label {
	height: 60%;
	width: var(--header-height);
	line-height: calc(var(--header-height) / 100 * 60);
	cursor: pointer;
	background: #364963;
	overflow: hidden;
}

#gridify-search-submit-label::before {
	content: '\26B2';
	font-size: calc(var(--header-height) / 100 * 40);
	color: #FFFFFF;
	display: grid;
	justify-content: center;
	align-items: center;
	transform: rotate(-45deg);
	cursor: pointer;
}

#gridify-search-submit {
	display: none;
}





#gridify-footer {
	grid-area: footer;
    display: block;
}

#gridify-footer-widget-area {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	flex-direction: column;
}

.footer-widget-item {
	flex: 1;
	max-width: max-content;
}
  
/*
 * Pseudo element to span across all inner content elements. Used for styling of background and border.
 */
 #gridify-wrapper::before {
	grid-column: innerstart;
	grid-row: innerstart / innerend;
}

/* Unsure what this is for, but its for responsive menu */
#gridify-wrapper::after {
	/* text-align: center;
	height: var(--header-height);
	background: var(--color-1-background); */
}

#gridify-wrapper::after {
	content: '';
	display: block;
	position: fixed;
	background: rgba(0, 0, 0, 0.6);
	top:0;
	right: -9999px;
	width: 100%;
	height: 100%;
	transition: right 0.3s;
	z-index: 1;
	opacity: 0;
}










/*
 * Hide the actual checkbox, but still render it so it can be accessed via keyboard for accessibility purposes.
 * Set position fixed so page doesn't jump to top when toggle is clicked.
 * Stylying done via label #gridify-burger-label.
 */
 #gridify-burger {
	display: block;
	clip: rect(1px,1px,1px,1px);
	width: 1px;
	height: 1px;
	margin: -1px;
	border: 0;
	padding: 0;
	overflow: hidden;
	position: fixed;
}

#gridify-wrapper::after,
#gridify-burger-label::before {
	content: '';
	transition: 0.3s;
}

#gridify-burger:checked ~ #gridify-wrapper::after {
	content: '';
	display: block;
	position: fixed;
	background: rgba(0, 0, 0, 0.6);
	top:0;
	left: 0;
	width: 100%;
	height: 100%;
	transition: opacity 0.3s;
	z-index: 1;
	opacity: 1;
}

#gridify-burger:checked ~ #gridify-wrapper #gridify-burger-label::before {
	content: '';
	display: block;
	position: fixed;
	top: calc(var(--header-height) + var(--header-height));
	left: var(--aside-wrapper-width);
	width: 100%;
	height: 100%;
	transition: left 0.3s;
}

/*
 * Needs fixing. No real accessibility here. Element permanently hidden. Element only exists to avoid Chrome lighthouse accessibility warning as label element requires text content.
 */
#gridify-burger-label-accessibility {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/*
 * Animated Hamburger item inspired by https://codepen.io/Bilal1909/pen/KKdrmRP
 */
#gridify-burger-label-icon {
	width: var(--header-height);
	padding: 0 17px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	/* background: var(--color-1-font); */
}

#gridify-burger-label-icon::before,
#gridify-burger-label-icon::after,
#gridify-burger-label-icon > div {
	content: '';
	display: block;
	height: 2px;
	margin: 5px 0;
	border-radius: 3px;
	background: var(--color-1-font);
	transition: 0.5s;
}

#gridify-burger:checked ~ #gridify-wrapper #gridify-burger-label-icon::before {
	transform: translateY(5px) rotate(135deg);
}

#gridify-burger:checked ~ #gridify-wrapper #gridify-burger-label-icon::after {
	transform: translateY(-9px) rotate(-135deg);
}

#gridify-burger:checked ~ #gridify-wrapper #gridify-burger-label-icon > div {
	transform: scale(0);
}

/*
 * "height: 100%" and "overflow: auto" required for scroll lock of main when responsive menu is open.
 */
#gridify-wrapper {
	height: 100%;
	overflow: auto;
}

/*
 * scroll lock of main content when responsive menu is open.
 */
#gridify-burger:checked ~ #gridify-wrapper {
	overflow: hidden;
}




.gridify-author-image {
	margin-right: 0.938rem;
	width: 50px;
	height: 50px;
	display: none;
}

.gridify-author-name {
	font-size: 0.75rem;
    margin: 0;
    padding: 0;
}





@media (min-width: 1024px) {
	#gridify-footer-widget-area {
		display: flex;
		flex-direction: row;
		justify-content: space-evenly;
		align-items: flex-start;
		gap: 20px;
	}

}
