/*
Theme Name: Wealth of Geeks
Description: Light-mode news/magazine child theme for Wealth of Geeks, built on Ollie.
Author: MediaForge
Template: ollie
Version: 1.0.12
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wog
*/

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

:root {
	--wog-gap: 1.5rem;
	--wog-radius: 6px;
	--wog-border: 1px solid var(--wp--preset--color--border-light);
}

h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wog-brand-name,
.wog-section-title {
	font-variant-numeric: lining-nums;
	font-feature-settings: "lnum" 1;
}

/* Beats a legacy "body { background: #eee }" code snippet left over from the old theme. */
html body {
	background-color: var(--wp--preset--color--base);
}

.wog-main {
	padding: 1.5rem 1rem 3rem;
}

.wog-main > * + * {
	margin-block-start: 2.5rem;
}

.wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Flow-layout block gap would offset every item after the first in grids and lists. */
.wp-block-post-template > li {
	margin-block-start: 0;
}

.wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
	border-radius: var(--wog-radius);
	background: var(--wp--preset--color--tertiary);
}

.wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.wp-block-post-featured-image a:hover img {
	transform: scale(1.03);
}

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

.wog-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--wp--preset--color--base);
}

.admin-bar .wog-site-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.wog-header-bar {
	border-bottom: 3px solid var(--wp--preset--color--primary-alt);
	padding: 0 1rem;
}

.wog-header-inner {
	gap: 2rem;
	min-height: 68px;
}

.wog-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: var(--wp--preset--color--main);
	flex-shrink: 0;
}

.wog-brand:hover {
	color: var(--wp--preset--color--primary);
}

.wog-brand-mark {
	width: 72px;
	height: auto;
}

.wog-brand-name {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	font-size: 1.15rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	white-space: nowrap;
}

.wog-nav {
	flex: 1;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	gap: 1.75rem;
}

.wog-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--main);
	padding: 0.4rem 0;
}

.wog-nav .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--primary);
}

.wog-search .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--main);
	border: 0;
	padding: 0.4rem;
	margin: 0;
}

.wog-search .wp-block-search__button:hover {
	color: var(--wp--preset--color--primary);
}

.wog-search .wp-block-search__input {
	border: var(--wog-border);
	border-radius: var(--wog-radius);
	padding: 0.45rem 0.75rem;
}

/* ---------- Section headings ---------- */

.wog-section-head {
	margin-bottom: 1rem;
	border-bottom: 2px solid var(--wp--preset--color--main);
}

.wog-section-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.wog-section-head .wog-section-title,
.wog-feed-col > .wog-section-title,
.wog-widget > .wog-section-title,
.wog-related > .wog-section-title {
	padding-bottom: 0.4rem;
}

.wog-feed-col > .wog-section-title,
.wog-widget > .wog-section-title,
.wog-related > .wog-section-title {
	margin-bottom: 1rem;
	border-bottom: 2px solid var(--wp--preset--color--main);
}

