/*
Theme Name: Hluhluwe-iMfolozi
Theme URI: https://hluhluwe-imfolozi-park.co.za
Author: Site owner
Description: A custom theme for an independent information website about Hluhluwe-iMfolozi Park in KwaZulu-Natal. Hill-contour banners, a Big Five sightings checklist and photo slots managed in the Customizer.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hluhluwe-imfolozi
*/

/* ------------------------------------------------------------------
   Design tokens
   Misty hill morning background, river-green text, straw-gold accents.
------------------------------------------------------------------- */
:root {
	--mist: #edf0e8;
	--paper: #f7f8f3;
	--ink: #1d2b22;
	--forest: #264233;
	--moss: #5b7e45;
	--ochre: #b9822a;
	--straw: #e3b964;
	--slate: #55646a;
	--rule: #c6cfbc;
	--on-dark: #e9efe3;

	--font-head: "Zilla Slab", Georgia, "Times New Roman", serif;
	--font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--gutter: 1.25rem;
	--measure: 44rem;
}

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

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

body {
	margin: 0;
	background: var(--mist);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1.125rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--forest);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 3px solid var(--ochre);
	outline-offset: 3px;
}

.site-footer :focus-visible,
.hero :focus-visible,
.page-banner :focus-visible,
.section--before :focus-visible {
	outline-color: var(--straw);
}

.wrap {
	width: 100%;
	max-width: 70rem;
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--forest);
	color: #fff;
	padding: 0.75rem 1rem;
	z-index: 100;
}

.skip-link:focus {
	left: 0;
}

/* ------------------------------------------------------------------
   Header and navigation
------------------------------------------------------------------- */
.site-header {
	background: var(--mist);
	border-bottom: 1px solid var(--rule);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	padding-top: 0.9rem;
	padding-bottom: 0.9rem;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.site-branding img {
	max-height: 3rem;
	width: auto;
}

.site-title {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 1.4rem;
	letter-spacing: -0.01em;
	color: var(--forest);
	text-decoration: none;
}

.primary-menu,
.footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.4rem;
}

.primary-menu a {
	display: inline-block;
	padding: 0.35rem 0;
	color: var(--ink);
	text-decoration: none;
	font-weight: 600;
	font-size: 1rem;
	border-bottom: 2px solid transparent;
}

.primary-menu a:hover,
.primary-menu a[aria-current="page"],
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
	border-bottom-color: var(--ochre);
}

.nav-toggle {
	display: none;
	font: inherit;
	font-weight: 600;
	color: var(--forest);
	background: transparent;
	border: 2px solid var(--forest);
	border-radius: 4px;
	padding: 0.35rem 0.9rem;
	cursor: pointer;
}

@media (max-width: 56rem) {
	.js .nav-toggle {
		display: inline-block;
	}

	.js .site-nav {
		display: none;
		width: 100%;
	}

	.js .site-nav.is-open {
		display: block;
	}

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

	.primary-menu li {
		border-top: 1px solid var(--rule);
	}

	.primary-menu a {
		display: block;
		padding: 0.7rem 0;
		border-bottom: 0;
	}

	.primary-menu a[aria-current="page"],
	.primary-menu .current-menu-item > a {
		color: var(--moss);
	}
}

/* ------------------------------------------------------------------
   Hero (home page)
------------------------------------------------------------------- */
.hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: min(80vh, 46rem);
	overflow: hidden;
	color: #fff;
	background: var(--forest) url("assets/contours.svg") center / cover no-repeat;
}

.hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero--photo::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(18, 33, 25, 0.72), rgba(18, 33, 25, 0.12) 45%, rgba(18, 33, 25, 0));
}

.hero__inner {
	position: relative;
	z-index: 1;
	padding-top: 4rem;
	padding-bottom: 3.5rem;
}

.hero__title {
	max-width: 14ch;
	margin: 0 0 1rem;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: clamp(2.6rem, 7vw, 5rem);
	line-height: 1.03;
	letter-spacing: -0.02em;
}

