/*
Theme Name: Lumio
Theme URI: https://github.com/chandrapatel/lumio
Author: Chandra Patel
Author URI: https://chandra.dev/
Description: Lumio is a clean block theme built for writers. Fluid typography, generous whitespace, and a focused reading experience — for any blog, any topic.
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.2
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lumio
Tags: blog, one-column, custom-colors, custom-logo, editor-style, featured-images, full-site-editing, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks
*/

/*
 * Design tokens and everything theme.json models as a real property — colours, the
 * type scale, spacing, block and element styling — live in theme.json.
 *
 * Anything needing a selector theme.json cannot express stays here: descendant and
 * sibling selectors, pseudo-elements, transforms, transitions, and form `:focus`
 * (still unsupported on elements.textInput/select in WP 7.1).
 */

/* ── Global resets ── */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

/* ── Accessibility: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

/* ── Focus rings ── */
:focus-visible {
	outline: 3px solid var(--wp--preset--color--brand-soft);
	outline-offset: 2px;
	border-radius: var(--wp--custom--radius--xs);
}

/* ── Link underline detail ── */
/* Colours come from theme.json elements.link; theme.json's textDecoration only takes
   the shorthand keyword, so the underline detail stays here. */
.wp-block-post-content a {
	text-decoration-color: var(--wp--preset--color--brand);
	text-underline-offset: 3px;
	text-decoration-thickness: 2px;
	transition: color var(--wp--custom--transition--fast), text-decoration-color var(--wp--custom--transition--fast);
}

.wp-block-post-content a:hover {
	text-decoration-thickness: 3px;
}

.wp-block-post-content a:visited {
	text-decoration-color: var(--wp--preset--color--link-visited);
}

/* ── Navigation ── */
/* theme.json's `-current` custom state colours the <li>, which loses to the anchor's
   own colour rule, so the current item is highlighted on the link here.
   Scoped to the direct child: `current-menu-item` also lands on a submenu's <li>,
   so a descendant selector would paint every link inside that submenu as current.
   Matching the item content rather than `a` also covers a link-less submenu toggle,
   which core renders as a <button>. */
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--brand);
}

/* ── Buttons ── */
.wp-block-button__link,
.wp-element-button {
	transition: background-color var(--wp--custom--transition--fast), color var(--wp--custom--transition--fast), border-color var(--wp--custom--transition--fast), transform var(--wp--custom--transition--instant);
}

.wp-block-button__link:active,
.wp-element-button:active {
	transform: translateY(1px);
}

/* ── Post title link ── */
.wp-block-post-title a {
	transition: color var(--wp--custom--transition--fast);
}

/* ── Post terms (categories/tags) ── */
/* The pill treatment itself is theme.json blocks.core/post-terms.elements.link. */
.wp-block-post-terms {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.wp-block-post-terms a {
	transition: background var(--wp--custom--transition--fast), border-color var(--wp--custom--transition--fast);
}

.wp-block-post-terms .wp-block-post-terms__separator {
	display: none;
}

.wp-block-post-terms__title {
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 500;
	letter-spacing: -0.015em;
}

/* ── Quote / pullquote ── */
/* Border, padding and typography are theme.json blocks.core/quote + core/pullquote;
   citation typography is theme.json elements.cite. */
.wp-block-pullquote blockquote {
	margin: 0;
}

.wp-block-pullquote cite,
.wp-block-pullquote blockquote cite,
.wp-block-quote cite {
	display: block;
}

/* ── Code ── */
/* `code` is not one of theme.json's elements (button, link, heading, h1–h6,
   caption, cite, select, textInput), so it stays here. */
code {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.875em;
	color: var(--wp--preset--color--brand-hover);
	background: var(--wp--preset--color--brand-soft);
	padding: 2px 6px;
	border-radius: var(--wp--custom--radius--xs);
}

.wp-block-code code {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: inherit;
	color: inherit;
	background: none;
	padding: 0;
	border-radius: 0;
}

/* ── Table ── */
/* Only the table's own typography, colour and horizontal margin are in theme.json:
   core/table's root selector is `.wp-block-table > table`, so the figure chrome is
   out of reach — and overflow:hidden on a <table> doesn't clip in browsers. */
.wp-block-table {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--default);
	overflow: hidden;
	background: var(--wp--preset--color--surface);
}

.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	background: transparent;
}

.wp-block-table thead th {
	font-family: var(--wp--preset--font-family--outfit);
	font-weight: 500;
	font-size: 13px;
	letter-spacing: -0.005em;
	padding: 14px 20px;
	background: var(--wp--preset--color--background-subtle);
	border-bottom: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text);
	text-align: start;
}

.wp-block-table tfoot td,
.wp-block-table tfoot th {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	padding: 12px 20px;
	background: var(--wp--preset--color--background-subtle);
	border-top: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text);
}

.wp-block-table td,
.wp-block-table tbody th {
	padding: 14px 20px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	vertical-align: top;
	color: var(--wp--preset--color--text-body);
}

