/*
Theme Name: Jashehe
Theme URI: https://jashehe.com
Author: Yuhe
Description: A travel logbook theme. Every post is a numbered entry with the facts readers need to plan the same trip: where, when, how long, what it cost, how it was booked and what to do differently. Countries are categories, so it covers a working holiday in Australia, a ski trip in China or a campervan loop in New Zealand alike. Includes trip-sheet, cost ledger, day-by-day, booking, gear and note patterns, plus three colour styles.
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jashehe
Tags: blog, one-column, block-patterns, full-site-editing, style-variations, wide-blocks, editor-style
*/

/* ===== Labels: the logbook's small mono text ===== */
.jh-label,
.jh-entry-no {
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1.4;
	color: var(--wp--preset--color--muted);
}
.jh-label a { color: inherit; }

/* ===== Header ===== */
.jh-header {
	padding-top: 1.1rem;
	padding-bottom: 1.1rem;
	border-bottom: 1px solid var(--wp--preset--color--contrast);
}
.jh-header .jh-label { margin: 0; }
.jh-brand { gap: 0.75rem; align-items: baseline !important; }

/* ===== Section heads: a heavy rule and a mono label ===== */
.jh-section { margin-top: var(--wp--preset--spacing--60) !important; }
.jh-section-head {
	border-top: 2px solid var(--wp--preset--color--contrast);
	padding-top: 0.7rem;
	margin-bottom: 0 !important;
}
.jh-section-head > * { margin: 0; }
.jh-section-head .wp-block-heading {
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.jh-section-head a {
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-decoration: none;
}

/* ===== Home masthead ===== */
.jh-masthead {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	align-items: end;
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--40);
}
.jh-masthead > * { margin: 0 !important; }
.jh-masthead .wp-block-site-tagline {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.04;
	color: var(--wp--preset--color--contrast);
	max-width: 17ch;
	text-wrap: balance;
}
.jh-masthead-side > * { margin: 0; }
.jh-masthead-side > * + * { margin-top: 0.6rem; }
.jh-masthead-side p:not(.jh-label) { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); max-width: 40ch; }
@media (max-width: 781px) {
	.jh-masthead { grid-template-columns: 1fr; }
}

/* ===== Latest entry (lead) ===== */
.jh-lead { padding-top: var(--wp--preset--spacing--40); }
.jh-lead .wp-block-columns { gap: var(--wp--preset--spacing--50); }
.jh-lead .wp-block-post-title { font-size: var(--wp--preset--font-size--xx-large); text-wrap: balance; }
.jh-lead .wp-block-post-excerpt { font-size: var(--wp--preset--font-size--medium); }
.jh-lead .wp-block-post-excerpt__more-link a {
	font-weight: 600;
	text-decoration: none;
}

/* ===== Meta rows ("No. 07 / NEW ZEALAND / 18 NOV 2026") ===== */
.jh-meta { gap: 0 !important; align-items: baseline; }
.jh-meta > * { margin: 0 !important; }
.jh-meta > * + *::before {
	content: "/";
	margin: 0 0.55em;
	color: var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
}
.jh-meta .wp-block-post-date { text-transform: uppercase; letter-spacing: 0.06em; }
.jh-meta .jh-entry-no { color: var(--wp--preset--color--contrast); }