.wog-see-more {
	margin: 0;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.wog-see-more a {
	text-decoration: none;
}

.wog-see-more a::after {
	content: " \2192";
}

/* ---------- Cards ---------- */

.wog-card,
.wog-row,
.wog-mini {
	position: relative;
}

.wog-card-body > * {
	margin: 0;
}

.wog-card-body > * + * {
	margin-top: 0.4rem;
}

.wog-card .wp-block-post-featured-image {
	margin-bottom: 0.75rem;
}

.wog-card .wp-block-post-title {
	font-size: 1.1rem;
	line-height: 1.3;
}

.wog-card .wp-block-post-title a,
.wog-row .wp-block-post-title a,
.wog-mini .wp-block-post-title a {
	text-decoration: none;
}

.wog-cat {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.wog-cat a {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 3px;
	background: var(--wp--preset--color--primary-accent);
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.wog-cat a:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

.wog-cat .wp-block-post-terms__separator {
	display: none;
}

.wog-cat a + a {
	margin-left: 0.25rem;
}

.wog-dek {
	color: var(--wp--preset--color--secondary);
	font-size: 0.95rem;
	line-height: 1.5;
}

.wog-dek p {
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wog-dek .wp-block-post-excerpt__more-text {
	display: none;
}

.wog-meta {
	gap: 0.35rem 0.75rem;
	font-size: 0.8rem;
	color: var(--wp--preset--color--secondary);
}

.wp-block-post-author-name,
.wp-block-post-date {
	font-size: 0.8rem;
	color: var(--wp--preset--color--secondary);
}

.wp-block-post-author-name::before {
	content: "By ";
}

.wp-block-post-author-name a {
	color: var(--wp--preset--color--main);
	font-weight: 600;
	text-decoration: none;
}

.wog-meta .wp-block-post-date::before {
	content: "\00b7";
	margin-right: 0.75rem;
}

/* Lead story */

.wog-card-lead .wp-block-post-title {
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	line-height: 1.15;
}

.wog-card-lead .wog-card-body > * + * {
	margin-top: 0.6rem;
}

.wog-card-lead .wog-dek {
	font-size: 1.05rem;
}

/* Grids */

.wog-grid {
	display: grid;
	gap: var(--wog-gap);
}

.wog-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wog-grid-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* One wide + two portrait */

.wog-grid-feature {
	grid-template-columns: 2fr 1fr 1fr;
}

.wog-card-overlay {
	overflow: hidden;
	border-radius: var(--wog-radius);
	min-height: 100%;
}

.wog-card-overlay .wp-block-post-featured-image {
	margin: 0;
	height: 100%;
	aspect-ratio: 4 / 5;
	border-radius: 0;
}

.wog-grid-feature > li:first-child .wog-card-overlay .wp-block-post-featured-image {
	aspect-ratio: auto;
	min-height: 100%;
}

.wog-card-overlay .wog-card-body {
	position: absolute;
	inset: auto 0 0 0;
	padding: 3rem 1.25rem 1.25rem;
	background: linear-gradient(to top, rgba(12, 16, 10, 0.88) 0%, rgba(12, 16, 10, 0.6) 55%, rgba(12, 16, 10, 0) 100%);
	pointer-events: none;
}

.wog-card-overlay .wog-card-body a {
	pointer-events: auto;
}

.wog-card-overlay .wp-block-post-title a,
.wog-card-overlay .wp-block-post-author-name {
	color: #fff;
}

.wog-grid-feature > li:first-child .wp-block-post-title {
	font-size: clamp(1.4rem, 2.4vw, 2rem);
}

/* Hero */

.wog-hero {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 2rem;
}

.wog-hero-main > * + * {
	margin-top: var(--wog-gap);
}

.wog-hero-rail {
	border-left: var(--wog-border);
	padding-left: 2rem;
}

/* Mini list (Popular rail, sidebar): 40px above every item, including the first. */

.wog-hero-rail .wog-section-head,
.wog-widget > .wog-section-title {
	margin-bottom: 0;
}

.wog-mini-list {
	margin-block-start: 0;
}

.wog-mini-list .wp-block-post-template {
	display: grid;
	gap: 40px;
	padding-top: 40px;
}

.wog-mini {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
}

.wog-mini .wp-block-post-title {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5rem;
}

/*
 * Pull the first line up so its capitals sit flush with the thumbnail top:
 * half the leading plus Raleway's gap between ascender (0.94em) and cap height (0.71em).
 */
.wog-mini .wp-block-post-title {
	margin-top: calc((1.174em - 1.5rem) / 2 - 0.23em);
}

.wog-numbered .wp-block-post-template {
	counter-reset: wog-rank;
}

.wog-numbered .wog-mini {
	counter-increment: wog-rank;
}

.wog-numbered .wog-mini .wp-block-post-featured-image::before {
	content: counter(wog-rank);
	position: absolute;
	z-index: 1;
	top: 0;
	left: 0;
	min-width: 1.6rem;
	padding: 0.1rem 0.35rem;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 0.85rem;
	text-align: center;
	border-bottom-right-radius: var(--wog-radius);
}

.wog-numbered .wog-mini .wp-block-post-featured-image {
	position: relative;
}

/* Feed rows */

.wog-feed .wp-block-post-template > li {
	padding: 1.25rem 0;
	border-bottom: var(--wog-border);
}

.wog-feed .wp-block-post-template > li:first-child {
	padding-top: 0;
}

.wog-row {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 1.25rem;
	align-items: start;
}

.wog-row > .wog-card-body {
	margin-block-start: 0;
}

/* Capitals flush with the thumbnail top; same metrics as the mini list. */
.wog-row .wp-block-post-title {
	font-size: 1.3rem;
	line-height: 1.25;
	margin-top: calc((1.174em - 1.25em) / 2 - 0.23em);
}

.wog-meta .wog-cat {
	margin-left: 0.25rem;
}

/* Layout with sidebar */

.wog-with-sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 3rem;
	align-items: start;
}

.wog-aside {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 100px);
}

.wog-widget + .wog-widget {
	margin-top: 2.5rem;
}

.wog-pagination {
	margin-top: 2rem;
	font-weight: 700;
	font-size: 0.9rem;
}

.wog-pagination a {
	display: inline-block;
	padding: 0.6rem 1.1rem;
	border: 2px solid var(--wp--preset--color--main);
	border-radius: var(--wog-radius);
	color: var(--wp--preset--color--main);
	text-decoration: none;
}

.wog-pagination a:hover {
	background: var(--wp--preset--color--main);
	color: var(--wp--preset--color--base);
}

.wog-pagination .page-numbers {
	padding: 0.6rem 0.4rem;
}

.wog-pagination .page-numbers.current {
	color: var(--wp--preset--color--primary);
}

.wog-pagination a.page-numbers {
	border: 0;
	padding: 0.6rem 0.4rem;
}

/* Archive head */

.wog-archive-head {
	padding: 1.5rem 0 1.25rem;
	border-bottom: 3px solid var(--wp--preset--color--main);
}

.wog-archive-head h1,
.wog-archive-head .wp-block-query-title {
	margin: 0;
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 800;
}

.wog-archive-head .wp-block-term-description,
.wog-archive-head p {
	margin: 0.5rem 0 0;
	max-width: 760px;
	color: var(--wp--preset--color--secondary);
}

.wog-archive-grid .wog-grid {
	row-gap: 2.5rem;
}

.wog-archive-grid .wog-card-body > .wog-meta {
	margin-top: 0.6rem;
}

.wog-search-page {
	margin-top: 1rem;
	max-width: 560px;
}

/* ---------- Single article ---------- */

.wog-article-head > * {
	margin: 0;
}

.wog-article-head > * + * {
	margin-top: 1rem;
}

.wog-article-head .wp-block-post-title {
	font-size: clamp(2rem, 4vw, 2.9rem);
	line-height: 1.15;
}

.wog-byline {
	gap: 1rem;
	padding: 0.75rem 0;
	border-top: var(--wog-border);
	border-bottom: var(--wog-border);
	font-size: 0.85rem;
}

.wog-byline .wp-block-post-author {
	align-items: center;
}

.wog-byline .wp-block-post-author__avatar img {
	border-radius: 50%;
}

.wog-byline .wp-block-post-author__name {
	font-weight: 700;
}

.wog-byline .wp-block-post-author__name a {
	color: var(--wp--preset--color--main);
	text-decoration: none;
}

.wog-published {
	margin-left: auto;
}

.wog-article-image {
	margin-top: 1.5rem;
}

.wog-article-body {
	margin-top: 1.75rem;
	font-size: 1.125rem;
	line-height: 1.75;
}

.wog-article-body > * {
	max-width: 760px;
}

.wog-article-body img {
	max-width: 100%;
	height: auto;
	border-radius: var(--wog-radius);
}

/* Classic-editor captions and embeds carry fixed pixel widths; keep them inside the column. */
.wog-article-body figure,
.wog-article-body .wp-caption,
.wog-article-body iframe,
.wog-article-body embed,
.wog-article-body video {
	max-width: 100%;
}

.wog-article {
	min-width: 0;
}

.wog-article-body h2 {
	margin-top: 2.25rem;
	font-size: 1.7rem;
}

.wog-article-body h3 {
	margin-top: 1.75rem;
}

.wog-article-body blockquote {
	margin-left: 0;
	padding-left: 1.25rem;
	border-left: 4px solid var(--wp--preset--color--primary-alt);
}

.wog-tags {
	margin-top: 2rem;
	font-size: 0.85rem;
}

.wog-tags a {
	display: inline-block;
	padding: 0.2rem 0.7rem;
	border: var(--wog-border);
	border-radius: 999px;
	color: var(--wp--preset--color--main);
	text-decoration: none;
}

.wog-tags .wp-block-post-terms__separator {
	display: none;
}

.wog-author-box {
	margin-top: 2rem;
	padding: 1.25rem;
	border-radius: var(--wog-radius);
	background: var(--wp--preset--color--tertiary);
}

.wog-author-box .wp-block-post-author__avatar img {
	border-radius: 50%;
}

.wog-author-box .wp-block-post-author__bio {
	margin-top: 0.35rem;
	font-size: 0.9rem;
	color: var(--wp--preset--color--secondary);
}

.wog-related {
	padding-top: 2rem;
	border-top: var(--wog-border);
}

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

.wog-page > .wp-block-post-title {
	margin-top: 1.5rem;
}

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

.wog-site-footer {
	margin-top: 2rem;
	background: var(--wp--preset--color--tertiary);
	border-top: 3px solid var(--wp--preset--color--primary-alt);
}

.wog-footer {
	padding: 3rem 1rem 2rem;
	font-size: 0.9rem;
	color: var(--wp--preset--color--secondary);
}

.wog-footer-grid {
	display: grid;
	grid-template-columns: 2fr repeat(3, 1fr);
	gap: 2rem;
}

.wog-footer-about p {
	max-width: 360px;
	margin-top: 1rem;
}

.wog-footer-heading {
	margin: 0 0 0.75rem;
	font-size: 0.8rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--main);
}

.wog-footer-col ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wog-footer-col li + li {
	margin-top: 0.4rem;
}

.wog-footer-col a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
}

