/*
Theme Name: Commons Template
Theme URI: https://internetoutreachexperts.com/templates/commons/
Author: Internet Outreach Experts
Author URI: https://internetoutreachexperts.com
Description: Editorial magazine. Black + emerald + clay, Fraunces serif (display) + Inter Tight (body). Each Sunday treated as a new "issue" — for urban plants, multicultural congregations, and social-justice-engaged churches. Photo-essay sermon teasers, editorial pull quotes, oversized serif display.
Version: 1.0.0
License: Proprietary — IOE customer use only
Text Domain: commons-template
*/

/*
 * THE COMMONS — urban plant / multicultural / editorial
 * Aesthetic: Magazine. The website is a thoughtful publication, not a brochure.
 * "Issue numbers," big serif display, photo-essay sermon teasers.
 */

:root {
	--ink: #0a0a0a;
	--ink-soft: #181816;
	--paper: #f8f5f0;
	--paper-deep: #ede8de;
	--emerald: #1f5641;
	--emerald-deep: #143a2c;
	--emerald-light: #2d7754;
	--clay: #c97a47;
	--clay-deep: #a55e2e;
	--clay-light: #e5a478;
	--text: #1a1a18;
	--text-soft: #4a4842;
	--text-muted: #7b7870;
	--rule: #d4cfc3;

	--font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
	--font-body: 'Inter Tight', 'Inter', -apple-system, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, monospace;

	--page-max: 1280px;
	--gutter: clamp(1.25rem, 4vw, 3.5rem);
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.65;
	color: var(--text);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0.03 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
	background-attachment: fixed;
}

img, svg { max-width: 100%; height: auto; display: block; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
a { color: var(--emerald); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--clay-deep); }
::selection { background: var(--emerald); color: var(--paper); }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 400;
	line-height: 0.98;
	letter-spacing: -0.015em;
	color: var(--ink);
	margin: 0 0 .5em;
	font-variation-settings: 'opsz' 60, 'SOFT' 10;
}
h1 { font-size: clamp(3rem, 2rem + 5vw, 7rem); font-weight: 300; }
h2 { font-size: clamp(2rem, 1.3rem + 3vw, 4rem); font-weight: 300; }
h3 { font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem); font-weight: 400; }
h4 { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.005em; }

h1 em, h2 em, h3 em { font-style: italic; font-weight: 300; color: var(--emerald); }

.issue-mark {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--clay-deep);
}
.issue-mark::before {
	content: '';
	width: 28px;
	height: 1px;
	background: var(--clay);
}
.issue-mark.solo::before { display: none; }

.byline {
	font-family: var(--font-display);
	font-style: italic;
	font-size: 0.9rem;
	color: var(--text-muted);
	letter-spacing: 0.02em;
}

p { margin: 0 0 1em; max-width: 60ch; }
p.lead {
	font-family: var(--font-display);
	font-size: clamp(1.2rem, 1rem + 0.7vw, 1.6rem);
	line-height: 1.4;
	color: var(--text-soft);
	font-weight: 300;
	font-style: italic;
	max-width: 32ch;
}

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: clamp(4rem, 3rem + 5vw, 7rem) 0; }
.section-tight { padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0; }

.rule-top { border-top: 1px solid var(--ink); padding-top: .75rem; }