/* ===== Entry list rows ===== */
.jh-list .wp-block-post-template { margin-top: 0; }
.jh-row {
	display: grid;
	grid-template-columns: 4rem 176px minmax(0, 1fr) 11rem;
	gap: 0 1.5rem;
	align-items: start;
	padding: 1.25rem 0;
	border-top: 1px solid var(--wp--preset--color--line);
}
.wp-block-post-template > li:first-child .jh-row { border-top: 0; }
.wp-block-post-template > li:last-child .jh-row { border-bottom: 1px solid var(--wp--preset--color--line); }
.jh-row > * { margin: 0 !important; }
.jh-row > .jh-entry-no { grid-column: 1; grid-row: 1; padding-top: 0.3rem; color: var(--wp--preset--color--contrast); }
.jh-row > .wp-block-post-featured-image { grid-column: 2; grid-row: 1; }
.jh-row > .jh-row-main { grid-column: 3; grid-row: 1; }
.jh-row > .jh-row-side { grid-column: 4; grid-row: 1; text-align: right; padding-top: 0.3rem; }
.jh-row-main > * { margin: 0; }
.jh-row-main > * + * { margin-top: 0.4rem; }
.jh-row .wp-block-post-title { font-size: var(--wp--preset--font-size--large); line-height: 1.2; text-wrap: balance; }
.jh-row .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }
.jh-row-side > * { margin: 0; }
.jh-row-side > * + * { margin-top: 0.3rem; }
@media (max-width: 781px) {
	.jh-row { grid-template-columns: 96px minmax(0, 1fr); gap: 0.15rem 1rem; }
	.jh-row > .jh-entry-no { grid-column: 2; grid-row: 1; padding-top: 0; }
	.jh-row > .wp-block-post-featured-image { grid-column: 1; grid-row: 1 / span 3; }
	.jh-row > .jh-row-main { grid-column: 2; grid-row: 2; }
	.jh-row > .jh-row-side { grid-column: 2; grid-row: 3; text-align: left; padding-top: 0.3rem; display: flex; gap: 0.75rem; }
	.jh-row-side > * + * { margin-top: 0; }
	.jh-row .wp-block-post-excerpt { display: none; }
	.jh-row .wp-block-post-title { font-size: 1.0625rem; }
}

/* ===== Country index (categories) ===== */
.wp-block-categories.is-style-jh-index {
	list-style: none;
	padding: 0;
	margin: 0;
	columns: 3 15rem;
	column-gap: var(--wp--preset--spacing--50);
}
.wp-block-categories.is-style-jh-index li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	break-inside: avoid;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
	font-variant-numeric: tabular-nums;
}
.wp-block-categories.is-style-jh-index li a {
	font-family: var(--wp--preset--font-family--plex-sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.wp-block-categories.is-style-jh-index li a:hover { color: var(--wp--preset--color--accent); }

/* ===== Single entry ===== */
.jh-entry-head { padding-top: var(--wp--preset--spacing--50); }
.jh-entry-head .wp-block-post-title { text-wrap: balance; margin-top: 0.9rem; }
.jh-updated { gap: 0.4rem !important; margin-top: 1rem !important; }
.jh-updated > * { margin: 0 !important; }
.jh-entry-hero { margin-top: var(--wp--preset--spacing--40) !important; }
.single .wp-block-post-content,
.page .wp-block-post-content { margin-top: var(--wp--preset--spacing--40); }

/* Numbered sections: every H2 in a post gets 01, 02, 03… */
.wp-block-post-content { counter-reset: jh-section; }
.wp-block-post-content > h2.wp-block-heading {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: 0.9rem;
	border-top: 1px solid var(--wp--preset--color--contrast);
}
.wp-block-post-content > h2.wp-block-heading::before {
	counter-increment: jh-section;
	content: counter(jh-section, decimal-leading-zero);
	display: block;
	margin-bottom: 0.6rem;
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--muted);
}
.wp-block-post-content a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
/* Affiliate links get a small arrow, so readers know where they go */
.wp-block-post-content a[rel~="sponsored"]:not(.wp-block-button__link)::after {
	content: "\2197";
	font-size: 0.8em;
	margin-left: 0.12em;
}
.wp-block-post-content figure.wp-block-image,
.wp-block-post-content .wp-block-gallery { margin-top: var(--wp--preset--spacing--40); margin-bottom: var(--wp--preset--spacing--40); }

.jh-entry-foot { margin-top: var(--wp--preset--spacing--50) !important; }
.jh-entry-foot > * + * { margin-top: var(--wp--preset--spacing--40); }
.jh-filed { gap: 0.6rem !important; }
.jh-filed > * { margin: 0 !important; }
.jh-postnav {
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 1rem 0;
	gap: 1rem 2rem !important;
}
.jh-postnav > * { margin: 0 !important; flex: 1 1 14rem; }
.jh-postnav .post-navigation-link-next { text-align: right; }
.jh-postnav a { color: var(--wp--preset--color--contrast); text-decoration: none; font-weight: 600; font-size: var(--wp--preset--font-size--small); }
.jh-postnav a:hover { color: var(--wp--preset--color--accent); }

/* ===== Patterns ===== */
/* Trip sheet */
.jh-sheet { border: 1px solid var(--wp--preset--color--contrast); }
.jh-sheet > * { margin: 0 !important; }
.jh-sheet > .jh-label {
	padding: 0.6rem 1rem;
	border-bottom: 1px solid var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast);
}
.wp-block-table.is-style-jh-sheet { margin: 0; }
.wp-block-table.is-style-jh-sheet table { width: 100%; border-collapse: collapse; }
.wp-block-table.is-style-jh-sheet td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.65rem 1rem;
	vertical-align: top;
	line-height: 1.45;
}
.wp-block-table.is-style-jh-sheet tr:last-child td { border-bottom: 0; }
.wp-block-table.is-style-jh-sheet td:first-child {
	width: 36%;
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--muted);
	padding-top: 0.85rem;
}