.hero__text {
	max-width: 36rem;
	margin: 0 0 1.75rem;
	font-size: 1.2rem;
	color: var(--on-dark);
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
}

.btn {
	display: inline-block;
	padding: 0.8rem 1.4rem;
	border: 2px solid transparent;
	border-radius: 4px;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn--primary {
	background: var(--straw);
	color: var(--ink);
}

.btn--primary:hover {
	background: #efc978;
}

.btn--ghost {
	border-color: rgba(255, 255, 255, 0.75);
	color: #fff;
}

.btn--ghost:hover {
	background: rgba(255, 255, 255, 0.14);
}

/* ------------------------------------------------------------------
   Home page sections
------------------------------------------------------------------- */
.section {
	padding: 4rem 0;
}

.section__title {
	margin: 0 0 1rem;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: clamp(1.8rem, 3.6vw, 2.6rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--forest);
}

.text-link {
	font-weight: 700;
}

/* At a glance: ruled field notes */
.section--glance {
	padding-bottom: 2rem;
}

.glance {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
	gap: 0 2.5rem;
	margin: 1.5rem 0 0;
}

.glance__row {
	padding: 0.9rem 0;
	border-top: 1px solid var(--rule);
}

.glance dt {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--slate);
}

.glance dd {
	margin: 0.1rem 0 0;
	font-family: var(--font-head);
	font-weight: 500;
	font-size: 1.3rem;
	line-height: 1.25;
	color: var(--ink);
}

/* Story */
.story {
	display: grid;
	gap: 2.5rem;
	align-items: center;
}

.story__text {
	max-width: 38rem;
}

.story__photo {
	margin: 0;
}

.story__photo img {
	width: 100%;
	border-radius: 2px;
}

.story__photo figcaption {
	margin-top: 0.5rem;
	font-size: 0.95rem;
	color: var(--slate);
}

@media (min-width: 56rem) {
	.story:not(.story--solo) {
		grid-template-columns: 1.1fr 0.9fr;
		gap: 4rem;
	}
}

/* Big Five sightings checklist */
.section--sightings {
	background: var(--paper);
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
}

.sightings-wrap {
	display: grid;
	gap: 2rem;
}

.sightings-intro {
	max-width: 30rem;
}

@media (min-width: 56rem) {
	.sightings-wrap {
		grid-template-columns: 0.8fr 1.2fr;
		gap: 4rem;
		align-items: start;
	}
}

.sightings {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--rule);
}

.sightings li {
	border-bottom: 1px solid var(--rule);
}

