/* ==========================================================================
   Kamakura KOTOBART — Frontend Styles
   Block theme custom styles for enso hero, post cards, patterns.
   ========================================================================== */

:root {
	--kotobart-green: #2E5E4E;
	--kotobart-green-dark: #1a3b31;
	--kotobart-green-light: #3d7a65;
	--kotobart-green-pale: #e8f2ed;
	--kotobart-cream: #f7f4ef;
	--kotobart-cream-dark: #ede9e0;
	--kotobart-ink: #1a1a18;
	--kotobart-ink-mid: #3a3a36;
	--kotobart-ink-muted: #7a7a72;
	--kotobart-ink-faint: #b4b2a4;
	--kotobart-base: #fdfcfa;
}

/* Japanese text gets a slightly looser line-height and richer font */
:lang(ja),
.has-serif-ja-font-family {
	line-height: 1.9;
	letter-spacing: 0.01em;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

a {
	transition: color 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.kotobart-header {
	position: sticky;
	top: 0;
	z-index: 90;
	background: rgba(253, 252, 250, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.kotobart-header .wp-block-site-logo img {
	height: auto;
	max-height: 56px;
	width: auto;
	transition: opacity 0.25s ease;
}

.kotobart-header .wp-block-site-logo a:hover img {
	opacity: 0.75;
}

.kotobart-nav .wp-block-navigation-item__content {
	font-family: 'DM Mono', monospace;
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--kotobart-ink-muted);
	transition: color 0.2s ease;
}

.kotobart-nav .wp-block-navigation-item__content:hover {
	color: var(--kotobart-green);
}

/* ==========================================================================
   HERO — Large Enso Logo
   ========================================================================== */

.kotobart-hero {
	position: relative;
	overflow: hidden;
}

.kotobart-hero-columns {
	min-height: 92vh;
	gap: 0 !important;
}

.kotobart-hero-left {
	position: relative;
	overflow: hidden;
	display: flex !important;
	flex-direction: column;
	justify-content: flex-end;
}

.kotobart-hero-ma {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -55%);
	font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
	font-size: clamp(10rem, 22vw, 22rem);
	font-weight: 300;
	color: rgba(255, 255, 255, 0.07);
	line-height: 1;
	pointer-events: none;
	user-select: none;
	z-index: 0;
}

.kotobart-hero-left > *:not(.kotobart-hero-ma) {
	position: relative;
	z-index: 1;
}

.kotobart-hero-label,
.kotobart-hero-title,
.kotobart-hero-left > p {
	opacity: 0;
	transform: translateY(20px);
	animation: kotobart-fadeup 0.9s ease forwards;
}

.kotobart-hero-label { animation-delay: 0.15s; }
.kotobart-hero-title { animation-delay: 0.3s; }
.kotobart-hero-left > p:nth-of-type(2) { animation-delay: 0.45s; }
.kotobart-hero-left > p:nth-of-type(3) { animation-delay: 0.65s; }

.kotobart-hero-right {
	display: flex !important;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 4vw, 4rem) !important;
	position: relative;
}

.kotobart-hero-logo-wrap {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 640px;
	width: 100%;
	opacity: 0;
	transform: translateY(24px);
	animation: kotobart-fadeup 1.2s ease 0.4s forwards;
}

.kotobart-hero-logo {
	display: block;
	width: 100%;
	max-width: 520px;
	height: auto;
	filter: drop-shadow(0 4px 20px rgba(46, 94, 78, 0.06));
	animation: kotobart-gentle-breath 7s ease-in-out infinite;
}

@keyframes kotobart-gentle-breath {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.012); }
}

.kotobart-hero-quote {
	margin-top: 2rem;
	padding-left: 2rem;
	border-left: 2px solid var(--kotobart-green);
	max-width: 420px;
}

.kotobart-hero-quote-ja {
	display: block;
	font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
	font-size: clamp(1.1rem, 1.8vw, 1.35rem);
	color: var(--kotobart-ink);
	line-height: 1.7;
	margin-bottom: 0.7rem;
	font-weight: 300;
}

.kotobart-hero-quote-en {
	display: block;
	font-family: 'Cormorant Garamond', serif;
	font-size: clamp(0.85rem, 1.3vw, 1rem);
	color: var(--kotobart-ink-muted);
	font-style: italic;
	line-height: 1.7;
}