/* Cost ledger */
.wp-block-table.is-style-jh-ledger table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.wp-block-table.is-style-jh-ledger th,
.wp-block-table.is-style-jh-ledger td { border: 0; padding: 0.6rem 0; text-align: left; vertical-align: top; }
.wp-block-table.is-style-jh-ledger thead th {
	border-bottom: 1px solid var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--muted);
}
.wp-block-table.is-style-jh-ledger tbody td { border-bottom: 1px solid var(--wp--preset--color--line); }
.wp-block-table.is-style-jh-ledger th:last-child,
.wp-block-table.is-style-jh-ledger td:last-child { text-align: right; padding-left: 1rem; }
.wp-block-table.is-style-jh-ledger tfoot td { border-top: 2px solid var(--wp--preset--color--contrast); font-weight: 700; padding-top: 0.75rem; }
.wp-block-table.is-style-jh-ledger thead { border-bottom: 0; }
.wp-block-table.is-style-jh-ledger tfoot { border-top: 0; }

/* Booked-with card */
.jh-booked {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	padding: var(--wp--preset--spacing--40);
}
.jh-booked > * { margin-top: 0; margin-bottom: 0; }
.jh-booked > * + * { margin-top: 0.6rem; }
.jh-booked .wp-block-buttons { margin-top: 1.1rem; }
.jh-booked .jh-fine { font-size: var(--wp--preset--font-size--x-small); color: var(--wp--preset--color--muted); }

/* Day by day */
.jh-day {
	display: grid;
	grid-template-columns: 5.5rem minmax(0, 1fr);
	gap: 0 1.25rem;
	padding: 1rem 0;
	border-top: 1px solid var(--wp--preset--color--line);
}
.jh-day > * { grid-column: 2; margin: 0 !important; }
.jh-day > * + * { margin-top: 0.4rem !important; }
.jh-day > .jh-label { grid-column: 1; grid-row: 1 / span 3; margin-top: 0.3rem !important; color: var(--wp--preset--color--contrast); }
.jh-day .wp-block-heading { font-size: var(--wp--preset--font-size--medium); letter-spacing: 0; }

