/*
Theme Name: Western Welcome Neighbors
Description: Theme for Western Welcome Neighbors, a social club for active seniors in Grants Pass, Oregon. Large, readable type on a clean white and cream layout.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
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: wwneighbors
*/

/* ---------- Tokens ---------- */

:root {
	--wwn-ink: #161616;
	--wwn-text: #2e2d29;
	--wwn-muted: #5f5e55;
	--wwn-gold: #a8842c;
	--wwn-cream: #f7f5e5;
	--wwn-sand: #e9e5c9;
	--wwn-mist: #f6f6f6;
	--wwn-line: #dcd9c6;
	--wwn-white: #fff;
	--wwn-body: "Josefin Sans", "Century Gothic", "Trebuchet MS", Arial, sans-serif;
	--wwn-display: Righteous, "Josefin Sans", "Century Gothic", Arial, sans-serif;
	--wwn-content: 760px;
	--wwn-wide: 1120px;
	--wwn-gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Base ---------- */

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

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

body {
	margin: 0;
	background: var(--wwn-white);
	color: var(--wwn-text);
	font-family: var(--wwn-body);
	font-size: 1.25rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

p,
ul,
ol,
figure,
blockquote {
	margin-top: 0;
	margin-bottom: 1.25em;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.6em;
	color: var(--wwn-ink);
	font-family: var(--wwn-display);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-wrap: balance;
}

h1 {
	font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
}

h2 {
	font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
}

h3 {
	font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
}

h4 {
	font-family: var(--wwn-body);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

a {
	color: var(--wwn-ink);
	text-decoration: underline;
	text-decoration-color: var(--wwn-gold);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
object:focus-visible {
	outline: 3px solid var(--wwn-gold);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 0.75rem 1.25rem;
	background: var(--wwn-ink);
	color: var(--wwn-white);
}

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

/* ---------- Header ---------- */

.site-header {
	background: var(--wwn-white);
	border-bottom: 1px solid var(--wwn-line);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	max-width: calc(var(--wwn-wide) + 2 * var(--wwn-gutter));
	margin: 0 auto;
	padding: 0.9rem var(--wwn-gutter);
}

.site-branding {
	display: flex;
	align-items: center;
	flex: none;
}

.custom-logo-link {
	display: block;
	line-height: 0;
}

.custom-logo {
	width: 104px;
	height: auto;
	border-radius: 50%;
}

.site-title {
	color: var(--wwn-ink);
	font-family: var(--wwn-display);
	font-size: 1.25rem;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
}

/* With a logo, the site name is kept for screen readers only. */
.site-title--with-logo {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.main-navigation ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.25rem 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-navigation li {
	position: relative;
}

.main-navigation a {
	display: block;
	padding: 0.7rem 0.75rem;
	color: var(--wwn-ink);
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a {
	box-shadow: inset 0 -3px 0 var(--wwn-gold);
}

.main-navigation .menu-item-has-children > a::after,
.main-navigation .page_item_has_children > a::after {
	content: "";
	display: inline-block;
	width: 0.45em;
	height: 0.45em;
	margin-left: 0.5em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-0.2em) rotate(45deg);
}

.main-navigation .sub-menu,
.main-navigation .children {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	display: none;
	flex-direction: column;
	gap: 0;
	min-width: 15rem;
	padding: 0.5rem 0;
	background: var(--wwn-white);
	border: 1px solid var(--wwn-line);
	box-shadow: 0 10px 24px rgba(22, 22, 22, 0.12);
}

.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu,
.main-navigation li.is-open > .sub-menu,
.main-navigation li:hover > .children,
.main-navigation li:focus-within > .children,
.main-navigation li.is-open > .children {
	display: flex;
}

.main-navigation .sub-menu a,
.main-navigation .children a {
	padding: 0.75rem 1.25rem;
}

.main-navigation .sub-menu a:hover,
.main-navigation .sub-menu .current-menu-item > a {
	background: var(--wwn-cream);
	box-shadow: inset 3px 0 0 var(--wwn-gold);
}

.menu-toggle {
	display: none;
	align-items: center;
	gap: 0.65rem;
	min-height: 48px;
	padding: 0.5rem 1rem;
	background: var(--wwn-white);
	border: 2px solid var(--wwn-ink);
	color: var(--wwn-ink);
	cursor: pointer;
	font-family: var(--wwn-body);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
}

.menu-toggle__bars {
	position: relative;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.menu-toggle__bars::before {
	top: -7px;
}

.menu-toggle__bars::after {
	top: 7px;
}

@media (max-width: 1099px) {
	.site-header__inner {
		flex-wrap: wrap;
	}

	.custom-logo {
		width: 80px;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.main-navigation {
		display: none;
		flex-basis: 100%;
	}

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

	.main-navigation ul {
		flex-direction: column;
		gap: 0;
	}

	.main-navigation a {
		padding: 0.95rem 0.25rem;
		border-top: 1px solid var(--wwn-line);
		font-size: 1.125rem;
		white-space: normal;
	}

	.main-navigation a:hover,
	.main-navigation .current-menu-item > a,
	.main-navigation .current_page_item > a,
	.main-navigation .current-menu-ancestor > a {
		box-shadow: inset 3px 0 0 var(--wwn-gold);
		padding-left: 0.9rem;
	}

	/* On small screens the drop-down is simply shown, indented. */
	.main-navigation .sub-menu,
	.main-navigation .children {
		position: static;
		display: flex;
		min-width: 0;
		padding: 0 0 0 1.25rem;
		border: 0;
		box-shadow: none;
	}

	.main-navigation .sub-menu a,
	.main-navigation .children a {
		padding: 0.85rem 0.25rem;
	}

	.main-navigation .menu-item-has-children > a::after,
	.main-navigation .page_item_has_children > a::after {
		display: none;
	}
}

/* ---------- Page layout ---------- */

.site-main {
	display: block;
	min-height: 50vh;
}

.page-header {
	padding: clamp(2rem, 5vw, 3.5rem) var(--wwn-gutter) 0;
	text-align: center;
}

.page-title {
	max-width: var(--wwn-wide);
	margin: 0 auto;
}

.page-title::after {
	content: "";
	display: block;
	width: 72px;
	height: 3px;
	margin: 1.1rem auto 0;
	background: var(--wwn-gold);
}

.entry-content {
	padding: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(3rem, 7vw, 5rem);
}

.entry-content > * {
	width: min(100% - 2 * var(--wwn-gutter), var(--wwn-content));
	margin-left: auto;
	margin-right: auto;
}

.entry-content > .alignwide {
	width: min(100% - 2 * var(--wwn-gutter), var(--wwn-wide));
}

.entry-content > .alignfull {
	width: 100%;
	max-width: none;
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

.entry-content > .alignfull:last-child {
	margin-bottom: calc(-1 * clamp(3rem, 7vw, 5rem));
}

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

.entry-content > h2:first-child,
.entry-content > h3:first-child {
	margin-top: 0;
}

.has-text-align-center {
	text-align: center;
}

.wwn-lede {
	font-size: 1.375rem;
	text-align: center;
}

/* ---------- Images ---------- */

.wp-block-image {
	margin-bottom: 1.75em;
}

.wp-block-image img {
	display: block;
}

.wp-block-image.aligncenter,
.wp-block-image .aligncenter {
	display: table;
	margin-left: auto;
	margin-right: auto;
}

.wp-block-image figcaption,
.wp-element-caption {
	margin: 0.6rem 0 0;
	color: var(--wwn-muted);
	font-size: 1.0625rem;
	line-height: 1.4;
	text-align: center;
}

/* Illustration at the top of an inner page. */
.wwn-page-art {
	text-align: center;
}

.wwn-page-art img {
	display: inline-block;
	width: auto;
	max-width: min(100%, 460px);
	max-height: 260px;
}

/* Old photographs, shown at their own modest size in a snapshot frame. */
.entry-content > .wwn-snapshot {
	width: -moz-fit-content;
	width: fit-content;
	max-width: calc(100% - 2 * var(--wwn-gutter));
	padding: 0.75rem 0.75rem 0.85rem;
	background: var(--wwn-white);
	border: 1px solid var(--wwn-line);
	box-shadow: 0 6px 18px rgba(22, 22, 22, 0.08);
}

.wwn-snapshot img {
	width: auto;
	min-width: min(100%, 340px);
	max-width: 100%;
	margin: 0 auto;
}

.wwn-snapshot figcaption {
	max-width: 22rem;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Bands (full-width coloured sections) ---------- */

.wwn-band {
	margin-top: clamp(2.5rem, 6vw, 4rem);
	margin-bottom: 0;
	padding: clamp(2.5rem, 6vw, 4rem) var(--wwn-gutter);
	background: var(--wwn-cream);
	text-align: center;
}

.wwn-band + .wwn-band {
	margin-top: 0;
}

.wwn-band--mist {
	background: var(--wwn-mist);
}

.wwn-band--white {
	background: var(--wwn-white);
}

.entry-content .wwn-band > * {
	max-width: var(--wwn-content);
	margin: 0 auto 1.25rem;
}

.entry-content .wwn-band > h2,
.entry-content .wwn-band > h3 {
	margin-bottom: 1.75rem;
}

.entry-content .wwn-band > *:last-child {
	margin-bottom: 0;
}

.wwn-band .wwn-docs {
	text-align: left;
}

/* ---------- Home page photo mosaic ---------- */

.wwn-mosaic {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(0.75rem, 2vw, 1.5rem);
}

.entry-content .wwn-mosaic > * {
	margin: 0;
}

.wwn-mosaic > .wp-block-image,
.wwn-mosaic > .wp-block-image img {
	width: 100%;
	height: 100%;
}

.wwn-mosaic > .wp-block-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.wwn-mosaic__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 1.25rem;
	background: var(--wwn-cream);
	text-align: center;
}

.entry-content .wwn-mosaic__text > * {
	margin: 0 0 0.75rem;
}

.entry-content .wwn-mosaic__text > h2 {
	font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
}

.entry-content .wwn-mosaic__text > *:last-child {
	margin-bottom: 0;
}

@media (max-width: 900px) {
	.wwn-mosaic {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wwn-mosaic__text {
		grid-column: 1 / -1;
		grid-row: 1;
		padding: 1.75rem 1.25rem;
	}
}

/* ---------- Photo grid (Photos page) ---------- */

.wwn-photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.75rem 1.5rem;
	margin-bottom: 2.5rem;
}

.entry-content .wwn-photo-grid > .wp-block-image {
	margin: 0;
}

.entry-content .wwn-heading-wide {
	margin-top: 2.5rem;
	margin-bottom: 1rem;
}

.entry-content .wwn-heading-wide > h2 {
	margin: 0;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--wwn-line);
}

.wwn-photo-grid > .wp-block-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--wwn-mist);
}

.wwn-photo-grid figcaption {
	text-align: left;
}

/* ---------- Buttons ---------- */

.wwn-button,
.wp-block-button__link,
.wp-element-button,
button.wwn-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-height: 52px;
	padding: 0.8rem 1.6rem 0.65rem;
	background: var(--wwn-ink);
	border: 2px solid var(--wwn-ink);
	border-radius: 0;
	color: var(--wwn-white);
	cursor: pointer;
	font-family: var(--wwn-body);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.15s, color 0.15s;
}

.wwn-button:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
	background: var(--wwn-white);
	color: var(--wwn-ink);
}

.wwn-button--light {
	background: transparent;
	color: var(--wwn-ink);
}

.wwn-button--light:hover {
	background: var(--wwn-ink);
	color: var(--wwn-white);
}

.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.wwn-band .wp-block-buttons,
.wp-block-buttons.is-content-justification-center {
	justify-content: center;
}

/* ---------- Document lists ---------- */

.wwn-docs {
	margin-top: 0;
	margin-bottom: 1.75em;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--wwn-line);
}

.wwn-docs__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--wwn-line);
}

