* {
	box-sizing: border-box;
}

html {
	height: 100%;
}

body {
	margin: 0;
	padding: 0;
	font-family: sans-serif;
	line-height: 1.3;
	color: var(--text-color);
	background: var(--bg-color);
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 100%;
}

header {
	background: none;
	flex-shrink: 0;
	display: block;
	color: var(--white);
	text-align: center;
	position: relative;
	overflow: visible;
}

header .header-banner {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: -1;
}

header .header-banner img {
	width: 100%;
	/* height: 250px; */
	object-fit: cover;
	object-position: center;
	display: block;
}

header h1 {
	font-size: 3.5em;
	text-shadow: 3px 3px 6px rgba(0,0,0,0.9), -2px -2px 4px rgba(0,0,0,0.7), 0 0 10px rgba(0,0,0,0.8);
}

header h1 a {
	color: var(--white);
	text-decoration: none;
}
header h1 a:hover {
	color: var(--white);
	text-decoration: none;
}
header h1 a:visited {
	color: var(--white);
	text-decoration: none;
}

main {
	flex: 1;
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
	display: flex;
	gap: 30px;
	padding: 0px 20px 20px 20px;
}

.main-content {
	flex: 1;
}

.main-content > *:not(:has(article,footer)):has(*) {
	background: var(--bg-color);
	border-radius: 8px;
	padding-left: 20px;
	padding-right: 20px;
	padding-top: 20px;
	padding-bottom: 20px;
}

.main-content:not(:has(article)) {
}

footer s {
	text-decoration: none;
}

body:not(:has(.mode-edit)) footer {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background: white;
	padding: 2px 10px;
}
body:not(:has(.mode-edit)) div:has(> footer) {
	padding: 0;
}

/* show footer if has save button */
body:has(.mode-edit) footer:has(input) {
	background: var(--white);
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 10px var(--shadow);
}

/* Sidebar styles */
.sidenav {
	flex: 0 0 300px;
}

.sidenav .ham-icon {
	display: none;
}

.sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.sidebar-widget {
	background: var(--white);
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 10px var(--shadow);
}

.sidebar-widget h3 {
	color: var(--primary-green);
	margin-top: 0px;
	margin-bottom: 15px;
	font-size: 1.3em;
	border-bottom: 2px solid var(--primary-green-light);
	padding-bottom: 10px;
}

form#search input {
	width: 100%;
}

.nav-links a {
	display: block;
	padding: 8px 0;
	color: var(--primary-green);
	text-decoration: none;
	border-bottom: 1px solid var(--border-gray);
}

.nav-links a:hover {
	color: var(--primary-green-light);
}

/* Blog post styles */
article {
	background: var(--white);
	padding: 30px;
	margin-bottom: 30px;
	border-radius: 8px;
	box-shadow: 0 2px 10px var(--shadow);
	position: relative;
}

article .post-family {
	float: right;
	color: var(--primary-green);
	margin-top: 5px;
	font-size: 18px;
	font-style: italic;
}

article h1.post-latin {
	margin-top: 0;
}

.main-content article {
	-margin-left: -20px;
	-margin-right: -20px;
}

article a {
	text-decoration: underline 1px dashed;
	text-underline-offset: 2px;
}

article h1 {
	font-size: 2em;
	margin: 1rem 0;
}

article h1 a {
	color: var(--primary-green);
	text-decoration: none;
}

article h1 a:hover {
	color: var(--primary-green-light);
}

article::after {
	content: "";
	display: table;
	clear: both;
}

.post-meta {
	opacity: 0.5;
	font-size: smaller;
	margin-top: -1rem;
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
	padding: 10px;
	border: 2px solid var(--primary-green-light);
	border-radius: 4px;
	font-size: 1em;
}

 /* Checkbox styling - subtle enhancement */
  input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
    vertical-align: middle;
    color: var(--primary-green);
    accent-color: var(--primary-green);
  }

  /* Label styling */
  label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  /* Disabled/readonly state */
  input[type="checkbox"]:disabled {
    opacity: 1;
    cursor: default;
    color: var(--primary-green);
    accent-color: var(--primary-green);
  }

  input[type="checkbox"]:disabled + label,
  label:has(input[type="checkbox"]:disabled) {
    opacity: 1;
    cursor: default;
  }


/* searchbox */
  .search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.search-wrapper input[type="text"] {
  padding-right: 35px;
  flex: 1;
}
.search-wrapper button[type=submit] {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: url(/attach/blog/searchbox/search.svg);
  background-size: 24px;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: transparent;
  border: none;
  color: var(--primary-green);
  cursor: pointer;
}
.search-wrapper button[type=submit]:hover {
  background: url(/attach/blog/searchbox/search.svg);
  background-size: 24px;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: transparent;
  color: var(--primary-green);
}