/* Highlighter note */
p.is-style-jh-note {
	background: var(--wp--preset--color--highlight);
	padding: 1rem 1.2rem;
}
p.is-style-jh-note::before {
	content: "Note";
	display: block;
	margin-bottom: 0.3rem;
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* Disclosure */
.jh-disclosure {
	font-family: var(--wp--preset--font-family--plex-mono);
	font-size: var(--wp--preset--font-size--x-small) !important;
	line-height: 1.6 !important;
	color: var(--wp--preset--color--muted);
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.75rem 0;
}

/* About the writers */
.jh-about { border-top: 2px solid var(--wp--preset--color--contrast); padding-top: 0.7rem; }
.jh-about > * { margin: 0; }
.jh-about > * + * { margin-top: 0.6rem; }
.jh-about p:not(.jh-label) { font-size: var(--wp--preset--font-size--small); }

/* Subscribe row */
.jh-subscribe {
	border-top: 2px solid var(--wp--preset--color--contrast);
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 1.25rem 0;
	gap: 1rem 2rem !important;
}
.jh-subscribe > * { margin: 0 !important; }
.jh-subscribe .wp-block-heading { font-size: var(--wp--preset--font-size--large); }
.jh-subscribe p { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }

/* Ad slot: no space until code is added */
.jh-ad:has(ins, iframe, script, img) { min-height: 280px; display: flex; align-items: center; justify-content: center; }

/* ===== Footer ===== */
.jh-footer {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--50);
	border-top: 2px solid var(--wp--preset--color--contrast);
}
.jh-footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}
.jh-footer-grid > * { margin: 0 !important; }
.jh-footer-grid .wp-block-group > * { margin-top: 0; margin-bottom: 0; }
.jh-footer-grid .wp-block-group > * + * { margin-top: 0.75rem; }
.jh-footer .wp-block-categories.is-style-jh-index { columns: 2 10rem; }
.jh-footer-links { font-size: var(--wp--preset--font-size--small); line-height: 2; }
.jh-footer-links a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.jh-footer-links a:hover { color: var(--wp--preset--color--accent); }
@media (max-width: 781px) {
	.jh-footer-grid { grid-template-columns: 1fr; }
}

/* ===== Archive, search, 404 ===== */
.jh-archive-head { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--30); }
.jh-archive-head > * { margin-top: 0; margin-bottom: 0; }
.jh-archive-head > * + * { margin-top: 0.75rem; }
.jh-archive-head .wp-block-term-description { color: var(--wp--preset--color--muted); max-width: 60ch; }

.wp-block-search__input {
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 2px;
	padding: 0.7rem 0.9rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.wp-block-search__button { margin-left: 0.5rem; }

/* Pagination */
.wp-block-query-pagination { margin-top: var(--wp--preset--spacing--40) !important; }
.wp-block-query-pagination a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.wp-block-query-pagination .page-numbers.current { color: var(--wp--preset--color--accent); }

/* Comments */
.jh-comment { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1rem; }
.jh-comment > * { margin-top: 0; margin-bottom: 0; }
.jh-comment > * + * { margin-top: 0.35rem; }
.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-post-comments-form textarea {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	padding: 0.65rem 0.8rem;
	font: inherit;
	font-size: 1rem;
}
.wp-block-post-comments-form label,
.wp-block-post-comments-form .comment-notes,
.wp-block-post-comments-form .comment-form-cookies-consent { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }

:where(a, button, input, textarea):focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; }

.jh-section-lead { margin-top: var(--wp--preset--spacing--30) !important; }
.jh-section-list { margin-top: 0 !important; }
.jh-subscribe-text > * { margin: 0; }
.jh-subscribe-text > * + * { margin-top: 0.35rem; }

/* Fixes */
.jh-row .wp-block-post-featured-image { align-self: start; }
.jh-row .wp-block-post-featured-image img { height: auto !important; aspect-ratio: 4 / 3; }
.jh-row-side .wp-block-post-date,
.jh-meta .wp-block-post-date { text-transform: uppercase; letter-spacing: 0.06em; }
.jh-updated:not(:has(time)) { display: none; }
p.is-style-jh-note { box-sizing: border-box; }