@keyframes kotobart-fadeup {
	to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MA CHARACTER DIVIDER
   ========================================================================== */

.kotobart-ma-divider {
	font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
	font-size: clamp(4rem, 8vw, 6rem);
	font-weight: 300;
	color: var(--kotobart-green-pale);
	line-height: 1;
	text-align: center;
	user-select: none;
}

.kotobart-ma-divider--left {
	text-align: left;
}

/* ==========================================================================
   PHILOSOPHY FULL
   ========================================================================== */

@media (min-width: 900px) {
	.kotobart-phil-columns .kotobart-phil-sticky {
		position: sticky;
		top: 8rem;
		align-self: flex-start;
	}
}

/* ==========================================================================
   THREE AXES
   ========================================================================== */

.kotobart-axes {
	position: relative;
	overflow: hidden;
}

.kotobart-axes::before {
	content: '間';
	position: absolute;
	top: 50%;
	right: -8%;
	transform: translateY(-50%);
	font-family: 'Noto Serif JP', serif;
	font-size: 35rem;
	font-weight: 300;
	color: rgba(255, 255, 255, 0.02);
	line-height: 1;
	pointer-events: none;
	user-select: none;
	z-index: 0;
}

.kotobart-axes > * {
	position: relative;
	z-index: 1;
}

@media (max-width: 900px) {
	.kotobart-axes-grid .kotobart-axis-item {
		border-right: none !important;
		border-bottom: 1px solid rgba(255, 255, 255, 0.12);
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
	.kotobart-axes-grid .kotobart-axis-item:last-child {
		border-bottom: none;
	}
}

/* ==========================================================================
   SERVICES
   ========================================================================== */

.kotobart-service-item {
	transition: background-color 0.3s ease;
}

.kotobart-service-item:hover {
	background-color: rgba(46, 94, 78, 0.03);
}

.kotobart-service-tag {
	display: inline-block;
	margin-top: 0.8rem;
	padding: 3px 10px;
	font-family: 'DM Mono', monospace;
	font-size: 0.58rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--kotobart-green);
	border: 1px solid rgba(46, 94, 78, 0.3);
	border-radius: 2px;
}

/* ==========================================================================
   FOR WHOM
   ========================================================================== */

.kotobart-who-item {
	transition: background-color 0.3s ease;
}

.kotobart-who-item:hover {
	background-color: var(--kotobart-cream-dark) !important;
}

/* ==========================================================================
   MANIFESTO STRIP
   ========================================================================== */

.kotobart-strip {
	position: relative;
	overflow: hidden;
}

.kotobart-strip::before {
	content: '間';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-family: 'Noto Serif JP', serif;
	font-size: 38rem;
	font-weight: 300;
	color: rgba(255, 255, 255, 0.025);
	line-height: 1;
	pointer-events: none;
	user-select: none;
	z-index: 0;
}

.kotobart-strip > * {
	position: relative;
	z-index: 1;
}

/* ==========================================================================
   BLOG POST CARDS
   ========================================================================== */

.kotobart-posts-grid {
	gap: clamp(1.5rem, 3vw, 2.8rem) !important;
}

.kotobart-post-card {
	background: transparent;
	transition: transform 0.35s ease;
}

.kotobart-post-card:hover {
	transform: translateY(-3px);
}

.kotobart-post-card .kotobart-card-img {
	overflow: hidden;
	margin: 0 !important;
	background: var(--kotobart-cream-dark);
	position: relative;
}

.kotobart-post-card .kotobart-card-img::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 60%, rgba(26, 59, 49, 0.08));
	pointer-events: none;
}

.kotobart-post-card .kotobart-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.7s ease;
}

.kotobart-post-card:hover .kotobart-card-img img {
	transform: scale(1.04);
}

/* Placeholder when no featured image */
.kotobart-post-card .wp-block-post-featured-image {
	position: relative;
}

.kotobart-post-card .wp-block-post-featured-image:empty::before,
.kotobart-post-card .wp-block-post-featured-image a:empty::before {
	content: '間';
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 240px;
	font-family: 'Noto Serif JP', serif;
	font-size: 5rem;
	font-weight: 300;
	color: var(--kotobart-green-pale);
	background: var(--kotobart-base);
	border: 1px solid rgba(46, 94, 78, 0.08);
}

.kotobart-post-card .wp-block-post-title a,
.kotobart-post-card .wp-block-post-title {
	color: var(--kotobart-ink);
	text-decoration: none;
	transition: color 0.2s ease;
}

.kotobart-post-card .wp-block-post-title a:hover {
	color: var(--kotobart-green);
}

.kotobart-post-card .wp-block-post-excerpt__more-text {
	display: none;
}

/* ==========================================================================
   SECTION HEADER (latest posts)
   ========================================================================== */

.kotobart-section-header .kotobart-view-all {
	color: var(--kotobart-green);
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-thickness: 1px;
	text-decoration-color: rgba(46, 94, 78, 0.3);
}

.kotobart-section-header .kotobart-view-all:hover {
	text-decoration-color: var(--kotobart-green);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.wp-block-button__link {
	font-family: 'DM Mono', monospace !important;
	font-size: 0.72rem !important;
	letter-spacing: 0.2em !important;
	text-transform: uppercase !important;
	font-weight: 400 !important;
	transition: background-color 0.25s ease, transform 0.15s ease, color 0.25s ease !important;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent !important;
	color: var(--kotobart-green) !important;
	border: 1px solid rgba(46, 94, 78, 0.35) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: rgba(46, 94, 78, 0.06) !important;
	border-color: var(--kotobart-green) !important;
}

/* Outline button on dark backgrounds */
.kotobart-strip .wp-block-button.is-style-outline .wp-block-button__link,
.kotobart-axes .wp-block-button.is-style-outline .wp-block-button__link {
	color: #ffffff !important;
	border-color: rgba(255, 255, 255, 0.35) !important;
}

.kotobart-strip .wp-block-button.is-style-outline .wp-block-button__link:hover,
.kotobart-axes .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.06) !important;
	border-color: #ffffff !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.kotobart-footer {
	position: relative;
}

