/*
Theme Name: GrowWithEric Editorial
Template: coachify
Author: Nate (design prototype, growwitheric.com)
Description: Open-editorial homepage + post-template prototype. Child theme of
  Coachify — visual/layout exploration only, per the 2026-08-10 GrowWithEric
  design-direction discussion. Does not touch nav labels, categories, or
  post-template metadata; those are gated on the content/IA freeze.
Version: 0.1.9
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: growwitheric-editorial

Palette and fonts below are a first pass from Lucy's read of the reference
sites (warm neutral / charcoal / restrained sage-teal-rust-gold accents) —
provisional pending Fletcher's sign-off, not locked.
*/

:root {
	/* --- provisional palette --- */
	--gwe-bg: #f7f2e8;
	--gwe-surface: #fffdf9;
	--gwe-ink: #262420;
	--gwe-ink-soft: #5a564d;
	--gwe-border: rgba(38, 36, 32, 0.12);
	--gwe-sage: #7c8f6f;
	--gwe-teal: #3f6b66;
	--gwe-rust: #b5563c;
	--gwe-gold: #c69a3b;

	/* --- type --- */
	--gwe-font-display: "Fraunces", Georgia, serif;
	--gwe-font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================================================
   Shared editorial base
   ========================================================================== */

body.gwe-no-sidebar,
body.home,
body.blog {
	background-color: var(--gwe-bg);
	color: var(--gwe-ink);
}

body.home .gwe-cat-links,
body.blog .gwe-cat-links,
body.gwe-no-sidebar .gwe-cat-links {
	font-family: var(--gwe-font-body);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	margin-bottom: 0.75em;
}
.gwe-cat-links a {
	color: var(--gwe-teal);
	text-decoration: none;
}
.gwe-cat-links a:hover {
	color: var(--gwe-rust);
}

/*
 * single.php intentionally reuses the parent's content-single.php template
 * part unchanged (see single.php comment), so the post's category pills are
 * parent markup — plain .cat-links, not our .gwe-cat-links — and inherit
 * coachify's own color. Its selector is
 * `:is(.entry-meta, .entry-footer) :is(.category, .cat-links, .cat-tags) a`
 * (specificity 0,2,1); this beats it on purpose rather than reaching for
 * !important.
 */
.gwe-single .entry-header .cat-links a {
	color: var(--gwe-teal);
}
.gwe-single .entry-header .cat-links a:hover {
	color: var(--gwe-rust);
}
.gwe-single .entry-header .cat-links a::before {
	background: rgba(63, 107, 102, 0.18);
}

.gwe-media-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--gwe-sage), var(--gwe-teal));
	opacity: 0.18;
}

.gwe-excerpt p {
	margin: 0;
}

/*
 * Mobile overflow safety net. Coachify's base stylesheet sets
 * `body { overflow-x: hidden }` with no global box-sizing reset, so any
 * element that ends up wider than its container gets silently clipped
 * instead of scrolling — which is what v1's screenshots showed on mobile.
 * This constrains every element we introduce to its container and removes
 * flex/grid items' default content-based minimum width, which is the
 * standard fix for that failure mode. If the v2 mobile screenshots still
 * show clipping, the remaining cause isn't one of ours and needs a
 * devtools/`getBoundingClientRect()` pass to find.
 */
.gwe-home,
.gwe-home *,
.gwe-single.page-grid,
.gwe-single.page-grid * {
	box-sizing: border-box;
	max-width: 100%;
}
.gwe-hero,
.gwe-hero-body,
.gwe-grid,
.gwe-card,
.gwe-card-body {
	min-width: 0;
}

/* ==========================================================================
   Homepage: hero + asymmetric grid
   ========================================================================== */

.gwe-home {
	max-width: 1320px;
	margin: 0 auto;
	padding: clamp(24px, 4vw, 56px) 20px clamp(48px, 6vw, 96px);
}