/* BUTTONS */
.btn {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: 1em 1.75em;
	font-family: var(--font-body);
	font-weight: 500;
	font-size: 0.92rem;
	letter-spacing: 0.02em;
	background: var(--ink);
	color: var(--paper);
	border: 1px solid var(--ink);
	border-radius: 0;
	text-decoration: none;
	transition: background .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: var(--emerald); border-color: var(--emerald); color: var(--paper); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-emerald { background: var(--emerald); border-color: var(--emerald); }
.btn-emerald:hover { background: var(--emerald-deep); border-color: var(--emerald-deep); }
.btn-clay { background: var(--clay); border-color: var(--clay); color: var(--ink); }
.btn-clay:hover { background: var(--clay-deep); border-color: var(--clay-deep); color: var(--paper); }
.btn-lg { padding: 1.15em 2em; font-size: 0.98rem; }

.link-arrow {
	font-family: var(--font-body);
	font-weight: 500;
	font-size: 0.85rem;
	color: var(--ink);
	text-decoration: none;
	border-bottom: 1px solid var(--ink);
	padding-bottom: 2px;
}
.link-arrow:hover { color: var(--clay-deep); border-bottom-color: var(--clay); text-decoration: none; }
.link-arrow::after { content: ' →'; }

/* HEADER */
.masthead {
	border-bottom: 1px solid var(--ink);
	background: var(--paper);
	position: sticky;
	top: 0;
	z-index: 40;
}
.masthead-inner {
	max-width: var(--page-max);
	margin: 0 auto;
	padding: 1.25rem var(--gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
}
.brand {
	display: inline-flex;
	align-items: baseline;
	gap: .6rem;
	color: var(--ink);
	text-decoration: none;
	font-family: var(--font-display);
	font-weight: 300;
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
	letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand .ampersand { color: var(--clay); font-style: italic; }
.brand-sub {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-left: .5em;
	align-self: center;
}

.primary-menu { display: flex; gap: 1.5rem; align-items: center; }
.primary-menu a {
	font-family: var(--font-body);
	font-size: 0.92rem;
	color: var(--ink);
	text-decoration: none;
	padding: .3rem 0;
	border-bottom: 1px solid transparent;
	font-weight: 500;
}
.primary-menu a:hover { border-bottom-color: var(--clay); color: var(--ink); }
.primary-menu a.current { border-bottom-color: var(--ink); }

.menu-toggle { display: none; padding: .5rem .9rem; border: 1px solid var(--ink); }

@media (max-width: 880px) {
	.masthead-inner { flex-wrap: wrap; }
	.menu-toggle { display: inline-flex; }
	.primary-menu {
		order: 3; width: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		border-top: 1px solid var(--ink);
		padding-top: 1rem;
		margin-top: 1rem;
		display: none;
	}
	.primary-menu.is-open { display: flex; }
	.primary-menu a { padding: .8rem 0; border-bottom: 1px solid var(--rule); text-align: center; }
}

/* HERO: Magazine cover */
.hero {
	padding: clamp(2.5rem, 2rem + 3vw, 5rem) 0;
	border-bottom: 1px solid var(--ink);
}
.hero-inner {
	max-width: var(--page-max);
	margin: 0 auto;
	padding: 0 var(--gutter);
}
.hero-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
	align-items: end;
}
@media (min-width: 900px) { .hero-grid { grid-template-columns: 5fr 4fr; gap: 4rem; } }

.hero-head .issue-mark { margin-bottom: 1.75rem; }
.hero-head h1 { margin: 0 0 1.5rem; }
.hero-head .byline { margin-bottom: 2rem; }
.hero-head p {
	font-family: var(--font-display);
	font-size: clamp(1.2rem, 1rem + 0.6vw, 1.55rem);
	line-height: 1.45;
	font-weight: 300;
	color: var(--text-soft);
	max-width: 30ch;
}

.hero-image {
	aspect-ratio: 3 / 4;
	background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-deep) 60%, var(--ink) 100%);
	position: relative;
	overflow: hidden;
	display: grid;
	place-items: center;
}
.hero-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle at 25% 25%, rgba(201, 122, 71, 0.4), transparent 50%),
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' seed='11'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.9  0 0 0 0.07 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
	mix-blend-mode: overlay;
}
.hero-image svg {
	width: 60%; height: 60%;
	color: var(--paper);
	opacity: 0.4;
	position: relative;
	z-index: 1;
}

/* HERO META STRIP */
.hero-meta-strip {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	padding: 1.75rem var(--gutter);
	background: var(--ink);
	color: var(--paper);
	max-width: var(--page-max);
	margin: 0 auto;
}
@media (min-width: 780px) { .hero-meta-strip { grid-template-columns: repeat(4, 1fr); gap: 2rem; } }
.hero-meta-item { display: flex; flex-direction: column; gap: .25rem; }
.hero-meta-label {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--clay-light);
}
.hero-meta-value {
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 400;
	color: var(--paper);
}