.sighting {
	display: grid;
	grid-template-columns: 4.2rem 1fr;
	gap: 1rem;
	align-items: center;
	width: 100%;
	padding: 1.1rem 0.25rem;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.sighting:hover .sighting__name {
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

.print {
	position: relative;
	display: block;
	width: 3.6rem;
	height: 3.6rem;
}

.print__svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: #000;
	stroke-width: 2.2;
	stroke-linejoin: round;
	stroke-linecap: round;
	transition: fill 0.15s, stroke 0.15s;
}

.sighting[aria-pressed="true"] .print__svg {
	fill: #000;
	stroke: #000;
}

.print::after {
	content: "";
	position: absolute;
	right: -0.3rem;
	bottom: -0.3rem;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: var(--ochre);
	opacity: 0;
	transition: opacity 0.15s;
}

.print::before {
	content: "";
	position: absolute;
	right: 0.29rem;
	bottom: 0.2rem;
	z-index: 1;
	width: 0.28rem;
	height: 0.55rem;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
	transition: opacity 0.15s;
}

.sighting[aria-pressed="true"] .print::after,
.sighting[aria-pressed="true"] .print::before {
	opacity: 1;
}

.sighting__body {
	display: block;
}

.sighting__name {
	display: block;
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 1.55rem;
	line-height: 1.2;
	color: var(--forest);
}

.sighting__note {
	display: block;
	margin-top: 0.15rem;
	color: var(--slate);
}

@media (max-width: 34rem) {
	.sighting {
		grid-template-columns: 3.2rem 1fr;
		gap: 0.75rem;
	}
	.print {
		width: 2.8rem;
		height: 2.8rem;
	}
}

/* Explore: signpost list */
.signposts {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	border-top: 1px solid var(--rule);
}

.signposts li {
	border-bottom: 1px solid var(--rule);
}

.signposts a {
	position: relative;
	display: grid;
	gap: 0.15rem 2rem;
	padding: 1.1rem 2.25rem 1.1rem 0.25rem;
	color: inherit;
	text-decoration: none;
}

.signposts a::after {
	content: "";
	position: absolute;
	right: 0.6rem;
	top: 50%;
	width: 0.7rem;
	height: 0.7rem;
	border: solid var(--ochre);
	border-width: 3px 3px 0 0;
	transform: translateY(-50%) rotate(45deg);
}

.signposts a:hover {
	background: rgba(91, 126, 69, 0.1);
}

.signposts__title {
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 1.5rem;
	line-height: 1.2;
	color: var(--forest);
}

.signposts__desc {
	color: var(--slate);
}

@media (min-width: 48rem) {
	.signposts a {
		grid-template-columns: minmax(14rem, 20rem) 1fr;
		align-items: baseline;
	}
}

/* Gallery */
.section--gallery {
	padding-top: 0;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.gallery__item {
	margin: 0;
}

.gallery__item img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 2px;
}

/* Before you go */
.section--before {
	color: var(--on-dark);
	background: var(--forest) url("assets/contours.svg") center / cover no-repeat;
}

.section--before .section__title {
	color: #fff;
}

.before {
	display: grid;
	gap: 1.75rem 2.5rem;
	margin-top: 1.5rem;
}

@media (min-width: 48rem) {
	.before {
		grid-template-columns: repeat(3, 1fr);
	}
}

.before h3 {
	margin: 0 0 0.35rem;
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 1.4rem;
	line-height: 1.2;
	color: var(--straw);
}

.before p {
	margin: 0;
}

.before__action {
	margin: 2.25rem 0 0;
}

/* ------------------------------------------------------------------
   Inner page banner
------------------------------------------------------------------- */
.page-banner {
	position: relative;
	overflow: hidden;
	color: #fff;
	background: var(--forest) url("assets/contours.svg") center / cover no-repeat;
}

.page-banner__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.page-banner--photo::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(18, 33, 25, 0.62), rgba(18, 33, 25, 0.1));
}

.page-banner__inner {
	position: relative;
	z-index: 1;
	padding-top: 3.5rem;
	padding-bottom: 2.75rem;
}

.page-banner--photo .page-banner__inner {
	padding-top: 7rem;
}

.page-banner__title {
	margin: 0;
	max-width: 22ch;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: clamp(2.2rem, 5.5vw, 3.6rem);
	line-height: 1.06;
	letter-spacing: -0.02em;
}

.page-banner__lead {
	max-width: 38rem;
	margin: 0.9rem 0 0;
	font-size: 1.2rem;
	color: var(--on-dark);
}

/* ------------------------------------------------------------------
   Page and post content
------------------------------------------------------------------- */
.prose {
	max-width: var(--measure);
	padding: 3rem 0 4rem;
}

.prose > :first-child {
	margin-top: 0;
}

.prose h2,
.prose h3,
.prose h4 {
	font-family: var(--font-head);
	font-weight: 700;
	line-height: 1.15;
	color: var(--forest);
}

.prose h2 {
	margin: 2.75rem 0 0.75rem;
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	letter-spacing: -0.01em;
}

.prose h3 {
	margin: 2rem 0 0.5rem;
	font-size: 1.4rem;
}

.prose p {
	margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
	margin: 0 0 1.25rem;
	padding-left: 1.3rem;
}

.prose li {
	margin-bottom: 0.5rem;
}

.prose li::marker {
	color: var(--ochre);
}

.prose strong {
	color: var(--ink);
}

.prose figure {
	margin: 1.75rem 0;
}

.prose img {
	border-radius: 2px;
}

.prose figcaption {
	margin-top: 0.4rem;
	font-size: 0.95rem;
	color: var(--slate);
}