.wwn-docs__text {
	min-width: 0;
}

.wwn-docs__title {
	display: block;
	color: var(--wwn-ink);
	font-size: 1.3125rem;
	font-weight: 600;
	line-height: 1.3;
}

.wwn-docs__meta {
	display: block;
	margin-top: 0.15rem;
	color: var(--wwn-muted);
	font-size: 1.0625rem;
	line-height: 1.4;
}

.wwn-docs__item .wwn-button {
	flex: none;
}

.wwn-docs__empty {
	color: var(--wwn-muted);
}

@media (max-width: 560px) {
	.wwn-docs__item {
		flex-direction: column;
		align-items: flex-start;
	}

	.wwn-docs__item .wwn-button {
		width: 100%;
	}
}

/* Latest issue cards (home page). */
.wwn-latest {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1.25rem;
	max-width: var(--wwn-content);
	margin-top: 0;
	margin-bottom: 1.75em;
}

.wwn-latest__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding: 1.75rem 1.25rem;
	background: var(--wwn-white);
	border: 1px solid var(--wwn-line);
	text-align: center;
}

.wwn-latest__label {
	color: var(--wwn-muted);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.wwn-latest__title {
	margin-bottom: 0.9rem;
	color: var(--wwn-ink);
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.25;
}

/* PDF shown on the page, with an "open" button for phones and tablets. */
.wwn-pdf {
	margin-bottom: 2.25em;
}

.wwn-pdf__frame {
	display: block;
	width: 100%;
	aspect-ratio: 8.5 / 11;
	margin-bottom: 1rem;
	background: var(--wwn-mist);
	border: 1px solid var(--wwn-line);
}

.wwn-pdf__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75rem 1.25rem;
	text-align: center;
}

