/*
Theme Name: Trainer Labo
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: trainerlabo
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) 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;
}

/*
 * Trainer Labo — design system CSS
 * Colors reference theme.json palette slugs, never hardcoded hex.
 *
 * Quiet luxury editorial set on a ruled grid.
 *
 * Tokens map onto the theme palette (see DESIGN.md):
 *   --paper    background      warm cream ground
 *   --ink      text            near-black warm ink
 *   --surface  surface         slightly lighter card ground
 *   --cream    cream           one step darker paper for bands
 *   --hairline line            faint 1px rules
 *   --muted    muted           captions, meta, secondary copy
 *   --oxblood  primary         the single link/rule accent
 */
:root {
	--paper: var( --wp--preset--color--background );
	--ink: var( --wp--preset--color--text );
	--surface: var( --wp--preset--color--surface );
	--cream: var( --wp--preset--color--cream );
	--hairline: var( --wp--preset--color--line );
	--muted: var( --wp--preset--color--muted );
	--oxblood: var( --wp--preset--color--primary );
}

/* === labels & eyebrows === */
.tl-label,
.tl-eyebrow {
	font-family: var( --wp--preset--font-family--fraunces );
	font-size: var( --wp--preset--font-size--label );
	line-height: 1.5;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var( --muted );
	margin-bottom: 1.1rem;
}

/* === header === */
.tl-header {
	border-bottom: 1px solid var( --hairline );
}
.tl-header-row {
	gap: 1.5rem;
}
.tl-brand {
	gap: 1rem;
	min-width: 0;
}
.tl-brand .wp-block-site-title {
	font-size: 1.45rem;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.tl-brand .wp-block-site-title a {
	color: var( --ink );
}
.tl-brand .wp-block-site-title a:hover {
	color: var( --oxblood );
}
.tl-tagline {
	margin: 0;
	color: var( --muted );
	font-size: var( --wp--preset--font-size--label );
	text-transform: uppercase;
	letter-spacing: 0.14em;
	white-space: nowrap;
}
.tl-header .wp-block-navigation a,
.tl-footer .wp-block-navigation a {
	color: var( --ink );
	text-decoration: none;
}
.tl-header .wp-block-navigation a:hover,
.tl-footer .wp-block-navigation a:hover {
	color: var( --oxblood );
}

/* === links & buttons === */
.tl-post-card .wp-block-post-title a,
.wp-block-post-content a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: color-mix( in srgb, var( --oxblood ) 40%, transparent );
	transition: color 0.25s ease, text-decoration-color 0.25s ease;
}
.tl-post-card .wp-block-post-title a:hover,
.wp-block-post-content a:hover {
	color: var( --oxblood );
	text-decoration-color: var( --oxblood );
}
.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var( --ink );
	border: 1px solid var( --ink );
}
.is-style-outline .wp-block-button__link:hover {
	background: var( --ink );
	color: var( --paper );
}

/* === hero === */
.tl-hero {
	border-bottom: 1px solid var( --hairline );
}
.tl-hero-inner {
	padding-top: clamp( 3.5rem, 9vw, 7rem );
	padding-bottom: clamp( 2.5rem, 6vw, 5rem );
}
.tl-hero-inner > * + * {
	margin-top: 1.25rem;
}
.tl-hero-copy {
	padding-right: clamp( 0.5rem, 4vw, 4rem );
}
.tl-hero-title {
	margin: 0;
}
.tl-hero-lede {
	margin: 1.9rem 0 0;
	color: var( --ink );
}
.tl-hero .wp-block-buttons {
	margin-top: 2.2rem;
}

/* warm film grade (DESIGN.md Imagery) + framed editorial photos */
.tl-photo img,
.tl-hero-photo img,
.tl-figure-img img,
.tl-about-photo img {
	filter: sepia( 0.08 ) contrast( 1.02 );
}
.tl-hero-photo,
.tl-about-photo {
	border: 1px solid var( --hairline );
}
.tl-hero-photo img,
.tl-about-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.tl-hero-photo {
	height: 100%;
}

/* === figures (取上げている演劇家) ruled grid === */
.tl-figures {
	border-bottom: 1px solid var( --hairline );
}
.tl-figure-grid {
	border-left: 1px solid var( --hairline );
	border-top: 1px solid var( --hairline );
	column-gap: 0 !important;
	row-gap: 0 !important;
}
.tl-figure-grid > * {
	border-right: 1px solid var( --hairline );
	border-bottom: 1px solid var( --hairline );
	padding: clamp( 1.25rem, 2.5vw, 2rem );
}
.tl-figure-card {
	height: 100%;
}
.tl-figure-img {
	margin: 0 0 1.5rem;
}
.tl-figure-img img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	display: block;
}
.tl-figure-name {
	margin: 0 0 0.4rem;
	font-family: var( --wp--preset--font-family--fraunces );
	font-size: var( --wp--preset--font-size--headline );
	line-height: 1.25;
}
.tl-figure-sub {
	margin: 0 0 0.9rem;
	color: var( --oxblood );
	font-size: var( --wp--preset--font-size--label );
	text-transform: uppercase;
	letter-spacing: 0.14em;
}
.tl-figure-bio {
	margin: 0;
	color: var( --muted );
	font-size: 0.9375rem;
}

