/*
Theme Name: Tiptoes
Theme URI: https://tiptoes.ca/
Description: Child theme of Twenty Twenty-Five for tiptoes.ca. Warm paper, deep red, contemporary display serif. The tiptoes.ca original — a weekend-supplement feel.
Author: Tiptoes
Version: 1.7.0
Template: twentytwentyfive
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: tiptoes
*/

:root {
	--tt-rule: var(--wp--preset--color--accent-3);
	--tt-muted: var(--wp--preset--color--accent-2);
	--tt-accent: var(--wp--preset--color--accent-1);
	--tt-ui: var(--wp--preset--font-family--ui);
	--tt-display: var(--wp--preset--font-family--display);
}

/* ---------------------------------------------------------------- masthead */

.tt-masthead {
	border-bottom: 1px solid var(--tt-rule);
}
.tt-masthead .wp-block-site-title {
	font-family: var(--tt-display);
	font-weight: 800;
	letter-spacing: -0.03em;
	font-size: clamp(2rem, 5vw, 3.25rem);
	line-height: 1;
	margin: 0;
	text-align: center;
}
.tt-masthead .wp-block-site-title a { text-decoration: none; }

.tt-masthead .wp-block-navigation {
	font-family: var(--tt-ui);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	justify-content: center;
	gap: clamp(1rem, 3vw, 2.25rem);
}
.tt-masthead .wp-block-navigation a { text-decoration: none; }
.tt-masthead .wp-block-navigation a:hover { color: var(--tt-accent); text-decoration: underline; text-underline-offset: 0.35em; }

/* ------------------------------------------------------------------ kicker */
/* Category label above a headline. Sans, small caps, accent — the one place
   colour is used, which is what keeps it doing work. */

.tt-kicker,
.tt-kicker .wp-block-post-terms {
	font-family: var(--tt-ui);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--tt-accent);
	line-height: 1;
}
.tt-kicker a { color: inherit; text-decoration: none; }
.tt-kicker a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.tt-kicker .wp-block-post-terms__separator { opacity: 0.5; }

/* ---------------------------------------------------------- section header */
/* Short accent rule above a serif section heading. */

.tt-section-head {
	border-top: 3px solid var(--tt-accent);
	padding-top: 0.75rem;
	margin-bottom: 1.5rem;
	max-width: 100%;
}
/* The heading sits inside a constrained group, which was centring it over a
   left-aligned grid. Pin it back to the left edge of the rule above it.
   Core's constrained-layout rule is
     .is-layout-constrained > :where(...) { margin-left:auto !important; margin-right:auto !important }
   so !important is required here, not optional. Without it only full-width
   children look correct — anything with a max-width (a standfirst, a term
   description) silently centres itself over a left-aligned grid. */
.tt-section-head > * {
	max-width: none;
	margin-left: 0 !important;
	margin-right: auto !important;
}
/* h1 on archive/search/blog-index, h2 on the homepage bands — same treatment,
   so a section header looks identical whatever the page's heading level is. */
.tt-section-head :is(h1, h2) {
	font-size: clamp(1.4rem, 2.6vw, 1.9rem);
	margin: 0;
	letter-spacing: -0.01em;
}
/* Yoast/core emit the term name in a span inside query-title; keep it inline. */
.tt-section-head :is(h1, h2) span { font: inherit; }

/* Optional one-line standfirst under a section header. */
.tt-section-sub {
	margin: 0.4rem 0 0;
	color: var(--tt-muted);
	font-size: 0.98rem;
	max-width: 56ch;
}

/* Term description, when a category has one. */
.tt-section-head .wp-block-term-description {
	margin: 0.4rem 0 0;
	color: var(--tt-muted);
	font-size: 0.98rem;
	max-width: 56ch;
}

/* -------------------------------------------------------------- lead story */
/* Until every post had a featured image the lead was text-only, because the six
   most recent posts had none and a blank slot at that size is worse than no
   image. All 226 now have one, so the lead carries it. */

.tt-lead .wp-block-post-template { list-style: none; margin: 0; padding: 0; }
.tt-lead li { display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); }
.tt-lead .wp-block-post-featured-image { margin: 0; overflow: hidden; background: var(--wp--preset--color--accent-4); }
.tt-lead .wp-block-post-featured-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	height: auto;
	display: block;
	transition: transform 420ms ease;
}
.tt-lead .wp-block-post-featured-image:hover img { transform: scale(1.02); }