/* EDITORIAL CARDS — photo-essay feature grid */
.editorial-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 3rem 2.5rem;
}
@media (min-width: 720px) { .editorial-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .editorial-grid { grid-template-columns: repeat(3, 1fr); } }

.essay {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.essay-image {
	aspect-ratio: 5 / 4;
	background: linear-gradient(165deg, var(--emerald-light), var(--emerald-deep));
	position: relative;
	overflow: hidden;
}
.essay-image.var-clay { background: linear-gradient(165deg, var(--clay-light), var(--clay-deep)); }
.essay-image.var-ink { background: linear-gradient(165deg, var(--text-soft), var(--ink)); }
.essay-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.88  0 0 0 0.08 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
	mix-blend-mode: overlay;
}
.essay .issue-mark { margin-top: 0; }
.essay h3 { margin: .25rem 0 .5rem; }
.essay p { color: var(--text-soft); font-size: 1rem; }
.essay .byline { margin-top: auto; }

/* PULL QUOTE */
.pull-quote {
	padding: clamp(2rem, 1.5rem + 2vw, 4rem) 0;
	border-top: 1px solid var(--ink);
	border-bottom: 1px solid var(--ink);
	text-align: center;
	background: var(--paper-deep);
}
.pull-quote blockquote {
	margin: 0 auto;
	max-width: 22ch;
	font-family: var(--font-display);
	font-size: clamp(2rem, 1.5rem + 3vw, 4rem);
	font-weight: 300;
	font-style: italic;
	line-height: 1.05;
	color: var(--ink);
	padding: 0;
	border: 0;
}
.pull-quote blockquote em { color: var(--clay-deep); font-weight: 300; font-style: italic; }
.pull-quote cite {
	display: block;
	margin-top: 2rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--text-muted);
	font-style: normal;
}

/* ABOUT / GATHER / SERVE */
.three-col {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}
@media (min-width: 820px) { .three-col { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }
.three-col-item { border-top: 1px solid var(--ink); padding-top: 1.5rem; }
.three-col-item .num {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.15em;
	color: var(--clay-deep);
	margin-bottom: 1rem;
	display: block;
}
.three-col-item h3 { font-size: 1.85rem; margin: 0 0 1rem; font-weight: 300; }
.three-col-item p { color: var(--text-soft); font-size: 1rem; }

/* CTA BAND */
.cta-band {
	background: var(--ink);
	color: var(--paper);
	padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0;
}
.cta-band h2 { color: var(--paper); max-width: 14ch; margin: 1rem 0 1.5rem; }
.cta-band h2 em { color: var(--clay-light); }
.cta-band p { color: rgba(248, 245, 240, 0.7); max-width: 48ch; }
.cta-band .issue-mark { color: var(--clay-light); }
.cta-band .issue-mark::before { background: var(--clay-light); }
.cta-band .btn { background: var(--clay); border-color: var(--clay); color: var(--ink); }
.cta-band .btn:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.cta-band .btn-ghost { background: transparent; color: var(--paper); border-color: rgba(248, 245, 240, 0.3); }
.cta-band .btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* PAGE BANNER */
.page-banner {
	padding: clamp(3rem, 2rem + 4vw, 6rem) 0 clamp(2rem, 1.5rem + 2vw, 3rem);
	border-bottom: 1px solid var(--ink);
}
.page-banner .issue-mark { margin-bottom: 1.5rem; }
.page-banner h1 { margin-bottom: 1rem; max-width: 20ch; }
.page-banner h1 em { color: var(--clay-deep); }
.page-banner .lead { max-width: 40ch; }

/* FOOTER */
.site-footer {
	background: var(--ink);
	color: rgba(248, 245, 240, 0.8);
	padding: clamp(3rem, 2rem + 3vw, 5rem) 0 1.5rem;
}
.footer-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
	max-width: var(--page-max);
	margin: 0 auto;
	padding: 0 var(--gutter);
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-brand .brand { color: var(--paper); font-size: 2rem; }
.footer-brand .brand .ampersand { color: var(--clay-light); }
.footer-brand p { color: rgba(248, 245, 240, 0.65); max-width: 30ch; margin-top: 1rem; font-family: var(--font-display); font-style: italic; font-size: 1.05rem; line-height: 1.5; }
.footer-col h5 {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--clay-light);
	margin: 0 0 1rem;
	font-weight: 500;
}
.footer-col ul { display: flex; flex-direction: column; gap: .45rem; }
.footer-col a { color: rgba(248, 245, 240, 0.75); font-size: 0.95rem; }
.footer-col a:hover { color: var(--paper); }
.footer-bottom {
	margin-top: 3rem;
	padding: 1.5rem var(--gutter) 0;
	max-width: var(--page-max);
	margin-left: auto; margin-right: auto;
	border-top: 1px solid rgba(248, 245, 240, 0.15);
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: rgba(248, 245, 240, 0.45);
}