.wp-block-table tbody tr:last-child td,
.wp-block-table tbody tr:last-child th {
	border-bottom: none;
}

/* Striped table style */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: var(--wp--preset--color--background-subtle);
}

.wp-block-table.is-style-stripes tbody tr:nth-child(even) {
	background-color: var(--wp--preset--color--surface);
}

/* Inline code inside table cells */
.wp-block-table td code,
.wp-block-table th code {
	font-size: 12px;
}

/* Table caption is a sibling of the table, not a descendant — overrides elements.caption */
.wp-block-table figcaption {
	font-size: var(--wp--preset--font-size--xs);
	margin-top: 0;
	padding: 10px 20px 14px;
	border-top: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--background-subtle);
}

/* ── Lists ── */
.wp-block-list li::marker {
	color: var(--wp--preset--color--brand);
}

/* ── Pagination ── */
.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border-radius: var(--wp--custom--radius--sm);
	border: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text-secondary);
	text-decoration: none;
	transition: border-color var(--wp--custom--transition--fast), color var(--wp--custom--transition--fast), background var(--wp--custom--transition--fast);
}

.wp-block-query-pagination-numbers .page-numbers:hover {
	border-color: var(--wp--preset--color--text);
	color: var(--wp--preset--color--text);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--brand);
	border-color: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--surface);
}

/* ── Post featured image ── */
/* The radius is theme.json blocks.core/post-featured-image.border. */
.wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
}

/* ── Post author ── */
.wp-block-post-author__avatar img {
	border-radius: 50%;
}

.wp-block-post-author__byline {
	color: var(--wp--preset--color--text-muted);
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: var(--wp--preset--font-size--xs);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.wp-block-post-author__name {
	font-family: var(--wp--preset--font-family--outfit);
	font-size: var(--wp--preset--font-size--md);
	font-weight: 500;
}

.wp-block-post-author__bio {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-size: var(--wp--preset--font-size--base);
}

/* ── Footer ── */
/* The top border is a block attribute in parts/footer.html. */
.site-footer a {
	text-decoration: none;
	transition: color var(--wp--custom--transition--fast);
}

/* ── 404 Page ── */

.lumio-error-eyebrow {
	font-family: var(--wp--preset--font-family--fira-code) !important;
	font-size: var(--wp--preset--font-size--xs) !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
	color: var(--wp--preset--color--brand) !important;
}

/* Outlined 404 with gradient fill visible through transparent letter interiors */
.lumio-error-num {
	font-family: var(--wp--preset--font-family--outfit) !important;
	font-weight: 500 !important;
	font-size: clamp(120px, 18vw, 200px) !important;
	line-height: 0.9 !important;
	letter-spacing: -0.04em !important;
	color: transparent !important;
	-webkit-text-stroke: 2px var(--wp--preset--color--brand-200);
	user-select: none;
	position: relative;
}

.lumio-error-num::after {
	content: "404";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--wp--preset--color--brand-soft) 0%, var(--wp--preset--color--background-alt) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	z-index: -1;
}

.lumio-error-columns .wp-block-column:last-child {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

/* theme.json's @tablet key compiles to a range query (480px < width <= 782px), so a
   plain max-width breakpoint is still the clearer way to express this one. */
@media (max-width: 900px) {
	.lumio-error-columns.wp-block-columns {
		flex-direction: column !important;
	}

	.lumio-error-num {
		font-size: clamp(80px, 22vw, 140px) !important;
	}

	.lumio-error-columns .wp-block-column:last-child {
		justify-content: flex-start;
	}

	.lumio-error-num.has-text-align-right {
		text-align: left !important;
	}
}

.lumio-recent-card {
	overflow: hidden;
	transition: box-shadow var(--wp--custom--transition--fast), transform var(--wp--custom--transition--fast);
	text-decoration: none !important;
}

.lumio-recent-card:hover {
	box-shadow: var(--wp--preset--shadow--card-hover);
	transform: translateY(-2px);
}

.lumio-recent-card .wp-block-post-title a {
	text-decoration: none !important;
	transition: color var(--wp--custom--transition--fast);
}

.lumio-recent-card:hover .wp-block-post-title a {
	color: var(--wp--preset--color--brand-hover) !important;
}

.lumio-browse-all a {
	text-underline-offset: 3px;
	font-weight: 500;
}

/* Root padding is left/right only in theme.json; drop any top padding core adds. */
.wp-site-blocks {
	padding-top: 0 !important;
}

/* ═══════════════════════════════════════════════
   FORM ELEMENTS

   Field typography, colour, border, radius and padding come from theme.json
   elements.textInput and elements.select, which target the bare HTML elements —
   so WP core forms and plugin forms are both covered without naming them here.

   These rules cover only what theme.json cannot express.
═══════════════════════════════════════════════ */

input:where([type="email"], [type="number"], [type="password"], [type="search"], [type="text"], [type="tel"], [type="url"]),
textarea,
select {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color var(--wp--custom--transition--fast), box-shadow var(--wp--custom--transition--fast);
}

/* Focus state — :focus is still unsupported on elements.textInput/select in WP 7.1 */
input:where([type="email"], [type="number"], [type="password"], [type="search"], [type="text"], [type="tel"], [type="url"]):focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--wp--preset--color--brand);
	box-shadow: var(--wp--preset--shadow--focus);
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
	color: var(--wp--preset--color--text-subtle);
	opacity: 1;
}