.wwn-pdf__hint {
	flex-basis: 100%;
	margin: 0;
	color: var(--wwn-muted);
	font-size: 1.0625rem;
}

@media (max-width: 700px), (hover: none) {
	.wwn-pdf__frame {
		display: none;
	}
}

@media (min-width: 701px) and (hover: hover) {
	.wwn-pdf__hint {
		display: none;
	}
}

/* ---------- Contact form ---------- */

.wwn-form {
	display: grid;
	gap: 1.25rem;
	margin-top: 0;
	margin-bottom: 1.75em;
	text-align: left;
}

.wwn-form__field label {
	display: block;
	margin-bottom: 0.35rem;
	color: var(--wwn-ink);
	font-weight: 700;
}

.wwn-form__field input,
.wwn-form__field textarea {
	display: block;
	width: 100%;
	padding: 0.85rem 1rem 0.7rem;
	background: var(--wwn-white);
	border: 2px solid #8a897f;
	border-radius: 0;
	color: var(--wwn-ink);
	font: inherit;
	line-height: 1.4;
}

.wwn-form__field textarea {
	min-height: 11rem;
	resize: vertical;
}

.wwn-form__field input:focus,
.wwn-form__field textarea:focus {
	border-color: var(--wwn-ink);
}

.wwn-form__optional {
	color: var(--wwn-muted);
	font-weight: 400;
}