.kotobart-footer .wp-block-site-logo img {
	filter: brightness(0) invert(1);
	opacity: 0.55;
	max-height: 48px;
	width: auto;
}

.kotobart-footer a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.kotobart-footer a:hover {
	color: rgba(255, 255, 255, 0.8);
	border-bottom-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.wp-block-query-pagination {
	font-family: 'DM Mono', monospace;
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	gap: 0.5rem !important;
}

.wp-block-query-pagination a,
.wp-block-query-pagination-numbers .page-numbers {
	color: var(--kotobart-ink-muted);
	text-decoration: none;
	padding: 0.4rem 0.7rem;
	border: 1px solid transparent;
	transition: all 0.2s ease;
}

.wp-block-query-pagination a:hover,
.wp-block-query-pagination-numbers .page-numbers:hover {
	color: var(--kotobart-green);
	border-color: rgba(46, 94, 78, 0.2);
}

.wp-block-query-pagination-numbers .current {
	color: var(--kotobart-green);
	border-color: var(--kotobart-green);
}

/* ==========================================================================
   POST NAVIGATION LINKS
   ========================================================================== */

.wp-block-post-navigation-link {
	display: inline-block;
	margin-right: 1.5rem;
}

.wp-block-post-navigation-link a {
	color: var(--kotobart-ink-muted);
	text-decoration: none;
	text-transform: uppercase;
	transition: color 0.2s ease;
}

.wp-block-post-navigation-link a:hover {
	color: var(--kotobart-green);
}

/* ==========================================================================
   SEARCH FORM
   ========================================================================== */

.wp-block-search__inside-wrapper {
	border: 1px solid rgba(46, 94, 78, 0.2);
	border-radius: 2px;
	overflow: hidden;
}

.wp-block-search__input {
	font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
	font-size: 1rem;
	padding: 0.7rem 1rem;
	border: none;
	background: transparent;
	color: var(--kotobart-ink);
}

.wp-block-search__input:focus {
	outline: none;
	background: rgba(46, 94, 78, 0.03);
}

.wp-block-search__button {
	background: var(--kotobart-green) !important;
	color: #fff !important;
	font-family: 'DM Mono', monospace !important;
	font-size: 0.7rem !important;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	padding: 0.6rem 1.4rem !important;
	border: none !important;
}

/* ==========================================================================
   ARTICLE CONTENT — Prose styles
   ========================================================================== */

.kotobart-article-body .wp-block-post-content > * {
	margin-bottom: 1.5em;
}

.kotobart-article-body .wp-block-post-content h2 {
	margin-top: 3rem;
	margin-bottom: 1.2rem;
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	font-weight: 300;
}

.kotobart-article-body .wp-block-post-content h3 {
	margin-top: 2.5rem;
	margin-bottom: 1rem;
	font-size: clamp(1.3rem, 2.2vw, 1.6rem);
	font-weight: 400;
}

.kotobart-article-body .wp-block-post-content blockquote {
	border-left: 2px solid var(--kotobart-green);
	padding-left: 1.8rem;
	margin: 2rem 0;
	font-style: italic;
	color: var(--kotobart-ink-mid);
}

.kotobart-article-body .wp-block-post-content p {
	line-height: 1.95;
}

.kotobart-article-body .wp-block-post-content :is(p, li) :lang(ja),
.kotobart-article-body .wp-block-post-content p[lang="ja"] {
	line-height: 2;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
	.kotobart-hero-columns {
		flex-wrap: wrap !important;
	}
	.kotobart-hero-left,
	.kotobart-hero-right {
		flex-basis: 100% !important;
		width: 100% !important;
	}
	.kotobart-hero-left {
		min-height: 60vh;
	}
	.kotobart-hero-right {
		padding: 4rem 1.5rem !important;
	}
	.kotobart-hero-logo {
		max-width: 340px;
	}

	.kotobart-phil-columns {
		flex-wrap: wrap !important;
	}
	.kotobart-phil-columns .wp-block-column {
		flex-basis: 100% !important;
	}

	.kotobart-section-header {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 1.5rem !important;
	}

	.kotobart-service-item .wp-block-columns {
		flex-wrap: wrap !important;
	}
	.kotobart-service-item .wp-block-column {
		flex-basis: 100% !important;
		width: 100% !important;
	}

	.kotobart-posts-grid {
		grid-template-columns: 1fr !important;
	}

	.kotobart-who-grid {
		flex-wrap: wrap !important;
	}
	.kotobart-who-grid .wp-block-column {
		flex-basis: 100% !important;
	}

	.kotobart-footer .wp-block-columns {
		flex-wrap: wrap !important;
	}
	.kotobart-footer-right p {
		text-align: left !important;
	}
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	.kotobart-hero-logo {
		animation: none !important;
	}
}