/* Invalid / error state — set via aria-invalid="true" or an error class.
   Each selector needs at least one class or attribute to outrank theme.json's
   bare `input`/`textarea`/`select` element rules. */
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"],
input.error,
textarea.error,
input.wpcf7-not-valid,
textarea.wpcf7-not-valid,
select.wpcf7-not-valid {
	border-color: var(--wp--custom--color--danger);
	box-shadow: 0 0 0 3px var(--wp--custom--color--danger-soft);
}

/* Textarea */
textarea {
	min-height: 120px;
	resize: vertical;
	line-height: 1.65;
}

/* Labels */
.wp-block-post-comments-form label,
.comment-respond .comment-form label,
.wpcf7 label {
	display: block;
	font-family: var(--wp--preset--font-family--fira-sans);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	color: var(--wp--preset--color--text-body);
	letter-spacing: -0.005em;
	margin-block-end: 6px;
}

/* Field wrapper — adds spacing between fields */
.wp-block-post-comments-form p,
.comment-respond .comment-form p {
	margin-block-end: 18px;
}

/* Help / description text */
.comment-form .description,
.wp-block-post-comments-form .description,
.comment-notes {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-size: var(--wp--preset--font-size--xs);
	color: var(--wp--preset--color--text-muted);
	margin-block-start: 4px;
	display: block;
}

/* Validation error message */
.wpcf7-not-valid-tip,
.comment-form .form-submit .comment-error {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-size: var(--wp--preset--font-size--xs);
	color: var(--wp--custom--color--danger);
	margin-block-start: 4px;
	display: block;
}

/* Select — custom arrow. The stroke colour is baked into the data URI and must be
   kept in sync with the `text-muted` palette colour (#61616b). The 36px right padding
   that makes room for it is set in theme.json elements.select, since a bare `select`
   rule here would tie with theme.json's own on specificity. */
select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2361616b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	cursor: pointer;
}

/* Radio & checkbox — accent colour */
input[type="checkbox"],
input[type="radio"] {
	accent-color: var(--wp--preset--color--brand);
	width: 16px;
	height: 16px;
	cursor: pointer;
	flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   INLINE TYPOGRAPHY (inside post content)
   None of these have a theme.json element.
═══════════════════════════════════════════════ */

.wp-block-post-content strong {
	font-weight: 600;
	color: var(--wp--preset--color--text);
}

.wp-block-post-content em {
	font-style: italic;
}

/* Highlighted text — uses the brand-soft palette colour */
.wp-block-post-content mark {
	background-color: var(--wp--preset--color--brand-soft);
	color: var(--wp--preset--color--text);
	padding: 1px 3px;
	border-radius: var(--wp--custom--radius--xs);
}

.wp-block-post-content del,
.wp-block-post-content s {
	color: var(--wp--preset--color--text-muted);
	text-decoration-color: var(--wp--preset--color--text-subtle);
}

.wp-block-post-content abbr[title] {
	text-decoration: underline dotted var(--wp--preset--color--text-subtle);
	cursor: help;
}

.wp-block-post-content sub,
.wp-block-post-content sup {
	font-size: 0.75em;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

.wp-block-post-content sup { top: -0.5em; }

.wp-block-post-content sub { bottom: -0.25em; }

.wp-block-post-content kbd {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.85em;
	background: var(--wp--preset--color--background-subtle);
	border: 1px solid var(--wp--preset--color--border-strong);
	border-bottom-width: 2px;
	border-radius: var(--wp--custom--radius--xs);
	padding: 1px 6px;
	color: var(--wp--preset--color--text);
}

/* ═══════════════════════════════════════════════
   POST CONTENT SPACING
   Tightens the blockGap between headings that
   immediately follow paragraphs and vice versa.
═══════════════════════════════════════════════ */

.wp-block-post-content > * + h2,
.wp-block-post-content > * + h3,
.wp-block-post-content > * + h4 {
	margin-top: var(--wp--preset--spacing--7);
}

.wp-block-post-content > h2 + *,
.wp-block-post-content > h3 + *,
.wp-block-post-content > h4 + * {
	margin-top: var(--wp--preset--spacing--3);
}

/* Keep consecutive paragraphs at standard gap */
.wp-block-post-content > p + p {
	margin-top: var(--wp--preset--spacing--5);
}

/* Search results title */
.lumio-search-query {
	border-bottom: 3px solid var(--wp--preset--color--brand-200);
	color: var(--wp--preset--color--brand-hover);
}

/* Misc fixes */
.wp-block-group:empty {
	display: none;
}