/* === about / author === */
.tl-about {
	border-bottom: 1px solid var( --hairline );
}
.tl-about-photo {
	margin-bottom: 0;
}
.tl-about-name {
	margin: 0 0 0.2rem;
}
.tl-about-role {
	margin: 0 0 1.4rem;
	color: var( --oxblood );
	font-size: var( --wp--preset--font-size--label );
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

/* === works (ワーク紹介 罫線グリッド) === */
.tl-works {
	border-bottom: 1px solid var( --hairline );
}
.tl-works-intro-title {
	margin: 0 0 1.2rem;
}
.tl-works-intro-role {
	margin: 0 0 1.6rem;
	color: var( --oxblood );
	font-size: var( --wp--preset--font-size--label );
	text-transform: uppercase;
	letter-spacing: 0.14em;
}
.tl-works-lede {
	margin: 0;
	color: var( --ink );
}
.tl-works-grid {
	border-left: 1px solid var( --hairline );
	border-top: 1px solid var( --hairline );
	column-gap: 0 !important;
	row-gap: 0 !important;
}
.tl-works-grid > * {
	border-right: 1px solid var( --hairline );
	border-bottom: 1px solid var( --hairline );
	padding: clamp( 1.75rem, 3.5vw, 3rem );
}
.tl-works-num {
	margin: 0 0 1.1rem;
	color: var( --oxblood );
	font-family: var( --wp--preset--font-family--fraunces );
	font-size: var( --wp--preset--font-size--label );
	text-transform: uppercase;
	letter-spacing: 0.14em;
}
.tl-works-title {
	margin: 0 0 0.9rem;
}
.tl-works-desc {
	margin: 0;
	color: var( --muted );
	font-size: 0.9375rem;
}

/* === works index (トップ→3ワークへ) === */
.tl-works-links {
	border-bottom: 1px solid var( --hairline );
}
.tl-link-grid {
	border-left: 1px solid var( --hairline );
	border-top: 1px solid var( --hairline );
	grid-template-columns: repeat( 3, 1fr );
	column-gap: 0 !important;
	row-gap: 0 !important;
}
.tl-link-grid > * {
	border-right: 1px solid var( --hairline );
	border-bottom: 1px solid var( --hairline );
	padding: clamp( 2rem, 4vw, 3.5rem );
}
.tl-link-card {
	height: 100%;
}
.tl-link-title {
	margin: 0 0 0.9rem;
}
.tl-link-title a {
	color: var( --ink );
	text-decoration: none;
}
.tl-link-title a:hover {
	color: var( --oxblood );
}
.tl-link-desc {
	margin: 0;
	color: var( --muted );
	font-size: 0.9375rem;
}
.tl-link-more {
	margin: 1.6rem 0 0;
	color: var( --oxblood );
	text-transform: uppercase;
	letter-spacing: 0.14em;
}
.tl-link-more a {
	color: var( --oxblood );
	text-decoration: none;
}
.tl-link-more a:hover {
	text-decoration: underline;
}

/* === sections === */
.tl-section-title {
	margin: 0;
}
.tl-section-head {
	border-bottom: 1px solid var( --hairline );
}
.tl-essays,
.tl-approach {
	border-bottom: 1px solid var( --hairline );
}

/* === ruled grid (Ruled grid concept) === */
.tl-ruled-grid > .wp-block-post-template,
.tl-featured-grid > .wp-block-post-template {
	border-left: 1px solid var( --hairline );
	border-top: 1px solid var( --hairline );
	column-gap: 0 !important;
	row-gap: 0 !important;
}
.tl-ruled-grid > .wp-block-post-template > li,
.tl-featured-grid > .wp-block-post-template > li {
	border-right: 1px solid var( --hairline );
	border-bottom: 1px solid var( --hairline );
	padding: clamp( 1.5rem, 3vw, 2.25rem );
	margin: 0;
}
.tl-ruled-grid .tl-post-card,
.tl-featured-grid .tl-post-card {
	height: 100%;
	display: flex;
	flex-direction: column;
}
.tl-post-date {
	margin: 0 0 1.1rem;
	color: var( --muted );
	font-size: var( --wp--preset--font-size--label );
	text-transform: uppercase;
	letter-spacing: 0.14em;
}
.tl-post-card .wp-block-post-title {
	margin: 0 0 1.1rem;
}
.tl-post-card .wp-block-post-title a {
	color: var( --ink );
}
.tl-post-excerpt {
	margin: 0;
	color: var( --muted );
}
.tl-post-more {
	margin-top: auto;
}
.tl-post-more .tl-readmore {
	margin: 0;
	padding-top: 1.6rem;
	color: var( --oxblood );
	font-size: var( --wp--preset--font-size--label );
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

/* === single / reading column === */
.tl-post-hero {
	border-bottom: 1px solid var( --hairline );
}
.tl-post-meta-top {
	gap: 1.75rem;
}
.tl-post-meta-top .wp-block-post-terms,
.tl-post-meta-top .wp-block-post-date {
	margin: 0;
}
.tl-post-title {
	margin: 1.25rem 0 0;
}
.tl-post-author {
	gap: 0.6rem;
	margin-top: 1.75rem;
}
.tl-post-author p {
	margin: 0;
}
.tl-featured {
	margin: clamp( 2.5rem, 6vw, 5rem ) 0;
}
.tl-post-content {
	padding-bottom: clamp( 3rem, 7vw, 6rem );
	border-bottom: 1px solid var( --hairline );
}
.wp-block-post-content {
	overflow-wrap: break-word;
}
.wp-block-post-content .wp-block-paragraph {
	line-height: 1.85;
}
.tl-post-nav {
	padding-top: clamp( 2.5rem, 5vw, 4rem );
}
.tl-post-comments {
	padding-top: clamp( 2.5rem, 5vw, 4rem );
}

/* === archive / search / index === */
.tl-archive-head {
	border-bottom: 1px solid var( --hairline );
}
.tl-archive-title {
	margin: 0;
}
.tl-archive-desc {
	max-width: 40em;
	color: var( --muted );
}
.tl-archive-list {
	padding-bottom: clamp( 3rem, 7vw, 6rem );
}
.tl-search .wp-block-search__input {
	border: 1px solid var( --hairline );
	background: transparent;
	border-radius: 2px;
	color: var( --ink );
}
.tl-search .wp-block-search__button {
	background: var( --ink );
	color: var( --paper );
	padding: 0.7rem 1.4rem;
	border-radius: 2px;
	font-family: var( --wp--preset--font-family--fraunces );
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.tl-search .wp-block-search__button:hover {
	background: var( --oxblood );
}

/* === 404 === */
.tl-404 {
	border-bottom: 1px solid var( --hairline );
}
.tl-404-title {
	margin: 0;
}
.tl-404-text {
	max-width: 34em;
	color: var( --muted );
}

/* === footer === */
.tl-footer {
	border-top: 1px solid var( --hairline );
}
.tl-footer-grid {
	border-top: 1px solid var( --hairline );
}
.tl-footer-col {
	padding: var( --wp--preset--spacing--md ) 2rem 0 0;
}
.tl-footer-col .tl-label {
	color: var( --muted );
}
.tl-footer-note {
	color: var( --muted );
	font-size: 0.9rem;
	max-width: 30em;
}
.tl-footer-rule {
	margin: clamp( 2.5rem, 6vw, 4.5rem ) 0 0;
	border-top: 1px solid var( --hairline );
}

/* === footer external links band === */
.tl-footer-links {
	border-bottom: 1px solid var( --hairline );
}
.tl-footer-links-head {
	border-bottom: 1px solid var( --hairline );
}
.tl-footer-links-note {
	color: var( --muted );
}
.tl-ext-grid {
	grid-template-columns: repeat( 3, 1fr );
	column-gap: 0 !important;
	row-gap: 0 !important;
}
.tl-ext-grid > * {
	border-right: 1px solid var( --hairline );
	border-bottom: 1px solid var( --hairline );
	padding: clamp( 1.5rem, 3vw, 2.5rem );
}
.tl-ext-cell {
	height: 100%;
}
.tl-ext-name {
	margin: 0 0 0.6rem;
}
.tl-ext-name a {
	color: var( --ink );
	text-decoration: none;
}
.tl-ext-name a:hover {
	color: var( --oxblood );
}
.tl-ext-dom {
	margin: 0;
	color: var( --muted );
	font-size: var( --wp--preset--font-size--label );
	letter-spacing: 0.08em;
}

/* === reveal (progressive enhancement) === */
/* Final state by default so content is never hidden (editor-safe).
   The JS in assets/js/main.js adds [data-reveal] state only at runtime. */
.tl-reveal {
	opacity: 1;
	transform: none;
	transition: opacity 0.8s ease, transform 0.8s ease;
}
.tl-reveal.is-hidden {
	opacity: 0;
	transform: translateY( 12px );
}

/* === prefers-reduced-motion === */
@media ( prefers-reduced-motion: reduce ) {
	.tl-reveal.is-hidden {
		opacity: 1;
		transform: none;
		transition: none;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* === responsive === */
@media ( max-width: 1180px ) {
	.tl-tagline {
		display: none;
	}
}

@media ( max-width: 1024px ) {
	.tl-figure-grid,
	.tl-works-grid {
		grid-template-columns: repeat( 2, 1fr ) !important;
	}
}

@media ( max-width: 781px ) {
	.tl-ruled-grid > .wp-block-post-template,
	.tl-featured-grid > .wp-block-post-template {
		grid-template-columns: repeat( 1, 1fr ) !important;
	}
	.tl-figure-grid,
	.tl-works-grid,
	.tl-link-grid,
	.tl-ext-grid {
		grid-template-columns: repeat( 1, 1fr ) !important;
	}
	.tl-footer-col {
		padding-right: 0;
	}
}