/*
 * Bug fix (v0.1.3): Coachify's own stylesheet has a high-specificity rule —
 * `:is(.blog,.home,...).full-width:not(.blog-layout-four) .site-content
 * .content-area :is(.navigation.pagination,.site-main){max-width:var(--centered-maxwidth);
 * margin:0 auto}` — intended to center its default single-column blog list.
 * It also matches our body (.home.full-width), clamping .site-main (and
 * therefore .gwe-grid inside it) down to that narrow centered width instead
 * of the ~1170-1320px .gwe-home column. That's the real cause of the "tiny
 * columns / huge white space" bug: the grid itself was rendering in a box
 * less than 2/3 its intended width. Needs !important to beat that rule's
 * ~8-class specificity without an arms race.
 */
.gwe-home-content .site-main {
	max-width: none !important;
	width: 100% !important;
	margin: 0 !important;
}

.gwe-hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(20px, 3vw, 40px);
	margin-bottom: clamp(48px, 6vw, 88px);
}
@media screen and (min-width: 900px) {
	.gwe-hero {
		grid-template-columns: 1.2fr 1fr;
		align-items: center;
	}
}

.gwe-hero-media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 4px;
}
.gwe-hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gwe-hero-title {
	font-family: var(--gwe-font-display);
	font-weight: 600;
	font-size: clamp(2.25rem, 4.5vw, 3.75rem);
	line-height: 1.05;
	margin: 0 0 0.4em;
}
.gwe-hero-title a {
	color: var(--gwe-ink);
	text-decoration: none;
}

.gwe-hero-body .gwe-excerpt {
	font-family: var(--gwe-font-body);
	font-size: 1.15rem;
	line-height: 1.6;
	color: var(--gwe-ink-soft);
	margin-bottom: 1.25em;
}

.gwe-read-more {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-family: var(--gwe-font-body);
	font-weight: 600;
	color: var(--gwe-rust);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 0.15em;
}

.gwe-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(28px, 3vw, 48px);
}

/*
 * Bug fix (v0.1.4): Coachify also has `.site-main article:not(:first-child)
 * {width:calc(50% - 20px)}` (its own default 2-up card grid, min-width:768px)
 * which matches every .gwe-card too since they're <article> tags — it
 * shrinks each card to 50% of whatever grid-column track it's already been
 * placed in, on top of (not instead of) the span. A span-6 "big" card was
 * rendering at half its 1170px track (~565px) and a span-3 card at half its
 * ~563px track (~262px), which is exactly the "narrow columns, huge gaps"
 * look reported - the grid-fix above wasn't enough on its own.
 */
.gwe-grid .gwe-card {
	width: auto !important;
}

@media screen and (min-width: 640px) {
	.gwe-grid {
		grid-template-columns: repeat(6, 1fr);
	}
	.gwe-grid .gwe-card {
		grid-column: span 3;
	}
	/* asymmetric rhythm: first card of every group of 5 runs large */
	.gwe-grid .gwe-card:nth-child(5n + 1) {
		grid-column: span 6;
	}
	.gwe-grid .gwe-card:nth-child(5n + 1) .gwe-card-media {
		aspect-ratio: 21 / 9;
	}
	.gwe-grid .gwe-card:nth-child(5n + 1) .gwe-card-title {
		font-size: clamp(1.75rem, 2.5vw, 2.25rem);
	}
}

.gwe-card-media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 4px;
	margin-bottom: 1em;
}
.gwe-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.gwe-card:hover .gwe-card-media img {
	transform: scale(1.03);
}

.gwe-card-title {
	font-family: var(--gwe-font-display);
	font-weight: 600;
	font-size: 1.35rem;
	line-height: 1.2;
	margin: 0 0 0.4em;
}
.gwe-card-title a {
	color: var(--gwe-ink);
	text-decoration: none;
}
.gwe-card .gwe-excerpt {
	font-family: var(--gwe-font-body);
	font-size: 0.98rem;
	line-height: 1.55;
	color: var(--gwe-ink-soft);
}

/* ==========================================================================
   Single post: no sidebar, wider column, bigger type contrast
   ========================================================================== */

