/*
Theme Name: Take Your Time
Theme URI: https://takeyourtime.junpeitakeya.com/
Author: Junpei Takeya
Author URI: https://junpeitakeya.com/
Description: A quiet, text-first block theme for Take Your Time — slow letters from Niigata. One column, generous margins, self-hosted type, no tracking.
Version: 0.1.2
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: take-your-time
*/

/* Most styling lives in theme.json. This file holds only what theme.json cannot express. */

.tyt-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Eyebrow labels: small caps-like sans */
.tyt-eyebrow {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

/* Subscribe form (raw HTML inside a pattern) */
.tyt-subscribe {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.tyt-subscribe__row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.tyt-subscribe input[type="email"] {
	flex: 1 1 220px;
	min-height: 48px;
	padding: 0 16px;
	border: 1px solid var(--wp--preset--color--line-strong);
	border-radius: 0;
	background: #fff;
	color: var(--wp--preset--color--ink);
	font: inherit;
}
.tyt-subscribe input[type="email"]:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
.tyt-subscribe button {
	min-height: 48px;
	padding: 0 24px;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--accent);
	color: #fff;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}
.tyt-subscribe button:hover,
.tyt-subscribe button:focus-visible {
	background: var(--wp--preset--color--ink);
}
.tyt-subscribe__note {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
}
.tyt-subscribe__options {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.tyt-subscribe__options label {
	display: flex;
	gap: 12px;
	align-items: baseline;
}
.tyt-subscribe__options input {
	accent-color: var(--wp--preset--color--accent);
	width: 18px;
	height: 18px;
}

/* Thin rule above section labels */
.tyt-ruled {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: 1.25rem;
}

/* Featured images: keep the paper tone while loading */
.wp-block-post-featured-image img {
	display: block;
}

/* ---------- Layout pieces used by the templates ---------- */

:root { --tyt-sans: var(--wp--preset--font-family--sans); }

/* Top bar */
.tyt-topbar {
	border-bottom: 1px solid var(--wp--preset--color--line);
	font-family: var(--tyt-sans);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
}
.tyt-topbar__inner { padding-block: 10px; }
.tyt-topbar p { margin: 0; }
.tyt-topbar a { color: var(--wp--preset--color--muted); text-decoration: none; }
.tyt-topbar a:hover { color: var(--wp--preset--color--ink); }

/* Header */
.tyt-header__inner { padding-block: 28px; gap: 24px; }
.tyt-nav { gap: 28px; }
.tyt-nav .tyt-nav__cta a { color: var(--wp--preset--color--accent) !important; font-weight: 500; }
body:not(.home) .tyt-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.single .tyt-header__inner, .page .tyt-header__inner, .archive .tyt-header__inner { padding-block: 24px; }

/* Main sections */
.tyt-main { padding-bottom: var(--wp--preset--spacing--60); }
.tyt-section { margin-top: 0; padding-bottom: var(--wp--preset--spacing--60); }

/* Hero */
.tyt-hero { text-align: center; padding-top: clamp(3rem, 7vw, 4.5rem); padding-bottom: 3.5rem; }
.tyt-hero .tyt-eyebrow { margin-bottom: 1.25rem; }
.tyt-hero__title {
	font-size: var(--wp--preset--font-size--display) !important;
	line-height: 1.02 !important;
	letter-spacing: -0.01em;
	margin-block: 0 !important;
	text-align: center;
}
.tyt-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
	color: var(--wp--preset--color--ink-soft);
}
.tyt-hero .tyt-lead { max-width: 560px; margin: 1.75rem auto 0 !important; }
.tyt-hero-form { padding-bottom: var(--wp--preset--spacing--60); margin-top: 0 !important; }

/* Bordered card holding the form */
.tyt-card {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	padding: 2rem;
}
.tyt-subscribe__later { color: var(--wp--preset--color--muted); }

/* Latest letter on the home page */
.tyt-latest { margin-top: 0 !important; padding-bottom: var(--wp--preset--spacing--60); }
.tyt-latest__image img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.tyt-latest__body { margin-top: var(--wp--preset--spacing--50); }
.tyt-latest__title { font-size: var(--wp--preset--font-size--xx-large); margin-top: 0.25rem !important; }
.tyt-latest__title a, .tyt-list__title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.tyt-latest__title a:hover, .tyt-list__title a:hover { color: var(--wp--preset--color--accent); }

/* Post meta line: Category · date */
.tyt-postmeta { gap: 0.5em; font-family: var(--tyt-sans); font-size: var(--wp--preset--font-size--small); }
.tyt-postmeta > * { margin: 0 !important; }
.tyt-postmeta .wp-block-post-terms a { color: var(--wp--preset--color--accent); text-decoration: none; }
.tyt-postmeta .wp-block-post-terms::after { content: "·"; margin-left: 0.5em; color: var(--wp--preset--color--muted); }

/* Small text helpers */
.tyt-meta { font-family: var(--tyt-sans); font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); margin-top: 0.25rem !important; }
.tyt-more { font-family: var(--tyt-sans); font-size: var(--wp--preset--font-size--small); }
.tyt-ruled-top { border-top: 1px solid var(--wp--preset--color--line); padding-top: 2.5rem; }

/* Two-column groups (newsletters, about) */
.tyt-cols { gap: 48px !important; }
.tyt-col { flex: 1 1 320px; }
.tyt-col > h3 { margin: 0; }
.tyt-about .tyt-portrait { flex: 0 1 300px; margin: 0; }
.tyt-about .tyt-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.tyt-about .tyt-col { flex-basis: 420px; }

/* Banner to the main site */
.tyt-banner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
	padding: 28px 32px;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base) !important;
	text-decoration: none !important;
	font-family: var(--tyt-sans);
	font-size: var(--wp--preset--font-size--small);
}
.tyt-banner:hover { background: var(--wp--preset--color--ink-soft); }
.tyt-banner__text { display: flex; flex-direction: column; gap: 4px; }
.tyt-banner__title { font-family: var(--wp--preset--font-family--display); font-size: 1.75rem; font-weight: 500; }
.tyt-banner__sub { color: var(--wp--preset--color--inverse-muted); }