/* Desktop: headline left so it keeps the page's left spine, image right.
   The image is first in the DOM so it leads on mobile, where a magazine
   front would show the picture before the headline. */
@media (min-width: 900px) {
	.tt-lead li { grid-template-columns: 1fr 1fr; align-items: center; }
	.tt-lead .tt-lead-text          { grid-column: 1; grid-row: 1; }
	.tt-lead .wp-block-post-featured-image { grid-column: 2; grid-row: 1; }
	.tt-lead .wp-block-post-featured-image img { aspect-ratio: 5 / 4; }
}


.tt-lead .wp-block-post-title {
	font-size: clamp(1.9rem, 3.6vw, 3rem);
	line-height: 1.05;
	letter-spacing: -0.025em;
	margin: 0.5rem 0 0.75rem;
	max-width: 20ch;
}
.tt-lead .wp-block-post-title { max-width: 18ch; }
.tt-lead .wp-block-post-title a { text-decoration: none; }
.tt-lead .wp-block-post-title a:hover { text-decoration: underline; text-underline-offset: 0.1em; }
.tt-lead .wp-block-post-excerpt__excerpt {
	font-size: clamp(1.05rem, 1.6vw, 1.2rem);
	color: var(--tt-muted);
	max-width: 52ch;
	line-height: 1.55;
}
.tt-lead .wp-block-post-excerpt__more-text { display: none; }

/* ------------------------------------------------------- ruled text list */
/* Used where posts have no featured image, so the absence reads as a
   deliberate list rather than a broken grid. 67 of 226 posts have no image. */

.tt-list .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0 2.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.tt-list .wp-block-post-template > li {
	border-top: 1px solid var(--tt-rule);
	padding: 1.1rem 0 1.2rem;
	margin: 0;
}
.tt-list .wp-block-post-title {
	font-size: 1.15rem;
	line-height: 1.25;
	margin: 0.45rem 0 0.4rem;
}
.tt-list .wp-block-post-title a { text-decoration: none; }
.tt-list .wp-block-post-title a:hover { text-decoration: underline; text-underline-offset: 0.12em; }
.tt-list .wp-block-post-excerpt__excerpt {
	font-size: 0.9rem;
	color: var(--tt-muted);
	line-height: 1.5;
	margin: 0;
}
.tt-list .wp-block-post-excerpt__more-text { display: none; }

/* ------------------------------------------------------------- image cards */

.tt-cards .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
	gap: 2.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.tt-cards .wp-block-post-template > li { margin: 0; }
.tt-cards .wp-block-post-featured-image {
	margin: 0 0 0.9rem;
	overflow: hidden;
	background: var(--wp--preset--color--accent-4);
}
.tt-cards .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
	height: auto;
	display: block;
	transition: transform 320ms ease;
}
.tt-cards .wp-block-post-featured-image:hover img { transform: scale(1.03); }
.tt-cards .wp-block-post-title {
	font-size: 1.2rem;
	line-height: 1.25;
	margin: 0.45rem 0 0.4rem;
}
.tt-cards .wp-block-post-title a { text-decoration: none; }
.tt-cards .wp-block-post-title a:hover { text-decoration: underline; text-underline-offset: 0.12em; }
.tt-cards .wp-block-post-excerpt__excerpt {
	font-size: 0.9rem;
	color: var(--tt-muted);
	line-height: 1.5;
	margin: 0;
}
.tt-cards .wp-block-post-excerpt__more-text { display: none; }

/* -------------------------------------------------------- more-link / meta */

.tt-more {
	font-family: var(--tt-ui);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-top: 1.75rem;
	border-top: 1px solid var(--tt-rule);
	padding-top: 0.9rem;
}
.tt-more a { text-decoration: none; }
.tt-more a:hover { color: var(--tt-accent); text-decoration: underline; text-underline-offset: 0.3em; }

.tt-meta,
.tt-meta .wp-block-post-date,
.tt-meta .wp-block-post-terms {
	font-family: var(--tt-ui);
	font-size: 0.76rem;
	letter-spacing: 0.04em;
	color: var(--tt-muted);
}
.tt-meta a { color: inherit; text-decoration: none; }
.tt-meta a:hover { color: var(--tt-accent); text-decoration: underline; }

/* ------------------------------------------------------- communities band */