/* PROSE */
.prose { max-width: 680px; margin: 0 auto; padding: clamp(2.5rem, 1.5rem + 3vw, 4rem) var(--gutter); font-size: 1.08rem; line-height: 1.75; }
.prose p { margin: 0 0 1.3em; max-width: 100%; color: var(--text-soft); }
.prose p strong { color: var(--ink); }
.prose p em { color: var(--emerald); font-style: italic; }
.prose h2 { margin: 2.25em 0 .5em; }
.prose h3 { margin: 1.75em 0 .4em; color: var(--emerald); }
.prose ul, .prose ol { padding-left: 1.25em; margin: 1em 0 1.5em; color: var(--text-soft); }
.prose ul li::marker { color: var(--clay-deep); }
.prose ul li { margin-bottom: .4em; }

/* MOTION */
@media (prefers-reduced-motion: no-preference) {
	.hero-head > *:nth-child(1) { animation: co-rise 0.9s var(--ease) both; }
	.hero-head > *:nth-child(2) { animation: co-rise 0.9s 0.1s var(--ease) both; }
	.hero-head > *:nth-child(3) { animation: co-rise 0.9s 0.2s var(--ease) both; }
	.hero-head > *:nth-child(4) { animation: co-rise 0.9s 0.3s var(--ease) both; }
}
@keyframes co-rise {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: none; }
}

/* ========== PHOTO COMPONENTS ========== */

/* Hero image with photo — replaces SVG arch in hero-image div.
   3:4 aspect kept; photo fills the box. URL via inline CSS var (must be absolute /images/ path). */
.hero-image.hero-image--photo {
	background:
		linear-gradient(160deg, rgba(8,12,10,0.20) 0%, rgba(8,12,10,0.0) 50%),
		var(--hero-photo) center / cover,
		var(--ink);
}
.hero-image.hero-image--photo::after {
	/* Tone the noise overlay so the photo shows through */
	mix-blend-mode: multiply;
	opacity: 0.4;
}
.hero-image.hero-image--photo svg { display: none; }

/* Essay image with photo — replaces gradient placeholder in editorial cards.
   Each essay card uses its own --essay-photo CSS variable for the URL. */
.essay-image.essay-image--photo {
	background:
		linear-gradient(180deg, rgba(8,12,10,0.0) 60%, rgba(8,12,10,0.25) 100%),
		var(--essay-photo) center / cover,
		var(--ink);
}
.essay-image.essay-image--photo::after {
	mix-blend-mode: multiply;
	opacity: 0.3;
}

/* Full-width photo band — capped height with centered crop (per template-imagery skill) */
.photo-band {
	width: 100%;
	display: block;
	margin: 0;
	background: var(--paper-deep);
	overflow: hidden;
}
.photo-band img {
	width: 100%;
	height: auto;
	display: block;
	max-height: clamp(280px, 32vw, 540px);
	object-fit: cover;
	object-position: center;
}