.wog-footer-col a:hover {
	color: var(--wp--preset--color--primary);
}

.wog-copyright {
	margin: 2.5rem 0 0;
	padding-top: 1.25rem;
	border-top: var(--wog-border);
	font-size: 0.8rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
	.wog-grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wog-with-sidebar {
		grid-template-columns: minmax(0, 1fr) 280px;
		gap: 2rem;
	}
}

@media (max-width: 900px) {
	.wog-hero,
	.wog-with-sidebar {
		grid-template-columns: minmax(0, 1fr);
	}

	.wog-hero-rail {
		border-left: 0;
		padding-left: 0;
	}

	.wog-aside {
		position: static;
	}

	.wog-grid-feature {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wog-grid-feature > li:first-child {
		grid-column: 1 / -1;
	}

	.wog-grid-feature > li:first-child .wog-card-overlay .wp-block-post-featured-image {
		aspect-ratio: 16 / 10;
	}

	.wog-footer-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.wog-footer-about {
		grid-column: 1 / -1;
	}
}

@media (max-width: 600px) {
	.wog-header-inner {
		gap: 1rem;
	}

	.wog-brand-mark {
		width: 52px;
	}

	.wog-brand-name {
		font-size: 0.85rem;
		letter-spacing: 0.14em;
	}

	.wog-grid-3 {
		grid-template-columns: minmax(0, 1fr);
	}

	.wog-grid-3 .wog-card {
		display: grid;
		grid-template-columns: 120px minmax(0, 1fr);
		gap: 0.85rem;
	}

	.wog-grid-3 .wog-card .wp-block-post-featured-image {
		margin: 0;
	}

	.wog-row {
		grid-template-columns: 120px minmax(0, 1fr);
		gap: 0.85rem;
	}

	.wog-row .wp-block-post-title {
		font-size: 1.05rem;
	}

	.wog-row .wog-dek {
		display: none;
	}

	/* Narrow cards: stack the meta instead of wrapping with a stray separator. */
	.wog-row .wog-meta,
	.wog-grid .wog-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.2rem;
	}

	.wog-row .wog-meta .wp-block-post-date::before,
	.wog-grid .wog-meta .wp-block-post-date::before {
		display: none;
	}

	.wog-meta .wog-cat {
		margin-left: 0;
		margin-top: 0.2rem;
	}

	.wog-grid-feature {
		grid-template-columns: minmax(0, 1fr);
	}

	.wog-grid-feature .wog-card-overlay .wp-block-post-featured-image {
		aspect-ratio: 16 / 10;
	}

	.wog-footer-grid {
		grid-template-columns: 1fr 1fr;
	}
}
