/*
 * Glowence base styles.
 *
 * Colours and fonts read Elementor's global variables first, so changing a
 * global in Site Settings restyles the fallback templates too. The literal
 * values are the Glowence defaults, used when Elementor is not active.
 * Elementor prints its globals on <body>, which is why the tokens live there.
 */

body {
	--glowence-ginger: var(--e-global-color-primary, #af6200);
	--glowence-ochre: var(--e-global-color-secondary, #d2831a);
	--glowence-text: var(--e-global-color-text, #6f6c6a);
	--glowence-ink: var(--e-global-color-accent, #0f0b08);
	--glowence-warm-white: var(--e-global-color-glw_warm_white, #fffcfb);
	--glowence-soft-gray: var(--e-global-color-glw_soft_gray, #f1eeec);
	--glowence-light-gray: var(--e-global-color-glw_light_gray, #e2dfde);
	--glowence-white: var(--e-global-color-glw_white, #fff);
	--glowence-font-display: var(--e-global-typography-primary-font-family, "Lora"), Georgia, serif;
	--glowence-font-body: var(--e-global-typography-text-font-family, "Inter"), system-ui, -apple-system, "Segoe UI", sans-serif;
	--glowence-container: 84rem;
	--glowence-gutter: 1rem;
	--glowence-radius: 1.25rem;

	margin: 0;
	background-color: var(--glowence-white);
	color: var(--glowence-ink);
	font-family: var(--glowence-font-body);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.6em;
	color: var(--glowence-ink);
	font-family: var(--glowence-font-display);
	font-weight: 400;
	line-height: 1.2;
}

h1 {
	font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.1125rem;
}

h2 {
	font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
	line-height: 1.1;
}

h3 {
	font-size: clamp(1.25rem, 1rem + 1vw, 2rem);
}

h4 {
	font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.75rem);
	font-weight: 500;
	line-height: 1.3;
}

h5 {
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.3;
}

h6 {
	color: var(--glowence-text);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
}

p {
	margin: 0 0 1em;
}

a {
	color: var(--glowence-ginger);
	text-decoration: none;
}

a:hover,
a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

:focus-visible {
	outline: 2px solid var(--glowence-ginger);
	outline-offset: 3px;
}

blockquote {
	margin: 1.5em 0;
	padding-left: 1.25em;
	border-left: 3px solid var(--glowence-ochre);
	font-family: var(--glowence-font-display);
	font-size: 1.25rem;
	font-style: italic;
}

input,
select,
textarea,
button {
	font: inherit;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
select,
textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid var(--glowence-light-gray);
	border-radius: 0.75rem;
	background-color: var(--glowence-white);
	color: var(--glowence-ink);
	font-size: 1rem;
}

button,
input[type="submit"],
.glowence-theme-button,
.wp-block-button.is-style-glowence-pill .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 0.75rem 1.5rem;
	border: 0;
	border-radius: 999px;
	background-color: var(--glowence-ginger);
	color: var(--glowence-white);
	font-family: var(--glowence-font-body);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

button:hover,
input[type="submit"]:hover,
.glowence-theme-button:hover {
	background-color: var(--glowence-ink);
	color: var(--glowence-white);
	text-decoration: none;
}

/* Accessibility helpers */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	padding: 0.75rem 1.25rem;
	clip: auto !important;
	clip-path: none;
	border-radius: 999px;
	background-color: var(--glowence-ink);
	color: var(--glowence-white);
	font-weight: 600;
}

/* Layout */

.glowence-container {
	width: 100%;
	max-width: var(--glowence-container);
	margin-inline: auto;
	padding-inline: var(--glowence-gutter);
}

/* Full-bleed panels (mobile menus, wide sections) must never cause a sideways scroll. */
.site {
	overflow-x: clip;
}

.site-main {
	display: block;
}

.content-area {
	display: grid;
	gap: 3rem;
	padding-block: 4rem 6rem;
}

body:not(.no-sidebar) .has-sidebar-layout {
	grid-template-columns: minmax(0, 1fr) 20rem;
}

/* Fallback header and footer */

.site-header {
	position: relative;
	z-index: 50;
	border-bottom: 1px solid var(--glowence-light-gray);
	background-color: var(--glowence-white);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	min-height: 5rem;
}

.site-title {
	color: var(--glowence-ink);
	font-family: var(--glowence-font-display);
	font-size: 1.5rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.custom-logo {
	display: block;
	width: auto;
	max-height: 3rem;
}

.primary-menu,
.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-menu a,
.footer-menu a {
	color: var(--glowence-ink);
	font-weight: 500;
}

.primary-menu .sub-menu {
	display: none;
}

.menu-toggle {
	display: none;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.85rem 0.75rem;
	background-color: var(--glowence-soft-gray);
}

.menu-toggle__bar {
	display: block;
	width: 1.25rem;
	height: 2px;
	background-color: var(--glowence-ink);
}

.site-footer {
	padding-block: 3rem;
	background-color: var(--glowence-ink);
	color: var(--glowence-warm-white);
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

.site-footer__copyright {
	margin: 0;
}

.site-footer .footer-menu a {
	color: var(--glowence-warm-white);
}

/* Posts */

.page-header {
	margin-bottom: 2.5rem;
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
	gap: 2rem;
}

.post-card {
	overflow: hidden;
	border-radius: var(--glowence-radius);
	background-color: var(--glowence-soft-gray);
}

.post-card .entry-thumbnail img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.post-card__body {
	padding: 1.5rem;
}

.post-card__title {
	font-size: 1.5rem;
}

.post-card__title a {
	color: inherit;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin-bottom: 1rem;
	color: var(--glowence-text);
	font-size: 0.875rem;
}

.entry {
	padding-block: 4rem 6rem;
}

.content-area .entry {
	padding-block: 0;
}

.entry--page {
	max-width: 52rem;
}

.entry-thumbnail {
	display: block;
	margin: 0 0 2rem;
}

.entry-thumbnail img {
	border-radius: var(--glowence-radius);
}

.entry-content {
	color: var(--glowence-text);
	font-size: 1.0625rem;
}

.entry-content > * + * {
	margin-top: 1.25em;
}

.entry-content h2,
.entry-content h3 {
	margin-top: 1.6em;
}

.entry-footer,
.post-navigation,
.comments-area,
.page-links {
	margin-top: 3rem;
}

.post-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1.5rem;
}

.nav-label {
	display: block;
	color: var(--glowence-text);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 3rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding-inline: 1rem;
	border-radius: 999px;
	background-color: var(--glowence-soft-gray);
	color: var(--glowence-ink);
}

.pagination .page-numbers.current {
	background-color: var(--glowence-ginger);
	color: var(--glowence-white);
}

.comment-list {
	padding-left: 0;
	list-style: none;
}

.comment-list .children {
	list-style: none;
}

.comment-body {
	margin-bottom: 1.5rem;
	padding: 1.25rem;
	border-radius: 1rem;
	background-color: var(--glowence-soft-gray);
}

.bypostauthor > .comment-body {
	border-left: 3px solid var(--glowence-ginger);
}

.widget {
	margin-bottom: 2.5rem;
}

.widget-title {
	font-size: 1.25rem;
}

.search-form {
	display: flex;
	gap: 0.5rem;
}

.not-found {
	padding-block: 8rem;
	text-align: center;
}

.not-found__code {
	margin: 0;
	color: var(--glowence-ginger);
	font-family: var(--glowence-font-display);
	font-size: clamp(5rem, 3rem + 10vw, 10rem);
	line-height: 1;
}

.not-found .search-form {
	max-width: 28rem;
	margin: 2rem auto;
}

/* WordPress core classes */

.alignleft {
	float: left;
	margin: 0.5em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: 0.5em 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.alignwide {
	margin-inline: calc((52rem - 72rem) / 2);
	max-width: 72rem;
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text,
.gallery-caption,
figcaption {
	margin-top: 0.5rem;
	color: var(--glowence-text);
	font-size: 0.875rem;
}

.sticky .post-card__title::before {
	content: "\2605\00a0";
	color: var(--glowence-ochre);
}

/* Breakpoints match Elementor's: tablet 991px, mobile landscape 767px, mobile 479px. */

@media (max-width: 991px) {
	body:not(.no-sidebar) .has-sidebar-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.alignwide {
		margin-inline: 0;
	}
}

@media (max-width: 767px) {
	.menu-toggle {
		display: inline-flex;
	}

	.primary-navigation {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		display: none;
		padding: 1.5rem var(--glowence-gutter);
		border-bottom: 1px solid var(--glowence-light-gray);
		background-color: var(--glowence-white);
	}

	.primary-navigation.is-open {
		display: block;
	}

	.primary-menu {
		flex-direction: column;
	}

	.primary-menu .sub-menu {
		display: block;
		padding-left: 1rem;
		list-style: none;
	}

	.content-area,
	.entry {
		padding-block: 3rem 4rem;
	}
}