/* Responsive design */
@media (max-width: 768px) {
	main {
		flex-direction: column;
		padding: 5px;
	}

	body:has(.showmenu) .overlay {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		background-color: #00000080;
		z-index: 1;
		transition: background-color 0.3s ease;
	}

	.sidenav {
		position: fixed;
		top: 80px;
		width: 300px;
		right: -300px;
		transition: right 0.3s ease;
		z-index: 3;
	}

	.sidenav.showmenu {
		right: 0;
	}

	.sidenav .ham-icon {
		position: absolute;
		top: 0;
		left: -40px;
		display: block;
		background: #00000080;
		border-radius: 8px 0 0 8px;
		height: 40px;
		width: 40px;
		cursor: pointer;
	}

	.sidebar {
		overflow-y: scroll;
		height: calc(100vh - 80px);
	}

	footer s {
		display: none;
	}

	header {
		height: 150px;
		min-height: 150px;
	}

	header .header-banner img {
		height: 150px;
		object-position: center center;
	}

	header h1 {
		font-size: 2em;
	}

	article {
		padding: 20px;
	}

	article h1 {
		font-size: 1.5em;
	}

	.post-family {
		display: none;
	}

	section article {
		padding: 0;
		border: 20px solid transparent;
		max-height: 500px;
		overflow: hidden;
	}

	section article h1 {
		white-space: nowrap;
	}

	section article figure.image {
		max-width: 40%;
	}

	input, textarea {
		max-width: 100%;
	}

	/* contact form responsive fixes */
	table.plain {
		width: 100%;
	}

	table.plain input[type="text"],
	table.plain input[type="email"],
	table.plain textarea {
		width: 100%;
	}

}

/* Banner fade effect at bottom (cubic bezier ease-in-out) */
header .header-banner img {
	mask-image: linear-gradient( to bottom,
	    rgb(0, 0, 0) 0%,
	    rgb(0, 0, 0) 90%,
	    rgba(0, 0, 0, 0.987) 90.81%,
	    rgba(0, 0, 0, 0.951) 91.55%,
	    rgba(0, 0, 0, 0.896) 92.25%,
	    rgba(0, 0, 0, 0.825) 92.9%,
	    rgba(0, 0, 0, 0.741) 93.53%,
	    rgba(0, 0, 0, 0.648) 94.12%,
	    rgba(0, 0, 0, 0.55) 94.71%,
	    rgba(0, 0, 0, 0.45) 95.29%,
	    rgba(0, 0, 0, 0.352) 95.88%,
	    rgba(0, 0, 0, 0.259) 96.47%,
	    rgba(0, 0, 0, 0.175) 97.1%,
	    rgba(0, 0, 0, 0.104) 97.75%,
	    rgba(0, 0, 0, 0.049) 98.45%,
	    rgba(0, 0, 0, 0.013) 99.19%,
	    rgba(0, 0, 0, 0) 100%
	);
}


/* mini-blog display */
.mini-blog {
	display: block;
	position: relative;
}

.mini-blog img:not(:first-of-type),
.mini-blog figure:not(:first-of-type) {
	display: none;
}

.mini-blog article {
	display: grid;
	grid-template-columns: 64px auto auto 1fr;
	grid-template-rows: 34px 30px;
	grid-template-areas: 	"pic latin common"
				"pic meta meta";
	gap: 0px 10px;
	padding: 10px;
	margin-bottom: 10px;
	border: 0;
}

.mini-blog h1 {
	grid-area: title;
	font-size: 22px;
	order: 2;
	margin: 0;
	overflow: hidden;
	white-space: nowrap;
}

.mini-blog .post-family {
	display: none;
}

.mini-blog .post-latin {
	grid-area: latin;
}

.mini-blog .post-common {
	grid-area: common;
}

.mini-blog .post-meta {
	grid-area: meta;
	text-align: left !important;
	opacity: 1;
	margin: 0;
}

.mini-blog .post-content {
	grid-area: pic;
	font-size: 0 !important;
	line-height: 0;
}
.mini-blog .post-content * {
	font-size: 0 !important;
}


body .mini-blog figure.image {
	float: left;
	margin: 0;
	max-width: 64px;
	max-height: 64px;
}
body .mini-blog figure img {
	margin: 0;
	width: 64px;
	height: 64px;
	object-fit: cover;
}
body .mini-blog figcaption {
	display: none;
}