/* Article */
.tyt-article-header { padding-top: clamp(3rem, 8vw, 5rem); padding-bottom: 2.5rem; }
.tyt-article-header .wp-block-post-title { margin-top: 1rem; }
.tyt-dek { font-size: 1.4375rem; line-height: 1.45; font-style: italic; color: var(--wp--preset--color--ink-soft); }
.tyt-dek .wp-block-post-excerpt__more-text { display: none; }
.tyt-byline { gap: 0.3em; font-family: var(--tyt-sans); font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); margin-top: 1.75rem !important; }
.tyt-byline > * { margin: 0 !important; }
.tyt-article-image { margin-bottom: 3rem; }
.tyt-article-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.tyt-article-body { font-size: 1.25rem; line-height: 1.65; }
.tyt-article-body > p { margin-block: 0 1.6em; }
.tyt-article-end { padding-top: 4rem; }
.tyt-subscribe-inline {
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-block: 2rem;
}
.tyt-subscribe-inline__title { font-size: 1.75rem !important; margin: 0 0 0.5rem !important; }
.tyt-postnav { padding-top: 2.5rem; gap: 24px; }

/* Sign-off: use the "Signature" paragraph style (see register_block_style in functions.php) */
.is-style-signature { font-family: var(--wp--preset--font-family--display); font-size: 1.875rem; font-style: italic; margin-top: 0 !important; }

/* Pages and lists */
.tyt-page { padding-top: clamp(3rem, 8vw, 5rem); }
.tyt-archive { padding-top: clamp(3rem, 8vw, 5rem); }
.tyt-archive__title { margin-bottom: 2rem; }
.tyt-list__item { border-top: 1px solid var(--wp--preset--color--line); padding-block: 2rem; }
.tyt-list__title { font-size: var(--wp--preset--font-size--x-large); margin-top: 0.25rem !important; }

/* Footer */
.tyt-footer {
	border-top: 1px solid var(--wp--preset--color--line);
	font-family: var(--tyt-sans);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
	margin-top: 0 !important;
}
.tyt-footer__inner { padding-block: 32px 48px; gap: 24px; }
.tyt-footer p { margin: 0; }
.tyt-footer a { color: var(--wp--preset--color--muted); margin-left: 1.25em; }
.tyt-footer__links a:first-child { margin-left: 0; }

@media (max-width: 600px) {
	.tyt-card { padding: 1.5rem; }
	.tyt-banner { padding: 24px; }
	.tyt-footer a { margin-left: 0; margin-right: 1.25em; }
}

/* Accessibility helper WordPress expects themes to provide */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto; margin: 0; padding: 0.5rem 1rem;
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); z-index: 100000;
}

/* "Read the letter" link: left-aligned like the mock */
.wp-block-read-more.tyt-more { display: block; width: 100%; max-width: 720px; margin-inline: auto !important; text-align: left; margin-top: 1.25rem; }

/* Previous / next letter: small label above the title */
.tyt-postnav .post-navigation-link__label {
	display: block;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: 0.12em;
}
.tyt-postnav a { text-decoration: none; }
.tyt-postnav .post-navigation-link__title { font-family: var(--wp--preset--font-family--display); font-size: 1.375rem; color: var(--wp--preset--color--ink); }
