/*
Theme Name: Gargoyle
Theme URI: https://nickmcsherry.com
Author: Nick McSherry
Description: A dark, stone-cut author theme built from the GARGOYLE cover — deep forest, pale sage, lichen rust. Block theme, no page builder.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gargoyle
Tags: block-theme, dark, one-column, wide-blocks, custom-colors, editor-style
*/

/* ---------- base ---------- */
html { scrollbar-color: #3c5a2c #12170d; }
body {
	background-color: var(--wp--preset--color--base);
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .92 0 0 0 0 .93 0 0 0 0 .86 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
::selection { background: #b4703a; color: #0a0d07; }
:where(a, button, input, textarea, summary):focus-visible { outline: 2px solid var(--wp--preset--color--sage); outline-offset: 3px; }

/* ---------- header ---------- */
.g-head {
	position: sticky; top: 0; z-index: 40;
	background: rgba(18,23,13,.82);
	-webkit-backdrop-filter: blur(14px) saturate(120%);
	backdrop-filter: blur(14px) saturate(120%);
	border-bottom: 1px solid rgba(233,235,220,.08);
}
.g-head__inner { min-height: 74px; }
.g-wordmark a { display: inline-flex; align-items: center; gap: .55rem; }
.g-wordmark .g-mark { width: 30px; height: 30px; flex: none; color: var(--wp--preset--color--lichen-bright); }
.g-head .wp-block-navigation-item__content { padding: .4rem 0; position: relative; }
.g-head .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
	background: var(--wp--preset--color--lichen);
	transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.g-head .wp-block-navigation-item__content:hover::after { transform: scaleX(1); }
.g-head .g-cta .wp-block-button__link { padding: .72em 1.25em; }

/* ---------- hero ---------- */
.g-hero { position: relative; overflow: clip; border-bottom: 1px solid rgba(233,235,220,.08); }
.g-hero::before {
	content: ""; position: absolute; inset: 0;
	background:
		radial-gradient(60% 55% at 78% 30%, rgba(60,90,44,.35), transparent 70%),
		radial-gradient(45% 45% at 12% 85%, rgba(180,112,58,.16), transparent 70%);
	pointer-events: none;
}
.g-hero__grid { position: relative; align-items: center; min-height: clamp(540px, 70vh, 760px); }
.g-hero__eyebrow { display: inline-flex; align-items: center; gap: .7rem; }
.g-hero__eyebrow::before { content: ""; width: 42px; height: 1px; background: var(--wp--preset--color--lichen); }
.g-hero h1.wp-block-heading { line-height: .82; letter-spacing: .02em; margin-left: -.04em; white-space: nowrap; font-size: clamp(2.9rem, 8vw, 7.4rem) !important; }
.g-hero h1 .g-hero__outline { color: transparent; -webkit-text-stroke: 1.5px rgba(194,209,181,.55); }
.g-hero__cover { position: relative; justify-self: end; width: min(100%, 470px); }
.g-hero__cover img {
	display: block; width: 100%; height: auto; border-radius: 3px;
	box-shadow: 28px 34px 80px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(233,235,220,.14);
	transform: rotate(2.4deg);
	transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.g-hero__cover:hover img { transform: rotate(0deg) translateY(-6px); }
.g-hero__badge {
	position: absolute; left: -22px; bottom: -16px; transform: rotate(-4deg);
	background: var(--wp--preset--color--lichen); color: #0a0d07;
	font: 600 .68rem/1.2 var(--wp--preset--font-family--body);
	letter-spacing: .16em; text-transform: uppercase;
	padding: .6rem .8rem; border-radius: 2px; box-shadow: 0 10px 30px -12px #000;
}
.g-hero__scroll { position: absolute; left: 0; bottom: 1.2rem; font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--wp--preset--color--stone-light); animation: g-bob 2.4s ease-in-out infinite; }
@keyframes g-bob { 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .g-hero__scroll { animation: none; } }

/* ---------- ticker ---------- */
.g-ticker { overflow: hidden; border-bottom: 1px solid rgba(233,235,220,.08); background: var(--wp--preset--color--surface); }
.g-ticker { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.g-ticker__track { display: flex; gap: 3rem; width: max-content; padding: .8rem 0; animation: g-slide 38s linear infinite; }
.g-ticker span { font: 400 .8rem/1 var(--wp--preset--font-family--display); letter-spacing: .22em; text-transform: uppercase; color: var(--wp--preset--color--sage); white-space: nowrap; }
.g-ticker span::after { content: "◆"; margin-left: 3rem; color: var(--wp--preset--color--lichen); font-size: .6rem; vertical-align: middle; }
@keyframes g-slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .g-ticker { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.g-ticker__track { animation: none; } }

/* ---------- section furniture ---------- */
.g-kicker { display: flex; align-items: center; gap: .8rem; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--wp--preset--color--lichen-bright); font-weight: 600; }
.g-kicker::after { content: ""; flex: 1; height: 1px; background: rgba(233,235,220,.1); }
.g-section { border-bottom: 1px solid rgba(233,235,220,.08); }
.g-archive { padding-top: var(--wp--preset--spacing--50) !important; }

/* ---------- post cards ---------- */
.g-cards { counter-reset: gcard; }
.g-cards .wp-block-post { counter-increment: gcard; }
.g-cards .wp-block-post-title::before { content: counter(gcard, decimal-leading-zero); display: block; font: 400 .78rem/1 var(--wp--preset--font-family--display); letter-spacing: .3em; color: var(--wp--preset--color--lichen); margin-bottom: .7rem; }
.g-cards .wp-block-post-template.is-layout-grid:has(> li:only-child) { grid-template-columns: 1fr !important; }
.g-cards .wp-block-post-template:has(> li:only-child) .wp-block-post-title { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.g-cards .wp-block-post {
	display: flex; flex-direction: column; gap: .85rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid rgba(233,235,220,.08);
	border-radius: 3px;
	padding: clamp(1.3rem, 2.4vw, 2rem);
	position: relative;
	transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.g-cards .wp-block-post::before {
	content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 0;
	background: var(--wp--preset--color--lichen); transition: width .35s ease;
}
.g-cards .wp-block-post:hover { background: var(--wp--preset--color--surface-2); border-color: rgba(233,235,220,.16); transform: translateY(-4px); }
.g-cards .wp-block-post:hover::before { width: 100%; }
.g-cards .wp-block-post-title { font-size: clamp(1.3rem, 1.9vw, 1.7rem); line-height: 1.02; margin: .1rem 0; letter-spacing: .015em; overflow-wrap: anywhere; hyphens: auto; }
.g-cards .wp-block-post-excerpt__more-text a { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--wp--preset--color--lichen); padding-bottom: 2px; }
.g-cards .wp-block-post-excerpt { overflow-wrap: anywhere; }
.g-cards .wp-block-post-date { margin-top: auto; padding-top: .8rem; border-top: 1px solid rgba(233,235,220,.07); }

/* ---------- book band ---------- */
.g-book { background: linear-gradient(180deg, var(--wp--preset--color--surface) 0%, var(--wp--preset--color--base) 100%); border-bottom: 1px solid rgba(233,235,220,.08); }
.g-book__cover img { display: block; width: 100%; height: auto; border-radius: 2px; box-shadow: 18px 24px 60px -26px #000, 0 0 0 1px rgba(233,235,220,.12); }
.g-book blockquote { border-left: 2px solid var(--wp--preset--color--lichen); margin: 0; padding-left: 1.2rem; }
.g-book__meta { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--wp--preset--color--stone); }

/* ---------- author strip ---------- */
.g-author { background: var(--wp--preset--color--contrast); border-bottom: 1px solid rgba(233,235,220,.08); }
.g-author__sig { font-family: var(--wp--preset--font-family--serif); font-style: italic; font-size: 1.15rem; color: var(--wp--preset--color--stone-light); }

/* ---------- newsletter ---------- */
.g-news { position: relative; background: var(--wp--preset--color--lichen); color: #0a0d07; }
.g-news::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
	background-image: repeating-linear-gradient(135deg, rgba(10,13,7,.055) 0 2px, transparent 2px 9px); }
.g-news :is(h2, h3, p) { color: #0a0d07; }
.g-news .wp-block-button__link { background: #0a0d07; border-color: #0a0d07; color: var(--wp--preset--color--ink); }
.g-news .wp-block-button__link:hover { background: #1b2113; color: #fff; }
.g-news .g-kicker { color: #0a0d07; }
.g-news .g-kicker::after { background: rgba(10,13,7,.35); }

/* ---------- post body ---------- */
.g-post__header { border-bottom: 1px solid rgba(233,235,220,.1); }
.g-post__header .wp-block-group { align-items: baseline; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--wp--preset--color--stone); }
.g-post__header .wp-block-group > * + *::before { content: "·"; margin-right: 1.2rem; color: var(--wp--preset--color--lichen); }
.g-post__title { font-size: clamp(2.4rem, 6vw, 4.6rem) !important; line-height: .94 !important; }
.g-content { font-family: var(--wp--preset--font-family--serif); font-size: clamp(1.1rem, 1.15vw, 1.22rem); line-height: 1.85; }
.g-content > p:first-of-type::first-letter {
	float: left; font-family: var(--wp--preset--font-family--display);
	font-size: 3.55em; line-height: .96; padding: .02em .11em 0 0; color: var(--wp--preset--color--lichen-bright);
}
.g-content :is(h2, h3) { margin-top: 2.2em; }
.g-content :is(ul, ol) { padding-left: 1.3em; }
.g-content li { margin: .45em 0; }

/* ---------- footer ---------- */
.g-foot { background: var(--wp--preset--color--contrast); border-top: 1px solid rgba(233,235,220,.1); }
.g-foot__mark { font-family: var(--wp--preset--font-family--display); font-size: clamp(2rem, 7vw, 4.4rem); letter-spacing: .06em; line-height: .9; color: transparent; -webkit-text-stroke: 1px rgba(160,163,149,.42); }
.g-foot a { text-decoration: none; }
.g-foot a:hover { color: var(--wp--preset--color--lichen-bright); }
.g-foot__small { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--stone); }

/* ---------- misc blocks ---------- */
.wp-block-image img { border-radius: 2px; }
.wp-block-table td, .wp-block-table th { border-color: rgba(233,235,220,.14); }
.wp-block-search__input, .wp-block-search__button { border-radius: 2px; }
.g-404__code { font-family: var(--wp--preset--font-family--display); font-size: clamp(6rem, 24vw, 17rem); line-height: .8; color: transparent; -webkit-text-stroke: 1px rgba(194,209,181,.35); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
	/* Poster stack: the text column dissolves (display:contents) so the title can sit
	   directly above the cover, pushed right of it, with copy underneath. */
	.g-hero__grid { display: flex; flex-direction: column; min-height: 0; gap: var(--wp--preset--spacing--20); }
	.g-hero__grid > .wp-block-column:first-child { display: contents; }
	.g-hero__grid > .wp-block-column:last-child { order: 2; width: 100%; }
	.g-hero__cover { justify-self: start; width: min(58%, 270px); margin-left: 0; }
	.g-hero__eyebrow { order: 0; }
	.g-hero h1.wp-block-heading {
		order: 1; white-space: normal; text-align: right; margin-left: 0; margin-right: -.04em; margin-bottom: .34em !important;
		font-size: clamp(3rem, 15vw, 5rem) !important;
	}
	.g-hero h1 .g-hero__outline { display: block; -webkit-text-stroke-width: 2px; -webkit-text-stroke-color: rgba(194,209,181,.72); }
	.g-hero__grid > .wp-block-column:first-child > p:not(.g-hero__eyebrow):not(.g-hero__scroll) { order: 3; margin-top: var(--wp--preset--spacing--20) !important; }
	.g-hero__grid > .wp-block-column:first-child > .wp-block-buttons { order: 4; }
	.g-hero__scroll { display: none; }
	.g-head__inner { min-height: 62px; }
	.g-wordmark .wp-block-site-title { font-size: 1.05rem !important; letter-spacing: .08em !important; }
}
@media (max-width: 600px) {
	.g-hero__badge { left: auto; right: -8px; bottom: 14px; }
	.g-foot__mark { font-size: 2.6rem; }
}