/*
 * Bug fix (v0.1.2): this was previously `.gwe-single .page-grid` (descendant
 * combinator), which never matched — single.php puts both classes on the
 * same element (`class="page-grid gwe-single"`), not nested. That meant the
 * 900px reading-column cap was never actually applied; computed max-width
 * was `none` and the column silently rendered at the theme's full content
 * width instead, which is also why the YouTube embed looked like it was
 * breaking out — it wasn't breaking out, the whole column was never capped.
 */
.gwe-single.page-grid {
	max-width: 900px;
	margin: 0 auto;
	padding: clamp(24px, 4vw, 48px) 20px clamp(56px, 6vw, 96px);
}

/* Extra safety net so the embed specifically can never exceed the column,
   even if a future block sets an explicit wide/full alignment class. */
.gwe-single .wp-block-embed,
.gwe-single .entry-content > * {
	max-width: 100%;
}

.gwe-single .entry-title {
	font-family: var(--gwe-font-display);
	font-weight: 600;
	font-size: clamp(2rem, 4vw, 3.25rem);
	line-height: 1.08;
}

.gwe-single .entry-content {
	font-family: var(--gwe-font-body);
	font-size: 1.15rem;
	line-height: 1.7;
	color: var(--gwe-ink);
}
.gwe-single .entry-content h2 {
	font-family: var(--gwe-font-display);
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	margin-top: 1.6em;
}
.gwe-single .entry-content h3 {
	font-family: var(--gwe-font-display);
	font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.gwe-single blockquote {
	font-family: var(--gwe-font-display);
	font-style: italic;
	font-size: clamp(1.3rem, 2.2vw, 1.7rem);
	border-left: 3px solid var(--gwe-gold);
	padding-left: 1em;
	margin: 1.5em 0;
	color: var(--gwe-ink);
}

.gwe-single #ez-toc-container {
	background: var(--gwe-surface) !important;
	border: 1px solid var(--gwe-border) !important;
	border-radius: 4px !important;
	font-family: var(--gwe-font-body) !important;
}

/* ==========================================================================
   Header: quiet editorial masthead (uses Coachify's existing menu markup)
   ========================================================================== */

/* Keep the existing WordPress menu and mobile drawer intact; this is a visual
   layer only, so menu labels/IA can remain frozen until their content pass. */
.site-header {
	background: var(--gwe-surface);
	border-bottom: 1px solid var(--gwe-border);
	box-shadow: none;
}
.site-header .header-top {
	border-color: var(--gwe-border);
	color: var(--gwe-ink-soft);
}
.site-header > .header-main {
	padding: 18px 0;
}
.site-header > .header-main .container,
.site-header .header-top > .container {
	width: min(100% - 40px, 1320px);
}
.site-header .site-branding .site-title,
.site-header .site-branding .site-title a {
	font-family: var(--gwe-font-display);
	font-size: clamp(1.35rem, 2vw, 1.75rem);
	font-weight: 600;
	letter-spacing: -0.025em;
	line-height: 1;
	color: var(--gwe-ink);
}
.site-header .site-branding .site-description {
	font-family: var(--gwe-font-body);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--gwe-ink-soft);
}
.site-header .nav-menu > li > a {
	font-family: var(--gwe-font-body);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--gwe-ink);
}
@media screen and (min-width: 1200px) {
	.site-header.style-one > .header-main .nav-wrap {
		gap: 28px;
	}
	.site-header .nav-menu > li > a {
		padding: 0.65rem 0;
	}
	.site-header .nav-menu > li + li {
		margin-left: 1.5rem;
	}
	.site-header .nav-menu > li > a::after {
		content: "";
		display: block;
		width: 0;
		border-bottom: 1px solid var(--gwe-rust);
		transition: width 0.2s ease;
	}
	.site-header .nav-menu > li:is(:hover, :focus, .current-menu-item, .current_page_item) > a::after {
		width: 100%;
	}
}
.site-header .nav-menu li:is(:hover, :focus, .hover, .focus) > a,
.site-header .nav-menu li.current_page_item > a,
.site-header .nav-menu li.current-menu-item > a {
	color: var(--gwe-rust);
}
.site-header .nav-menu .sub-menu {
	border: 1px solid var(--gwe-border);
	box-shadow: 0 12px 28px rgba(38, 36, 32, 0.08);
}
.site-header .nav-menu .sub-menu a {
	font-family: var(--gwe-font-body);
	color: var(--gwe-ink);
}
.mobile-header .header-main {
	background: var(--gwe-surface);
	border-bottom: 1px solid var(--gwe-border);
}
.mobile-header .header-main .container {
	width: min(100% - 40px, 1320px);
}
.mobile-header .toggle-btn {
	color: var(--gwe-ink);
}
.mobile-header .toggle-btn:hover,
.mobile-header .toggle-btn:focus-visible {
	color: var(--gwe-rust);
}
@media screen and (max-width: 575px) {
	.site-header > .header-main .container,
	.site-header .header-top > .container,
	.mobile-header .header-main .container {
		width: min(100% - 32px, 1320px);
	}
}