.tt-feature {
	background: var(--wp--preset--color--accent-4);
	border-top: 3px solid var(--tt-accent);
	padding: clamp(2rem, 5vw, 3.5rem);
}
.tt-feature h2 {
	font-size: clamp(1.6rem, 3.4vw, 2.4rem);
	margin: 0.4rem 0 0.75rem;
	max-width: 22ch;
}
.tt-feature p { max-width: 58ch; color: var(--tt-muted); }
.tt-feature .tt-more { border-top: none; padding-top: 0.5rem; }
.tt-feature .tt-more a { color: var(--tt-accent); }

/* ---------------------------------------------------------------- articles */

.tt-article .wp-block-post-title {
	max-width: 22ch;
	letter-spacing: -0.025em;
	line-height: 1.06;
}
.tt-article .tt-lede {
	font-size: clamp(1.1rem, 1.8vw, 1.3rem);
	line-height: 1.55;
	color: var(--tt-muted);
	max-width: 56ch;
}
/* First paragraph of body copy carries a little more weight. */
.tt-article .wp-block-post-content > p:first-of-type {
	font-size: 1.15rem;
	line-height: 1.6;
}
.tt-article .wp-block-post-content h2 {
	margin-top: 2.4em;
	margin-bottom: 0.5em;
	font-size: clamp(1.35rem, 2.3vw, 1.7rem);
}
.tt-article .wp-block-post-content h3 {
	margin-top: 2em;
	margin-bottom: 0.4em;
}
.tt-article .wp-block-post-content p { margin-block: 0 1.3em; }
.tt-article .wp-block-post-content a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.tt-article .wp-block-post-content img { height: auto; }

/* The featured image on a post was filling the viewport at desktop width. */
.tt-article .wp-block-post-featured-image img {
	max-height: 60vh;
	width: 100%;
	object-fit: cover;
}

/* ------------------------------------------------------------------ footer */

.tt-footer {
	border-top: 1px solid var(--tt-rule);
	font-family: var(--tt-ui);
	font-size: 0.8rem;
	color: var(--tt-muted);
}
.tt-footer .wp-block-navigation {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	gap: 1.5rem;
}
.tt-footer a { color: inherit; text-decoration: none; }
.tt-footer a:hover { color: var(--tt-accent); text-decoration: underline; text-underline-offset: 0.3em; }

/* ------------------------------------------------------------ small screens */

@media (max-width: 1023px) {
	.tt-list .wp-block-post-template,
	.tt-index .wp-block-post-template { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 781px) {
	.tt-list .wp-block-post-template,
	.tt-index .wp-block-post-template { grid-template-columns: 1fr; }
	.tt-lead .wp-block-post-title { max-width: none; }
	.tt-list .wp-block-post-template { gap: 0; }
	.tt-cards .wp-block-post-template { gap: 2rem; }
	.tt-masthead .wp-block-navigation { font-size: 0.72rem; gap: 0.9rem; }
}


/* ------------------------------------------------ communities section index */

.tt-index .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0 2.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: tt-idx;
}
.tt-index .wp-block-post-template > li {
	border-top: 1px solid var(--tt-rule);
	padding: 1.1rem 0 1.3rem;
	margin: 0;
	counter-increment: tt-idx;
}
.tt-index .wp-block-post-template > li::before {
	content: counter(tt-idx, decimal-leading-zero);
	font-family: var(--tt-ui);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--tt-accent);
	display: block;
	margin-bottom: 0.4rem;
}
.tt-index .wp-block-post-title {
	font-size: 1.15rem;
	line-height: 1.25;
	margin: 0 0 0.4rem;
}
.tt-index .wp-block-post-title a { text-decoration: none; }
.tt-index .wp-block-post-title a:hover { text-decoration: underline; text-underline-offset: 0.12em; }
.tt-index .wp-block-post-excerpt__excerpt {
	font-size: 0.9rem;
	color: var(--tt-muted);
	line-height: 1.5;
	margin: 0;
}
.tt-index .wp-block-post-excerpt__more-text { display: none; }

/* Hub intro: the lede paragraph of the section front. */
.tt-hub-intro .wp-block-post-content > p:first-of-type {
	font-size: clamp(1.15rem, 1.9vw, 1.35rem);
	line-height: 1.55;
}


/* ============================================================ page furniture */

/* Generic pages (About, Privacy, and anything added later) get the same lede
   treatment as the section fronts, so no page looks like an afterthought. */