.prose .wp-block-table {
	overflow-x: auto;
	margin: 1.5rem 0;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1rem;
	line-height: 1.5;
}

.prose th,
.prose td {
	padding: 0.7rem 0.9rem 0.7rem 0;
	border-bottom: 1px solid var(--rule);
	text-align: left;
	vertical-align: top;
}

.prose th {
	font-family: var(--font-head);
	font-weight: 700;
	color: var(--forest);
	border-bottom: 2px solid var(--forest);
	white-space: nowrap;
}

/* Callout used in page content: add the class "hip-note" to a Group block */
.prose .hip-note {
	margin: 2rem 0;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--ochre);
	background: rgba(91, 126, 69, 0.12);
}

.prose .hip-note > :last-child {
	margin-bottom: 0;
}

/* Fact sheet used in page content: add the class "hip-facts" to a Group block */
.prose .hip-facts {
	margin: 1.5rem 0 2rem;
	padding: 0.25rem 1.25rem;
	border: 1px solid var(--rule);
	background: var(--paper);
}

.prose .hip-facts ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.prose .hip-facts li {
	margin: 0;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--rule);
}

.prose .hip-facts li:last-child {
	border-bottom: 0;
}

.hip-admin-note {
	padding: 0.75rem 1rem;
	border: 2px dashed var(--ochre);
	background: #fff;
}

/* Next page link */
.next-page {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 1rem;
	margin-top: 3.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
}

.next-page__label {
	color: var(--slate);
	font-size: 0.95rem;
}

.next-page__link {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 1.5rem;
	text-decoration: none;
}

.next-page__link:hover {
	text-decoration: underline;
}

/* News list */
.post-list__item {
	padding: 1.5rem 0;
	border-bottom: 1px solid var(--rule);
}

.post-list .post-list__title {
	margin: 0;
	font-size: 1.6rem;
}

.post-list__title a {
	text-decoration: none;
}

.post-list__meta {
	margin: 0.25rem 0 0.75rem;
	color: var(--slate);
	font-size: 0.95rem;
}

.navigation.pagination {
	margin-top: 2rem;
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */
.site-footer {
	margin-top: 0;
	color: var(--on-dark);
	background: var(--forest);
	font-size: 1rem;
}

.site-footer a {
	color: #fff;
}

.site-footer__grid {
	display: grid;
	gap: 2rem 3rem;
	padding-top: 3rem;
	padding-bottom: 2rem;
}

@media (min-width: 48rem) {
	.site-footer__grid {
		grid-template-columns: 1.2fr 1fr 1.2fr;
	}
}

.site-footer__name {
	margin: 0 0 0.5rem;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 1.5rem;
	color: #fff;
}

.site-footer__heading {
	margin: 0 0 0.6rem;
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 1.15rem;
	color: var(--straw);
}

.site-footer p {
	margin: 0 0 0.75rem;
}

.footer-menu li {
	margin-bottom: 0.35rem;
}

.footer-menu a {
	text-decoration: none;
}

.footer-menu a:hover {
	text-decoration: underline;
}

.site-footer__legal {
	padding-top: 1.5rem;
	padding-bottom: 2.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 0.95rem;
}

.site-footer__legal p {
	max-width: 52rem;
}

/* ------------------------------------------------------------------
   Search form (404 page)
------------------------------------------------------------------- */
.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.5rem;
}

.search-form label {
	flex: 1 1 14rem;
}

.search-field {
	width: 100%;
	padding: 0.65rem 0.8rem;
	border: 2px solid var(--forest);
	border-radius: 4px;
	background: #fff;
	font: inherit;
}

.search-submit {
	padding: 0.65rem 1.2rem;
	border: 2px solid var(--forest);
	border-radius: 4px;
	background: var(--forest);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

/* ------------------------------------------------------------------
   Motion and print
------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.nav-toggle,
	.hero__actions {
		display: none;
	}

	body {
		background: #fff;
	}
}

/* Keep banner text readable now the photo overlay is lighter */
.hero--photo .hero__inner,
.page-banner--photo .page-banner__inner {
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}
