/*
Theme Name: Nazmul Robin Products
Theme URI: https://nazmulrobin.com/products/
Author: Nazmul Hasan Robin
Description: Child theme for nazmulrobin.com/products, with the blog's colours, fonts and dark mode.
Template: twentytwentyfive
Version: 0.1.0
Requires at least: 6.7
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nazmulrobin-products
*/

/* Colours, fonts and sizes are in theme.json, the same as the blog's. This file holds what
   theme.json cannot say: the dark colours, the page frame, the header and the footer.
   The catalogue, product and docs blocks are styled in the site plugin's assets/products.css. */

/* Dark colours: used when the visitor's system is dark, or when they chose dark with the switch. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--wp--preset--color--base: #11161C;
		--wp--preset--color--contrast: #E8EDF2;
		--wp--preset--color--accent-2: #7BDB4F;
		--wp--preset--color--accent-3: #0B0F14;
		--wp--preset--color--accent-4: #A3AFBB;
		--wp--preset--color--accent-5: #182029;
		--wp--preset--color--accent-6: #2A3440;
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--wp--preset--color--base: #11161C;
	--wp--preset--color--contrast: #E8EDF2;
	--wp--preset--color--accent-2: #7BDB4F;
	--wp--preset--color--accent-3: #0B0F14;
	--wp--preset--color--accent-4: #A3AFBB;
	--wp--preset--color--accent-5: #182029;
	--wp--preset--color--accent-6: #2A3440;
	color-scheme: dark;
}

:root {
	--nr-mono: var(--wp--preset--font-family--plex-mono);
	--nr-muted: var(--wp--preset--color--accent-4);
	--nr-line: var(--wp--preset--color--accent-6);
	--nr-accent: var(--wp--preset--color--accent-2);
	--nr-surface: var(--wp--preset--color--accent-5);
}

/* Page frame */
.nr-wrap { box-sizing: border-box; margin-inline: auto; max-width: 1180px; padding-inline: 24px; width: 100%; }
.nr-narrow { max-width: 760px; }
.wp-site-blocks > * { margin-block-start: 0; }
.nr-wrap > *, .nr-main > * { margin-block: 0; }
.nr-label, .nr-eyebrow { color: var(--nr-muted); font-family: var(--nr-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nr-eyebrow { color: var(--nr-accent); font-size: 0.8rem; }
.nr-muted { color: var(--nr-muted); }
.nr-sr-only { clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

/* Header */
.nr-header { border-bottom: 1px solid var(--nr-line); }
.nr-header__row { align-items: center; display: flex; flex-wrap: wrap; gap: 4px 36px; min-height: 68px; }
.nr-logo a { align-items: center; color: inherit; display: inline-flex; gap: 10px; min-height: 44px; text-decoration: none; }
.nr-logo a::before { background: var(--wp--preset--color--accent-1); border-radius: 50%; content: ""; height: 10px; width: 10px; }
.nr-nav { flex: 1 1 auto; }
.nr-nav.wp-block-navigation .wp-block-navigation-item__content { color: var(--nr-muted); padding-block: 10px; }
.nr-nav.wp-block-navigation .wp-block-navigation-item__content:hover,
.home .nr-nav.wp-block-navigation a[href$="/products/"],
.single-nazmulrobin_product .nr-nav.wp-block-navigation a[href$="/products/"],
.single-nazmulrobin_doc .nr-nav.wp-block-navigation a[href$="/docs/"] { color: var(--nr-accent); }
.nr-nav.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); }
.nr-tools { align-items: center; display: flex; font-size: 0.95rem; gap: 8px; }
.nr-tools > * { margin: 0; }
.nr-tools button { align-items: center; background: none; border: 0; color: var(--nr-muted); cursor: pointer; display: inline-flex; justify-content: center; min-height: 44px; min-width: 44px; padding: 0; }
.nr-tools button:hover { color: var(--nr-accent); }
@media (max-width: 599px) {
	/* One row on a phone: the name, then the switch and My account, then the menu button. */
	.nr-header__row { flex-wrap: nowrap; gap: 4px 10px; }
	.nr-nav { flex: 0 0 auto; order: 3; }
	.nr-tools { margin-left: auto; }
}

/* A page's title block, and the intro of a search or a 404 */
.nr-intro { display: flex; flex-direction: column; gap: 18px; padding-block: 56px 36px; }
.nr-intro h1 { margin: 0; max-width: 760px; }
.nr-intro__lead { color: var(--nr-muted); font-size: 1.125rem; margin: 0; max-width: 620px; }
.wp-block-search__input { background: var(--nr-surface); border: 1px solid var(--nr-muted); border-radius: 8px; color: inherit; font: inherit; min-height: 46px; padding: 0 14px; }
.wp-block-search .wp-block-search__button { background: transparent; border: 1px solid var(--nr-muted); border-radius: 8px; color: inherit; font-size: 0.95rem; font-weight: 500; margin-left: 8px; min-height: 46px; padding: 0 18px; }

/* Text of a page, a product or a doc */
.nr-post { font-size: 1.0625rem; line-height: 1.75; }
.nr-post > * { margin-block: 0 20px; }
.nr-post > h2 { margin-top: 40px; }
.nr-post > h3 { margin-top: 28px; }
.nr-post li + li { margin-top: 6px; }
.nr-post code { font-family: var(--nr-mono); font-size: 0.92em; }
.nr-post pre { background: var(--nr-surface); border: 1px solid var(--nr-line); border-radius: 10px; overflow-x: auto; padding: 16px 20px; }
.nr-page { padding-bottom: 72px; }

/* A list of results */
.nr-list .wp-block-post-template { list-style: none; margin: 0; padding: 0; }
.nr-item { border-bottom: 1px solid var(--nr-line); display: flex; flex-direction: column; gap: 8px; padding-block: 24px; }
.nr-item > * { margin: 0; }
.nr-item .wp-block-post-title { font-size: 1.25rem; }
.nr-item .wp-block-post-title a { color: inherit; text-decoration: none; }
.nr-item .wp-block-post-title a:hover { text-decoration: underline; }
.nr-item .wp-block-post-excerpt { color: var(--nr-muted); }
.nr-item .wp-block-post-excerpt p { margin: 0; }
.nr-search { padding-bottom: 72px; }
.nr-empty { color: var(--nr-muted); padding-top: 24px; }
.nr-empty__links { display: flex; flex-wrap: wrap; gap: 0 20px; list-style: none; padding: 0; }
.nr-empty__links a { display: inline-block; padding-block: 10px; }

/* Footer */
.nr-footer { border-top: 1px solid var(--nr-line); color: var(--nr-muted); font-size: 0.875rem; }
.nr-footer__row { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; padding-block: 14px; }
.nr-footer__row > * { margin: 0; }
.nr-footer__links { display: flex; flex-wrap: wrap; gap: 0 24px; list-style: none; margin: 0; padding: 0; }
.nr-footer__links a { color: inherit; display: inline-block; padding-block: 12px; text-decoration: none; }
.nr-footer__links a:hover { color: var(--nr-accent); }