.tt-page .wp-block-post-title {
	max-width: 20ch;
	letter-spacing: -0.025em;
	line-height: 1.06;
}
.tt-page .wp-block-post-content > p:first-of-type {
	font-size: clamp(1.1rem, 1.8vw, 1.3rem);
	line-height: 1.55;
	color: var(--tt-muted);
}
.tt-page .wp-block-post-content h2 {
	margin-top: 2.4em;
	margin-bottom: 0.5em;
	font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}
.tt-page .wp-block-post-content h3 { margin-top: 2em; margin-bottom: 0.4em; }
.tt-page .wp-block-post-content p { margin-block: 0 1.3em; }
.tt-page .wp-block-post-content ul,
.tt-page .wp-block-post-content ol { margin-block: 0 1.3em; padding-left: 1.4em; }
.tt-page .wp-block-post-content li { margin-block: 0.35em; }

/* ================================================================== forms */
/* Contact Form 7 ships unstyled, which on a default theme reads as a raw
   browser form. These rules are generic CF7 selectors, so they carry to any
   site in the network running the same plugin. */

.tt-form .wpcf7-form p { margin-block: 0 1.25rem; }

.tt-form label {
	display: block;
	font-family: var(--tt-ui);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tt-muted);
	margin-bottom: 0.45rem;
}

.tt-form input[type="text"],
.tt-form input[type="email"],
.tt-form input[type="tel"],
.tt-form input[type="url"],
.tt-form input[type="search"],
.tt-form textarea,
.tt-form select {
	width: 100%;
	box-sizing: border-box;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	line-height: 1.5;
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base);
	border: 1px solid var(--tt-rule);
	border-radius: 2px;
	padding: 0.7rem 0.85rem;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}
.tt-form textarea { min-height: 11rem; resize: vertical; }

.tt-form input:focus,
.tt-form textarea:focus,
.tt-form select:focus {
	outline: none;
	border-color: var(--tt-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tt-accent) 14%, transparent);
}
.tt-form ::placeholder { color: var(--tt-muted); opacity: 0.7; }

.tt-form input[type="submit"],
.tt-form button[type="submit"],
.tt-form .wpcf7-submit {
	width: auto;
	font-family: var(--tt-ui);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--base);
	background: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 2px;
	padding: 0.85rem 2rem;
	cursor: pointer;
	transition: background 160ms ease, border-color 160ms ease;
}
.tt-form input[type="submit"]:hover,
.tt-form .wpcf7-submit:hover {
	background: var(--tt-accent);
	border-color: var(--tt-accent);
}

/* CF7 status and validation messages */
.tt-form .wpcf7-not-valid-tip {
	font-family: var(--tt-ui);
	font-size: 0.78rem;
	color: var(--tt-accent);
	margin-top: 0.35rem;
}
.tt-form .wpcf7-response-output {
	font-family: var(--tt-ui);
	font-size: 0.85rem;
	border: 1px solid var(--tt-rule) !important;
	border-left: 3px solid var(--tt-accent) !important;
	padding: 0.9rem 1.1rem !important;
	margin: 1.5rem 0 0 !important;
}
.tt-form .wpcf7-spinner { display: none; }

/* Contact layout: intro beside the form on wide screens. */
.tt-contact-grid { align-items: start; }
.tt-contact-aside p { color: var(--tt-muted); font-size: 0.95rem; }
.tt-contact-aside .tt-kicker { margin-bottom: 0.5rem; }

/* ================================================= search form and results */

.tt-searchbar .wp-block-search__input {
	font-family: var(--wp--preset--font-family--body);
	border: 1px solid var(--tt-rule);
	border-radius: 2px;
	padding: 0.7rem 0.85rem;
	background: var(--wp--preset--color--base);
}
.tt-searchbar .wp-block-search__button {
	font-family: var(--tt-ui);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 2px;
	padding: 0.75rem 1.6rem;
	cursor: pointer;
}
.tt-searchbar .wp-block-search__button:hover {
	background: var(--tt-accent);
	border-color: var(--tt-accent);
}

/* ===================================================================== 404 */

.tt-404 h1 { max-width: 16ch; }
.tt-404 p { color: var(--tt-muted); max-width: 48ch; }

/* ==== preset ==== */
.tt-cards .wp-block-post-featured-image img { aspect-ratio: 3 / 2; }