/* Spam trap: hidden from people, visible to automated form-fillers. */
.wwn-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wwn-notice {
	margin-bottom: 1.5em;
	padding: 1rem 1.25rem;
	border-left: 6px solid var(--wwn-gold);
	background: var(--wwn-cream);
	color: var(--wwn-ink);
	font-weight: 600;
	text-align: left;
}

.wwn-notice--error {
	border-left-color: #a12a1e;
	background: #fbecea;
}

/* ---------- Lists of posts, search ---------- */

.post-list {
	padding: 0;
	list-style: none;
}

.post-list li {
	padding: 1rem 0;
	border-bottom: 1px solid var(--wwn-line);
}

.post-list__title {
	font-size: 1.3125rem;
	font-weight: 600;
}

.post-list__date {
	display: block;
	color: var(--wwn-muted);
	font-size: 1.0625rem;
}

/* ---------- Footer ---------- */

.site-footer {
	background: #111;
	color: #efecd9;
	text-align: center;
}

.site-footer__inner {
	max-width: calc(var(--wwn-wide) + 2 * var(--wwn-gutter));
	margin: 0 auto;
	padding: clamp(2.5rem, 6vw, 3.5rem) var(--wwn-gutter);
}

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

.site-footer a {
	color: var(--wwn-white);
	text-decoration-color: #d3b45f;
}

.site-footer__social {
	margin-bottom: 1.5rem !important;
}

.site-footer__facebook {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 600;
}

.site-footer__name {
	color: var(--wwn-white);
	font-family: var(--wwn-display);
	font-size: 1.25rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.site-footer__small {
	max-width: 46rem;
	margin: 1.75rem auto 0;
	padding-top: 1.5rem;
	border-top: 1px solid #3a3a36;
	color: #cfccb9;
	font-size: 1.0625rem;
}

/* ---------- Print ---------- */

@media print {
	.site-header,
	.site-footer,
	.wwn-pdf__frame,
	.menu-toggle {
		display: none !important;
	}

	body {
		font-size: 12pt;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	* {
		transition: none !important;
	}
}
