/*
Theme Name: TMWWITS
Description: A custom block theme scaffolded by Studio Code.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tmwwits
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts margin-block-start: var(--wp--style--block-gap) between the
   template's top-level sections (header part, main, footer part) — a gap that
   exists even when no markup asks for it. Zero it so sections butt edge-to-edge
   and own their vertical rhythm via padding; this does not affect block gaps
   inside nested layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author (WooCommerce shop, product, cart…) still clear the
   header and footer. A descendant selector, not a child one: WooCommerce wraps
   the single-product main in an extra group. Templates built from full-bleed
   sections opt out with is-flush and let the sections own the rhythm. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* === reset === */
html {
	overflow-x: hidden;
}
body {
	background-color: var(--wp--preset--color--base);
}

/* === typography === */
p, li {
	color: var(--wp--preset--color--contrast);
}
.is-muted,
.wp-block-post-date,
.wp-block-post-terms {
	color: var(--wp--preset--color--muted);
}
h1, h2, h3, h4, h5, h6 {
	letter-spacing: -0.01em;
}
/* === figures === */
/* devlog_sync.py appends raw <figure><img></figure> markup to post_content —
   no align classes, no block wrapper. Break these out of the 680px reading
   column to full viewport width: they are 2000px screenshots and carry the
   argument. Do not require a plugin or block to do this; it must survive
   plain HTML exactly as the script writes it. */
/* :not(.wp-block-image) excludes editable core/image figures elsewhere in
   this same content column — those already get proper full-bleed alignfull
   handling from core, and stacking this hack on top of it double-applies
   the breakout and clips the image. This rule is for the script's plain,
   unclassed <figure> only. */