/* --- v0.1.6: palette, mobile header, breadcrumb ---------------------------
   Coachify prints its Customizer colours (pink #E75387 primary) in an inline
   :root block after this stylesheet, and most parent link/button/meta colours
   read those vars. html:root outranks :root, so this wins regardless of load
   order and removes the pink everywhere at the source instead of per selector. */
html:root {
	--g-primary-color: var(--gwe-rust);
	--g-primary-color-rgb: 181, 86, 60;
	--g-secondary-color: var(--gwe-teal);
	--g-secondary-color-rgb: 63, 107, 102;
	--g-primary-accent-color: rgba(181, 86, 60, 0.2);
	--g-secondary-accent-color: rgba(63, 107, 102, 0.2);
	--btn-bg-initial-color: var(--gwe-rust);
	--btn-bg-hover-color: var(--gwe-teal);
}

/* Mobile header: one compact row (logo, title, hamburger). */
.mobile-header .header-main .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.mobile-header .header-center {
	flex: 1 1 auto;
	min-width: 0;
}
.mobile-header .site-branding {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	text-align: left;
}
.mobile-header .site-logo,
.mobile-header .site-logo .custom-logo-link {
	flex: 0 0 auto;
	display: block;
	line-height: 0;
}
.mobile-header .site-logo img {
	width: auto;
	height: 44px;
	max-height: 44px;
}
.mobile-header .site-title-wrap {
	min-width: 0;
}
.mobile-header .site-branding .site-title,
.mobile-header .site-branding .site-title a {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.15;
}
.mobile-header .site-branding .site-description {
	display: none;
}
.mobile-header .header-main {
	padding: 10px 0;
}

/* Breadcrumb lines up with the 900px reading column on single posts. */
.single .breadcrumb-wrapper {
	max-width: 900px;
	margin: 0 auto;
	padding: 16px 20px 0;
	box-sizing: border-box;
}
.single .breadcrumb-wrapper #crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	row-gap: 4px;
}

/* v0.1.7: text wordmark only until a new logo is chosen (Fletcher, 2026-11-26).
   CSS-only; the Customizer logo is untouched. Delete this rule to bring it back. */
.site-branding .site-logo {
	display: none;
}

/* v0.1.8: breadcrumb wrap indent + header wordmark guard.
   Coachify spaces crumbs with `span + span { margin-left: 10px }`, which
   indents a wrapped item. Use flex column-gap instead so wraps start flush. */
.single .breadcrumb-wrapper #crumbs {
	column-gap: 10px;
}
.single .breadcrumb-wrapper #crumbs > span + span {
	margin-left: 0;
}
/* A long menu must never squeeze the wordmark onto two lines. */
.site-header > .header-main .site-branding {
	flex-shrink: 0;
}
.site-header .site-branding .site-title,
.site-header .site-branding .site-title a {
	white-space: nowrap;
}

/* v0.1.9: desktop nav stays on one row. Sized for the planned 4-item menu
   (Home, Topics, About, Contact); a much longer menu would overflow, not wrap. */
@media screen and (min-width: 1200px) {
	.site-header .nav-menu {
		flex-wrap: nowrap;
	}
	.site-header .nav-menu > li > a {
		white-space: nowrap;
	}
}