.wp-block-post-content figure:not(.wp-block-image),
.entry-content figure:not(.wp-block-image) {
	/* WordPress core forces margin-left/right: auto !important on unaligned
	   children of a constrained layout, which would otherwise collapse this
	   back to 0 on one side. Match its own specificity with !important and
	   use the calc(50% - 50vw) break-out instead of a transform, which core's
	   forced auto-margins would also fight. */
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	margin-top: var(--wp--preset--spacing--60);
	margin-bottom: var(--wp--preset--spacing--60);
}
.wp-block-post-content figure:not(.wp-block-image) img,
.entry-content figure:not(.wp-block-image) img {
	display: block;
	width: 100%;
	height: auto;
}
.wp-block-post-content figure:not(.wp-block-image) figcaption,
.entry-content figure:not(.wp-block-image) figcaption {
	max-width: 680px;
	margin-inline: auto;
	padding-inline: clamp(1.25rem, 5vw, 3rem);
	padding-top: 0.75rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

/* === header === */
.site-header {
	padding-block: var(--wp--preset--spacing--50);
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}
.site-header__title a {
	font-size: var(--wp--preset--font-size--medium);
	text-decoration: none;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.site-header__nav {
	font-size: var(--wp--preset--font-size--small);
}
.site-header__nav .wp-block-navigation-item a {
	text-decoration: none;
	color: var(--wp--preset--color--muted);
	letter-spacing: 0.03em;
}
.site-header__nav .wp-block-navigation-item a:hover {
	color: var(--wp--preset--color--contrast);
}

/* === footer === */
.site-footer {
	padding-block: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--hairline);
	margin-top: var(--wp--preset--spacing--70);
}
.site-footer__copy {
	color: var(--wp--preset--color--muted);
	margin: 0;
}
/* === home === */
.home-hero {
	min-height: calc(100svh - 10rem);
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.home-hero__eyebrow {
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin-bottom: 0;
}
.home-hero h1 {
	margin-top: 0.5rem;
	margin-bottom: 0;
}
.home-hero__line {
	color: var(--wp--preset--color--muted);
	margin-top: 1rem;
}
.home-hero__links {
	margin-top: var(--wp--preset--spacing--60);
	gap: 1.5rem;
}
.home-hero__links a {
	text-decoration: none;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	padding-bottom: 0.1rem;
}
.home-hero__links a:hover {
	border-color: var(--wp--preset--color--muted);
}

/* === devlog === */
.devlog-archive__eyebrow {
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: 0.12em;
}
.devlog-archive__description {
	color: var(--wp--preset--color--muted);
	max-width: 46ch;
}
.devlog-archive__filter {
	margin-top: 1rem;
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
}
.devlog-archive__filter a {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}
.devlog-archive__filter a:hover {
	color: var(--wp--preset--color--contrast);
}
.devlog-archive__list {
	margin-top: var(--wp--preset--spacing--70);
}
.wp-block-post-template.devlog-archive__items {
	list-style: none;
	margin: 0;
	padding: 0;
}
.devlog-archive__items > li {
	padding-block: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--wp--preset--color--hairline);
}
.devlog-archive__items > li:last-child {
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}
.devlog-archive__items .wp-block-post-featured-image {
	margin-bottom: 1.25rem;
}
.devlog-archive__items .wp-block-post-featured-image img {
	width: 100%;
	height: 420px;
	object-fit: cover;
	display: block;
}
.devlog-archive__entry-game {
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	display: block;
	margin-bottom: 0.5rem;
}
.devlog-archive__items .wp-block-post-title {
	margin: 0 0 0.35rem;
}
.devlog-archive__items .wp-block-post-title a {
	text-decoration: none;
}
.devlog-archive__items .wp-block-post-excerpt {
	max-width: 680px;
	margin-top: 0.75rem;
	color: var(--wp--preset--color--muted);
}
.devlog-single__game {
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	display: block;
	margin-bottom: 0.75rem;
}
.devlog-single__game a {
	text-decoration: none;
}

/* === work === */
.work-intro {
	padding-top: var(--wp--preset--spacing--70);
}
.work-list {
	padding-bottom: var(--wp--preset--spacing--70);
}
.work-list__grid {
	display: grid !important;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60);
	margin-top: var(--wp--preset--spacing--70);
}
.work-card__image {
	margin: 0 0 1.25rem;
}
.work-card__image img {
	width: 100%;
	height: 280px;
	object-fit: cover;
	display: block;
}
.work-card h2 {
	margin: 0 0 0.35rem;
}
.work-card h2 a {
	text-decoration: none;
}
.work-card__meta {
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 0.75rem;
}
.work-project__meta {
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.work-project__figure {
	margin-block: var(--wp--preset--spacing--60);
}
.work-project__figure img {
	width: 100%;
	height: auto;
	display: block;
}

/* === lightbox === */
/* Click-to-enlarge affordance on any image lightbox.js has wired up.
   Purely visual — the JS adds the click behavior, this just signals it. */
.has-lightbox {
	cursor: zoom-in;
}

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 10, 0.92);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.lightbox.is-visible {
	opacity: 1;
}
.lightbox__img {
	max-width: min(90vw, 1400px);
	max-height: 86vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox__close,
.lightbox__prev,
.lightbox__next {
	position: absolute;
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	line-height: 1;
	padding: var(--wp--preset--spacing--30);
}
.lightbox__close {
	top: var(--wp--preset--spacing--40);
	right: var(--wp--preset--spacing--40);
	font-size: 2rem;
}
.lightbox__prev,
.lightbox__next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 3rem;
}
.lightbox__prev {
	left: var(--wp--preset--spacing--30);
}
.lightbox__next {
	right: var(--wp--preset--spacing--30);
}
.lightbox__counter {
	position: absolute;
	bottom: var(--wp--preset--spacing--40);
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.7;
	margin: 0;
}
body.has-lightbox-open {
	overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
	.lightbox {
		transition: none;
	}
}
@media (max-width: 700px) {
	.lightbox__prev,
	.lightbox__next {
		font-size: 2rem;
	}
}

/* === about-colophon === */
.about-method__title {
	margin-top: var(--wp--preset--spacing--70);
}

/* === responsive === */
@media (max-width: 700px) {
	.work-list__grid {
		grid-template-columns: 1fr;
	}
	.devlog-archive__items .wp-block-post-featured-image img {
		height: 260px;
	}
}
